WebStats: prepare /channels/NAME/subdir style url

master
Valentin Lorentz 2010-11-26 17:58:23 +01:00
parent 78a5bd0f39
commit f3f6815022
2 changed files with 14 additions and 4 deletions

View File

@ -102,9 +102,19 @@ class HTTPHandler(BaseHTTPServer.BaseHTTPRequestHandler):
elif self.path.startswith('/%s/' % _('channels')):
response = 200
content_type = 'text/html'
chanName = self.path.split('/')[2]
output = getTemplate('chan_index').get(not testing, chanName,
self.server.db)
splittedPath = self.path.split('/')
chanName = splittedPath[2]
print splittedPath
if len(splittedPath) == 3:
output = getTemplate('chan_index').get(not testing,
chanName,
self.server.db)
else:
subdir = splittedPath[3]
output = getTemplate('chan_index').get(not testing,
chanName,
self.server.db,
subdir)
else:
response = 404
content_type = 'text/html'

View File

@ -48,7 +48,7 @@ headers = (_('Hour'), _('Lines'), _('Words'), _('Joins'), _('Parts'),
tableHeaders = '<table><tr>'
for header in headers:
tableHeaders += '<th style="width: 100px;">%s</th>' % header
def get(useSkeleton, channel, db):
def get(useSkeleton, channel, db, orderby=None):
channel = '#' + channel
items = db.getChanGlobalData(channel)
bound = db.getChanRecordingTimeBoundaries(channel)