From 0bfaa63722038e71af01917a9e900f0156479f70 Mon Sep 17 00:00:00 2001 From: Lars Eggert Date: Mon, 17 Jan 2022 15:05:22 +0000 Subject: [PATCH] More fixes. - Legacy-Id: 19855 --- ietf/doc/templatetags/ietf_filters.py | 10 +- ietf/doc/tests_js.py | 1 + ietf/group/forms.py | 15 +- ietf/group/tests_info.py | 6 +- ietf/iesg/tests.py | 2 +- ietf/person/templatetags/person_filters.py | 8 +- ietf/static/css/ietf.scss | 2 +- ietf/static/js/ietf.js | 22 +- ietf/static/js/list.js | 4 +- ietf/static/js/manage-review-requests.js | 203 +- ietf/templates/base.html | 2 +- ietf/templates/doc/document_history.html | 5 - ietf/templates/group/active_ags.html | 20 +- ietf/templates/group/active_dirs.html | 49 +- ietf/templates/group/active_groups.html | 17 +- ietf/templates/group/active_iabgroups.html | 38 +- ietf/templates/group/active_rags.html | 27 +- ietf/templates/group/active_review_dirs.html | 42 +- ietf/templates/group/active_rgs.html | 45 +- ietf/templates/group/active_teams.html | 19 +- ietf/templates/group/active_wgs.html | 167 +- ietf/templates/group/add_comment.html | 28 +- ietf/templates/group/all_photos.html | 68 +- ietf/templates/group/all_status.html | 66 +- ietf/templates/group/bofs.html | 35 +- .../change_review_secretary_settings.html | 29 +- .../group/change_reviewer_settings.html | 189 +- ietf/templates/group/chartering_groups.html | 48 +- ietf/templates/group/conclude.html | 16 +- ietf/templates/group/concluded_groups.html | 157 +- ietf/templates/group/customize_workflow.html | 246 ++- ietf/templates/group/edit.html | 32 +- ietf/templates/group/edit_milestones.html | 32 +- ietf/templates/group/email.html | 45 +- ietf/templates/group/email_aliases.html | 54 +- .../group/email_open_review_assignments.html | 31 +- .../group/feed_item_description.html | 4 +- ietf/templates/group/group_about.html | 282 ++- .../group/group_about_rendertest.html | 50 +- ietf/templates/group/group_about_status.html | 43 +- .../group/group_about_status_edit.html | 48 +- .../group/group_about_status_meeting.html | 21 +- ietf/templates/group/group_base.html | 37 +- ietf/templates/group/group_documents.html | 4 +- ietf/templates/group/group_photos.html | 67 +- ietf/templates/group/history.html | 16 +- ietf/templates/group/index.html | 28 +- .../group/manage_review_requests.html | 352 ++-- ietf/templates/group/materials.html | 62 +- ietf/templates/group/milestone_form.html | 2 +- ietf/templates/group/milestones.html | 2 +- .../group/reset_charter_milestones.html | 62 +- ietf/templates/group/reset_next_reviewer.html | 22 +- ietf/templates/group/review_requests.html | 391 ++-- ietf/templates/group/reviewer_overview.html | 147 +- ietf/templates/group/stream_documents.html | 15 +- ietf/templates/iesg/agenda.html | 29 +- ietf/templates/iesg/photos.html | 25 +- ietf/templates/ipr/list.html | 2 +- ietf/templates/nomcom/announcements.html | 2 +- ietf/templates/nomcom/chair_help.html | 5 +- ietf/templates/nomcom/history.html | 2 +- ietf/templates/nomcom/view_feedback.html | 2 +- ietf/templates/person/person_link.html | 32 +- ietf/templates/person/photo.html | 32 + ietf/templates/review/unavailable_table.html | 22 +- package-lock.json | 1691 ++++++++--------- 67 files changed, 2678 insertions(+), 2601 deletions(-) create mode 100644 ietf/templates/person/photo.html diff --git a/ietf/doc/templatetags/ietf_filters.py b/ietf/doc/templatetags/ietf_filters.py index 037cbefb4..2452ec7b8 100644 --- a/ietf/doc/templatetags/ietf_filters.py +++ b/ietf/doc/templatetags/ietf_filters.py @@ -226,10 +226,10 @@ def urlize_ietf_docs(string, autoescape=None): """ if autoescape and not isinstance(string, SafeData): string = escape(string) - string = re.sub(r"(?)(RFC ?)0{0,3}(\d+)", "\\1\\2", string) - string = re.sub(r"(?)(BCP ?)0{0,3}(\d+)", "\\1\\2", string) - string = re.sub(r"(?)(STD ?)0{0,3}(\d+)", "\\1\\2", string) - string = re.sub(r"(?)(FYI ?)0{0,3}(\d+)", "\\1\\2", string) + string = re.sub(r"(?)(RFC\s*?)0{0,3}(\d+)", "\\1\\2", string) + string = re.sub(r"(?)(BCP\s*?)0{0,3}(\d+)", "\\1\\2", string) + string = re.sub(r"(?)(STD\s*?)0{0,3}(\d+)", "\\1\\2", string) + string = re.sub(r"(?)(FYI\s*?)0{0,3}(\d+)", "\\1\\2", string) string = re.sub(r"(?)(draft-[-0-9a-zA-Z._+]+)", "\\1", string) string = re.sub(r"(?)(conflict-review-[-0-9a-zA-Z._+]+)", "\\1", string) string = re.sub(r"(?)(status-change-[-0-9a-zA-Z._+]+)", "\\1", string) @@ -424,7 +424,7 @@ def format_snippet(text, trunc_words=25): snippet = truncatewords_html(full, trunc_words) if snippet != full: return mark_safe('
%s
%s
' % (snippet, full)) - return full + return mark_safe(full) @register.simple_tag def doc_edit_button(url_name, *args, **kwargs): diff --git a/ietf/doc/tests_js.py b/ietf/doc/tests_js.py index 6b517cbd1..776537833 100644 --- a/ietf/doc/tests_js.py +++ b/ietf/doc/tests_js.py @@ -44,6 +44,7 @@ class EditAuthorsTests(IetfSeleniumTestCase): name )) except: + # print(self.driver.execute_script("return document.documentElement.outerHTML")) print(name, email, self.driver.find_element(By.CSS_SELECTOR, ".select2-results__message").text) # FIXME-LARS: force the test to succeed anyway, so CI doesn't crap out return diff --git a/ietf/group/forms.py b/ietf/group/forms.py index a31897329..4451ac183 100644 --- a/ietf/group/forms.py +++ b/ietf/group/forms.py @@ -283,10 +283,10 @@ class ManageReviewRequestForm(forms.Form): action = forms.ChoiceField(choices=ACTIONS, widget=forms.HiddenInput, required=False) close = forms.ModelChoiceField(queryset=close_review_request_states(), required=False) - close_comment = forms.CharField(max_length=255, required=False) - reviewer = PersonEmailChoiceField(empty_label="(None)", required=False, label_with="person") - review_type = forms.ModelChoiceField(queryset=ReviewTypeName.objects.filter(slug__in=['telechat', 'lc']), required=True) - add_skip = forms.BooleanField(required=False) + close_comment = forms.CharField(max_length=255, required=False, label="Closing comment") + reviewer = PersonEmailChoiceField(empty_label="(None)", required=False, label_with="person", label="Assign reviewer") + review_type = forms.ModelChoiceField(queryset=ReviewTypeName.objects.filter(slug__in=['telechat', 'lc']), required=True, label="Review type") + add_skip = forms.BooleanField(required=False, label="Skip next time") def __init__(self, review_req, *args, **kwargs): if not "prefix" in kwargs: @@ -309,10 +309,7 @@ class ManageReviewRequestForm(forms.Form): if close_initial: self.fields["close"].initial = close_initial - self.fields["close"].widget.attrs["class"] = "form-control input-sm" - get_reviewer_queue_policy(review_req.team).setup_reviewer_field(self.fields["reviewer"], review_req) - self.fields["reviewer"].widget.attrs["class"] = "form-control input-sm" if not getattr(review_req, 'in_lc_and_telechat', False): del self.fields["review_type"] @@ -390,6 +387,4 @@ class ReviewSecretarySettingsForm(forms.ModelForm): class Meta: model = ReviewSecretarySettings fields = ['remind_days_before_deadline', 'max_items_to_show_in_reviewer_list', - 'days_to_show_in_reviewer_list'] - - + 'days_to_show_in_reviewer_list'] \ No newline at end of file diff --git a/ietf/group/tests_info.py b/ietf/group/tests_info.py index 6fe16ab1b..ca02f8b03 100644 --- a/ietf/group/tests_info.py +++ b/ietf/group/tests_info.py @@ -421,7 +421,7 @@ class GroupPagesTests(TestCase): self.assertEqual(r.status_code, 200) q = PyQuery(r.content) chairs = Role.objects.filter(group__type='wg', group__state='active', name_id='chair') - self.assertEqual(len(q('div.photo-thumbnail img')), chairs.count()) + self.assertEqual(len(q('.photo')), chairs.count()) def test_wg_photos(self): GroupFactory(acronym='mars') @@ -432,7 +432,7 @@ class GroupPagesTests(TestCase): self.assertEqual(r.status_code, 200) q = PyQuery(r.content) roles = Role.objects.filter(group__acronym='mars') - self.assertEqual(len(q('div.photo-thumbnail img')), roles.count()) + self.assertEqual(len(q('.photo')), roles.count()) def test_group_photos(self): url = urlreverse("ietf.group.views.group_photos", kwargs={'acronym':'iab'}) @@ -440,7 +440,7 @@ class GroupPagesTests(TestCase): self.assertEqual(r.status_code, 200) q = PyQuery(r.content) roles = Role.objects.filter(group__acronym='iab') - self.assertEqual(len(q('div.photo-thumbnail img')), roles.count()) + self.assertEqual(len(q('.photo')), roles.count()) def test_nonactive_group_badges(self): concluded_group = GroupFactory(state_id='conclude') diff --git a/ietf/iesg/tests.py b/ietf/iesg/tests.py index ed102dcbc..f317ad32b 100644 --- a/ietf/iesg/tests.py +++ b/ietf/iesg/tests.py @@ -93,7 +93,7 @@ class IESGTests(TestCase): self.assertEqual(r.status_code, 200) q = PyQuery(r.content) ads = Role.objects.filter(group__type='area', group__state='active', name_id='ad') - self.assertEqual(len(q('div.photo-thumbnail')), ads.count()) + self.assertEqual(len(q('.photo')), ads.count()) class IESGAgendaTests(TestCase): def setUp(self): diff --git a/ietf/person/templatetags/person_filters.py b/ietf/person/templatetags/person_filters.py index 29762bada..e3b7e632f 100644 --- a/ietf/person/templatetags/person_filters.py +++ b/ietf/person/templatetags/person_filters.py @@ -35,11 +35,13 @@ def person_by_name(name): def person_link(person, **kwargs): title = kwargs.get('title', '') cls = kwargs.get('class', '') + with_email = kwargs.get('with_email', True) + nowrap = kwargs.get('nowrap', True) if person: name = person.name if person.alias_set.filter(name=person.name).exists() else '' plain_name = person.plain_name() email = person.email_address() - return {'name': name, 'plain_name': plain_name, 'email': email, 'title': title, 'class': cls} + return {'name': name, 'plain_name': plain_name, 'email': email, 'title': title, 'class': cls, 'with_email': with_email, 'nowrap': nowrap} else: return {} @@ -48,7 +50,9 @@ def person_link(person, **kwargs): def email_person_link(email, **kwargs): title = kwargs.get('title', '') cls = kwargs.get('class', '') + with_email = kwargs.get('with_email', True) + nowrap = kwargs.get('nowrap', True) name = email.person.name if email.person.alias_set.filter(name=email.person.name).exists() else '' plain_name = email.person.plain_name() email = email.address - return {'name': name, 'plain_name': plain_name, 'email': email, 'title': title, 'class': cls} \ No newline at end of file + return {'name': name, 'plain_name': plain_name, 'email': email, 'title': title, 'class': cls, 'with_email': with_email, 'nowrap': nowrap} \ No newline at end of file diff --git a/ietf/static/css/ietf.scss b/ietf/static/css/ietf.scss index bf249165a..3b2dd4936 100644 --- a/ietf/static/css/ietf.scss +++ b/ietf/static/css/ietf.scss @@ -6,7 +6,7 @@ $enable-negative-margins: true; // Don't add carets to dropdowns by default. // $enable-caret: false; -$tooltip-max-width: 100%; +// $tooltip-max-width: 100%; // Only import what we need: // https://getbootstrap.com/docs/5.1/customize/optimize/ diff --git a/ietf/static/js/ietf.js b/ietf/static/js/ietf.js index bc5508ee6..d79238f25 100644 --- a/ietf/static/js/ietf.js +++ b/ietf/static/js/ietf.js @@ -108,7 +108,8 @@ $(document) $(document) .ready(function () { var headings = $("#content") - .find("h1:visible, h2:visible, h3:visible, h4:visible, h5:visible, h6:visible"); + .find("h1:visible, h2:visible, h3:visible, h4:visible, h5:visible, h6:visible") + .not(".navskip"); var contents = $(headings) .html() @@ -132,12 +133,12 @@ $(document) .attr("tabindex", 0) .after($(`
-
`)) .find("h1:visible, h2:visible, h3:visible, h4:visible, h5:visible, h6:visible") + .not(".navskip") .each(function () { // Some headings have complex HTML in them - only use first part in that case. var text = $(this) @@ -162,7 +163,7 @@ $(document) if (nav === undefined) { nav = $("#righthand-nav"); nav = $(nav) - .append(`