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
This commit is contained in:
Lars Eggert 2022-05-18 08:58:39 -07:00 committed by GitHub
parent 4a5583845e
commit de7ff7e84e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 11 additions and 119 deletions

View file

@ -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,

View file

@ -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))
return render(request, 'nomcom/volunteers.html', dict(year=year, nomcom=nomcom, volunteers=volunteers, public=public))

View file

@ -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;
}
}

View file

@ -186,7 +186,7 @@ $(function () {
<div class="col-xl-2 ps-0 small">
<div id="righthand-panel" class="position-fixed col-xl-2 bg-light d-flex flex-column justify-content-between align-items-start">
<nav id="righthand-nav" class="navbar navbar-light w-100 overflow-auto align-items-start flex-fill"></nav>
</div></div>
</div>
</div>
`));

View file

@ -6,9 +6,9 @@
{% origin %}
{% load ietf_filters %}
<h1>{{ group_type | upper }} {{ role }} photos</h1>
{% regroup roles by last_initial as alphabet_blocks %}
{% regroup roles|dictsort:"last_initial" by last_initial as alphabet_blocks %}
{% for letter in alphabet_blocks %}
<h2 class="mt-4" id="{{ letter.grouper }}">{{ letter.grouper }}</h2>
<h2 class="mt-4" {% if letter.grouper|slugify %}id="{{ letter.grouper|slugify }}"{% endif %}>{{ letter.grouper }}</h2>
{% regroup letter.list by person as person_groups %}
{# keep in sync with group_photos.html #}
<div class="mt-0 row row-cols-2 row-cols-sm-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-4 row-cols-xxl-5 g-2">

View file

@ -14,7 +14,7 @@
{% person_link curr_chair.person %}
</p>
{% for regime in regimes %}
<h2 class="mt-5" id="{{ regime.group.start_year }}">
<h2 class="mt-5" id="nomcom-{{ regime.group.start_year }}">
Messages from {{ regime.group.start_year }}/{{ regime.group.end_year }}
</h2>
{# use person email address here rather than the generic nomcom-chair@ietf.org #}
@ -68,4 +68,4 @@
{% endblock %}
{% block js %}
<script src="{% static "ietf/js/list.js" %}"></script>
{% endblock %}
{% endblock %}