A bunch more cosmetic fixes.

- Legacy-Id: 19913
This commit is contained in:
Lars Eggert 2022-02-09 10:11:03 +00:00
parent 02b97208b1
commit 67ebadeadd
11 changed files with 36 additions and 85 deletions

View file

@ -67,6 +67,7 @@ INTERNAL_IPS = [".".join(ip.split(".")[:-1] + ["1"]) for ip in ips]
DOCUMENT_PATH_PATTERN = 'data/developers/ietf-ftp/{doc.type_id}/'
INTERNET_DRAFT_PATH = 'data/developers/ietf-ftp/internet-drafts/'
RFC_PATH = 'data/developers/ietf-ftp/rfc/'
CHARTER_PATH = 'data/developers/ietf-ftp/charter/'
BOFREQ_PATH = 'data/developers/ietf-ftp/bofreq/'
CONFLICT_REVIEW_PATH = 'data/developers/ietf-ftp/conflict-reviews/'

View file

@ -46,45 +46,6 @@ def unindent(value):
"""Remove indentation from string."""
return re.sub("\n +", "\n", value)
@register.filter(name='parse_email_list')
def parse_email_list(value):
"""
Parse a list of comma-seperated email addresses into
a list of mailto: links.
Splitting a string of email addresses should return a list:
>>> force_str(parse_email_list('joe@example.org, fred@example.com'))
'<a href="mailto:joe@example.org">joe@example.org</a>, <a href="mailto:fred@example.com">fred@example.com</a>'
Parsing a non-string should return the input value, rather than fail:
>>> [ force_str(e) for e in parse_email_list(['joe@example.org', 'fred@example.com']) ]
['joe@example.org', 'fred@example.com']
Null input values should pass through silently:
>>> force_str(parse_email_list(''))
''
>>> parse_email_list(None)
"""
if value and isinstance(value, str): # testing for 'value' being true isn't necessary; it's a fast-out route
addrs = re.split(", ?", value)
ret = []
for addr in addrs:
(name, email) = parseaddr(addr)
if not(name):
name = email
ret.append('<a href="mailto:%s">%s</a>' % ( email.replace('&', '&amp;'), escape(name) ))
return mark_safe(", ".join(ret))
elif value and isinstance(value, bytes):
log.assertion('isinstance(value, str)')
else:
return value
@register.filter
def strip_email(value):
"""Get rid of email part of name/email string like 'Some Name <email@example.com>'."""

View file

@ -78,7 +78,7 @@ class ViewCharterTests(TestCase):
url = urlreverse('ietf.doc.views_doc.document_main',kwargs={'name':charter.name})
r = self.client.get(url)
q = PyQuery(r.content)
self.assertEqual('',q('.alert').text())
self.assertEqual('',q('.alert:not(.alert-ignore)').text())

View file

@ -85,7 +85,7 @@
{% endif %}
<div class="col overflow-hidden mx-3" id="content">
<noscript>
<div class="alert alert-danger my-3">
<div class="alert alert-danger alert-ignore my-3">
<b>Javascript disabled?</b> Like other modern websites, the IETF Datatracker relies on Javascript.
Please enable Javascript for full functionality.
</div>

View file

@ -437,17 +437,17 @@
</span>
{% endif %}
{% if milestones %}
(
<span class="milestone">
wg milestone{{ milestones|pluralize }}:
<br>
<span class="text-muted">
<span class="milestone">
WG milestone{{ milestones|pluralize }}:
</span>
{% for m in milestones %}
<span title="{{ m.desc }} ({{ m.group.acronym }} milestone)"
class="milestone">
{{ m.due|date:"M Y" }} - {{ m.desc }}</span>{% if not forloop.last %},{% endif %}
{% endfor %}
</span>
{% for m in milestones %}
<span title="{{ m.desc }} ({{ m.group.acronym }} milestone)"
class="milestone">
{{ m.due|date:"M Y" }} - {{m }}
</span>{% if not forloop.last %},{% endif %}
{% endfor %}
)
{% endif %}
{% if stream_tags %}
<div class="stream-tags">
@ -579,7 +579,7 @@
href="{% url 'ietf.doc.views_doc.document_shepherd_writeup' name=doc.name %}">
Show
</a>
<span class="text-muted">(Last changed {{ shepherd_writeup.time|date:"Y-m-d" }})</span>
<span class="badge bg-secondary">Last changed {{ shepherd_writeup.time|date:"Y-m-d" }}</span>
{% else %}
<span class="text-muted">
(None)
@ -734,11 +734,9 @@
On agenda of {{ telechat.telechat_date }} IESG telechat
{% if telechat.returning_item %}(returning item){% endif %}
{% else %}
{% if can_edit %}
<span class="text-muted">
(None)
</span>
{% endif %}
<span class="text-muted">
(None)
</span>
{% endif %}
{% if iesg_ballot_summary %}
<br>
@ -1047,12 +1045,10 @@
<i class="bi bi-search">
</i>
Search lists
<i class="caret">
</i>
</button>
<ul class="dropdown-menu" role="menu">
<li role="presentation">
<a role="menuitem"
<a class="dropdown-item"
href="https://mailarchive.ietf.org/arch/search?q=%22{{ doc.name }}%22"
rel="nofollow"
target="_blank">
@ -1060,7 +1056,7 @@
</a>
</li>
<li role="presentation">
<a role="menuitem"
<a class="dropdown-item"
href="https://www.google.com/search?as_q={{ doc.name }}&amp;as_sitesearch={{ search_archive }}"
rel="nofollow"
target="_blank">
@ -1069,7 +1065,7 @@
</li>
{% if user|has_role:"Area Director" %}
<li role="presentation">
<a role="menuitem"
<a class="dropdown-item"
href="https://www.iesg.org/bin/c5i?mid=6&amp;rid=77&amp;target={{ doc.name }}"
rel="nofollow"
target="_blank">

View file

@ -124,13 +124,13 @@
{% endif %}
</span>
{% if doc.latest_revision_date|timesince_days|new_enough:request %}
<wbr>
<br>
<div class="float-end">
<span class="badge bg-success">New</span>
</div>
{% endif %}
{% if doc.get_state_slug == "active" and doc.expirable and doc.expires|timesince_days|expires_soon:request %}
<wbr>
<br>
<span class="badge bg-warning">Expires soon</span>
{% endif %}
</td>
@ -138,7 +138,7 @@
<td class="text-center">
{% if doc.related_ipr %}
<a href="{% url "ietf.ipr.views.search" %}?submit=draft&amp;id={{ doc.name }}">
<span class="badge bg-secondary">{{ doc.related_ipr|length }}</span>
<span class="badge bg-info">{{ doc.related_ipr|length }}</span>
</a>
{% endif %}
</td>
@ -146,8 +146,8 @@
<td>
{% if doc.ad %}
{% person_link doc.ad title="Area Director" %}
<br>
{% endif %}
<br>
{% if doc.shepherd %}
{% email_person_link doc.shepherd title="Shepherd" class="small text-muted" %}
{% endif %}

View file

@ -4,18 +4,16 @@
{% load ietf_filters ballot_icon person_filters %}
<td class="status">
{% if doc.ballot %}
<div class="float-end" id="ballot-icon-{{ doc.name }}">{% ballot_icon doc %}</div>
<div class="float-end ms-1 mb-1" id="ballot-icon-{{ doc.name }}">{% ballot_icon doc %}</div>
{% endif %}
{% if not doc.get_state_slug == "rfc" %}
{% if '::' in doc.friendly_state %}
{{ doc.friendly_state|safe|split:'::'|join:'::<wbr>' }}
{{ doc.friendly_state|safe }}
{% else %}
{{ doc.friendly_state|safe }}
{% endif %}
{% if doc|state:"draft-rfceditor" %}
<wbr>
:
<a href="https://www.rfc-editor.org/queue2.html#{{ doc.name }}">{{ doc|state:"draft-rfceditor" }}</a>
: <a href="https://www.rfc-editor.org/queue2.html#{{ doc.name }}">{{ doc|state:"draft-rfceditor" }}</a>
{% endif %}
{{ doc|auth48_alert_badge }}
{{ doc|state_age_colored }}
@ -35,13 +33,11 @@
{{ doc|state:"stream" }}
{% if doc.intended_std_level %}
:
<wbr>
{% endif %}
{% else %}
{{ doc.stream }} stream
{% if doc.intended_std_level %}
:
<wbr>
{% endif %}
{% endif %}
{% endif %}

View file

@ -27,8 +27,7 @@
<div class="col-sm-3 text-end fw-bold">Area</div>
<div class="col">
<a href="{% url 'ietf.group.views.active_groups' group_type='wg' %}#{{ doc.group.parent.acronym }}">
{{ doc.group.parent.acronym|upper }}
</a>
{{ doc.group.parent.acronym|upper }}</a>
({% person_link doc.ad %})
</div>
</div>

View file

@ -1,7 +1,7 @@
{# Copyright The IETF Trust 2016, All Rights Reserved #}
{% load origin %}
{% origin %}
{% load ietf_filters ballot_icon person_filters %}
{% load ietf_filters ballot_icon person_filters textfilters %}
<div class="card mb-3">
<div class="position-absolute top-0 end-0 m-3">{% ballot_icon doc %}</div>
<div class="card-body">
@ -32,7 +32,7 @@
{% if doc.note %}
<div class="row">
<div class="col-sm-3 text-end fw-bold">Note</div>
<div class="col">{{ doc.note|linebreaksbr }}</div>
<div class="col">{{ doc.note|urlize_ietf_docs|linkify|linebreaksbr }}</div>
</div>
{% endif %}
<div class="row">

View file

@ -40,31 +40,31 @@
{% if liaison.to_contacts %}
<tr>
<th class="text-nowrap">To Contacts</th>
<td>{{ liaison.to_contacts|parse_email_list|make_one_per_line|safe|linebreaksbr }}</td>
<td>{{ liaison.to_contacts|linkify|make_one_per_line|safe|linebreaksbr }}</td>
</tr>
{% endif %}
{% if liaison.cc_contacts %}
<tr>
<th class="text-nowrap">Cc</th>
<td>{{ liaison.cc_contacts|parse_email_list|make_one_per_line|safe|linebreaksbr }}</td>
<td>{{ liaison.cc_contacts|linkify|make_one_per_line|safe|linebreaksbr }}</td>
</tr>
{% endif %}
{% if liaison.response_contacts %}
<tr>
<th class="text-nowrap">Response Contact</th>
<td>{{ liaison.response_contacts|parse_email_list|make_one_per_line|safe|linebreaksbr }}</td>
<td>{{ liaison.response_contacts|linkify|make_one_per_line|safe|linebreaksbr }}</td>
</tr>
{% endif %}
{% if liaison.technical_contacts %}
<tr>
<th class="text-nowrap">Technical Contact</th>
<td>{{ liaison.technical_contacts|parse_email_list|make_one_per_line|safe|linebreaksbr }}</td>
<td>{{ liaison.technical_contacts|linkify|make_one_per_line|safe|linebreaksbr }}</td>
</tr>
{% endif %}
{% if liaison.action_holder_contacts %}
<tr>
<th class="text-nowrap">Action Holder Contacts</th>
<td>{{ liaison.action_holder_contacts|parse_email_list|make_one_per_line|safe|linebreaksbr }}</td>
<td>{{ liaison.action_holder_contacts|linkify|make_one_per_line|safe|linebreaksbr }}</td>
</tr>
{% endif %}
<tr>

View file

@ -1,8 +1,6 @@
{# Copyright The IETF Trust 2020, All Rights Reserved #}
<span {% if class or nowrap %}class="{% if nowrap %}text-nowrap{% endif %}
{{ class }}"
{% endif %}>
{% if email or name %}<a {% if class %}class="text-reset"{% endif %}
{% endif %}>{% if email or name %}<a {% if class %}class="text-reset"{% endif %}
title="{% if title %}{{ title }}{% else %}Datatracker profile of {{ name }}.{% endif %}"
{% if email %} href="{% url 'ietf.person.views.profile' email_or_name=email %}" {% else %} href="{% url 'ietf.person.views.profile' email_or_name=name %}" {% endif %}>{{ name }}</a>{% if email and with_email %} <a {% if class %}class="text-reset"{% endif %}
href="mailto:{{ email|urlencode }}"