Commit 049e07d2 authored by Martin Mareš's avatar Martin Mareš
Browse files

App: Show current time

parent 0febf3f4
......@@ -68,3 +68,10 @@ body {
margin-top: 0.5ex;
font-size: 9px;
}
#now {
height: 1px;
background-color: #cc0000;
opacity: 0.3;
z-index: 10;
}
......@@ -51,6 +51,9 @@
<p class=mdesc>{{ m.topic }}
</div>
{% endfor %}
{% if g.now %}
<div id=now style='position: absolute; left: {{ g.now.x }}px; top: {{ g.now.y }}px; width: {{ g.now.w }}px;'></div>
{% endif %}
</div>
</body>
</html>
......@@ -151,6 +151,15 @@ def main_page():
"label": (dt + timedelta(seconds = first_slot + i*slot_size)).strftime("%H:%M"),
} for i in range(num_slots)]
dt_now = datetime.now(tz=dateutil.tz.tzlocal())
rel_now = dt_now.timestamp() - dt.timestamp() - first_slot
if rel_now > 0 and rel_now < num_slots * slot_size:
g.now = {
"x": 0,
"y": int(rel_now / 3600. * room_hour_height),
"w": row_offset + num_rooms * room_box_width + 20,
}
# XXX: No meeting is ever longer than 24 hours
db_query("""
SELECT m.meeting_id, m.topic, s.start_time, s.duration, u.email, u.full_name
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment