From 661bb18f0c51acac4545a15d0587876891ed9906 Mon Sep 17 00:00:00 2001 From: Robert Sparks Date: Wed, 9 Aug 2017 20:06:36 +0000 Subject: [PATCH] Make it more obvious which sessions are scheduled and which are not when viewing session details and managing materials. Fixes #2084. Commit ready for merge. - Legacy-Id: 14035 --- ietf/meeting/views.py | 6 +- ietf/templates/meeting/session_details.html | 135 ++---------------- .../meeting/session_details_panel.html | 129 +++++++++++++++++ 3 files changed, 148 insertions(+), 122 deletions(-) create mode 100644 ietf/templates/meeting/session_details_panel.html diff --git a/ietf/meeting/views.py b/ietf/meeting/views.py index 22e10988c..a95967267 100644 --- a/ietf/meeting/views.py +++ b/ietf/meeting/views.py @@ -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, diff --git a/ietf/templates/meeting/session_details.html b/ietf/templates/meeting/session_details.html index 46ab28318..257ff12f9 100644 --- a/ietf/templates/meeting/session_details.html +++ b/ietf/templates/meeting/session_details.html @@ -14,133 +14,26 @@ {% origin %}

{{ meeting }} : {{ acronym }}

- {% for session in sessions %} -

{% if sessions|length > 1 %}Session {{ forloop.counter }} : {% endif %}{{ session.time }}{% if session.name %} : {{ session.name }}{% endif %}

- {% if session.agenda_note %}

{{session.agenda_note}}

{% endif %} - - {% if can_manage_materials %} - {% if session.status.slug == 'sched' or session.status.slug == 'schedw' %} -
- {% if meeting.type.slug == 'interim' and user|has_role:"Secretariat" %} - Meeting Details - {% endif %} -
- {% if not session.type_counter.agenda %} - This session does not yet have an agenda - {% endif %} - {% endif %} + {% with use_panels=unscheduled_sessions %} + {% if use_panels %} +
+
Scheduled Sessions
+
{% endif %} - -
-
Agenda, Minutes, and Bluesheets
-
- - {% for pres in session.filtered_artifacts %} - - {% 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 %} - - {% if user|has_role:"Secretariat" or can_manage_materials %} - - {% endif %} - - {% endfor %} -
- {{pres.document.title}} - ({{ pres.document.name }}{% if pres.rev %}-{{ pres.rev }}{% endif %}) - - {% 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" %} - Upload Revision - {% endif %} -
- {% if can_manage_materials %} - {% if not session.type_counter.agenda %} - Upload Agenda - {% endif %} - {% if not session.type_counter.minutes %} - Upload Minutes - {% 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 %} - Upload Bluesheets - {% endif %} + {% include 'meeting/session_details_panel.html' with sessions=scheduled_sessions %} + {% if use_panels %}
-
-
Slides
+
+
Uncheduled Sessions
- - - {% for pres in session.filtered_slides %} - - {% 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 %} - - {% if can_manage_materials %} - - {% endif %} - - {% endfor %} - -
- {{pres.document.title}} - ({{ pres.document.name }}{% if pres.rev %}-{{ pres.rev }}{% endif %}) - - Upload Revision - Remove -
- {% if can_manage_materials %} - Upload New Slides - {% endif %} -
- {% if can_manage_materials %} - - {% endif %} -
-
-
Drafts -
-
- - {% for pres in session.filtered_drafts %} - - - {% if can_manage_materials %} - - {% endif %} - - {% endfor %} -
- {% 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 %} - {{pres.document.title}} ({{ pres.document.name }}{% if pres.rev %}-{{ pres.rev }}{% endif %}) - - Remove -
- {% if can_manage_materials %} - - Link additional drafts to session - - {% endif %} + {% endif %} + {% include 'meeting/session_details_panel.html' with sessions=unscheduled_sessions %} + {% if use_panels %}
- {% endfor %} + {% endif %} + {% endwith %} {% endblock %} diff --git a/ietf/templates/meeting/session_details_panel.html b/ietf/templates/meeting/session_details_panel.html new file mode 100644 index 000000000..6348d7aae --- /dev/null +++ b/ietf/templates/meeting/session_details_panel.html @@ -0,0 +1,129 @@ +{% load ietf_filters %} + + {% for session in sessions %} +

{% if sessions|length > 1 %}Session {{ forloop.counter }} : {% endif %}{{ session.time }}{% if session.name %} : {{ session.name }}{% endif %}

+ {% if session.agenda_note %}

{{session.agenda_note}}

{% endif %} + + {% if can_manage_materials %} + {% if session.status.slug == 'sched' or session.status.slug == 'schedw' %} +
+ {% if meeting.type.slug == 'interim' and user|has_role:"Secretariat" %} + Meeting Details + {% endif %} +
+ {% if not session.type_counter.agenda %} + This session does not yet have an agenda + {% endif %} + {% endif %} + {% endif %} + +
+
Agenda, Minutes, and Bluesheets
+
+ + {% for pres in session.filtered_artifacts %} + + {% 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 %} + + {% if user|has_role:"Secretariat" or can_manage_materials %} + + {% endif %} + + {% endfor %} +
+ {{pres.document.title}} + ({{ pres.document.name }}{% if pres.rev %}-{{ pres.rev }}{% endif %}) + + {% 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" %} + Upload Revision + {% endif %} +
+ {% if can_manage_materials %} + {% if not session.type_counter.agenda %} + Upload Agenda + {% endif %} + {% if not session.type_counter.minutes %} + Upload Minutes + {% 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 %} + Upload Bluesheets + {% endif %} +
+
+
+
Slides
+
+ + + {% for pres in session.filtered_slides %} + + {% 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 %} + + {% if can_manage_materials %} + + {% endif %} + + {% endfor %} + +
+ {{pres.document.title}} + ({{ pres.document.name }}{% if pres.rev %}-{{ pres.rev }}{% endif %}) + + Upload Revision + Remove +
+ {% if can_manage_materials %} + Upload New Slides + {% endif %} +
+ {% if can_manage_materials %} + + {% endif %} +
+
+
Drafts +
+
+ + {% for pres in session.filtered_drafts %} + + + {% if can_manage_materials %} + + {% endif %} + + {% endfor %} +
+ {% 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 %} + {{pres.document.title}} ({{ pres.document.name }}{% if pres.rev %}-{{ pres.rev }}{% endif %}) + + Remove +
+ {% if can_manage_materials %} + + Link additional drafts to session + + {% endif %} +
+
+ {% endfor %}