From d4899b78f9ca2bfe4ed7700fb5aef793b124a34a Mon Sep 17 00:00:00 2001 From: Robert Sparks Date: Fri, 3 Sep 2021 15:14:06 +0000 Subject: [PATCH] Adjust groupfeatures has_session_materials to match modern usage. Adjusted proceedings and materials templates to show fewer unnecessary duplicates. Fixes #2981 and #3387. Commit ready for merge. - Legacy-Id: 19316 --- .../migrations/0048_has_session_materials.py | 29 +++++++++++++++++++ ietf/templates/base/menu.html | 2 +- ietf/templates/meeting/materials.html | 10 +++---- 3 files changed, 35 insertions(+), 6 deletions(-) create mode 100644 ietf/group/migrations/0048_has_session_materials.py diff --git a/ietf/group/migrations/0048_has_session_materials.py b/ietf/group/migrations/0048_has_session_materials.py new file mode 100644 index 000000000..3a081275d --- /dev/null +++ b/ietf/group/migrations/0048_has_session_materials.py @@ -0,0 +1,29 @@ +# Copyright The IETF Trust 2021 All Rights Reserved + +from django.db import migrations + +# Not adding team at this time - need to untangle the nonsession_materials mess first + +types_to_change = [ + 'program', + 'dir', + 'review', +] + +def forward(apps, schema_editor): + GroupFeatures = apps.get_model('group', 'GroupFeatures') + GroupFeatures.objects.filter(type__in=types_to_change).update(has_session_materials=True) + +def reverse(apps, schema_editor): + GroupFeatures = apps.get_model('group', 'GroupFeatures') + GroupFeatures.objects.filter(type__in=types_to_change).update(has_session_materials=False) + +class Migration(migrations.Migration): + + dependencies = [ + ('group', '0047_ietfllc'), + ] + + operations = [ + migrations.RunPython(forward, reverse), + ] diff --git a/ietf/templates/base/menu.html b/ietf/templates/base/menu.html index 19db79876..f1e88a43b 100644 --- a/ietf/templates/base/menu.html +++ b/ietf/templates/base/menu.html @@ -61,7 +61,7 @@ {% if user|has_role:"WG Chair,RG Chair" %} {% if flavor == "top" %}{% endif %} -
  • WG chair
  • +
  • Manage
  • Approve a draft
  • {% for g in user|docman_groups %} diff --git a/ietf/templates/meeting/materials.html b/ietf/templates/meeting/materials.html index 42a156d47..4f1c5f4de 100644 --- a/ietf/templates/meeting/materials.html +++ b/ietf/templates/meeting/materials.html @@ -134,8 +134,8 @@ - {% for session in training %} - {% ifchanged %} + {% for session in training %} + {% ifchanged %} {# TODO: Find a better way to represent purposed sessions in both materials and proceedings #} {% include "meeting/group_materials.html" %} {% endifchanged %} {% endfor %} @@ -171,7 +171,7 @@ {% for session in iab %} - {% ifchanged %} + {% ifchanged session.group.acronym %} {% include "meeting/group_materials.html" %} {% endifchanged %} {% endfor %} @@ -206,7 +206,7 @@ {% for session in irtf|dictsort:"group.acronym" %} - {% ifchanged %} + {% ifchanged session.group.acronym %} {% include "meeting/group_materials.html" %} {% endifchanged %} {% endfor %} @@ -240,7 +240,7 @@ {% for session in other|dictsort:"group.acronym" %} - {% ifchanged %} + {% ifchanged session.group.acronym %} {% include "meeting/group_materials.html" %} {% endifchanged %} {% endfor %}