Skip to content

Commit 67ebade

Browse files
committed
A bunch more cosmetic fixes.
- Legacy-Id: 19913
1 parent 02b9720 commit 67ebade

File tree

11 files changed

+36
-85
lines changed

11 files changed

+36
-85
lines changed

docker/configs/settings_local.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767

6868
DOCUMENT_PATH_PATTERN = 'data/developers/ietf-ftp/{doc.type_id}/'
6969
INTERNET_DRAFT_PATH = 'data/developers/ietf-ftp/internet-drafts/'
70+
RFC_PATH = 'data/developers/ietf-ftp/rfc/'
7071
CHARTER_PATH = 'data/developers/ietf-ftp/charter/'
7172
BOFREQ_PATH = 'data/developers/ietf-ftp/bofreq/'
7273
CONFLICT_REVIEW_PATH = 'data/developers/ietf-ftp/conflict-reviews/'

ietf/doc/templatetags/ietf_filters.py

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -46,45 +46,6 @@ def unindent(value):
4646
"""Remove indentation from string."""
4747
return re.sub("\n +", "\n", value)
4848

49-
@register.filter(name='parse_email_list')
50-
def parse_email_list(value):
51-
"""
52-
Parse a list of comma-seperated email addresses into
53-
a list of mailto: links.
54-
55-
Splitting a string of email addresses should return a list:
56-
57-
>>> force_str(parse_email_list('joe@example.org, fred@example.com'))
58-
'<a href="mailto:joe@example.org">joe@example.org</a>, <a href="mailto:fred@example.com">fred@example.com</a>'
59-
60-
Parsing a non-string should return the input value, rather than fail:
61-
62-
>>> [ force_str(e) for e in parse_email_list(['joe@example.org', 'fred@example.com']) ]
63-
['joe@example.org', 'fred@example.com']
64-
65-
Null input values should pass through silently:
66-
67-
>>> force_str(parse_email_list(''))
68-
''
69-
70-
>>> parse_email_list(None)
71-
72-
73-
"""
74-
if value and isinstance(value, str): # testing for 'value' being true isn't necessary; it's a fast-out route
75-
addrs = re.split(", ?", value)
76-
ret = []
77-
for addr in addrs:
78-
(name, email) = parseaddr(addr)
79-
if not(name):
80-
name = email
81-
ret.append('<a href="mailto:%s">%s</a>' % ( email.replace('&', '&amp;'), escape(name) ))
82-
return mark_safe(", ".join(ret))
83-
elif value and isinstance(value, bytes):
84-
log.assertion('isinstance(value, str)')
85-
else:
86-
return value
87-
8849
@register.filter
8950
def strip_email(value):
9051
"""Get rid of email part of name/email string like 'Some Name <email@example.com>'."""

ietf/doc/tests_charter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def test_view_revisions(self):
7878
url = urlreverse('ietf.doc.views_doc.document_main',kwargs={'name':charter.name})
7979
r = self.client.get(url)
8080
q = PyQuery(r.content)
81-
self.assertEqual('',q('.alert').text())
81+
self.assertEqual('',q('.alert:not(.alert-ignore)').text())
8282

8383

8484

ietf/templates/base.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
{% endif %}
8686
<div class="col overflow-hidden mx-3" id="content">
8787
<noscript>
88-
<div class="alert alert-danger my-3">
88+
<div class="alert alert-danger alert-ignore my-3">
8989
<b>Javascript disabled?</b> Like other modern websites, the IETF Datatracker relies on Javascript.
9090
Please enable Javascript for full functionality.
9191
</div>

ietf/templates/doc/document_draft.html

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -437,17 +437,17 @@
437437
</span>
438438
{% endif %}
439439
{% if milestones %}
440-
(
441-
<span class="milestone">
442-
wg milestone{{ milestones|pluralize }}:
440+
<br>
441+
<span class="text-muted">
442+
<span class="milestone">
443+
WG milestone{{ milestones|pluralize }}:
444+
</span>
445+
{% for m in milestones %}
446+
<span title="{{ m.desc }} ({{ m.group.acronym }} milestone)"
447+
class="milestone">
448+
{{ m.due|date:"M Y" }} - {{ m.desc }}</span>{% if not forloop.last %},{% endif %}
449+
{% endfor %}
443450
</span>
444-
{% for m in milestones %}
445-
<span title="{{ m.desc }} ({{ m.group.acronym }} milestone)"
446-
class="milestone">
447-
{{ m.due|date:"M Y" }} - {{m }}
448-
</span>{% if not forloop.last %},{% endif %}
449-
{% endfor %}
450-
)
451451
{% endif %}
452452
{% if stream_tags %}
453453
<div class="stream-tags">
@@ -579,7 +579,7 @@
579579
href="{% url 'ietf.doc.views_doc.document_shepherd_writeup' name=doc.name %}">
580580
Show
581581
</a>
582-
<span class="text-muted">(Last changed {{ shepherd_writeup.time|date:"Y-m-d" }})</span>
582+
<span class="badge bg-secondary">Last changed {{ shepherd_writeup.time|date:"Y-m-d" }}</span>
583583
{% else %}
584584
<span class="text-muted">
585585
(None)
@@ -734,11 +734,9 @@
734734
On agenda of {{ telechat.telechat_date }} IESG telechat
735735
{% if telechat.returning_item %}(returning item){% endif %}
736736
{% else %}
737-
{% if can_edit %}
738-
<span class="text-muted">
739-
(None)
740-
</span>
741-
{% endif %}
737+
<span class="text-muted">
738+
(None)
739+
</span>
742740
{% endif %}
743741
{% if iesg_ballot_summary %}
744742
<br>
@@ -1047,20 +1045,18 @@
10471045
<i class="bi bi-search">
10481046
</i>
10491047
Search lists
1050-
<i class="caret">
1051-
</i>
10521048
</button>
10531049
<ul class="dropdown-menu" role="menu">
10541050
<li role="presentation">
1055-
<a role="menuitem"
1051+
<a class="dropdown-item"
10561052
href="https://mailarchive.ietf.org/arch/search?q=%22{{ doc.name }}%22"
10571053
rel="nofollow"
10581054
target="_blank">
10591055
IETF Mail Archive
10601056
</a>
10611057
</li>
10621058
<li role="presentation">
1063-
<a role="menuitem"
1059+
<a class="dropdown-item"
10641060
href="https://www.google.com/search?as_q={{ doc.name }}&amp;as_sitesearch={{ search_archive }}"
10651061
rel="nofollow"
10661062
target="_blank">
@@ -1069,7 +1065,7 @@
10691065
</li>
10701066
{% if user|has_role:"Area Director" %}
10711067
<li role="presentation">
1072-
<a role="menuitem"
1068+
<a class="dropdown-item"
10731069
href="https://www.iesg.org/bin/c5i?mid=6&amp;rid=77&amp;target={{ doc.name }}"
10741070
rel="nofollow"
10751071
target="_blank">

ietf/templates/doc/search/search_result_row.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,30 +124,30 @@
124124
{% endif %}
125125
</span>
126126
{% if doc.latest_revision_date|timesince_days|new_enough:request %}
127-
<wbr>
127+
<br>
128128
<div class="float-end">
129129
<span class="badge bg-success">New</span>
130130
</div>
131131
{% endif %}
132132
{% if doc.get_state_slug == "active" and doc.expirable and doc.expires|timesince_days|expires_soon:request %}
133-
<wbr>
133+
<br>
134134
<span class="badge bg-warning">Expires soon</span>
135135
{% endif %}
136136
</td>
137137
{% include "doc/search/status_columns.html" %}
138138
<td class="text-center">
139139
{% if doc.related_ipr %}
140140
<a href="{% url "ietf.ipr.views.search" %}?submit=draft&amp;id={{ doc.name }}">
141-
<span class="badge bg-secondary">{{ doc.related_ipr|length }}</span>
141+
<span class="badge bg-info">{{ doc.related_ipr|length }}</span>
142142
</a>
143143
{% endif %}
144144
</td>
145145
{% if ad_name == None or ad_name != doc.ad.plain_name %}
146146
<td>
147147
{% if doc.ad %}
148148
{% person_link doc.ad title="Area Director" %}
149-
<br>
150149
{% endif %}
150+
<br>
151151
{% if doc.shepherd %}
152152
{% email_person_link doc.shepherd title="Shepherd" class="small text-muted" %}
153153
{% endif %}

ietf/templates/doc/search/status_columns.html

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,16 @@
44
{% load ietf_filters ballot_icon person_filters %}
55
<td class="status">
66
{% if doc.ballot %}
7-
<div class="float-end" id="ballot-icon-{{ doc.name }}">{% ballot_icon doc %}</div>
7+
<div class="float-end ms-1 mb-1" id="ballot-icon-{{ doc.name }}">{% ballot_icon doc %}</div>
88
{% endif %}
99
{% if not doc.get_state_slug == "rfc" %}
1010
{% if '::' in doc.friendly_state %}
11-
{{ doc.friendly_state|safe|split:'::'|join:'::<wbr>' }}
11+
{{ doc.friendly_state|safe }}
1212
{% else %}
1313
{{ doc.friendly_state|safe }}
1414
{% endif %}
1515
{% if doc|state:"draft-rfceditor" %}
16-
<wbr>
17-
:
18-
<a href="https://www.rfc-editor.org/queue2.html#{{ doc.name }}">{{ doc|state:"draft-rfceditor" }}</a>
16+
: <a href="https://www.rfc-editor.org/queue2.html#{{ doc.name }}">{{ doc|state:"draft-rfceditor" }}</a>
1917
{% endif %}
2018
{{ doc|auth48_alert_badge }}
2119
{{ doc|state_age_colored }}
@@ -35,13 +33,11 @@
3533
{{ doc|state:"stream" }}
3634
{% if doc.intended_std_level %}
3735
:
38-
<wbr>
3936
{% endif %}
4037
{% else %}
4138
{{ doc.stream }} stream
4239
{% if doc.intended_std_level %}
4340
:
44-
<wbr>
4541
{% endif %}
4642
{% endif %}
4743
{% endif %}

ietf/templates/iesg/agenda_charter.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@
2727
<div class="col-sm-3 text-end fw-bold">Area</div>
2828
<div class="col">
2929
<a href="{% url 'ietf.group.views.active_groups' group_type='wg' %}#{{ doc.group.parent.acronym }}">
30-
{{ doc.group.parent.acronym|upper }}
31-
</a>
30+
{{ doc.group.parent.acronym|upper }}</a>
3231
({% person_link doc.ad %})
3332
</div>
3433
</div>

ietf/templates/iesg/agenda_doc.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{# Copyright The IETF Trust 2016, All Rights Reserved #}
22
{% load origin %}
33
{% origin %}
4-
{% load ietf_filters ballot_icon person_filters %}
4+
{% load ietf_filters ballot_icon person_filters textfilters %}
55
<div class="card mb-3">
66
<div class="position-absolute top-0 end-0 m-3">{% ballot_icon doc %}</div>
77
<div class="card-body">
@@ -32,7 +32,7 @@
3232
{% if doc.note %}
3333
<div class="row">
3434
<div class="col-sm-3 text-end fw-bold">Note</div>
35-
<div class="col">{{ doc.note|linebreaksbr }}</div>
35+
<div class="col">{{ doc.note|urlize_ietf_docs|linkify|linebreaksbr }}</div>
3636
</div>
3737
{% endif %}
3838
<div class="row">

ietf/templates/liaisons/detail.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,31 +40,31 @@ <h1>
4040
{% if liaison.to_contacts %}
4141
<tr>
4242
<th class="text-nowrap">To Contacts</th>
43-
<td>{{ liaison.to_contacts|parse_email_list|make_one_per_line|safe|linebreaksbr }}</td>
43+
<td>{{ liaison.to_contacts|linkify|make_one_per_line|safe|linebreaksbr }}</td>
4444
</tr>
4545
{% endif %}
4646
{% if liaison.cc_contacts %}
4747
<tr>
4848
<th class="text-nowrap">Cc</th>
49-
<td>{{ liaison.cc_contacts|parse_email_list|make_one_per_line|safe|linebreaksbr }}</td>
49+
<td>{{ liaison.cc_contacts|linkify|make_one_per_line|safe|linebreaksbr }}</td>
5050
</tr>
5151
{% endif %}
5252
{% if liaison.response_contacts %}
5353
<tr>
5454
<th class="text-nowrap">Response Contact</th>
55-
<td>{{ liaison.response_contacts|parse_email_list|make_one_per_line|safe|linebreaksbr }}</td>
55+
<td>{{ liaison.response_contacts|linkify|make_one_per_line|safe|linebreaksbr }}</td>
5656
</tr>
5757
{% endif %}
5858
{% if liaison.technical_contacts %}
5959
<tr>
6060
<th class="text-nowrap">Technical Contact</th>
61-
<td>{{ liaison.technical_contacts|parse_email_list|make_one_per_line|safe|linebreaksbr }}</td>
61+
<td>{{ liaison.technical_contacts|linkify|make_one_per_line|safe|linebreaksbr }}</td>
6262
</tr>
6363
{% endif %}
6464
{% if liaison.action_holder_contacts %}
6565
<tr>
6666
<th class="text-nowrap">Action Holder Contacts</th>
67-
<td>{{ liaison.action_holder_contacts|parse_email_list|make_one_per_line|safe|linebreaksbr }}</td>
67+
<td>{{ liaison.action_holder_contacts|linkify|make_one_per_line|safe|linebreaksbr }}</td>
6868
</tr>
6969
{% endif %}
7070
<tr>

0 commit comments

Comments
 (0)