diff --git a/app/static/mffzoom.css b/app/static/mffzoom.css index 16a8bf6a108bdaba9fb834d2c8a4cc696c7e598c..e957ae1fbc6c23fbc9fe3a97078e00f0d616baa2 100644 --- a/app/static/mffzoom.css +++ b/app/static/mffzoom.css @@ -68,3 +68,10 @@ body { margin-top: 0.5ex; font-size: 9px; } + +#now { + height: 1px; + background-color: #cc0000; + opacity: 0.3; + z-index: 10; +} diff --git a/app/templates/main.html b/app/templates/main.html index ddbadc62709444687dd968dbb8b8e346c743eb92..f6cced3624e762cec3410f14798aea66240db8ec 100644 --- a/app/templates/main.html +++ b/app/templates/main.html @@ -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> diff --git a/app/zoom.py b/app/zoom.py index c240b9fb9af6617688add0586e5649da642542a7..0c0f95057cc4b2e871d03872fc3671f148ad9607 100644 --- a/app/zoom.py +++ b/app/zoom.py @@ -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