From de7ff7e84e98ff2b373a39c20e65fdceee0be38c Mon Sep 17 00:00:00 2001 From: Lars Eggert Date: Wed, 18 May 2022 08:58:39 -0700 Subject: [PATCH] test: fix more validation issues (#3975) * fix: Avoid numeric IDs on NomCom pages * fix: Correctly group last names with lowercase/i18n parts * Remove some unneeded CSS * fix: Remove extra div closing tag --- ietf/group/views.py | 4 +- ietf/nomcom/views.py | 4 +- ietf/static/css/liaisons.css | 112 +---------------------- ietf/static/js/ietf.js | 2 +- ietf/templates/group/all_photos.html | 4 +- ietf/templates/nomcom/announcements.html | 4 +- 6 files changed, 11 insertions(+), 119 deletions(-) diff --git a/ietf/group/views.py b/ietf/group/views.py index dcad99687..5105c78ae 100644 --- a/ietf/group/views.py +++ b/ietf/group/views.py @@ -790,7 +790,7 @@ def meetings(request, acronym=None, group_type=None): def chair_photos(request, group_type=None): roles = sorted(Role.objects.filter(group__type=group_type, group__state='active', name_id='chair'),key=lambda x: x.person.last_name()+x.person.name+x.group.acronym) for role in roles: - role.last_initial = role.person.last_name()[0] + role.last_initial = role.person.last_name()[0].upper() return render(request, 'group/all_photos.html', {'group_type': group_type, 'role': 'Chair', 'roles': roles }) def reorder_roles(roles, role_names): @@ -806,7 +806,7 @@ def group_photos(request, group_type=None, acronym=None): roles = reorder_roles(roles, group.features.role_order) for role in roles: - role.last_initial = role.person.last_name()[0] + role.last_initial = role.person.last_name()[0].upper() return render(request, 'group/group_photos.html', construct_group_menu_context(request, group, "photos", group_type, { 'group_type': group_type, diff --git a/ietf/nomcom/views.py b/ietf/nomcom/views.py index 97e75aa21..89953d4d3 100644 --- a/ietf/nomcom/views.py +++ b/ietf/nomcom/views.py @@ -57,7 +57,7 @@ def index(request): else: nomcom.url = None if year >= 2002: - nomcom.ann_url = "/nomcom/ann/#%4d" % year + nomcom.ann_url = "/nomcom/ann/#nomcom-%4d" % year else: nomcom.ann_url = None return render(request, 'nomcom/index.html', @@ -1324,4 +1324,4 @@ def volunteers(request, year, public=False): v.eligible = v.person in eligible decorate_volunteers_with_qualifications(volunteers,nomcom=nomcom) volunteers = sorted(volunteers,key=lambda v:(not v.eligible,v.person.last_name())) - return render(request, 'nomcom/volunteers.html', dict(year=year, nomcom=nomcom, volunteers=volunteers, public=public)) \ No newline at end of file + return render(request, 'nomcom/volunteers.html', dict(year=year, nomcom=nomcom, volunteers=volunteers, public=public)) diff --git a/ietf/static/css/liaisons.css b/ietf/static/css/liaisons.css index 81e180a93..9d141d1d0 100644 --- a/ietf/static/css/liaisons.css +++ b/ietf/static/css/liaisons.css @@ -1,67 +1,4 @@ -.baseform { - font-size: 12px; -} - -.baseform .fieldset { - margin: 1em 0px; - border: none; - border: 1px solid #8899dd; - background-color: #edf5ff; -} - -.baseform .fieldset h2 { - background-color: #2647a0; - color: white; - font-size: 14px; - padding: 5px 10px; - margin: 0px; -} - -.baseform .field { - padding: 0.5em 10px; -} - -.baseform .field label { - display: block; - width: 150px; - float: left; - clear: left; -} - -.baseform .field .endfield { - clear: left; -} - -.baseform .fieldWidget { - margin-left: 150px; -} - -.baseform #baseform-fieldname-purpose_text, -.baseform #baseform-fieldname-deadline_date { - display: none; -} - -.baseform select, -.baseform textarea, -.baseform input { - border: 1px solid #cccccc; -} - -.baseform input { - font-size: 12px; -} - -#id_title, -.baseformedit #id_from_field, -.baseform #id_organization, -.baseform #id_to_poc, -.baseform #id_response_contacts, -.baseform #id_technical_contact, -.baseform #id_cc1, -.attach_titleField input, -.baseform textarea { - width: 80%; -} +/* TODO: this should use bs5 styling and ideally be integrated into the code */ #id_purpose_text { height: 100px; @@ -71,49 +8,12 @@ height: 300px; } -.baseform input.disabledAddAttachment { - border: none; - padding: none; - background: none; - padding: 0px; - margin: 0px; - color: black; - font-weight: bold; -} - -span.fieldRequired { - color: red; -} - -.fieldError { - background-color: #ffcc66; -} - th.sort { - /*background-image: url(/images/sort-header-clear.png);*/ background-repeat: no-repeat; background-position: right center; cursor: pointer; } -th.headerSortUp { - /*background-image: url(/images/sort-header-up-filled.png);*/ -} - -th.headerSortDown { - /*background-image: url(/images/sort-header-filled.png);*/ -} - -td span.awaiting { - background-color: #ffcc33; - border-radius: 3px; - float: right; - width: 35px; - padding: 4px 8px; - text-align: center; - font-size: 10px; -} - .noActionTaken, .actionTaken { padding: 2px 5px; } .actionTaken { border: 1px solid green; background-color: #ccffbb; } .noActionTaken { border: 1px solid red; background-color: #ffccbb; } @@ -122,14 +22,6 @@ input[id$='DELETE'] { display: none; } -/*#id_from_groups + span { - display: none; -} - -#id_to_groups + span { - display: none; -} -*/ .liaison-group-col { min-width: 10em; -} \ No newline at end of file +} diff --git a/ietf/static/js/ietf.js b/ietf/static/js/ietf.js index f8cf82d9b..98c36c7eb 100644 --- a/ietf/static/js/ietf.js +++ b/ietf/static/js/ietf.js @@ -186,7 +186,7 @@ $(function () {
-
+ `)); diff --git a/ietf/templates/group/all_photos.html b/ietf/templates/group/all_photos.html index 8d8512e75..d32cccb4e 100644 --- a/ietf/templates/group/all_photos.html +++ b/ietf/templates/group/all_photos.html @@ -6,9 +6,9 @@ {% origin %} {% load ietf_filters %}

{{ group_type | upper }} {{ role }} photos

- {% regroup roles by last_initial as alphabet_blocks %} + {% regroup roles|dictsort:"last_initial" by last_initial as alphabet_blocks %} {% for letter in alphabet_blocks %} -

{{ letter.grouper }}

+

{{ letter.grouper }}

{% regroup letter.list by person as person_groups %} {# keep in sync with group_photos.html #}
diff --git a/ietf/templates/nomcom/announcements.html b/ietf/templates/nomcom/announcements.html index 6212b1482..b126ecd2d 100644 --- a/ietf/templates/nomcom/announcements.html +++ b/ietf/templates/nomcom/announcements.html @@ -14,7 +14,7 @@ {% person_link curr_chair.person %}

{% for regime in regimes %} -

+

Messages from {{ regime.group.start_year }}/{{ regime.group.end_year }}

{# use person email address here rather than the generic nomcom-chair@ietf.org #} @@ -68,4 +68,4 @@ {% endblock %} {% block js %} -{% endblock %} \ No newline at end of file +{% endblock %}