Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions ietf/doc/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ def test_document_draft(self):
self.assertEqual(r.status_code, 200)
self.assertContains(r, "Active Internet-Draft")
if settings.USER_PREFERENCE_DEFAULTS['full_draft'] == 'off':
self.assertContains(r, "Show full document text")
self.assertContains(r, "Show full document")
self.assertNotContains(r, "Deimos street")
self.assertContains(r, replaced.canonical_name())
self.assertContains(r, replaced.title)
Expand All @@ -579,7 +579,7 @@ def test_document_draft(self):
r = self.client.get(urlreverse("ietf.doc.views_doc.document_main", kwargs=dict(name=draft.name)) + "?include_text=0")
self.assertEqual(r.status_code, 200)
self.assertContains(r, "Active Internet-Draft")
self.assertContains(r, "Show full document text")
self.assertContains(r, "Show full document")
self.assertNotContains(r, "Deimos street")
self.assertContains(r, replaced.canonical_name())
self.assertContains(r, replaced.title)
Expand All @@ -596,7 +596,7 @@ def test_document_draft(self):
r = self.client.get(urlreverse("ietf.doc.views_doc.document_main", kwargs=dict(name=draft.name)) + "?include_text=foo")
self.assertEqual(r.status_code, 200)
self.assertContains(r, "Active Internet-Draft")
self.assertNotContains(r, "Show full document text")
self.assertNotContains(r, "Show full document")
self.assertContains(r, "Deimos street")
self.assertContains(r, replaced.canonical_name())
self.assertContains(r, replaced.title)
Expand All @@ -613,7 +613,7 @@ def test_document_draft(self):
r = self.client.get(urlreverse("ietf.doc.views_doc.document_main", kwargs=dict(name=draft.name)) + "?include_text=1")
self.assertEqual(r.status_code, 200)
self.assertContains(r, "Active Internet-Draft")
self.assertNotContains(r, "Show full document text")
self.assertNotContains(r, "Show full document")
self.assertContains(r, "Deimos street")
self.assertContains(r, replaced.canonical_name())
self.assertContains(r, replaced.title)
Expand All @@ -631,7 +631,7 @@ def test_document_draft(self):
r = self.client.get(urlreverse("ietf.doc.views_doc.document_main", kwargs=dict(name=draft.name)))
self.assertEqual(r.status_code, 200)
self.assertContains(r, "Active Internet-Draft")
self.assertNotContains(r, "Show full document text")
self.assertNotContains(r, "Show full document")
self.assertContains(r, "Deimos street")
self.assertContains(r, replaced.canonical_name())
self.assertContains(r, replaced.title)
Expand All @@ -649,7 +649,7 @@ def test_document_draft(self):
r = self.client.get(urlreverse("ietf.doc.views_doc.document_main", kwargs=dict(name=draft.name)))
self.assertEqual(r.status_code, 200)
self.assertContains(r, "Active Internet-Draft")
self.assertContains(r, "Show full document text")
self.assertContains(r, "Show full document")
self.assertNotContains(r, "Deimos street")
self.assertContains(r, replaced.canonical_name())
self.assertContains(r, replaced.title)
Expand All @@ -668,7 +668,7 @@ def test_document_draft(self):
self.assertEqual(r.status_code, 200)
self.assertContains(r, "Active Internet-Draft")
if settings.USER_PREFERENCE_DEFAULTS['full_draft'] == 'off':
self.assertContains(r, "Show full document text")
self.assertContains(r, "Show full document")
self.assertNotContains(r, "Deimos street")
self.assertContains(r, replaced.canonical_name())
self.assertContains(r, replaced.title)
Expand Down Expand Up @@ -2807,4 +2807,4 @@ def test_pdfized(self):
self.should_succeed(dict(name=rfc.name,rev=f'{r:02d}'))
for ext in ('pdf','txt','html','anythingatall'):
self.should_succeed(dict(name=rfc.name,rev=f'{r:02d}',ext=ext))
self.should_404(dict(name=rfc.name,rev='02'))
self.should_404(dict(name=rfc.name,rev='02'))
4 changes: 2 additions & 2 deletions ietf/doc/views_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,9 +360,9 @@ def document_main(request, name, rev=None):
if can_adopt_draft(request.user, doc) and not doc.get_state_slug() in ["rfc"] and not snapshot:
if doc.group and doc.group.acronym != 'none': # individual submission
# already adopted in one group
button_text = "Change Document Adoption to other Group (now in %s)" % doc.group.acronym
button_text = "Switch adoption"
else:
button_text = "Manage Document Adoption in Group"
button_text = "Adopt"
actions.append((button_text, urlreverse('ietf.doc.views_draft.adopt_draft', kwargs=dict(name=doc.name))))

if can_unadopt_draft(request.user, doc) and not doc.get_state_slug() in ["rfc"] and not snapshot:
Expand Down
4 changes: 2 additions & 2 deletions ietf/meeting/tests_js.py
Original file line number Diff line number Diff line change
Expand Up @@ -2320,7 +2320,7 @@ def _assert_interim_tz_correct(sessions, tz):
end = ts.utc_end_time().astimezone(zone).strftime('%H:%M')
meeting_link = self.driver.find_element(By.LINK_TEXT, session.meeting.number)
time_td = meeting_link.find_element(By.XPATH, '../../td[contains(@class, "session-time")]')
self.assertIn('%s - %s' % (start, end), time_td.text)
self.assertIn('%s-%s' % (start, end), time_td.text)

def _assert_ietf_tz_correct(meetings, tz):
zone = pytz.timezone(tz)
Expand All @@ -2339,7 +2339,7 @@ def _assert_ietf_tz_correct(meetings, tz):
end = end_dt.astimezone(zone).strftime('%Y-%m-%d')
meeting_link = self.driver.find_element(By.LINK_TEXT, "IETF " + meeting.number)
time_td = meeting_link.find_element(By.XPATH, '../../td[contains(@class, "meeting-time")]')
self.assertIn('%s - %s' % (start, end), time_td.text)
self.assertIn('%s to %s' % (start, end), time_td.text)

sessions = [m.session_set.first() for m in self.displayed_interims()]
self.assertGreater(len(sessions), 0)
Expand Down
2 changes: 1 addition & 1 deletion ietf/meeting/tests_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -4307,7 +4307,7 @@ def test_past(self):
q = PyQuery(r.content)
#id="-%s" % interim.group.acronym
#self.assertIn('Cancelled', q('[id*="'+id+'"]').text())
self.assertIn('Cancelled', q('tr>td>a>span').text())
self.assertIn('Cancelled', q('tr>td>a+span').text())

def do_upcoming_test(self, querystring=None, create_meeting=True):
if create_meeting:
Expand Down
19 changes: 16 additions & 3 deletions ietf/static/css/ietf.scss
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,26 @@ table tbody.meta {

th:first-child,
td:first-child {
width: 9em;
width: 4em;
}

th:nth-child(2),
td:nth-child(2) {
// text-align: right;
width: 14em;
width: 7em;
}

// See https://getbootstrap.com/docs/5.0/layout/breakpoints/#media-queries
@include media-breakpoint-up(md) {

th:first-child,
td:first-child {
width: 9em;
}

th:nth-child(2),
td:nth-child(2) {
width: 14em;
}
}

td.edit {
Expand Down
16 changes: 8 additions & 8 deletions ietf/static/js/agenda_timezone.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,20 +126,20 @@ function format_tooltip_table(start, end) {
var current_timezone = get_current_tz_cb();
var out = '<div class="text-start"><table class="table table-sm"><tr><th></th><th>Session start</th><th>Session end</th></tr>';
if (window.meeting_timezone !== "") {
out += '<tr><th class="timehead">Meeting timezone</th><td class="text-nowrap">' +
format_time(start, window.meeting_timezone, 0) + '</td><td class="text-nowrap">' +
out += '<tr><th class="timehead">Meeting timezone</th><td>' +
format_time(start, window.meeting_timezone, 0) + '</td><td>' +
format_time(end, window.meeting_timezone, 0) + '</td></tr>';
}
out += '<tr><th class="timehead">Local timezone</th><td class="text-nowrap">' +
format_time(start, local_timezone, 0) + '</td><td class="text-nowrap">' +
out += '<tr><th class="timehead">Local timezone</th><td>' +
format_time(start, local_timezone, 0) + '</td><td>' +
format_time(end, local_timezone, 0) + '</td></tr>';
if (current_timezone !== 'UTC') {
out += '<tr><th class="timehead">Selected Timezone</th><td class="text-nowrap">' +
format_time(start, current_timezone, 0) + '</td><td class="text-nowrap">' +
out += '<tr><th class="timehead">Selected Timezone</th><td>' +
format_time(start, current_timezone, 0) + '</td><td>' +
format_time(end, current_timezone, 0) + '</td></tr>';
}
out += '<tr><th class="timehead">UTC</th><td class="text-nowrap">' +
format_time(start, 'UTC', 0) + '</td><td class="text-nowrap">' +
out += '<tr><th class="timehead">UTC</th><td>' +
format_time(start, 'UTC', 0) + '</td><td>' +
format_time(end, 'UTC', 0) + '</td></tr>';
out += '</table>' + format_tooltip_notice(start, end) + '</div>';
return out;
Expand Down
43 changes: 43 additions & 0 deletions ietf/static/js/ietf.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,49 @@ $(document)
.tooltip();
});

// Help browser to wrap long link texts (esp. email addresses) more sensibly.
$(document)
.ready(function () {
$("#content a")
.each(function () {
// get the text of the <a> element
var text = $(this)
.text();
// insert some <wbr> at strategic places
var newtext = text.replace(/([@._])/g, "$1<wbr>");
if (newtext === text) {
return;
}
// now replace only that text inside the element's HTML
var newhtml = $(this)
.html()
.replace(text, newtext);
$(this)
.html(newhtml);
});

// $("#content table.tablesorter")
Comment thread
larseggert marked this conversation as resolved.
// .on("tablesorter:done", function () {
// $("#content table.tablesorter .date")
// .each(function () {
// // get the text of the <a> element
// var text = $(this)
// .text();
// // insert some <wbr> at strategic places
// var newtext = text.replace(/([-])/g, "$1<wbr>");
// if (newtext === text) {
// return;
// }
// // now replace only that text inside the element's HTML
// var newhtml = $(this)
// .html()
// .replace(text, newtext);
// $(this)
// .html(newhtml);
// });
// });
});

$(document)
.ready(function () {

Expand Down
2 changes: 2 additions & 0 deletions ietf/static/js/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,5 +273,7 @@ $(document)
});
$(table.addClass("tablesorter-done"));
n++;
$(table)[0]
.dispatchEvent(new Event("tablesorter:done"));
});
});
4 changes: 2 additions & 2 deletions ietf/static/js/upcoming.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ function format_session_time(session_elt, tz) {
.attr('data-start-utc'));
var end = moment.utc($(session_elt)
.attr('data-end-utc'));
return format_moment(start, tz, 'datetime') + ' - ' + format_moment(end, tz, 'time');
return format_moment(start, tz, 'datetime') + '-' + format_moment(end, tz, 'time');
}

function format_meeting_time(meeting_elt, tz) {
Expand All @@ -134,7 +134,7 @@ function format_meeting_time(meeting_elt, tz) {
var end = moment.tz($(meeting_elt)
.attr('data-end-date'), meeting_tz)
.endOf('day');
return format_moment(start, tz, 'date') + ' - ' + format_moment(end, tz, 'date');
return format_moment(start, tz, 'date') + ' to ' + format_moment(end, tz, 'date');
}

window.timezone_changed = function (newtz) {
Expand Down
4 changes: 2 additions & 2 deletions ietf/templates/doc/bofreq/bof_requests.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ <h2 class="mt-5">{{ req_group.grouper|capfirst }} BOF Requests</h2>
<thead>
<tr>
<th data-sort="name">Name</th>
<th data-sort="date">Date</th>
<th class="d-none d-sm-table-cell" data-sort="date">Date</th>
<th data-sort="title">Title</th>
<th data-sort="responsible">Responsible</th>
<th data-sort="editors">Editors</th>
Expand All @@ -44,7 +44,7 @@ <h2 class="mt-5">{{ req_group.grouper|capfirst }} BOF Requests</h2>
<td>
<a href="{% url 'ietf.doc.views_doc.document_main' name=req.name %}">{{ req.name }}-{{ req.rev }}</a>
</td>
<td>{{ req.latest_revision_event.time|date:"Y-m-d" }}</td>
<td class="d-none d-sm-table-cell">{{ req.latest_revision_event.time|date:"Y-m-d" }}</td>
<td>{{ req.title }}</td>
<td>
{% for person in req.responsible %}
Expand Down
2 changes: 1 addition & 1 deletion ietf/templates/doc/document_draft.html
Original file line number Diff line number Diff line change
Expand Up @@ -1152,7 +1152,7 @@
<a class="btn btn-primary my-3" href="?include_text=1">
<i class="bi bi-caret-down">
</i>
Show full document text
Show full document
</a>
{% endif %}
{% else %}
Expand Down
2 changes: 1 addition & 1 deletion ietf/templates/doc/document_history.html
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ <h2 class="my-3">Document history</h2>
<tbody>
{% for e in events %}
<tr id="history-{{ e.pk }}">
<td class="text-nowrap">
<td>
<div title="{{ e.time|date:'Y-m-d H:i:s O' }}">{{ e.time|date:"Y-m-d" }}</div>
</td>
<td class="text-end">{{ e.rev }}</td>
Expand Down
11 changes: 4 additions & 7 deletions ietf/templates/doc/drafts_for_ad.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ <h1>Blocking positions held by {{ ad_name }}</h1>
<tr>
<th data-sort="document">Document</th>
<th data-sort="status">Status</th>
<th data-sort="responsible">Responsible AD</th>
<th class="d-none d-sm-table-cell" data-sort="responsible">Responsible AD</th>
<th data-sort="discusses">Discusses</th>
</tr>
</thead>
Expand All @@ -25,7 +25,7 @@ <h1>Blocking positions held by {{ ad_name }}</h1>
<tr>
<td>{{ doc.displayname_with_link }}</td>
{% include "doc/search/status_columns.html" %}
<td>
<td class="d-none d-sm-table-cell">
{% if doc.ad %}
{% person_link doc.ad %}
{% else %}
Expand All @@ -40,11 +40,8 @@ <h1>Blocking positions held by {{ ad_name }}</h1>
{% else %}
{% person_link p.balloter %}
{% endif %}
(
{% if p.discuss_time %}{{ p.discuss_time|timesince_days }}{% endif %}
days ago
{% if doc.get_state_url != "rfc" and p.rev != doc.rev %}for -{{ p.rev }}{% endif %}
)
({% if p.discuss_time %}{{ p.discuss_time|timesince_days }}{% endif %}
days ago{% if doc.get_state_url != "rfc" and p.rev != doc.rev %} for -{{ p.rev }}{% endif %})
<br>
</span>
{% endfor %}
Expand Down
2 changes: 1 addition & 1 deletion ietf/templates/doc/email_aliases.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ <h1>
{% cycle '' 'table-active' as alternator silent %}
{% for item in alias.list %}
<tr {% if alternator %}class="{{ alternator }}"{% endif %}>
<td class="text-nowrap">{{ alias.grouper }}{{ item.alias_type|default:'' }}@{{ ietf_domain }}</td>
<td>{{ alias.grouper }}{{ item.alias_type|default:'' }}@{{ ietf_domain }}</td>
<td>{{ item.expansion }}</td>
</tr>
{% endfor %}
Expand Down
8 changes: 3 additions & 5 deletions ietf/templates/doc/search/search_result_row.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
{% endfor %}
</td>
<td class="doc">
{% if doc.pages %}<small class="float-end text-muted">{{ doc.pages }} page{{ doc.pages|pluralize }}</small>{% endif %}
{% if doc.pages %}<small class="float-end text-muted d-none d-sm-block">{{ doc.pages }} page{{ doc.pages|pluralize }}</small>{% endif %}
<div>
<a href="{{ doc.get_absolute_url }}">
{% if doc.get_state_slug == "rfc" %}
Expand Down Expand Up @@ -106,7 +106,6 @@
{% endif %}
</td>
<td>
<span class="text-nowrap">
{% if doc.latest_revision_date|timesince_days|new_enough:request and doc.get_state_slug != "rfc" %}
{% if doc.rev != "00" %}
<a href="{{ rfcdiff_base_url }}?url2={{ doc.name }}-{{ doc.rev }}">
Expand All @@ -122,7 +121,6 @@
{% if doc.latest_revision_date|timesince_days|new_enough:request and doc.get_state_slug != "rfc" %}
{% if doc.rev != "00" or doc.replaces %}</a>{% endif %}
{% endif %}
</span>
{% if doc.latest_revision_date|timesince_days|new_enough:request %}
<br>
<div class="float-end">
Expand All @@ -135,15 +133,15 @@
{% endif %}
</td>
{% include "doc/search/status_columns.html" %}
<td class="text-center">
<td class="text-center d-none d-sm-table-cell">
{% if doc.related_ipr %}
<a href="{% url "ietf.ipr.views.search" %}?submit=draft&amp;id={{ doc.name }}">
<span class="badge bg-info">{{ doc.related_ipr|length }}</span>
</a>
{% endif %}
</td>
{% if ad_name == None or ad_name != doc.ad.plain_name %}
<td>
<td class="d-none d-sm-table-cell">
{% if doc.ad %}
{% person_link doc.ad title="Area Director" %}
{% endif %}
Expand Down
5 changes: 4 additions & 1 deletion ietf/templates/doc/search/search_results.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
<th></th>
{% for h in meta.headers %}
{% if h.title != "Title" %}
<th data-sort="{{ h.key }}">
<th data-sort="{{ h.key }}"
{% if h.title|slugify == "ipr" or h.title|slugify == "ad-shepherd" %}
class="d-none d-sm-table-cell"
{% endif %}>
{% if "sort_url" in h %}
<a href="{{ h.sort_url }}">
{{ h.title|cut:" " }}
Expand Down
2 changes: 1 addition & 1 deletion ietf/templates/doc/search/status_columns.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<br>
Action Holder{{ doc.documentactionholder_set.all|pluralize }}:
{% for action_holder in doc.documentactionholder_set.all %}
{% person_link action_holder.person title=action_holder.role_for_doc %} {{ action_holder|action_holder_badge }}{% if not forloop.last %},{% endif %}
{% person_link action_holder.person title=action_holder.role_for_doc %}{% if action_holder|action_holder_badge %} {{ action_holder|action_holder_badge }}{% endif %}{% if not forloop.last %},{% endif %}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the {% if... %} wrapper should be a no-op. The action_holder-badge tag returns '' if there's nothing to include, so either way there should be no text inserted. Is this doing something subtle?

Copy link
Copy Markdown
Collaborator Author

@larseggert larseggert Mar 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue is that if there is no action_holder, there should also not be a space before the (empty) badge. (And if there is one, there should be a space.) Is there a better way to do this?

Copy link
Copy Markdown
Member

@rjsparks rjsparks Mar 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look to see if that space is appropriate for everywhere the action_holder templatetag is used. If it is, then add it to the html that the templatetag emits when a badge should be present.

Or, to make it much more obvious why you're adding the space, try

{% if action_holder|action_holder_badge %} {% endif %}{% action_holder|action_holder_badge %}

Or better yet, look to see if action_holder_badge being empty only happens when there is no action holder, and if so reduce that to

{% if action_holder %} {% endif %}{% action_holder|action_holder_badge %}

But this isn't enough to hold up the PR over.

{% endfor %}
{% endif %}
{% else %}
Expand Down
Loading