diff --git a/ietf/liaisons/tests.py b/ietf/liaisons/tests.py index d2f4fafca3..5e0a237575 100644 --- a/ietf/liaisons/tests.py +++ b/ietf/liaisons/tests.py @@ -110,6 +110,17 @@ def test_help_pages(self): self.assertEqual(self.client.get('/liaison/help/from_ietf/').status_code, 200) self.assertEqual(self.client.get('/liaison/help/to_ietf/').status_code, 200) + def test_list_other_sdo(self): + GroupFactory(type_id="sdo", state_id="conclude", acronym="third") + GroupFactory(type_id="sdo", state_id="active", acronym="second") + GroupFactory(type_id="sdo", state_id="active", acronym="first") + url = urlreverse("ietf.liaisons.views.list_other_sdo") + login_testing_unauthorized(self, "secretary", url) + r = self.client.get(url) + q = PyQuery(r.content) + self.assertEqual(len(q("h1")), 2) + first_td_elements_text = [e.text for e in q("tr").find("td:first-child")] + self.assertEqual(first_td_elements_text, ["first", "second", "third"]) class UnitTests(TestCase): def test_get_contacts_for_liaison_messages_for_group_primary(self): diff --git a/ietf/liaisons/urls.py b/ietf/liaisons/urls.py index 0fbd29425e..498df3b965 100644 --- a/ietf/liaisons/urls.py +++ b/ietf/liaisons/urls.py @@ -37,4 +37,5 @@ url(r'^add/$', views.redirect_add), url(r'^for_approval/$', views.redirect_for_approval), url(r'^for_approval/(?P\d+)/$', views.redirect_for_approval), + url(r"^list_other_sdo/$", views.list_other_sdo), ] diff --git a/ietf/liaisons/views.py b/ietf/liaisons/views.py index e2abff52ac..59c6ea69fc 100644 --- a/ietf/liaisons/views.py +++ b/ietf/liaisons/views.py @@ -509,3 +509,17 @@ def liaison_resend(request, object_id): messages.success(request,'Liaison Statement resent') return redirect('ietf.liaisons.views.liaison_list') + +@role_required("Secretariat", "IAB", "Liaison Coordinator", "Liaison Manager") +def list_other_sdo(request): + def _sdo_order_key(obj:Group)-> tuple[str,str]: + state_order = { + "active" : "a", + "conclude": "b", + } + return (state_order.get(obj.state.slug,f"c{obj.state.slug}"), obj.acronym) + + sdos = sorted(list(Group.objects.filter(type="sdo")),key = _sdo_order_key) + for sdo in sdos: + sdo.liaison_managers =[r.person for r in sdo.role_set.filter(name="liaiman")] + return render(request,"liaisons/list_other_sdo.html",dict(sdos=sdos)) diff --git a/ietf/templates/base/menu.html b/ietf/templates/base/menu.html index 1e7c1688ff..8ff6e952da 100644 --- a/ietf/templates/base/menu.html +++ b/ietf/templates/base/menu.html @@ -31,19 +31,19 @@ {% if flavor == 'top' %}
  • {% endif %}
  • New work
  • - Chartering groups
  • - BOFs
  • - BOF Requests @@ -51,13 +51,13 @@ {% if flavor == 'top' %}
  • {% endif %}
  • Other groups
  • - Concluded groups
  • - Non-WG lists @@ -81,26 +81,26 @@
  • {% endif %}
  • - Search
  • - Recent I-Ds
  • - Submit an Internet-Draft
  • {% if user and user.is_authenticated %}
  • - My tracked docs @@ -108,7 +108,7 @@ {% if user|has_role:"Area Director,Secretariat" %} {% if flavor == 'top' %}
  • {% endif %}
  • - RFC status changes @@ -121,19 +121,19 @@