Merge lp:~nigelbabu/summit/javascript-last-update into lp:summit

Proposed by Nigel Babu
Status: Merged
Approved by: Michael Hall
Approved revision: 213
Merged at revision: 213
Proposed branch: lp:~nigelbabu/summit/javascript-last-update
Merge into: lp:summit
Diff against target: 48 lines (+15/-2)
3 files modified
summit/media/css/schedule.css (+1/-1)
summit/schedule/render.py (+4/-1)
summit/schedule/templates/schedule/schedule.html (+10/-0)
To merge this branch: bzr merge lp:~nigelbabu/summit/javascript-last-update
Reviewer Review Type Date Requested Status
Michael Hall (community) Approve
Review via email: mp+80929@code.launchpad.net

Commit message

Add javascript-y "Updated x seconds ago" counter

Description of the change

This branch creates a javascript counter that counts from dislays "Updated x seconds ago", where x is updated every second. I've put this in render.py so that is renders correctly in the right-most of the schedule right above the last room name.

To post a comment you must log in.
Revision history for this message
Michael Hall (mhall119) wrote :

Looks good, IS needs to make sure ?reload is in the URL

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'summit/media/css/schedule.css'
--- summit/media/css/schedule.css 2011-09-03 02:16:40 +0000
+++ summit/media/css/schedule.css 2011-11-01 17:07:25 +0000
@@ -89,7 +89,7 @@
89 margin-left: 5px;89 margin-left: 5px;
90}90}
9191
92div.schedule-head .schedule-crew {92div.schedule-head .schedule-crew, .last-updated {
93 font-size: 0.7pc;93 font-size: 0.7pc;
94}94}
9595
9696
=== modified file 'summit/schedule/render.py'
--- summit/schedule/render.py 2011-10-30 00:16:31 +0000
+++ summit/schedule/render.py 2011-11-01 17:07:25 +0000
@@ -395,7 +395,10 @@
395 return mark_safe("<pre>%s</pre>" % escape(traceback.format_exc()))395 return mark_safe("<pre>%s</pre>" % escape(traceback.format_exc()))
396396
397 def as_html(self):397 def as_html(self):
398 html = u''398 html = (u'<span class="last-updated" style="float: right;">Updated '
399 '<span id="refresh-time">0</span> seconds ago</span>'
400 '<div style="clear: both;"></div>')
401
399402
400 if self.endofday:403 if self.endofday:
401 html += '<p><strong>No more sessions for today.</strong></p>'404 html += '<p><strong>No more sessions for today.</strong></p>'
402405
=== modified file 'summit/schedule/templates/schedule/schedule.html'
--- summit/schedule/templates/schedule/schedule.html 2011-09-15 23:23:51 +0000
+++ summit/schedule/templates/schedule/schedule.html 2011-11-01 17:07:25 +0000
@@ -91,6 +91,16 @@
91 window.onload = timedRefresh;91 window.onload = timedRefresh;
92 </script>92 </script>
93{% endif %}93{% endif %}
94<script type="text/javascript">
95function updateTimer() {
96 var secAgo = document.getElementById('refresh-time');
97 secAgo.innerHTML = Number(secAgo.innerHTML) + 1;
98}
99function starttimer() {
100 setInterval(updateTimer, 1000);
101}
102window.addEventListener('load', starttimer());
103</script>
94{% endblock %}104{% endblock %}
95{% block 960css %}{% endblock %}105{% block 960css %}{% endblock %}
96106

Subscribers

People subscribed via source and target branches