Skip to content

Commit 9bf1ff0

Browse files
committed
Merged in [10621] from lars@netapp.com:
Use js tablesort almost everywhere I thought it would make sense. While I touched the pages, I also corrected a few minor HTML nits, capitalization inconsistencies and some other minor things. Range r10605:r10621 - Legacy-Id: 10647 Note: SVN reference [10621] has been migrated to Git commit 7d3c268
1 parent d9686bf commit 9bf1ff0

Some content is hidden

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

51 files changed

+530
-187
lines changed

ietf/community/display.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,16 @@ def get_value(self, document, raw=False):
3030
class TitleField(DisplayField):
3131
codename = 'title'
3232
description = 'I-D title'
33-
rfcDescription = 'RFC Title'
33+
rfcDescription = 'RFC title'
3434

3535
def get_value(self, document, raw=False):
3636
return document.title
3737

3838

3939
class DateField(DisplayField):
4040
codename = 'date'
41-
description = 'Date of current I-D'
42-
rfcDescription = 'Date of RFC'
41+
description = 'Last revision'
42+
rfcDescription = 'Published'
4343

4444
def get_value(self, document, raw=False):
4545
date = document.latest_event(type='new_revision')

ietf/group/tests_info.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def test_active_groups(self):
4747
url = urlreverse('ietf.group.info.active_groups', kwargs=dict(group_type="rg"))
4848
r = self.client.get(url)
4949
self.assertEqual(r.status_code, 200)
50-
self.assertTrue('Active Research Groups' in unicontent(r))
50+
self.assertTrue('Active research groups' in unicontent(r))
5151

5252
url = urlreverse('ietf.group.info.active_groups', kwargs=dict(group_type="area"))
5353
r = self.client.get(url)
@@ -57,17 +57,17 @@ def test_active_groups(self):
5757
url = urlreverse('ietf.group.info.active_groups', kwargs=dict(group_type="ag"))
5858
r = self.client.get(url)
5959
self.assertEqual(r.status_code, 200)
60-
self.assertTrue("Active Area Groups" in unicontent(r))
60+
self.assertTrue("Active area groups" in unicontent(r))
6161

6262
url = urlreverse('ietf.group.info.active_groups', kwargs=dict(group_type="dir"))
6363
r = self.client.get(url)
6464
self.assertEqual(r.status_code, 200)
65-
self.assertTrue("Active Directorates" in unicontent(r))
65+
self.assertTrue("Active directorates" in unicontent(r))
6666

6767
url = urlreverse('ietf.group.info.active_groups', kwargs=dict(group_type="team"))
6868
r = self.client.get(url)
6969
self.assertEqual(r.status_code, 200)
70-
self.assertTrue("Active Teams" in unicontent(r))
70+
self.assertTrue("Active teams" in unicontent(r))
7171

7272
url = urlreverse('ietf.group.info.active_groups', kwargs=dict())
7373
r = self.client.get(url)
@@ -960,7 +960,7 @@ def testExpansions(self):
960960
url = urlreverse('ietf.group.info.email', kwargs=dict(acronym="mars"))
961961
r = self.client.get(url)
962962
self.assertEqual(r.status_code,200)
963-
self.assertTrue('Email Aliases' in unicontent(r))
963+
self.assertTrue('Email aliases' in unicontent(r))
964964
self.assertTrue('mars-ads@ietf.org' in unicontent(r))
965965
self.assertTrue('group_personnel_change' in unicontent(r))
966966

ietf/name/fixtures/names.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@
188188
"order": 0,
189189
"revname": "Conflict reviewed by",
190190
"used": true,
191-
"name": "conflict reviews",
191+
"name": "Conflict reviews",
192192
"desc": ""
193193
},
194194
"model": "name.docrelationshipname",

ietf/static/ietf/js/ietf.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,8 @@ $(document).ready(function () {
256256
};
257257
// disable the URL-based sorting stuff that uses the django backend
258258
$(".tablesorter thead a").contents().unwrap();
259+
// strip the caret used by the django backend sorting
260+
$(".tablesorter thead th span.fa-caret-down").remove();
259261
// make the table sortable
260262
$(".tablesorter").tablesorter({
261263
emptyTo: "zero",

ietf/templates/community/manage_clist.html

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
{% extends "base.html" %}
22
{# Copyright The IETF Trust 2015, All Rights Reserved #}
3-
{% load origin %}
3+
{% load origin staticfiles %}
44
{% load future %}
55
{% load staticfiles %}
66
{% load bootstrap3 %}
77

8+
{% block pagehead %}
9+
<link rel="stylesheet" href="{% static "jquery.tablesorter/css/theme.bootstrap.min.css" %}">
10+
{% endblock %}
11+
812
{% block title %}{{ cl.long_name }}{% endblock %}
913

1014
{% block content %}
@@ -34,12 +38,12 @@ <h1>{{ cl.long_name }}</h1>
3438
<li>Search for the document or documents you want to add using the datatracker search form.</li>
3539
<li>In the search results, you'll find a link to add individual documents to your list.</li>
3640
</ul>
37-
<a class="btn btn-default" href="/doc/search/">Document search</a>
41+
<p><a class="btn btn-default" href="/doc/search/">Document search</a></p>
3842

39-
<table class="table table-condensed table-striped">
43+
<table class="table table-condensed table-striped tablesorter">
4044
<thead>
4145
<tr>
42-
<th>Name</th><th>State</th><th>Title</th><th></th>
46+
<th>Name</th><th>State</th><th>Title</th><th class="sorter-false"></th>
4347
</tr>
4448
</thead>
4549
<tbody>
@@ -56,9 +60,9 @@ <h1>{{ cl.long_name }}</h1>
5660
</div>
5761

5862
<div class="tab-pane" id="rules">
59-
<table class="table table-condensed table-striped">
63+
<table class="table table-condensed table-striped tablesorter">
6064
<thead>
61-
<tr><th>Rule</th><th>Value</th><th>Documents</th><th></th></tr>
65+
<tr><th>Rule</th><th>Value</th><th>Documents</th><th class="sorter-false"></th></tr>
6266
</thead>
6367
<tbody>
6468
{% for rule in cl.rule_set.all %}
@@ -111,22 +115,26 @@ <h3>Add a new rule</h3>
111115

112116
{% endblock %}
113117

118+
{% block js %}
119+
<script src="{% static "jquery.tablesorter/js/jquery.tablesorter.combined.min.js" %}"></script>
120+
114121
{% comment %}
115-
XXX scrolling jumps around when using this, unfortunately
122+
Stay on the current tab after form submission.
123+
If other pages need this functionality, it should move to ietf.js.
124+
{% endcomment %}
116125
<script>
117-
$('.nav-memory a').click(function (e) {
118-
e.preventDefault();
119-
$(this).tab('show');
120-
});
121-
122-
// store the currently selected tab in the hash value
123-
$("ul.nav-tabs > li > a").on("shown.bs.tab", function (e) {
124-
var id = $(e.target).attr("href").substr(1);
125-
window.location.hash = id;
126+
$(function() {
127+
$('a[data-toggle="tab"]').on("click", function (e) {
128+
// save the current tab
129+
localStorage.setItem("currentTab", $(e.target).attr("href"));
130+
});
131+
132+
// go to "currentTab", if it exists
133+
var currentTab = localStorage.getItem("currentTab");
134+
if (currentTab) {
135+
$('a[href="' + currentTab + '"]').click();
136+
}
126137
});
127-
128-
// on load of the page: switch to the currently selected tab
129-
var hash = window.location.hash;
130-
$('.nav-memory a[href="' + hash + '"]').tab('show');
131138
</script>
132-
{% endcomment %}
139+
140+
{% endblock %}

ietf/templates/community/raw_view.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
{% with cl.get_rfcs_and_drafts as documents %}
77
{% with dc.get_active_fields as fields %}
8-
<h2>Drafts</h2>
9-
<table class="table table-condensed table-striped">
8+
<h2>Internet-Drafts</h2>
9+
<table class="table table-condensed table-striped tablesorter">
1010
<thead>
1111
<tr>
1212
{% for field in fields %}
@@ -28,7 +28,7 @@ <h2>Drafts</h2>
2828

2929
{% with dc.get_active_fields as fields %}
3030
<h2>RFCs</h2>
31-
<table class="table table-condensed table-striped">
31+
<table class="table table-condensed table-striped tablesorter">
3232
<thead>
3333
<tr>
3434
{% for field in fields %}

ietf/templates/doc/document_email.html

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
{# Copyright The IETF Trust 2015, All Rights Reserved #}
33
{% load origin %}
44
{% load ietf_filters %}
5-
{% load future %}
5+
{% load future staticfiles %}
6+
7+
{% block pagehead %}
8+
<link rel="stylesheet" href="{% static "jquery.tablesorter/css/theme.bootstrap.min.css" %}">
9+
{% endblock %}
610

711
{% block title %}Email expansions for {{ doc.name }}-{{ doc.rev }}{% endblock %}
812

@@ -11,26 +15,34 @@
1115
{{ top|safe }}
1216

1317
{% if aliases %}
14-
<h2>Email Aliases</h2>
15-
16-
<table class="table table-condensed table-striped ietf">
18+
<h2>Email aliases</h2>
19+
20+
<table class="table table-condensed table-striped tablesorter">
21+
<thead>
22+
<tr>
23+
<th>Alias</th>
24+
<th>Expansion</th>
25+
</tr>
26+
</thead>
1727
<tbody>
1828
{% for alias in aliases %}
1929
<tr>
20-
<td>{{ doc.name }}{{ alias.alias_type|default:''}}@{{ietf_domain}}</td>
30+
<td>
31+
<a href="mailto:{{ doc.name }}{{ alias.alias_type|default:''}}@{{ietf_domain}}">
32+
{{ doc.name }}{{ alias.alias_type|default:''}}@{{ietf_domain}}</a></td>
2133
<td>{{ alias.expansion }}</td>
2234
</tr>
2335
{% endfor %}
2436
</tbody>
2537
</table>
2638
{% endif %}
2739

28-
<h2>Recipient Expansions</h2>
40+
<h2>Recipient expansions</h2>
2941

30-
<table class="table table-condensed table-striped ietf">
42+
<table class="table table-condensed table-striped tablesorter">
3143
<thead>
3244
<tr>
33-
<th>Mail Trigger</th>
45+
<th>Mail trigger</th>
3446
<th>To</th>
3547
<th>Cc</th>
3648
</tr>
@@ -47,3 +59,7 @@ <h2>Recipient Expansions</h2>
4759
</tbody>
4860
</table>
4961
{% endblock content %}
62+
63+
{% block js %}
64+
<script src="{% static "jquery.tablesorter/js/jquery.tablesorter.combined.min.js" %}"></script>
65+
{% endblock %}

ietf/templates/doc/document_history.html

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{# Copyright The IETF Trust 2015, All Rights Reserved #}
33
{% load origin %}
44
{% load ietf_filters %}
5-
{% load future %}
5+
{% load future staticfiles %}
66

77
{% block title %}History for {{ doc.name }}-{{ doc.rev }}{% endblock %}
88

@@ -12,6 +12,7 @@
1212

1313
{% block pagehead %}
1414
<link rel="alternate" type="application/atom+xml" href="/feed/document-changes/{{ doc.name }}/" />
15+
<link rel="stylesheet" href="{% static "jquery.tablesorter/css/theme.bootstrap.min.css" %}">
1516
{% endblock %}
1617

1718
{% block content %}
@@ -88,7 +89,7 @@ <h2>Document history</h2>
8889
</div>
8990
{% endif %}
9091

91-
<table class="table table-condensed table-striped ietf">
92+
<table class="table table-condensed table-striped tablesorter">
9293
<thead>
9394
<tr>
9495
<th>Date</th>
@@ -110,3 +111,7 @@ <h2>Document history</h2>
110111
</tbody>
111112
</table>
112113
{% endblock content %}
114+
115+
{% block js %}
116+
<script src="{% static "jquery.tablesorter/js/jquery.tablesorter.combined.min.js" %}"></script>
117+
{% endblock %}

ietf/templates/doc/document_referenced_by.html

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{% extends "base.html" %}
22
{# Copyright The IETF Trust 2015, All Rights Reserved #}
3-
{% load origin %}
3+
{% load origin staticfiles %}
4+
5+
{% block pagehead %}
6+
<link rel="stylesheet" href="{% static "jquery.tablesorter/css/theme.bootstrap.min.css" %}">
7+
{% endblock %}
48

59
{% block title %}
610
References to {{alias_name}}
@@ -25,7 +29,7 @@ <h1>References to {{alias_name}}</h1>
2529
</div>
2630
{% endif %}
2731

28-
<table class="table table-condensed table-striped">
32+
<table class="table table-condensed table-striped tablesorter">
2933
<thead>
3034
<tr>
3135
<th>Document</th>
@@ -65,3 +69,7 @@ <h1>References to {{alias_name}}</h1>
6569
</tbody>
6670
</table>
6771
{% endblock %}
72+
73+
{% block js %}
74+
<script src="{% static "jquery.tablesorter/js/jquery.tablesorter.combined.min.js" %}"></script>
75+
{% endblock %}

ietf/templates/doc/document_references.html

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{% extends "base.html" %}
22
{# Copyright The IETF Trust 2015, All Rights Reserved #}
3-
{% load origin %}
3+
{% load origin staticfiles %}
4+
5+
{% block pagehead %}
6+
<link rel="stylesheet" href="{% static "jquery.tablesorter/css/theme.bootstrap.min.css" %}">
7+
{% endblock %}
48

59
{% block title %}
610
References from {{doc.canonical_name}}
@@ -17,7 +21,7 @@ <h1>References from {{doc.canonical_name}}</h1>
1721
<a class="btn btn-default" href="{% url 'relationship_subset_help' subset='reference' %}">Reference type help</a>
1822
</p>
1923

20-
<table class="table table-condensed table-striped">
24+
<table class="table table-condensed table-striped tablesorter">
2125
<thead>
2226
<tr>
2327
<th>Document</th>
@@ -52,3 +56,7 @@ <h1>References from {{doc.canonical_name}}</h1>
5256
</table>
5357

5458
{% endblock %}
59+
60+
{% block js %}
61+
<script src="{% static "jquery.tablesorter/js/jquery.tablesorter.combined.min.js" %}"></script>
62+
{% endblock %}

0 commit comments

Comments
 (0)