From 07e0ae3e4499f81b57d1868bcd556d99a5fa4117 Mon Sep 17 00:00:00 2001 From: Rich Salz Date: Sat, 25 Mar 2023 02:21:19 -0400 Subject: [PATCH 1/5] fix: Add "simple" list of nomcom volunteers (#4732) For doing cut/paste to IETF announcements of the list of volunteers, it can be very convenient to just have a simple text list of name and affiliation. We implement this by adding a "mode" flag to the volunteer functions, and omitting columns in the template in non-full (i.e., simple) mode. --- ietf/nomcom/views.py | 11 +++--- .../templates/nomcom/nomcom_private_base.html | 9 +++-- ietf/templates/nomcom/nomcom_public_base.html | 2 +- ietf/templates/nomcom/volunteers.html | 36 ++++++++++++------- 4 files changed, 39 insertions(+), 19 deletions(-) diff --git a/ietf/nomcom/views.py b/ietf/nomcom/views.py index 6f02b16e294..f03d6a1488d 100644 --- a/ietf/nomcom/views.py +++ b/ietf/nomcom/views.py @@ -1313,14 +1313,17 @@ def eligible(request, year, public=False): def public_volunteers(request, year): return volunteers(request=request, year=year, public=True) -def private_volunteers(request, year): - return volunteers(request=request, year=year, public=False) +def private_volunteers(request, year, mode): + return volunteers(request=request, year=year, public=False, mode="full") @role_required("Nomcom Chair", "Nomcom Advisor", "Secretariat") -def volunteers(request, year, public=False): +def volunteers(request, year, public=False, mode="full"): nomcom, volunteers = extract_volunteers(year) - return render(request, 'nomcom/volunteers.html', dict(year=year, nomcom=nomcom, volunteers=volunteers, public=public)) + fullmode = 1 + if mode != "full": + fullmode=0 + return render(request, 'nomcom/volunteers.html', dict(year=year, nomcom=nomcom, volunteers=volunteers, public=public, fullmode=fullmode)) @role_required("Nomcom Chair", "Nomcom Advisor", "Secretariat") def private_volunteers_csv(request, year, public=False): diff --git a/ietf/templates/nomcom/nomcom_private_base.html b/ietf/templates/nomcom/nomcom_private_base.html index 2a0495fbe6c..81bf438f701 100644 --- a/ietf/templates/nomcom/nomcom_private_base.html +++ b/ietf/templates/nomcom/nomcom_private_base.html @@ -132,7 +132,12 @@

+ @@ -153,4 +158,4 @@

window.location.hash=e.target.hash; }) -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/ietf/templates/nomcom/nomcom_public_base.html b/ietf/templates/nomcom/nomcom_public_base.html index 9e575a59e32..97e5303cba2 100644 --- a/ietf/templates/nomcom/nomcom_public_base.html +++ b/ietf/templates/nomcom/nomcom_public_base.html @@ -81,4 +81,4 @@

}); }); -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/ietf/templates/nomcom/volunteers.html b/ietf/templates/nomcom/volunteers.html index 5cc437c23cb..bb7d0087a35 100644 --- a/ietf/templates/nomcom/volunteers.html +++ b/ietf/templates/nomcom/volunteers.html @@ -18,26 +18,38 @@

{{ eligibility_group.grouper|yesno:"Eligible, Not Eligible" }}< - Last name - First name + {% if fullmode %} + Last name + First name + {% endif %} Plain name - Profile page - Affiliation - Primary email - Qualifications + {% if fullmode %} + Profile page + {% endif %} + Affiliation + {% if fullmode %} + Primary email + Qualifications + {% endif %} {% for v in eligibility_group.list %} {{ forloop.counter }} - {{ v.person.last_name }} - {{ v.person.first_name }} + {% if fullmode %} + {{ v.person.last_name }} + {{ v.person.first_name }} + {% endif %} {{ v.person.ascii_name }} - {% person_link v.person %} + {% if fullmode %} + {% person_link v.person %} + {% endif %} {{ v.affiliation }} - {{ v.person.email|linkify }} - {{ v.qualifications }} + {% if fullmode %} + {{ v.person.email|linkify }} + {{ v.qualifications }} + {% endif %} {% endfor %} @@ -46,4 +58,4 @@

{{ eligibility_group.grouper|yesno:"Eligible, Not Eligible" }}< {% endblock %} {% block js %} -{% endblock %} \ No newline at end of file +{% endblock %} From 75b6818dc82e1af61b97cb3a46b3e9317c3c2c2d Mon Sep 17 00:00:00 2001 From: Rich Salz Date: Sat, 25 Mar 2023 22:21:48 -0400 Subject: [PATCH 2/5] Re-order columns to "simple" ones are first Suggested by Robert; reduces the number of if/endif blocks. --- ietf/templates/nomcom/volunteers.html | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/ietf/templates/nomcom/volunteers.html b/ietf/templates/nomcom/volunteers.html index bb7d0087a35..0c4339870fe 100644 --- a/ietf/templates/nomcom/volunteers.html +++ b/ietf/templates/nomcom/volunteers.html @@ -18,16 +18,12 @@

{{ eligibility_group.grouper|yesno:"Eligible, Not Eligible" }}< + Plain name + Affiliation {% if fullmode %} Last name First name - {% endif %} - Plain name - {% if fullmode %} Profile page - {% endif %} - Affiliation - {% if fullmode %} Primary email Qualifications {% endif %} @@ -37,16 +33,12 @@

{{ eligibility_group.grouper|yesno:"Eligible, Not Eligible" }}< {% for v in eligibility_group.list %} {{ forloop.counter }} + {{ v.person.ascii_name }} + {{ v.affiliation }} {% if fullmode %} {{ v.person.last_name }} {{ v.person.first_name }} - {% endif %} - {{ v.person.ascii_name }} - {% if fullmode %} {% person_link v.person %} - {% endif %} - {{ v.affiliation }} - {% if fullmode %} {{ v.person.email|linkify }} {{ v.qualifications }} {% endif %} From 8321342e4fe333e5bfdb55e879e55aba5f580796 Mon Sep 17 00:00:00 2001 From: Rich Salz Date: Sat, 25 Mar 2023 22:25:08 -0400 Subject: [PATCH 3/5] Fix parameter declaration to have default value It was on the function call, which was an off-by-one-line bug :) --- ietf/nomcom/views.py | 4 ++-- ietf/templates/nomcom/nomcom_public_base.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ietf/nomcom/views.py b/ietf/nomcom/views.py index f03d6a1488d..a860b5ae6b0 100644 --- a/ietf/nomcom/views.py +++ b/ietf/nomcom/views.py @@ -1313,8 +1313,8 @@ def eligible(request, year, public=False): def public_volunteers(request, year): return volunteers(request=request, year=year, public=True) -def private_volunteers(request, year, mode): - return volunteers(request=request, year=year, public=False, mode="full") +def private_volunteers(request, year, mode="full"): + return volunteers(request=request, year=year, public=False, mode) @role_required("Nomcom Chair", "Nomcom Advisor", "Secretariat") diff --git a/ietf/templates/nomcom/nomcom_public_base.html b/ietf/templates/nomcom/nomcom_public_base.html index 97e5303cba2..9e575a59e32 100644 --- a/ietf/templates/nomcom/nomcom_public_base.html +++ b/ietf/templates/nomcom/nomcom_public_base.html @@ -81,4 +81,4 @@

}); }); -{% endblock %} +{% endblock %} \ No newline at end of file From 7e1818ede55d913e9186a42df81b7cb43186a7b9 Mon Sep 17 00:00:00 2001 From: Rich Salz Date: Sat, 25 Mar 2023 22:26:54 -0400 Subject: [PATCH 4/5] Fix parameter declaration to have default value It was on the function call, which was an off-by-one-line bug :) --- ietf/nomcom/views.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ietf/nomcom/views.py b/ietf/nomcom/views.py index a860b5ae6b0..bad1ec4a1f8 100644 --- a/ietf/nomcom/views.py +++ b/ietf/nomcom/views.py @@ -1314,8 +1314,7 @@ def public_volunteers(request, year): return volunteers(request=request, year=year, public=True) def private_volunteers(request, year, mode="full"): - return volunteers(request=request, year=year, public=False, mode) - + return volunteers(request=request, year=year, public=False, mode=mode) @role_required("Nomcom Chair", "Nomcom Advisor", "Secretariat") def volunteers(request, year, public=False, mode="full"): From cf53e11088cd5c528fee442339234a252d21814d Mon Sep 17 00:00:00 2001 From: Rich Salz Date: Thu, 13 Apr 2023 15:53:34 -0400 Subject: [PATCH 5/5] move dropdown item --- ietf/templates/nomcom/nomcom_private_base.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ietf/templates/nomcom/nomcom_private_base.html b/ietf/templates/nomcom/nomcom_private_base.html index 81bf438f701..b6089f2887c 100644 --- a/ietf/templates/nomcom/nomcom_private_base.html +++ b/ietf/templates/nomcom/nomcom_private_base.html @@ -125,11 +125,6 @@

Volunteers {% endif %}