#153 Improve the meeting widget
Merged 7 years ago by pingou. Opened 7 years ago by pingou.
pingou/fedora-hubs meeting_widget  into  develop

file modified
+9 -7
@@ -17,13 +17,15 @@ 

  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.

@@ -1,34 +1,41 @@ 

  {% if meetings %}

  {% for title, next in meetings.items() %}

  <div class="meeting">

-     <div class="row">

-         <h5>&nbsp;&nbsp;The {{ next.meeting_name }} is {{ next.start_dt | humanize }}</h5>

+   <div class="row">

+       <h5>&nbsp;&nbsp;The {{ next.meeting_name }} is {{ next.start_dt | humanize }}</h5>

+   </div>

+   <div class="row">

+     <div class="col-md-4 meeting-date">

+       {% if next.display_duration %}

+       <strong>{{ next.start_date }} - {{ next.stop_date }}</strong>

+       {% else %}

+       <strong>{{next.start_date}}</strong>

+       {% endif %}

      </div>

-     <div class="row">

-         <div class="col-md-4 meeting-date">

-             {% if next.display_duration %}

-             <strong>{{next.start_date}} - {{next.stop_date}}</strong>

-             {% else %}

-             <strong>

-                 {{next.start_date}}

-             </strong>

-             {% endif %}

-         </div>

-         <div class="col-md-4 meeting-time">

-             {% if next.display_time %}

-             @{{next.start_time}}{% endif %}<br>

+     <div class="col-md-4 meeting-time">

+       {% if next.display_time %}

+       @{{ next.start_time }}{% endif %}<br>

  

-             <a href="#">{{next.location}}</a>

-         </div>

-         <div class="col-md-4">

-             <button class="btn btn-default btn-sm add-calendar"><strong>Add to calendar</strong></button>

-         </div>

+       <a href="#">{{ next.location }}</a>

      </div>

-     <div class="row">

-         <div class="col-md-12 meeting-info">

-             {{next.meeting_information_html}}

-         </div>

+     <div class="col-md-4">

+       <a href="https://apps.fedoraproject.org/calendar/ical/calendar/meeting/{{ next.meeting_id }}/">

+         <button class="btn btn-default btn-sm add-calendar">

+           <strong>Add to calendar</strong>

+         </button>

+       </a>

      </div>

+   </div>

+   <div class="row">

+       <div class="col-md-12 meeting-info">

+         {{ next.meeting_information_html[:150] }}

+         {%- if next.meeting_information_html | length > 150 %}...

+         <p>

+           <a href="https://apps.fedoraproject.org/calendar/meeting/{{ next.meeting_id }}/">Full description</a>

+         </p>

+         {% endif %}

+       </div>

+   </div>

  </div>

  {% if meetings | length > 1 %} <hr> {% endif %}

  {% endfor %}

  • Do not show the entire meeting description, only 150 characters shown
  • Add link to the meeting for more information
  • Fix link to get the Add to calendar button working

Looks good to me :thumbsup:

Pull-Request has been merged by pingou

7 years ago