Skip to content

Commit 9c05373

Browse files
committed
More fixes.
- Legacy-Id: 19856
1 parent 0bfaa63 commit 9c05373

62 files changed

Lines changed: 6541 additions & 9307 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: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -409,17 +409,14 @@ def ad_area(user):
409409
def format_history_text(text, trunc_words=25):
410410
"""Run history text through some cleaning and add ellipsis if it's too long."""
411411
full = mark_safe(text)
412-
413-
if text.startswith("This was part of a ballot set with:"):
414-
full = urlize_ietf_docs(full)
412+
full = urlize_ietf_docs(full)
415413

416414
return format_snippet(full, trunc_words)
417415

418416
@register.filter
419417
def format_snippet(text, trunc_words=25):
420418
# urlize if there aren't already links present
421-
if not 'href=' in text:
422-
text = bleach.linkify(text, parse_email=True)
419+
text = bleach.linkify(text, parse_email=True)
423420
full = keep_spacing(collapsebr(linebreaksbr(mark_safe(sanitize_fragment(text)))))
424421
snippet = truncatewords_html(full, trunc_words)
425422
if snippet != full:

ietf/doc/tests_review.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ def test_reject_reviewer_assignment(self):
407407
login_testing_unauthorized(self, "reviewsecretary", reject_url)
408408
r = self.client.get(reject_url)
409409
self.assertEqual(r.status_code, 200)
410-
self.assertContains(r, assignment.reviewer.person.plain_name())
410+
self.assertContains(r, assignment.reviewer.person.name)
411411
self.assertNotContains(r, 'can not be rejected')
412412
self.assertContains(r, '<button type="submit"')
413413

ietf/ietfauth/tests.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ def test_apikey_management(self):
570570

571571
# Check api key list content
572572
r = self.client.get(url)
573-
self.assertContains(r, 'Personal API keys')
573+
self.assertContains(r, 'API keys')
574574
self.assertContains(r, 'Get a new personal API key')
575575

576576
# Check the add key form content
@@ -591,7 +591,7 @@ def test_apikey_management(self):
591591
for endpoint, display in endpoints:
592592
self.assertContains(r, endpoint)
593593
q = PyQuery(r.content)
594-
self.assertEqual(len(q('td code')), len(endpoints)) # hash
594+
self.assertEqual(len(q('td code')), len(endpoints) * 2) # hash and endpoint
595595
self.assertEqual(len(q('td a:contains("Disable")')), len(endpoints))
596596

597597
# Get one of the keys
@@ -612,7 +612,7 @@ def test_apikey_management(self):
612612
url = urlreverse('ietf.ietfauth.views.apikey_index')
613613
r = self.client.get(url)
614614
q = PyQuery(r.content)
615-
self.assertEqual(len(q('td code')), len(endpoints)) # key hash
615+
self.assertEqual(len(q('td code')), len(endpoints) * 2) # key hash and endpoint
616616
self.assertEqual(len(q('td a:contains("Disable")')), len(endpoints)-1)
617617

618618
def test_apikey_errors(self):

ietf/meeting/tests_js.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1492,7 +1492,7 @@ def assert_agenda_view_filter_matches_ics_filter(self, filter_string):
14921492
expected_event_count=len(sessions))
14931493

14941494
def test_session_materials_modal(self):
1495-
"""Test opening and re-opening a session materals modal
1495+
"""Test opening and re-opening a session materials modal
14961496
14971497
This currently only tests the slides to ensure that changes to these are picked up
14981498
without reloading the main agenda page. This should also test that the agenda and
@@ -1517,8 +1517,10 @@ def test_session_materials_modal(self):
15171517
),
15181518
'Modal open button not found or not clickable',
15191519
)
1520-
self.scroll_to_element(open_modal_button)
1521-
open_modal_button.click()
1520+
# FIXME-LARS: no idea why we need js instead of the following:
1521+
# self.scroll_to_element(open_modal_button)
1522+
# open_modal_button.click()
1523+
self.driver.execute_script("arguments[0].click();", open_modal_button)
15221524
WebDriverWait(self.driver, 2).until(
15231525
expected_conditions.visibility_of(modal_div),
15241526
'Modal did not become visible after clicking open button',

ietf/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,7 @@ def skip_unreadable_post(record):
498498
# Set placeholder attributes to label if no placeholder is provided
499499
'set_placeholder': False,
500500

501+
'required_css_class': 'required',
501502
'error_css_class': 'is-invalid',
502503
'success_css_class': 'is-valid',
503504

ietf/static/css/ietf.scss

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,20 @@ pre {
8787
font-size: inherit;
8888
}
8989

90+
// Highlight required form field labels with bi-asterisk
91+
.required>label:after {
92+
display: inline-block;
93+
width: .75rem;
94+
height: .75rem;
95+
margin-left: .1rem;
96+
content: "";
97+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='text-danger' viewBox='0 0 16 16'%3E%3Cpath d='M8 0a1 1 0 0 1 1 1v5.268l4.562-2.634a1 1 0 1 1 1 1.732L10 8l4.562 2.634a1 1 0 1 1-1 1.732L9 9.732V15a1 1 0 1 1-2 0V9.732l-4.562 2.634a1 1 0 1 1-1-1.732L6 8 1.438 5.366a1 1 0 0 1 1-1.732L7 6.268V1a1 1 0 0 1 1-1z'/%3E%3C/svg%3E");
98+
background-repeat: no-repeat;
99+
// Recolor black to $red, see https://codepen.io/sosuke/pen/Pjoqqp
100+
filter: invert(35%) sepia(9%) saturate(5669%) hue-rotate(312deg) brightness(102%) contrast(117%);
101+
font-weight: bold;
102+
}
103+
90104
// Make the long dropdowns in the group menu scrollable.
91105
.group-menu .dropdown-menu {
92106
height: auto;

ietf/static/js/ipr-search.js

Lines changed: 34 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,37 @@
1-
$(document).ready(function() {
2-
// hack the "All States" check box
3-
$("#id_state").addClass("list-inline");
1+
$(document)
2+
.ready(function () {
3+
// hack the "All States" check box
4+
$("#id_state")
5+
.addClass("list-inline");
46

5-
$("#id_state input[value!=all]").change(function(e) {
6-
if (this.checked) {
7-
$("#id_state input[value=all]").prop('checked',false);
8-
}
9-
});
7+
$("#id_state input[value!=all]")
8+
.on("change", function (e) {
9+
if (this.checked) {
10+
$("#id_state input[value=all]")
11+
.prop('checked', false);
12+
}
13+
});
1014

11-
$("#id_state_0").change(function(e) {
12-
if (this.checked) {
13-
$("#id_state input[value!=all]").prop('checked',false);
14-
}
15-
});
15+
$("#id_state_0")
16+
.on("change", function (e) {
17+
if (this.checked) {
18+
$("#id_state input[value!=all]")
19+
.prop('checked', false);
20+
}
21+
});
1622

17-
// make enter presses submit through the nearby button
18-
$("form.ipr-search input,select").keyup(function (e) {
19-
var submitButton = $(this).closest(".mb-3").find('button[type=submit]');
20-
if (e.which == 13 && submitButton.length > 0) {
21-
submitButton.click();
22-
return false;
23-
} else {
24-
return true;
25-
}
26-
});
27-
});
23+
// make enter presses submit through the nearby button
24+
// FIXME: this seems to be broken
25+
$("form.ipr-search input,select")
26+
.on("keyup", function (e) {
27+
var submitButton = $(this)
28+
.closest(".mb-3")
29+
.find('button[type=submit]');
30+
if (e.which == 13 && submitButton.length > 0) {
31+
submitButton.trigger("click");
32+
return false;
33+
} else {
34+
return true;
35+
}
36+
});
37+
});

ietf/static/js/list.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ 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" || fields[i] == "count") {
27+
if ($(e)
28+
.attr("colspan") === undefined && (fields[i] == "date" || fields[i] == "num" || fields[i] == "count" || fields[i] == "due" || fields[i] == "id")) {
2829
$(e)
2930
.addClass("text-end");
3031
}

ietf/templates/doc/document_charter.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ <h2 class="my-3">
245245
</p>
246246
{% endif %}
247247
{% if milestones %}
248-
{% include "group/milestones.html" %}
248+
{% include "group/milestones.html" with heading=True %}
249249
{% else %}
250250
<p>
251251
No milestones for charter found.

ietf/templates/group/group_about.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ <h2 class="mt-3">
325325
{{ group.description|default:"No description yet."| apply_markup:"restructuredtext" }}
326326
{% endif %}
327327
{% if group.features.has_milestones %}
328-
{% include "group/milestones.html" with milestones=group.milestones %}
328+
{% include "group/milestones.html" with milestones=group.milestones heading=True %}
329329
{% if milestones_in_review %}
330330
<p>
331331
{{ milestones_in_review|length }} new milestone{{ milestones_in_review|pluralize }}

0 commit comments

Comments
 (0)