From b436d090522ca67abc7b137be8fa08836aeb8df8 Mon Sep 17 00:00:00 2001 From: Robert Sparks Date: Thu, 12 May 2022 13:47:59 -0500 Subject: [PATCH 1/6] feat: restructure rfcedtype groups. add rpc, rswg, rsab. --- ietf/ietfauth/utils.py | 2 +- ietf/utils/test_data.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ietf/ietfauth/utils.py b/ietf/ietfauth/utils.py index 08767468689..d461db5f134 100644 --- a/ietf/ietfauth/utils.py +++ b/ietf/ietfauth/utils.py @@ -64,7 +64,7 @@ def has_role(user, role_names, *args, **kwargs): "Secretariat": Q(person=person, name="secr", group__acronym="secretariat"), "IAB" : Q(person=person, name="member", group__acronym="iab"), "IANA": Q(person=person, name="auth", group__acronym="iana"), - "RFC Editor": Q(person=person, name="auth", group__acronym="rfceditor"), + "RFC Editor": Q(person=person, name="auth", group__acronym="rpc"), "ISE" : Q(person=person, name="chair", group__acronym="ise"), "IAD": Q(person=person, name="admdir", group__acronym="ietf"), "IETF Chair": Q(person=person, name="chair", group__acronym="ietf"), diff --git a/ietf/utils/test_data.py b/ietf/utils/test_data.py index 1281756da95..be2e5bded8e 100644 --- a/ietf/utils/test_data.py +++ b/ietf/utils/test_data.py @@ -89,8 +89,8 @@ def make_immutable_base_data(): iana = create_group(name="IANA", acronym="iana", type_id="iana") create_person(iana, "auth", name="Iña Iana", username="iana", email_address="iana@ia.na") - rfc_editor = create_group(name="RFC Editor", acronym="rfceditor", type_id="rfcedtyp") - create_person(rfc_editor, "auth", name="Rfc Editor", username="rfc", email_address="rfc@edit.or") + rpc = create_group(name="RFC Production Center", acronym="rpc", type_id="rfcedtyp") + create_person(rpc, "auth", name="Rfc Editor", username="rfc", email_address="rfc@edit.or") iesg = create_group(name="Internet Engineering Steering Group", acronym="iesg", type_id="ietf", parent=ietf) # pyflakes:ignore irsg = create_group(name="Internet Research Steering Group", acronym="irsg", type_id="irtf", parent=irtf) # pyflakes:ignore From a088c1128744c7513aa6e4d2494e8fe332ee6886 Mon Sep 17 00:00:00 2001 From: Robert Sparks Date: Thu, 12 May 2022 15:54:00 -0500 Subject: [PATCH 2/6] feat: show rfc editor groups on menu --- ietf/doc/templatetags/active_groups_menu.py | 2 +- ietf/doc/templatetags/wg_menu.py | 7 +++- ietf/group/views.py | 9 +++- ietf/name/migrations/0041_update_rfcedtyp.py | 21 ++++++++++ ietf/templates/group/active_rfced.html | 44 ++++++++++++++++++++ ietf/urls.py | 4 +- 6 files changed, 81 insertions(+), 6 deletions(-) create mode 100644 ietf/name/migrations/0041_update_rfcedtyp.py create mode 100644 ietf/templates/group/active_rfced.html diff --git a/ietf/doc/templatetags/active_groups_menu.py b/ietf/doc/templatetags/active_groups_menu.py index dd97c8e45bb..23f565529bd 100644 --- a/ietf/doc/templatetags/active_groups_menu.py +++ b/ietf/doc/templatetags/active_groups_menu.py @@ -27,4 +27,4 @@ def active_groups_menu(flavor): return render_to_string( "base/menu_active_groups.html", {"parents": parents, "others": others, "flavor": flavor}, - ) \ No newline at end of file + ) diff --git a/ietf/doc/templatetags/wg_menu.py b/ietf/doc/templatetags/wg_menu.py index 1fea3fae458..193bce4e96d 100644 --- a/ietf/doc/templatetags/wg_menu.py +++ b/ietf/doc/templatetags/wg_menu.py @@ -50,7 +50,8 @@ models.Q(type="area") | models.Q(type="irtf", acronym="irtf") | models.Q(acronym="iab") - | models.Q(acronym="ietfadminllc"), + | models.Q(acronym="ietfadminllc") + | models.Q(acronym="rfceditor"), state="active", ).order_by("type__order", "type_id", "acronym") @@ -72,7 +73,9 @@ def wg_menu(flavor): p.menu_url = "/program/" elif p.acronym == "ietfadminllc": p.menu_url = "/adm/" + elif p.acronym == "rfceditor": + p.menu_url = "/rfcedtyp/" return render_to_string( "base/menu_wg.html", {"parents": parents, "flavor": flavor} - ) \ No newline at end of file + ) diff --git a/ietf/group/views.py b/ietf/group/views.py index dcad99687eb..b805c7fd3aa 100644 --- a/ietf/group/views.py +++ b/ietf/group/views.py @@ -295,6 +295,8 @@ def active_groups(request, group_type=None): return active_iab(request) elif group_type == "adm": return active_adm(request) + elif group_type == "rfcedtyp": + return active_rfced(request) else: raise Http404 @@ -332,6 +334,11 @@ def active_adm(request): adm = Group.objects.filter(type="adm", state="active").order_by("parent","name") return render(request, 'group/active_adm.html', {'adm' : adm }) +def active_rfced(request): + rfced = Group.objects.filter(type="rfcedtyp", state="active").order_by("parent", "name") + return render(request, 'group/active_rfced.html', {'rfced' : rfced}) + + def active_areas(request): areas = Group.objects.filter(type="area", state="active").order_by("name") return render(request, 'group/active_areas.html', {'areas': areas }) @@ -1293,7 +1300,7 @@ def stream_edit(request, acronym): @cache_control(public=True, max_age=30*60) @cache_page(30 * 60) def group_menu_data(request): - groups = Group.objects.filter(state="active", parent__state="active").filter(Q(type__features__acts_like_wg=True)|Q(type_id__in=['program','iabasg'])|Q(parent__acronym='ietfadminllc')).order_by("-type_id","acronym") + groups = Group.objects.filter(state="active", parent__state="active").filter(Q(type__features__acts_like_wg=True)|Q(type_id__in=['program','iabasg'])|Q(parent__acronym='ietfadminllc')|Q(parent__acronym='rfceditor')).order_by("-type_id","acronym") groups_by_parent = defaultdict(list) for g in groups: diff --git a/ietf/name/migrations/0041_update_rfcedtyp.py b/ietf/name/migrations/0041_update_rfcedtyp.py new file mode 100644 index 00000000000..8ebae6aa115 --- /dev/null +++ b/ietf/name/migrations/0041_update_rfcedtyp.py @@ -0,0 +1,21 @@ +# Copyright The IETF Trust 2022 All Rights Reserved + +from django.db import migrations + +def forward(apps, schema_editor): + GroupTypeName = apps.get_model('name', 'GroupTypeName') + GroupTypeName.objects.filter(slug='rfcedtyp').update(order=2, verbose_name='RFC Editor Group') + +def reverse(apps, schema_editor): + GroupTypeName = apps.get_model('name', 'GroupTypeName') + GroupTypeName.objects.filter(slug='rfcedtyp').update(order=0, verbose_name='The RFC Editor') + +class Migration(migrations.Migration): + + dependencies = [ + ('name', '0040_remove_constraintname_editor_label'), + ] + + operations = [ + migrations.RunPython(forward,reverse), + ] diff --git a/ietf/templates/group/active_rfced.html b/ietf/templates/group/active_rfced.html new file mode 100644 index 00000000000..30ff5f6a138 --- /dev/null +++ b/ietf/templates/group/active_rfced.html @@ -0,0 +1,44 @@ +{% extends "base.html" %} +{# Copyright The IETF Trust 2015, All Rights Reserved #} +{% load origin static person_filters %} +{% block pagehead %} + +{% endblock %} +{% block title %}Active RFC Editor Groups{% endblock %} +{% block content %} + {% origin %} +

Active RFC Editor Groups

+ + + + + + + + + {% regroup rfced by parent as grouped_groups %} + {% for grouptype in grouped_groups %} + + + + + + + {% for group in grouptype.list %} + + + + + {% endfor %} + + {% endfor %} + +
GroupName
+ Active {% firstof grouptype.grouper.verbose_name grouptype.grouper.name 'Top-level Organization' %} Groups +
+ {{ group.acronym }} + {{ group.name }}
+{% endblock %} +{% block js %} + +{% endblock %} diff --git a/ietf/urls.py b/ietf/urls.py index fbe74675199..516bcfae5eb 100644 --- a/ietf/urls.py +++ b/ietf/urls.py @@ -67,7 +67,7 @@ url(r'^submit/', include('ietf.submit.urls')), url(r'^sync/', include('ietf.sync.urls')), url(r'^templates/', include('ietf.dbtemplate.urls')), - url(r'^(?P(wg|rg|ag|rag|team|dir|review|area|program|iabasg|adhoc|ise|adm))/', include(grouptype_urls)), + url(r'^(?P(wg|rg|ag|rag|team|dir|review|area|program|iabasg|adhoc|ise|adm|rfcedtyp))/', include(grouptype_urls)), # Redirects url(r'^(?Ppublic)/', include('ietf.redirects.urls')), @@ -96,4 +96,4 @@ import debug_toolbar urlpatterns = urlpatterns + [path('__debug__/', include(debug_toolbar.urls)), ] except ImportError: - pass \ No newline at end of file + pass From c57a7ac1ea0a6f4034403fc45b9d78c6ed5dc40a Mon Sep 17 00:00:00 2001 From: Robert Sparks Date: Fri, 13 May 2022 08:05:07 -0500 Subject: [PATCH 3/6] feat: add the editorial stream --- .../group/migrations/0055_editorial_stream.py | 38 +++++++++++++++++++ ietf/group/tests_info.py | 2 +- ietf/name/admin.py | 4 +- ietf/name/migrations/0042_editorial_stream.py | 30 +++++++++++++++ .../0043_editorial_stream_grouptype.py | 26 +++++++++++++ ietf/templates/base/menu.html | 6 +++ ietf/templates/group/index.html | 4 +- 7 files changed, 105 insertions(+), 5 deletions(-) create mode 100644 ietf/group/migrations/0055_editorial_stream.py create mode 100644 ietf/name/migrations/0042_editorial_stream.py create mode 100644 ietf/name/migrations/0043_editorial_stream_grouptype.py diff --git a/ietf/group/migrations/0055_editorial_stream.py b/ietf/group/migrations/0055_editorial_stream.py new file mode 100644 index 00000000000..a7dc9ca9c3d --- /dev/null +++ b/ietf/group/migrations/0055_editorial_stream.py @@ -0,0 +1,38 @@ +# Copyright The IETF Trust 2022 All Rights Reserved + +from django.db import migrations + +def forward(apps, schema_editor): + Group = apps.get_model('group', 'Group') + GroupFeatures = apps.get_model('group', 'GroupFeatures') + Group.objects.create( + acronym='editorial', + name='Editorial Stream', + state_id='active', + type_id='editorial', + parent=None, + ) + templ = GroupFeatures.objects.get(type='rfcedtyp') + templ.pk = None + templ.type_id='editorial' + templ.save() + + + +def reverse(apps, schema_editor): + Group = apps.get_model('group', 'Group') + GroupFeatures = apps.get_model('group', 'GroupFeatures') + GroupFeatures.objects.filter(type='editorial').delete() + Group.objects.filter(acronym='editorial').delete() + + +class Migration(migrations.Migration): + + dependencies = [ + ('group', '0054_enable_delegation'), + ('name', '0043_editorial_stream_grouptype'), + ] + + operations = [ + migrations.RunPython(forward, reverse), + ] diff --git a/ietf/group/tests_info.py b/ietf/group/tests_info.py index 3487a937176..01882961a94 100644 --- a/ietf/group/tests_info.py +++ b/ietf/group/tests_info.py @@ -84,7 +84,7 @@ def test_active_groups(self): self.assertContains(r, "Directorate") self.assertContains(r, "AG") - for slug in GroupTypeName.objects.exclude(slug__in=['wg','rg','ag','rag','area','dir','review','team','program','adhoc','ise','adm','iabasg']).values_list('slug',flat=True): + for slug in GroupTypeName.objects.exclude(slug__in=['wg','rg','ag','rag','area','dir','review','team','program','adhoc','ise','adm','iabasg','rfcedtyp']).values_list('slug',flat=True): with self.assertRaises(NoReverseMatch): url=urlreverse('ietf.group.views.active_groups', kwargs=dict(group_type=slug)) diff --git a/ietf/name/admin.py b/ietf/name/admin.py index 0cd6265e81b..b7438189032 100644 --- a/ietf/name/admin.py +++ b/ietf/name/admin.py @@ -18,7 +18,7 @@ from ietf.stats.models import CountryAlias class NameAdmin(admin.ModelAdmin): - list_display = ["slug", "name", "desc", "used"] + list_display = ["slug", "name", "desc", "used", "order"] search_fields = ["slug", "name"] prepopulate_from = { "slug": ("name",) } @@ -96,4 +96,4 @@ class ProceedingsMaterialTypeNameAdmin(NameAdmin): admin.site.register(DocUrlTagName, NameAdmin) admin.site.register(ExtResourceTypeName, NameAdmin) admin.site.register(SlideSubmissionStatusName, NameAdmin) -admin.site.register(SessionPurposeName, NameAdmin) \ No newline at end of file +admin.site.register(SessionPurposeName, NameAdmin) diff --git a/ietf/name/migrations/0042_editorial_stream.py b/ietf/name/migrations/0042_editorial_stream.py new file mode 100644 index 00000000000..1b9aaaf0763 --- /dev/null +++ b/ietf/name/migrations/0042_editorial_stream.py @@ -0,0 +1,30 @@ +# Copyright The IETF Trust 2022 All Rights Reserved + +from django.db import migrations + +def forward(apps, schema_editor): + StreamName = apps.get_model('name', 'StreamName') + StreamName.objects.create( + slug = 'editorial', + name = 'Editorial', + desc = 'Editorial', + used = True, + order = 5, + ) + StreamName.objects.filter(slug='legacy').update(order=6) + + +def reverse(apps, schema_editor): + StreamName = apps.get_model('name', 'StreamName') + StreamName.objects.filter(slug='editorial').delete() + StreamName.objects.filter(slug='legacy').update(order=5) + +class Migration(migrations.Migration): + + dependencies = [ + ('name', '0041_update_rfcedtyp'), + ] + + operations = [ + migrations.RunPython(forward, reverse), + ] diff --git a/ietf/name/migrations/0043_editorial_stream_grouptype.py b/ietf/name/migrations/0043_editorial_stream_grouptype.py new file mode 100644 index 00000000000..5fe839174f0 --- /dev/null +++ b/ietf/name/migrations/0043_editorial_stream_grouptype.py @@ -0,0 +1,26 @@ +# Copyright The IETF Trust 2022 All Rights Reserved + +from django.db import migrations + +def forward(apps, schema_editor): + GroupTypeName = apps.get_model('name', 'GroupTypeName') + GroupTypeName.objects.create( + slug = 'editorial', + name = 'Editorial', + desc = 'Editorial Stream Group', + used = True, + ) + +def reverse(apps, schema_editor): + GroupTypeName = apps.get_model('name', 'GroupTypeName') + GroupTypeName.objects.filter(slug='editorial').delete() + +class Migration(migrations.Migration): + + dependencies = [ + ('name', '0042_editorial_stream'), + ] + + operations = [ + migrations.RunPython(forward, reverse), + ] diff --git a/ietf/templates/base/menu.html b/ietf/templates/base/menu.html index 33a1cda0a57..2d6f53de581 100644 --- a/ietf/templates/base/menu.html +++ b/ietf/templates/base/menu.html @@ -208,6 +208,12 @@ ISE +
  • + + Editorial + +
  • {% if flavor == 'top' %} diff --git a/ietf/templates/group/index.html b/ietf/templates/group/index.html index a2e0be7062a..77bb5351262 100644 --- a/ietf/templates/group/index.html +++ b/ietf/templates/group/index.html @@ -27,7 +27,7 @@

    Other RFC streams

    {% with stream.get_chair as role %} {% person_link role.person %} - {{ role.name }} + {% if role %}{{ role.name }}{% endif %} {% endwith %} @@ -37,4 +37,4 @@

    Other RFC streams

    {% endblock %} {% block js %} -{% endblock %} \ No newline at end of file +{% endblock %} From 59d0f576ae93d29cbc308a07143e0ff2c8f06bbc Mon Sep 17 00:00:00 2001 From: Robert Sparks Date: Fri, 13 May 2022 10:26:52 -0500 Subject: [PATCH 4/6] fix: repair broken html and extent dest coverage. --- ietf/group/tests_info.py | 2 +- ietf/templates/group/active_rfced.html | 38 ++++++++++++-------------- 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/ietf/group/tests_info.py b/ietf/group/tests_info.py index 01882961a94..c64e6327bbe 100644 --- a/ietf/group/tests_info.py +++ b/ietf/group/tests_info.py @@ -68,7 +68,7 @@ def test_active_groups(self): self.assertContains(r, group.name) self.assertContains(r, escape(group.ad_role().person.name)) - for t in ('rg','area','ag', 'rag', 'dir','review','team','program','iabasg','adm'): + for t in ('rg','area','ag', 'rag', 'dir','review','team','program','iabasg','adm','rfcedtyp'): g = GroupFactory.create(type_id=t,state_id='active') if t in ['dir','review']: g.parent = GroupFactory.create(type_id='area',state_id='active') diff --git a/ietf/templates/group/active_rfced.html b/ietf/templates/group/active_rfced.html index 30ff5f6a138..fd782f36388 100644 --- a/ietf/templates/group/active_rfced.html +++ b/ietf/templates/group/active_rfced.html @@ -15,28 +15,26 @@

    Active RFC Editor Groups

    Name - - {% regroup rfced by parent as grouped_groups %} - {% for grouptype in grouped_groups %} - + {% regroup rfced by parent as grouped_groups %} + {% for grouptype in grouped_groups %} + + + + Active {% firstof grouptype.grouper.verbose_name grouptype.grouper.name 'Top-level Organization' %} Groups + + + + + {% for group in grouptype.list %} - - Active {% firstof grouptype.grouper.verbose_name grouptype.grouper.name 'Top-level Organization' %} Groups - + + {{ group.acronym }} + + {{ group.name }} - - - {% for group in grouptype.list %} - - - {{ group.acronym }} - - {{ group.name }} - - {% endfor %} - - {% endfor %} - + {% endfor %} + + {% endfor %} {% endblock %} {% block js %} From aa4da07c7e2c7fe41e7d4ca7aa110105979957cb Mon Sep 17 00:00:00 2001 From: Robert Sparks Date: Fri, 20 May 2022 09:22:54 -0500 Subject: [PATCH 5/6] chore: address Lars review comment --- ietf/doc/templatetags/active_groups_menu.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ietf/doc/templatetags/active_groups_menu.py b/ietf/doc/templatetags/active_groups_menu.py index 23f565529bd..dd97c8e45bb 100644 --- a/ietf/doc/templatetags/active_groups_menu.py +++ b/ietf/doc/templatetags/active_groups_menu.py @@ -27,4 +27,4 @@ def active_groups_menu(flavor): return render_to_string( "base/menu_active_groups.html", {"parents": parents, "others": others, "flavor": flavor}, - ) + ) \ No newline at end of file From 87040a9ef97e66baa05e861a4686456c072468a5 Mon Sep 17 00:00:00 2001 From: Robert Sparks Date: Fri, 20 May 2022 10:12:24 -0500 Subject: [PATCH 6/6] chore: update copyright notices. --- ietf/doc/templatetags/wg_menu.py | 2 ++ ietf/group/tests_info.py | 2 +- ietf/group/views.py | 2 +- ietf/ietfauth/utils.py | 4 ++-- ietf/name/admin.py | 2 +- ietf/templates/group/active_rfced.html | 2 +- ietf/templates/group/index.html | 2 +- ietf/urls.py | 2 +- ietf/utils/test_data.py | 2 +- 9 files changed, 11 insertions(+), 9 deletions(-) diff --git a/ietf/doc/templatetags/wg_menu.py b/ietf/doc/templatetags/wg_menu.py index 193bce4e96d..e82f125c076 100644 --- a/ietf/doc/templatetags/wg_menu.py +++ b/ietf/doc/templatetags/wg_menu.py @@ -1,3 +1,5 @@ +# Copyright The IETF Trust 2009-2022, All Rights Reserved + # Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). # All rights reserved. Contact: Pasi Eronen # diff --git a/ietf/group/tests_info.py b/ietf/group/tests_info.py index c64e6327bbe..d015f270f62 100644 --- a/ietf/group/tests_info.py +++ b/ietf/group/tests_info.py @@ -1,4 +1,4 @@ -# Copyright The IETF Trust 2009-2020, All Rights Reserved +# Copyright The IETF Trust 2009-2022, All Rights Reserved # -*- coding: utf-8 -*- diff --git a/ietf/group/views.py b/ietf/group/views.py index ee3100de6d0..88267e78835 100644 --- a/ietf/group/views.py +++ b/ietf/group/views.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright The IETF Trust 2009-2020, All Rights Reserved +# Copyright The IETF Trust 2009-2022, All Rights Reserved # # Portion Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). # All rights reserved. Contact: Pasi Eronen diff --git a/ietf/ietfauth/utils.py b/ietf/ietfauth/utils.py index d461db5f134..c626b98b96c 100644 --- a/ietf/ietfauth/utils.py +++ b/ietf/ietfauth/utils.py @@ -1,4 +1,4 @@ -# Copyright The IETF Trust 2013-2020, All Rights Reserved +# Copyright The IETF Trust 2013-2022, All Rights Reserved # -*- coding: utf-8 -*- @@ -305,4 +305,4 @@ def scope_registration(self): } return info - \ No newline at end of file + diff --git a/ietf/name/admin.py b/ietf/name/admin.py index b7438189032..dd659d1135f 100644 --- a/ietf/name/admin.py +++ b/ietf/name/admin.py @@ -1,4 +1,4 @@ -# Copyright The IETF Trust 2010-2020, All Rights Reserved +# Copyright The IETF Trust 2010-2022, All Rights Reserved from django.contrib import admin from ietf.name.models import ( diff --git a/ietf/templates/group/active_rfced.html b/ietf/templates/group/active_rfced.html index fd782f36388..78dacfa4c62 100644 --- a/ietf/templates/group/active_rfced.html +++ b/ietf/templates/group/active_rfced.html @@ -1,5 +1,5 @@ {% extends "base.html" %} -{# Copyright The IETF Trust 2015, All Rights Reserved #} +{# Copyright The IETF Trust 2022, All Rights Reserved #} {% load origin static person_filters %} {% block pagehead %} diff --git a/ietf/templates/group/index.html b/ietf/templates/group/index.html index 77bb5351262..9930c140a58 100644 --- a/ietf/templates/group/index.html +++ b/ietf/templates/group/index.html @@ -1,5 +1,5 @@ {% extends "base.html" %} -{# Copyright The IETF Trust 2015, All Rights Reserved #} +{# Copyright The IETF Trust 2015-2022, All Rights Reserved #} {% load origin static person_filters %} {% load ietf_filters %} {% block pagehead %} diff --git a/ietf/urls.py b/ietf/urls.py index 516bcfae5eb..17a0fd5f4bf 100644 --- a/ietf/urls.py +++ b/ietf/urls.py @@ -1,4 +1,4 @@ -# Copyright The IETF Trust 2007-2019, All Rights Reserved +# Copyright The IETF Trust 2007-2022, All Rights Reserved from django.conf import settings from django.conf.urls import include diff --git a/ietf/utils/test_data.py b/ietf/utils/test_data.py index be2e5bded8e..7a7a77af49b 100644 --- a/ietf/utils/test_data.py +++ b/ietf/utils/test_data.py @@ -1,4 +1,4 @@ -# Copyright The IETF Trust 2011-2020, All Rights Reserved +# Copyright The IETF Trust 2011-2022, All Rights Reserved # -*- coding: utf-8 -*-