Skip to content

Commit

Permalink
Provide agenda-like details on session meeting view. Change the link …
Browse files Browse the repository at this point in the history
…to the calendar entry on interim meetings to be a button instead, to provide consistency and fix formatting issues vis-a-vis the new details in the session view. Fixes #2751. Commit ready for merge.

 - Legacy-Id: 17694
  • Loading branch information
meadmaker committed Apr 27, 2020
1 parent e01d411 commit 4df7e55
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 6 deletions.
9 changes: 8 additions & 1 deletion ietf/meeting/tests_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1090,7 +1090,14 @@ def test_session_details(self):
r = self.client.get(url)
self.assertTrue(all([x in unicontent(r) for x in ('slides','agenda','minutes','draft')]))
self.assertNotContains(r, 'deleted')


q = PyQuery(r.content)
self.assertTrue(q('div.session_buttons#session_%s' % session.id),
'Session detail page does not contain session tool buttons')

self.assertFalse(q('div.session_buttons#session_%s span.fa-arrows-alt' % session.id),
'The session detail page is incorrectly showing the "Show meeting materials" button')

def test_session_details_past_interim(self):
group = GroupFactory.create(type_id='wg',state_id='active')
chair = RoleFactory(name_id='chair',group=group)
Expand Down
14 changes: 14 additions & 0 deletions ietf/meeting/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
from ietf.secr.proceedings.proc_utils import (get_progress_stats, post_process, import_audio_files,
create_recording)
from ietf.utils.decorators import require_api_key
from ietf.utils.history import find_history_replacements_active_at
from ietf.utils.log import assertion
from ietf.utils.mail import send_mail_message, send_mail_text
from ietf.utils.pipe import pipe
Expand Down Expand Up @@ -1128,9 +1129,22 @@ def session_details(request, num, acronym):
if not sessions:
raise Http404

# Find the time of the meeting, so that we can look back historically
# for what the group was called at the time.
meeting_time = datetime.datetime.combine(meeting.date, datetime.time())

groups = [ sessions[0].group ]
group_replacements = find_history_replacements_active_at(groups, meeting_time)

status_names = {n.slug: n.name for n in SessionStatusName.objects.all()}
for session in sessions:

session.historic_group = None
if session.group:
session.historic_group = group_replacements.get(session.group_id)
if session.historic_group:
session.historic_group.historic_parent = None

session.type_counter = Counter()
ss = session.timeslotassignments.filter(schedule=meeting.schedule).order_by('timeslot__time')
if ss:
Expand Down
4 changes: 3 additions & 1 deletion ietf/templates/meeting/session_buttons_include.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
{% origin %}

{% if item.session.agenda %}
<button class="btn btn-default btn-xs" data-toggle="modal" data-target="#modal-{{item.slug}}" title="Show meeting materials"><span class="fa fa-arrows-alt"></span></button>
{% if not skip_meeting_materials %}
<button class="btn btn-default btn-xs" data-toggle="modal" data-target="#modal-{{item.slug}}" title="Show meeting materials"><span class="fa fa-arrows-alt"></span></button>
{% endif %}
<a class="btn btn-default btn-xs" href="/meeting/{{schedule.meeting.number}}/agenda/{{item.session.historic_group.acronym}}-drafts.tgz" title="Download meeting materials as .tar archive"><span class="fa fa-file-archive-o"></span></a>
<a class="btn btn-default btn-xs" href="/meeting/{{ schedule.meeting.number }}/agenda/{{item.session.historic_group.acronym}}-drafts.pdf" title="Download meeting materials as PDF file"><span class="fa fa-file-pdf-o"></span></a>
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion ietf/templates/meeting/session_details.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

<h1>{{ meeting }} : {{ acronym }}
{% if meeting.date >= thisweek %}
<a class="regular pull-right" title="icalendar entry for {{acronym}}@{{meeting.number}}" href="{% url 'ietf.meeting.views.ical_agenda' num=meeting.number acronym=acronym %}"><span class="fa fa-calendar"></span></a>
<button class="btn btn-default btn-xs pull-right" title="icalendar entry for {{acronym}}@{{meeting.number}}" href="{% url 'ietf.meeting.views.ical_agenda' num=meeting.number acronym=acronym %}"><span class="fa fa-calendar"></span></button>
{% endif %}
</h1>

Expand Down
17 changes: 14 additions & 3 deletions ietf/templates/meeting/session_details_panel.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,20 @@

{% for session in sessions %}
<h2 class="anchor-target" id="session_{{session.pk}}">{% if sessions|length > 1 %}Session {{ forloop.counter }} : {% endif %}{{ session.time }}{% if session.name %} : {{ session.name }}{% endif %}
{% if meeting.date >= thisweek %}
<a class="regular pull-right" title="icalendar entry for {{acronym}} session {{ forloop.counter }}" href="{% url 'ietf.meeting.views.ical_agenda' num=meeting.number session_id=session.id %}"><span class="fa fa-calendar"></span></a>
{% endif %}
<div class="session_buttons pull-right" id="session_{{session.id}}">
{% if meeting.date >= thisweek %}
<span>
<button class="btn btn-default btn-xs" title="icalendar entry for {{acronym}} session {{ forloop.counter }}" href="{% url 'ietf.meeting.views.ical_agenda' num=meeting.number session_id=session.id %}"><span class="fa fa-calendar"></span></button>
</span>
{% endif %}
{% with schedule=meeting.schedule %}
{% with item=session.timeslotassignments.first %}
{% with skip_meeting_materials=True %}
<span>{% include "meeting/session_buttons_include.html" %} </span>
{% endwith %}
{% endwith %}
{% endwith %}
</div>
</h2>
{% if session.agenda_note %}<h3>{{session.agenda_note}}</h3>{% endif %}

Expand Down

0 comments on commit 4df7e55

Please sign in to comment.