--- a/sites/irclogs.qmsk.net/handlers.py Sun Feb 08 00:29:36 2009 +0200
+++ b/sites/irclogs.qmsk.net/handlers.py Sun Feb 08 02:29:23 2009 +0200
@@ -4,15 +4,29 @@
from lib import http, template
+import urls, channels
+
# load templates from here
-templates = template.TemplateLoader("sites/irclogs.qmsk.net/templates")
+templates = template.TemplateLoader("sites/irclogs.qmsk.net/templates",
+ urls = urls,
+ channel_list = channels.channel_list,
+)
def index (request) :
"""
The topmost index page, display a list of available channels, perhaps some general stats
"""
- return templates.render_to_response("index")
+ return templates.render_to_response("index",
+ req = request,
+ )
+
+def channel_select (request, channel) :
+ """
+ Redirect to the appropriate channel_view
+ """
+
+ return http.Redirect(urls.channel_view.build(request, channel=channel.id))
def channel_view (request, channel) :
"""
@@ -20,6 +34,7 @@
"""
return templates.render_to_response("channel",
+ req = request,
channel = channel,
)