Skip to content

Commit 0bfaa63

Browse files
committed
More fixes.
- Legacy-Id: 19855
1 parent edf3242 commit 0bfaa63

67 files changed

Lines changed: 2689 additions & 2612 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

ietf/doc/templatetags/ietf_filters.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -226,10 +226,10 @@ def urlize_ietf_docs(string, autoescape=None):
226226
"""
227227
if autoescape and not isinstance(string, SafeData):
228228
string = escape(string)
229-
string = re.sub(r"(?<!>)(RFC ?)0{0,3}(\d+)", "<a href=\"/doc/rfc\\2/\">\\1\\2</a>", string)
230-
string = re.sub(r"(?<!>)(BCP ?)0{0,3}(\d+)", "<a href=\"/doc/bcp\\2/\">\\1\\2</a>", string)
231-
string = re.sub(r"(?<!>)(STD ?)0{0,3}(\d+)", "<a href=\"/doc/std\\2/\">\\1\\2</a>", string)
232-
string = re.sub(r"(?<!>)(FYI ?)0{0,3}(\d+)", "<a href=\"/doc/fyi\\2/\">\\1\\2</a>", string)
229+
string = re.sub(r"(?<!>)(RFC\s*?)0{0,3}(\d+)", "<a href=\"/doc/rfc\\2/\">\\1\\2</a>", string)
230+
string = re.sub(r"(?<!>)(BCP\s*?)0{0,3}(\d+)", "<a href=\"/doc/bcp\\2/\">\\1\\2</a>", string)
231+
string = re.sub(r"(?<!>)(STD\s*?)0{0,3}(\d+)", "<a href=\"/doc/std\\2/\">\\1\\2</a>", string)
232+
string = re.sub(r"(?<!>)(FYI\s*?)0{0,3}(\d+)", "<a href=\"/doc/fyi\\2/\">\\1\\2</a>", string)
233233
string = re.sub(r"(?<!>)(draft-[-0-9a-zA-Z._+]+)", "<a href=\"/doc/\\1/\">\\1</a>", string)
234234
string = re.sub(r"(?<!>)(conflict-review-[-0-9a-zA-Z._+]+)", "<a href=\"/doc/\\1/\">\\1</a>", string)
235235
string = re.sub(r"(?<!>)(status-change-[-0-9a-zA-Z._+]+)", "<a href=\"/doc/\\1/\">\\1</a>", string)
@@ -424,7 +424,7 @@ def format_snippet(text, trunc_words=25):
424424
snippet = truncatewords_html(full, trunc_words)
425425
if snippet != full:
426426
return mark_safe('<div class="snippet">%s<button class="btn btn-sm btn-primary show-all"><i class="bi bi-caret-down"></i></button></div><div class="visually-hidden full">%s</div>' % (snippet, full))
427-
return full
427+
return mark_safe(full)
428428

429429
@register.simple_tag
430430
def doc_edit_button(url_name, *args, **kwargs):

ietf/doc/tests_js.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ def _fill_in_author_form(form_elt, name, email, affiliation, country):
4444
name
4545
))
4646
except:
47+
# print(self.driver.execute_script("return document.documentElement.outerHTML"))
4748
print(name, email, self.driver.find_element(By.CSS_SELECTOR, ".select2-results__message").text)
4849
# FIXME-LARS: force the test to succeed anyway, so CI doesn't crap out
4950
return

ietf/group/forms.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -283,10 +283,10 @@ class ManageReviewRequestForm(forms.Form):
283283

284284
action = forms.ChoiceField(choices=ACTIONS, widget=forms.HiddenInput, required=False)
285285
close = forms.ModelChoiceField(queryset=close_review_request_states(), required=False)
286-
close_comment = forms.CharField(max_length=255, required=False)
287-
reviewer = PersonEmailChoiceField(empty_label="(None)", required=False, label_with="person")
288-
review_type = forms.ModelChoiceField(queryset=ReviewTypeName.objects.filter(slug__in=['telechat', 'lc']), required=True)
289-
add_skip = forms.BooleanField(required=False)
286+
close_comment = forms.CharField(max_length=255, required=False, label="Closing comment")
287+
reviewer = PersonEmailChoiceField(empty_label="(None)", required=False, label_with="person", label="Assign reviewer")
288+
review_type = forms.ModelChoiceField(queryset=ReviewTypeName.objects.filter(slug__in=['telechat', 'lc']), required=True, label="Review type")
289+
add_skip = forms.BooleanField(required=False, label="Skip next time")
290290

291291
def __init__(self, review_req, *args, **kwargs):
292292
if not "prefix" in kwargs:
@@ -309,10 +309,7 @@ def __init__(self, review_req, *args, **kwargs):
309309
if close_initial:
310310
self.fields["close"].initial = close_initial
311311

312-
self.fields["close"].widget.attrs["class"] = "form-control input-sm"
313-
314312
get_reviewer_queue_policy(review_req.team).setup_reviewer_field(self.fields["reviewer"], review_req)
315-
self.fields["reviewer"].widget.attrs["class"] = "form-control input-sm"
316313

317314
if not getattr(review_req, 'in_lc_and_telechat', False):
318315
del self.fields["review_type"]
@@ -390,6 +387,4 @@ class ReviewSecretarySettingsForm(forms.ModelForm):
390387
class Meta:
391388
model = ReviewSecretarySettings
392389
fields = ['remind_days_before_deadline', 'max_items_to_show_in_reviewer_list',
393-
'days_to_show_in_reviewer_list']
394-
395-
390+
'days_to_show_in_reviewer_list']

ietf/group/tests_info.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ def test_chair_photos(self):
421421
self.assertEqual(r.status_code, 200)
422422
q = PyQuery(r.content)
423423
chairs = Role.objects.filter(group__type='wg', group__state='active', name_id='chair')
424-
self.assertEqual(len(q('div.photo-thumbnail img')), chairs.count())
424+
self.assertEqual(len(q('.photo')), chairs.count())
425425

426426
def test_wg_photos(self):
427427
GroupFactory(acronym='mars')
@@ -432,15 +432,15 @@ def test_wg_photos(self):
432432
self.assertEqual(r.status_code, 200)
433433
q = PyQuery(r.content)
434434
roles = Role.objects.filter(group__acronym='mars')
435-
self.assertEqual(len(q('div.photo-thumbnail img')), roles.count())
435+
self.assertEqual(len(q('.photo')), roles.count())
436436

437437
def test_group_photos(self):
438438
url = urlreverse("ietf.group.views.group_photos", kwargs={'acronym':'iab'})
439439
r = self.client.get(url)
440440
self.assertEqual(r.status_code, 200)
441441
q = PyQuery(r.content)
442442
roles = Role.objects.filter(group__acronym='iab')
443-
self.assertEqual(len(q('div.photo-thumbnail img')), roles.count())
443+
self.assertEqual(len(q('.photo')), roles.count())
444444

445445
def test_nonactive_group_badges(self):
446446
concluded_group = GroupFactory(state_id='conclude')

ietf/iesg/tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def test_photos(self):
9393
self.assertEqual(r.status_code, 200)
9494
q = PyQuery(r.content)
9595
ads = Role.objects.filter(group__type='area', group__state='active', name_id='ad')
96-
self.assertEqual(len(q('div.photo-thumbnail')), ads.count())
96+
self.assertEqual(len(q('.photo')), ads.count())
9797

9898
class IESGAgendaTests(TestCase):
9999
def setUp(self):

ietf/person/templatetags/person_filters.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,13 @@ def person_by_name(name):
3535
def person_link(person, **kwargs):
3636
title = kwargs.get('title', '')
3737
cls = kwargs.get('class', '')
38+
with_email = kwargs.get('with_email', True)
39+
nowrap = kwargs.get('nowrap', True)
3840
if person:
3941
name = person.name if person.alias_set.filter(name=person.name).exists() else ''
4042
plain_name = person.plain_name()
4143
email = person.email_address()
42-
return {'name': name, 'plain_name': plain_name, 'email': email, 'title': title, 'class': cls}
44+
return {'name': name, 'plain_name': plain_name, 'email': email, 'title': title, 'class': cls, 'with_email': with_email, 'nowrap': nowrap}
4345
else:
4446
return {}
4547

@@ -48,7 +50,9 @@ def person_link(person, **kwargs):
4850
def email_person_link(email, **kwargs):
4951
title = kwargs.get('title', '')
5052
cls = kwargs.get('class', '')
53+
with_email = kwargs.get('with_email', True)
54+
nowrap = kwargs.get('nowrap', True)
5155
name = email.person.name if email.person.alias_set.filter(name=email.person.name).exists() else ''
5256
plain_name = email.person.plain_name()
5357
email = email.address
54-
return {'name': name, 'plain_name': plain_name, 'email': email, 'title': title, 'class': cls}
58+
return {'name': name, 'plain_name': plain_name, 'email': email, 'title': title, 'class': cls, 'with_email': with_email, 'nowrap': nowrap}

ietf/static/css/ietf.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ $enable-negative-margins: true;
66
// Don't add carets to dropdowns by default.
77
// $enable-caret: false;
88

9-
$tooltip-max-width: 100%;
9+
// $tooltip-max-width: 100%;
1010

1111
// Only import what we need:
1212
// https://getbootstrap.com/docs/5.1/customize/optimize/

ietf/static/js/ietf.js

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ $(document)
108108
$(document)
109109
.ready(function () {
110110
var headings = $("#content")
111-
.find("h1:visible, h2:visible, h3:visible, h4:visible, h5:visible, h6:visible");
111+
.find("h1:visible, h2:visible, h3:visible, h4:visible, h5:visible, h6:visible")
112+
.not(".navskip");
112113

113114
var contents = $(headings)
114115
.html()
@@ -132,12 +133,12 @@ $(document)
132133
.attr("tabindex", 0)
133134
.after($(`
134135
<div class="col-xl-2 small">
135-
<nav id="righthand-nav" class="position-fixed navbar navbar-light bg-light overflow-auto" style="height: 70vh;">
136-
<!--<a class="navbar-brand" href="#">Navbar</a>-->
136+
<nav id="righthand-nav" class="position-fixed navbar navbar-light bg-light overflow-auto flex-fill" style="height: 70vh; width: inherit;">
137137
</nav>
138138
</div>
139139
`))
140140
.find("h1:visible, h2:visible, h3:visible, h4:visible, h5:visible, h6:visible")
141+
.not(".navskip")
141142
.each(function () {
142143
// Some headings have complex HTML in them - only use first part in that case.
143144
var text = $(this)
@@ -162,7 +163,7 @@ $(document)
162163
if (nav === undefined) {
163164
nav = $("#righthand-nav");
164165
nav = $(nav)
165-
.append(`<nav class="nav nav-pills flex-column align-self-start">`)
166+
.append(`<nav class="nav nav-pills flex-column align-self-start flex-fill px-2">`)
166167
.children()
167168
.last();
168169
}
@@ -259,4 +260,17 @@ $(document)
259260
.load(loc);
260261
}
261262
});
263+
});
264+
265+
// Handle history snippet expansion.
266+
$(document)
267+
.ready(function () {
268+
$(".snippet .show-all")
269+
.on("click", function () {
270+
$(this)
271+
.parents(".snippet")
272+
.addClass("visually-hidden")
273+
.siblings(".full")
274+
.removeClass("visually-hidden");
275+
});
262276
});

ietf/static/js/list.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function replace_with_internal(table, internal_table, i) {
2424
}
2525

2626
function field_magic(i, e, fields) {
27-
if (fields[i] == "date" || fields[i] == "num") {
27+
if (fields[i] == "date" || fields[i] == "num" || fields[i] == "count") {
2828
$(e)
2929
.addClass("text-end");
3030
}
@@ -80,7 +80,7 @@ $(document)
8080

8181
// HTML for the search widget
8282
var searcher = $.parseHTML(`
83-
<div class="input-group my-3">
83+
<div class="input-group input-group-sm my-3">
8484
<input type="search" class="search form-control" placeholder="Search"/>
8585
<button class="btn btn-outline-secondary search-reset" type="button">
8686
<i class="bi bi-x"></i>

0 commit comments

Comments
 (0)