From 4fa2fe238993bc7d247e459e4e844b2f018498b0 Mon Sep 17 00:00:00 2001 From: James Polley Date: Sat, 9 Jul 2011 16:26:36 +1000 Subject: [PATCH 1/2] Create the "agenda" handler which prepares the agenda. Tweak the page to use the prepared agenda as the basis for the counter. --- events.py | 19 +++++ handler.py | 1 + static/css/countdown.css | 30 ++++++++ templates/base.html | 1 - templates/countdown.html | 160 ++++++++++++++++++++------------------- 5 files changed, 132 insertions(+), 79 deletions(-) diff --git a/events.py b/events.py index b0be630..9226b8b 100644 --- a/events.py +++ b/events.py @@ -46,6 +46,25 @@ def get(self, key=None): 'templates/event.html', locals())) +class Agenda(webapp.RequestHandler): + """Handler for displaying the agenda for a single event.""" + + def get (self, key=None): + if not key: + key = self.request.get('id') + + key = long(key) + event = models.Event.get_by_id(key) + agenda = event.agenda + + template_values = {} + template_values['agenda'] = agenda + template_values['self'] = self + + self.response.headers['Content-Type'] = 'text/html' + self.response.out.write(r( + 'templates/countdown.html', template_values)) + class Events(webapp.RequestHandler): """Handler for display a table of events.""" diff --git a/handler.py b/handler.py index 7e5fb85..7628e46 100644 --- a/handler.py +++ b/handler.py @@ -31,6 +31,7 @@ ('/rss', rss.RSSHandler), ('/\d*/.*feed.*', rss.RSSHandler), ('/full/.*feed.*', rss.RSSHandler), + ('/agenda/(.*)', events.Agenda), ('/event/.*feed.*', rss.RSSHandler), ('/event/(.*)/response/show', response.ShowResponsePage), ('/event/(.*)/response/update', response.UpdateResponsePage), diff --git a/static/css/countdown.css b/static/css/countdown.css index ec1b339..990a341 100644 --- a/static/css/countdown.css +++ b/static/css/countdown.css @@ -1,3 +1,7 @@ +#body { + width: 100%; +} + body .neutral { background-color: white; } @@ -13,3 +17,29 @@ body .close { body .overtime { background-color: red; } + +#talkdetails { + display: none; +} + +div { + text-align: center; + width: 100%; +} + +#currentspeaker { + font-size: 30; +} + +#currenttitle { + font-size: 60; +} + +#currentseconds { + font-size: 120; +} + +#talkselect { + position: absolute; + bottom: 0; +} diff --git a/templates/base.html b/templates/base.html index 7359ba8..457d726 100644 --- a/templates/base.html +++ b/templates/base.html @@ -127,7 +127,6 @@ }); }; $(ajaxifyforms); - $(window.console.log('ajaxification')); - - + + + + + + + + {% endblock %} {% block body %} -
00
-

-

(Seconds) -Start -Stop

-

- -

- +
+ {% for talk in agenda %} + + {% endfor %} +
+
+
+
+
+ + Start + Stop +
{%endblock %} + +{% block script %} + +{% endblock %} + + + From 2e21541708e6eb2ecde2a19bd3d2717c5a40a2b8 Mon Sep 17 00:00:00 2001 From: James Polley Date: Sat, 9 Jul 2011 16:48:58 +1000 Subject: [PATCH 2/2] Add link to countdown page for event. --- templates/editevent.html | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/editevent.html b/templates/editevent.html index 7b523d0..38a96a0 100644 --- a/templates/editevent.html +++ b/templates/editevent.html @@ -49,6 +49,7 @@
  • + Countdown View