Skip to content

Commit

Permalink
Make it more obvious which sessions are scheduled and which are not w…
Browse files Browse the repository at this point in the history
…hen viewing session details and managing materials. Fixes #2084. Commit ready for merge.

 - Legacy-Id: 14035
  • Loading branch information
rjsparks committed Aug 9, 2017
1 parent aaf3fa5 commit 661bb18
Show file tree
Hide file tree
Showing 3 changed files with 147 additions and 121 deletions.
6 changes: 5 additions & 1 deletion ietf/meeting/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1115,8 +1115,12 @@ def session_details(request, num, acronym ):

can_manage = can_manage_materials(request.user, Group.objects.get(acronym=acronym))

scheduled_sessions=[s for s in sessions if s.status_id=='sched']
unscheduled_sessions = [s for s in sessions if s.status_id!='sched']

return render(request, "meeting/session_details.html",
{ 'sessions':sessions ,
{ 'scheduled_sessions':scheduled_sessions ,
'unscheduled_sessions':unscheduled_sessions ,
'meeting' :meeting ,
'acronym' :acronym,
'can_manage_materials' : can_manage,
Expand Down
133 changes: 13 additions & 120 deletions ietf/templates/meeting/session_details.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,133 +14,26 @@
{% origin %}
<h1>{{ meeting }} : {{ acronym }}</h1>

{% 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 %}</h2>
{% if session.agenda_note %}<h3>{{session.agenda_note}}</h3>{% endif %}

{% if can_manage_materials %}
{% if session.status.slug == 'sched' or session.status.slug == 'schedw' %}
<div class="buttonlist">
{% if meeting.type.slug == 'interim' and user|has_role:"Secretariat" %}
<a class="btn btn-default" href="{% url 'ietf.meeting.views.interim_request_details' number=meeting.number %}">Meeting Details</a>
{% endif %}
</div>
{% if not session.type_counter.agenda %}
<span class="label label-warning">This session does not yet have an agenda</span>
{% endif %}
{% endif %}
{% endif %}

<div class="panel panel-default">
<div class="panel-heading">Agenda, Minutes, and Bluesheets</div>
<div class="panel-body">
<table class="table table-condensed table-striped">
{% for pres in session.filtered_artifacts %}
<tr>
{% if pres.rev %}
{% url 'ietf.doc.views_doc.document_main' name=pres.document.name rev=pres.rev as url %}
{% else %}
{% url 'ietf.doc.views_doc.document_main' name=pres.document.name as url %}
{% endif %}
<td>
<a href="{{pres.document.href}}">{{pres.document.title}}</a>
<a href="{{url}}">({{ pres.document.name }}{% if pres.rev %}-{{ pres.rev }}{% endif %})</a>
</td>
{% if user|has_role:"Secretariat" or can_manage_materials %}
<td class="col-md-2">
{% if pres.document.type.slug == 'minutes' %}
{% url 'ietf.meeting.views.upload_session_minutes' session_id=session.pk num=session.meeting.number as upload_url %}
{% elif pres.document.type.slug == 'agenda' %}
{% url 'ietf.meeting.views.upload_session_agenda' session_id=session.pk num=session.meeting.number as upload_url %}
{% else %}
{% url 'ietf.meeting.views.upload_session_bluesheets' session_id=session.pk num=session.meeting.number as upload_url %}
{% endif %}
{% if pres.document.type.slug != 'bluesheets' or user|has_role:"Secretariat" %}
<a class="btn btn-default btn-sm pull-right" href="{{upload_url}}">Upload Revision</a>
{% endif %}
</td>
{% endif %}
</tr>
{% endfor %}
</table>
{% if can_manage_materials %}
{% if not session.type_counter.agenda %}
<a class="btn btn-default pull-right" href="{% url 'ietf.meeting.views.upload_session_agenda' session_id=session.pk num=session.meeting.number %}">Upload Agenda</a>
{% endif %}
{% if not session.type_counter.minutes %}
<a class="btn btn-default pull-right" href="{% url 'ietf.meeting.views.upload_session_minutes' session_id=session.pk num=session.meeting.number %}">Upload Minutes</a>
{% endif %}
{% endif %}
{% if user|has_role:"Secretariat" and not session.type_counter.bluesheets or meeting.type.slug == 'interim' and can_manage_materials and not session.type_counter.bluesheets %}
<a class="btn btn-default pull-right" href="{% url 'ietf.meeting.views.upload_session_bluesheets' session_id=session.pk num=session.meeting.number %}">Upload Bluesheets</a>
{% endif %}
</div>
</div>
{% with use_panels=unscheduled_sessions %}
{% if use_panels %}
<div class="panel panel-default">
<div class="panel-heading" data-toggle="tooltip" title="Drag and drop to reorder slides">Slides</div>
<div class="panel-heading">Scheduled Sessions</div>
<div class="panel-body">
<table class="table table-condensed table-striped slides" id="slides">
<tbody>
{% for pres in session.filtered_slides %}
<tr data-order="{{pres.order}}" data-url="{% url 'ietf.meeting.views.set_slide_order' session_id=session.pk num=session.meeting.number name=pres.document.name %}">
{% if pres.rev %}
{% url 'ietf.doc.views_doc.document_main' name=pres.document.name rev=pres.rev as url %}
{% else %}
{% url 'ietf.doc.views_doc.document_main' name=pres.document.name as url %}
{% endif %}
<td>
<a href="{{pres.document.href}}">{{pres.document.title}} </a>
<a href="{{url}}">({{ pres.document.name }}{% if pres.rev %}-{{ pres.rev }}{% endif %}) </a>
</td>
{% if can_manage_materials %}
<td class="col-md-2">
<a class="btn btn-default btn-sm pull-right" href="{% url 'ietf.meeting.views.upload_session_slides' session_id=session.pk num=session.meeting.number name=pres.document.name %}">Upload Revision</a>
<a class="btn btn-default btn-sm pull-right" href="{% url 'ietf.meeting.views.remove_sessionpresentation' session_id=session.pk num=session.meeting.number name=pres.document.name %}">Remove</a>
</td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
{% if can_manage_materials %}
<a class="btn btn-default pull-right" href="{% url 'ietf.meeting.views.upload_session_slides' session_id=session.pk num=session.meeting.number %}">Upload New Slides</a>
{% endif %}
{% endif %}
{% include 'meeting/session_details_panel.html' with sessions=scheduled_sessions %}
{% if use_panels %}
</div>
{% if can_manage_materials %}
<div class="panel-footer small">Drag-and-drop to reorder slides</div>
{% endif %}
</div>
<div class="panel panel-default">
<div class="panel-heading">Drafts
</div>
<div class="panel panel-warning">
<div class="panel-heading">Uncheduled Sessions</div>
<div class="panel-body">
<table class="table table-condensed table-striped">
{% for pres in session.filtered_drafts %}
<tr>
<td>
{% if pres.rev %}
{% url 'ietf.doc.views_doc.document_main' name=pres.document.name rev=pres.rev as url %}
{% else %}
{% url 'ietf.doc.views_doc.document_main' name=pres.document.name as url %}
{% endif %}
<a href="{{url}}">{{pres.document.title}} ({{ pres.document.name }}{% if pres.rev %}-{{ pres.rev }}{% endif %})</a>
</td>
{% if can_manage_materials %}
<td class="col-md-2">
<a class="btn btn-default btn-sm pull-right" href="{% url 'ietf.meeting.views.remove_sessionpresentation' session_id=session.pk num=session.meeting.number name=pres.document.name %}">Remove</a>
</td>
{% endif %}
</tr>
{% endfor %}
</table>
{% if can_manage_materials %}
<a class="btn btn-default pull-right" href="{% url 'ietf.meeting.views.add_session_drafts' session_id=session.pk num=session.meeting.number %}">
Link additional drafts to session
</a>
{% endif %}
{% endif %}
{% include 'meeting/session_details_panel.html' with sessions=unscheduled_sessions %}
{% if use_panels %}
</div>
</div>
{% endfor %}
{% endif %}
{% endwith %}

{% endblock %}

Expand Down
129 changes: 129 additions & 0 deletions ietf/templates/meeting/session_details_panel.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
{% load ietf_filters %}

{% 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 %}</h2>
{% if session.agenda_note %}<h3>{{session.agenda_note}}</h3>{% endif %}

{% if can_manage_materials %}
{% if session.status.slug == 'sched' or session.status.slug == 'schedw' %}
<div class="buttonlist">
{% if meeting.type.slug == 'interim' and user|has_role:"Secretariat" %}
<a class="btn btn-default" href="{% url 'ietf.meeting.views.interim_request_details' number=meeting.number %}">Meeting Details</a>
{% endif %}
</div>
{% if not session.type_counter.agenda %}
<span class="label label-warning">This session does not yet have an agenda</span>
{% endif %}
{% endif %}
{% endif %}

<div class="panel panel-default">
<div class="panel-heading">Agenda, Minutes, and Bluesheets</div>
<div class="panel-body">
<table class="table table-condensed table-striped">
{% for pres in session.filtered_artifacts %}
<tr>
{% if pres.rev %}
{% url 'ietf.doc.views_doc.document_main' name=pres.document.name rev=pres.rev as url %}
{% else %}
{% url 'ietf.doc.views_doc.document_main' name=pres.document.name as url %}
{% endif %}
<td>
<a href="{{pres.document.href}}">{{pres.document.title}}</a>
<a href="{{url}}">({{ pres.document.name }}{% if pres.rev %}-{{ pres.rev }}{% endif %})</a>
</td>
{% if user|has_role:"Secretariat" or can_manage_materials %}
<td class="col-md-2">
{% if pres.document.type.slug == 'minutes' %}
{% url 'ietf.meeting.views.upload_session_minutes' session_id=session.pk num=session.meeting.number as upload_url %}
{% elif pres.document.type.slug == 'agenda' %}
{% url 'ietf.meeting.views.upload_session_agenda' session_id=session.pk num=session.meeting.number as upload_url %}
{% else %}
{% url 'ietf.meeting.views.upload_session_bluesheets' session_id=session.pk num=session.meeting.number as upload_url %}
{% endif %}
{% if pres.document.type.slug != 'bluesheets' or user|has_role:"Secretariat" %}
<a class="btn btn-default btn-sm pull-right" href="{{upload_url}}">Upload Revision</a>
{% endif %}
</td>
{% endif %}
</tr>
{% endfor %}
</table>
{% if can_manage_materials %}
{% if not session.type_counter.agenda %}
<a class="btn btn-default pull-right" href="{% url 'ietf.meeting.views.upload_session_agenda' session_id=session.pk num=session.meeting.number %}">Upload Agenda</a>
{% endif %}
{% if not session.type_counter.minutes %}
<a class="btn btn-default pull-right" href="{% url 'ietf.meeting.views.upload_session_minutes' session_id=session.pk num=session.meeting.number %}">Upload Minutes</a>
{% endif %}
{% endif %}
{% if user|has_role:"Secretariat" and not session.type_counter.bluesheets or meeting.type.slug == 'interim' and can_manage_materials and not session.type_counter.bluesheets %}
<a class="btn btn-default pull-right" href="{% url 'ietf.meeting.views.upload_session_bluesheets' session_id=session.pk num=session.meeting.number %}">Upload Bluesheets</a>
{% endif %}
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading" data-toggle="tooltip" title="Drag and drop to reorder slides">Slides</div>
<div class="panel-body">
<table class="table table-condensed table-striped slides" id="slides">
<tbody>
{% for pres in session.filtered_slides %}
<tr data-order="{{pres.order}}" data-url="{% url 'ietf.meeting.views.set_slide_order' session_id=session.pk num=session.meeting.number name=pres.document.name %}">
{% if pres.rev %}
{% url 'ietf.doc.views_doc.document_main' name=pres.document.name rev=pres.rev as url %}
{% else %}
{% url 'ietf.doc.views_doc.document_main' name=pres.document.name as url %}
{% endif %}
<td>
<a href="{{pres.document.href}}">{{pres.document.title}} </a>
<a href="{{url}}">({{ pres.document.name }}{% if pres.rev %}-{{ pres.rev }}{% endif %}) </a>
</td>
{% if can_manage_materials %}
<td class="col-md-2">
<a class="btn btn-default btn-sm pull-right" href="{% url 'ietf.meeting.views.upload_session_slides' session_id=session.pk num=session.meeting.number name=pres.document.name %}">Upload Revision</a>
<a class="btn btn-default btn-sm pull-right" href="{% url 'ietf.meeting.views.remove_sessionpresentation' session_id=session.pk num=session.meeting.number name=pres.document.name %}">Remove</a>
</td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
{% if can_manage_materials %}
<a class="btn btn-default pull-right" href="{% url 'ietf.meeting.views.upload_session_slides' session_id=session.pk num=session.meeting.number %}">Upload New Slides</a>
{% endif %}
</div>
{% if can_manage_materials %}
<div class="panel-footer small">Drag-and-drop to reorder slides</div>
{% endif %}
</div>
<div class="panel panel-default">
<div class="panel-heading">Drafts
</div>
<div class="panel-body">
<table class="table table-condensed table-striped">
{% for pres in session.filtered_drafts %}
<tr>
<td>
{% if pres.rev %}
{% url 'ietf.doc.views_doc.document_main' name=pres.document.name rev=pres.rev as url %}
{% else %}
{% url 'ietf.doc.views_doc.document_main' name=pres.document.name as url %}
{% endif %}
<a href="{{url}}">{{pres.document.title}} ({{ pres.document.name }}{% if pres.rev %}-{{ pres.rev }}{% endif %})</a>
</td>
{% if can_manage_materials %}
<td class="col-md-2">
<a class="btn btn-default btn-sm pull-right" href="{% url 'ietf.meeting.views.remove_sessionpresentation' session_id=session.pk num=session.meeting.number name=pres.document.name %}">Remove</a>
</td>
{% endif %}
</tr>
{% endfor %}
</table>
{% if can_manage_materials %}
<a class="btn btn-default pull-right" href="{% url 'ietf.meeting.views.add_session_drafts' session_id=session.pk num=session.meeting.number %}">
Link additional drafts to session
</a>
{% endif %}
</div>
</div>
{% endfor %}

0 comments on commit 661bb18

Please sign in to comment.