Skip to content
Snippets Groups Projects
Commit 99430959 authored by Martin Mareš's avatar Martin Mareš
Browse files

App: Shift colliding meetings

parent dd9afca5
Branches
No related tags found
No related merge requests found
......@@ -149,15 +149,16 @@ def main_page():
end = min(num_hours * 3600, int(rel_end))
app.logger.debug("Meeting: %s start_t=%s start=%s end=%s room_i=%s", r, start_t, start, end, i)
if start < end:
coll = (i == prev_room_i and start_t < prev_end_t)
g.meetings.append({
"x": i * room_box_width + 4,
"x": i * room_box_width + 4 + 10*int(coll),
"y": int(start / 3600. * room_hour_height),
"w": room_box_width - 7,
"w": room_box_width - 7 - 10*int(coll),
"h": int((end - start) / 3600 * room_hour_height),
"start": time.strftime("%H:%M", time.localtime(start_t)),
"end": time.strftime("%H:%M", time.localtime(end_t)),
"topic": r.topic,
"coll": (i == prev_room_i and start_t < prev_end_t),
"coll": coll,
})
prev_room_i = i
prev_end_t = end_t
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment