From 477fdc3e4d55375c4e44ca578ebbf16bba51d698 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Apr 28 2016 09:00:56 +0000 Subject: [PATCH 1/3] Make the `Add to calendar` button in the meeting widget working --- diff --git a/hubs/widgets/meetings.py b/hubs/widgets/meetings.py index 5812f94..e6c68c1 100755 --- a/hubs/widgets/meetings.py +++ b/hubs/widgets/meetings.py @@ -17,13 +17,15 @@ import requests def next_meeting(meetings): now = datetime.datetime.utcnow() for meeting in meetings: - start_string = "%s %s" % (meeting['meeting_date'], - meeting['meeting_time_start']) - start_dt = datetime.datetime.strptime(start_string, "%Y-%m-%d %H:%M:%S") - - stop_string = "%s %s" % (meeting['meeting_date_end'], - meeting['meeting_time_stop']) - stop_dt = datetime.datetime.strptime(stop_string, "%Y-%m-%d %H:%M:%S") + start_string = "%s %s" % ( + meeting['meeting_date'], meeting['meeting_time_start']) + start_dt = datetime.datetime.strptime( + start_string, "%Y-%m-%d %H:%M:%S") + + stop_string = "%s %s" % ( + meeting['meeting_date_end'], meeting['meeting_time_stop']) + stop_dt = datetime.datetime.strptime( + stop_string, "%Y-%m-%d %H:%M:%S") # Loop over them until we find a good one. # Meetings before now are no good. We want the first one after now. diff --git a/hubs/widgets/templates/meetings.html b/hubs/widgets/templates/meetings.html index 6965c5f..0fc9601 100644 --- a/hubs/widgets/templates/meetings.html +++ b/hubs/widgets/templates/meetings.html @@ -1,34 +1,36 @@ {% if meetings %} {% for title, next in meetings.items() %}
-
-
  The {{ next.meeting_name }} is {{ next.start_dt | humanize }}
+
+
  The {{ next.meeting_name }} is {{ next.start_dt | humanize }}
+
+
+
+ {% if next.display_duration %} + {{ next.start_date }} - {{ next.stop_date }} + {% else %} + {{next.start_date}} + {% endif %}
-
-
- {% if next.display_duration %} - {{next.start_date}} - {{next.stop_date}} - {% else %} - - {{next.start_date}} - - {% endif %} -
-
- {% if next.display_time %} - @{{next.start_time}}{% endif %}
+
+ {% if next.display_time %} + @{{ next.start_time }}{% endif %}
- {{next.location}} -
-
- -
+ {{ next.location }}
-
-
- {{next.meeting_information_html}} -
+ +
+
+
+ {{ next.meeting_information_html }} +
+
{% if meetings | length > 1 %}
{% endif %} {% endfor %} From bbe25f145f64ebbc71e9da299b28f30ee095824c Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Apr 28 2016 14:16:40 +0000 Subject: [PATCH 2/3] Keep the meeting description short --- diff --git a/hubs/widgets/templates/meetings.html b/hubs/widgets/templates/meetings.html index 0fc9601..c075ded 100644 --- a/hubs/widgets/templates/meetings.html +++ b/hubs/widgets/templates/meetings.html @@ -28,7 +28,8 @@
- {{ next.meeting_information_html }} + {{ next.meeting_information_html[:150] }}{% + if next.meeting_information_html | length > 150 %}...{% endif %}
From 2844984122ab746a90bf1039d0d321c2fe3af5bb Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Apr 28 2016 14:20:55 +0000 Subject: [PATCH 3/3] Link to the meeting detail page for more info --- diff --git a/hubs/widgets/templates/meetings.html b/hubs/widgets/templates/meetings.html index c075ded..e863b58 100644 --- a/hubs/widgets/templates/meetings.html +++ b/hubs/widgets/templates/meetings.html @@ -28,8 +28,12 @@
- {{ next.meeting_information_html[:150] }}{% - if next.meeting_information_html | length > 150 %}...{% endif %} + {{ next.meeting_information_html[:150] }} + {%- if next.meeting_information_html | length > 150 %}... +

+ Full description +

+ {% endif %}