Skip to content

Commit f8c06fa

Browse files
authored
fix: Use unique data-sort attributes (ietf-tools#3836)
* fix: Use unique `data-sort` attributes So list.js properly sorts columns. * Address @rjsparks' comments
1 parent ea22b0f commit f8c06fa

24 files changed

Lines changed: 83 additions & 80 deletions

docker/scripts/app-create-dirs.sh

100644100755
File mode changed.

ietf/static/js/list.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ function replace_with_internal(table, internal_table, i) {
2525

2626
function field_magic(i, e, fields) {
2727
if ($(e)
28-
.attr("colspan") === undefined && (fields[i] == "num" || fields[i] == "count" || fields[i] == "id")) {
28+
.attr("colspan") === undefined &&
29+
(fields[i] == "num" || fields[i] == "count" ||
30+
fields[i] == "percent" || fields[i] == "id" ||
31+
fields[i].endsWith("-num") || fields[i].endsWith("-date"))) {
2932
$(e)
3033
.addClass("text-end");
3134
}
@@ -276,4 +279,4 @@ $(document)
276279
$(table)[0]
277280
.dispatchEvent(new Event("tablesorter:done"));
278281
});
279-
});
282+
});

ietf/templates/debug.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
<tr>
1818
<th scope="col" data-sort="num">#</th>
1919
<th scope="col" data-sort="query">SQL</th>
20-
<th scope="col" data-sort="num">Count</th>
20+
<th scope="col" data-sort="count">Count</th>
2121
<th scope="col" data-sort="where">WHERE</th>
22-
<th scope="col" data-sort="num">View/Templ.</th>
23-
<th scope="col" data-sort="num">Time</th>
24-
<th scope="col" data-sort="num">Acc.</th>
22+
<th scope="col" data-sort="view-num">View/Templ.</th>
23+
<th scope="col" data-sort="time-num">Time</th>
24+
<th scope="col" data-sort="acc-num">Acc.</th>
2525
</tr>
2626
</thead>
2727
<tbody>
@@ -107,4 +107,4 @@ <h4 class="modal-title" id="modal-title-{{ forloop.counter }}">QuerySet Origin f
107107
Add <code>ietf.context_processors.sql_debug</code> to <code>settings.DEV_TEMPLATE_CONTEXT_PROCESSORS</code> to turn on the SQL statement table.
108108
</small>
109109
{% endif %}
110-
{% endif %}
110+
{% endif %}

ietf/templates/group/review_requests.html

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ <h2 class="mt-5" id="unassigned-and-open-review-requests">Unassigned and open re
2222
<tr>
2323
<th scope="col" data-sort="request">Request</th>
2424
<th scope="col" data-sort="type">Type</th>
25-
<th scope="col" data-sort="date">Requested</th>
26-
<th scope="col" data-sort="date">Deadline</th>
25+
<th scope="col" data-sort="req-date">Requested</th>
26+
<th scope="col" data-sort="deadline-date">Deadline</th>
2727
<th scope="col" data-sort="state">Document state</th>
28-
<th scope="col" data-sort="date">IESG Telechat</th>
28+
<th scope="col" data-sort="telechat-date">IESG Telechat</th>
2929
</tr>
3030
</thead>
3131
<tbody>
@@ -71,11 +71,11 @@ <h2 class="mt-5" id="unassigned-and-open-review-requests">Unassigned and open re
7171
<tr>
7272
<th scope="col" data-sort="request">Request</th>
7373
<th scope="col" data-sort="type">Type</th>
74-
<th scope="col" data-sort="date">Requested</th>
75-
<th scope="col" data-sort="date">Deadline</th>
74+
<th scope="col" data-sort="req-date">Requested</th>
75+
<th scope="col" data-sort="deadline-date">Deadline</th>
7676
<th scope="col" data-sort="reviewer">Reviewer</th>
7777
<th scope="col" data-sort="state">Document state</th>
78-
<th scope="col" data-sort="date">IESG Telechat</th>
78+
<th scope="col" data-sort="telechat-date">IESG Telechat</th>
7979
</tr>
8080
</thead>
8181
<tbody>
@@ -133,13 +133,13 @@ <h2 class="mt-5" id="closed-review-requests">Closed review requests and assignme
133133
<th scope="col" data-sort="type">
134134
Type
135135
</th>
136-
<th scope="col" data-sort="date">
136+
<th scope="col" data-sort="req-date">
137137
Requested
138138
</th>
139-
<th scope="col" data-sort="date">
139+
<th scope="col" data-sort="deadline-date">
140140
Deadline
141141
</th>
142-
<th scope="col" data-sort="date">
142+
<th scope="col" data-sort="closed-date">
143143
Closed
144144
</th>
145145
<th scope="col" data-sort="state">
@@ -188,13 +188,13 @@ <h2 class="mt-5" id="closed-review-requests">Closed review requests and assignme
188188
<th scope="col" data-sort="type">
189189
Type
190190
</th>
191-
<th scope="col" data-sort="date">
191+
<th scope="col" data-sort="assgn-date">
192192
Assigned
193193
</th>
194-
<th scope="col" data-sort="date">
194+
<th scope="col" data-sort="deadline-date">
195195
Deadline
196196
</th>
197-
<th scope="col" data-sort="date">
197+
<th scope="col" data-sort="closed-date">
198198
Closed
199199
</th>
200200
<th scope="col" data-sort="reviewer">

ietf/templates/liaisons/liaison_table.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<th scope="col" data-sort="date">Date</th>
77
<th scope="col" data-sort="from">From</th>
88
<th scope="col" class="d-none d-sm-table-cell" data-sort="to">To</th>
9-
<th scope="col" class="d-none d-sm-table-cell" data-sort="date">Deadline</th>
9+
<th scope="col" class="d-none d-sm-table-cell" data-sort="deadline-date">Deadline</th>
1010
<th scope="col" data-sort="title">Title</th>
1111
</tr>
1212
</thead>
@@ -36,4 +36,4 @@
3636
{% endfor %}
3737
</tbody>
3838
{% endif %}
39-
</table>
39+
</table>

ietf/templates/meeting/requests.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ <h2 class="mt-5" id="{{ area.grouper.acronym }}">
3030
<thead>
3131
<tr>
3232
<th scope="col" data-sort="group">Group</th>
33-
<th scope="col" data-sort="num">Length</th>
33+
<th scope="col" data-sort="count">Length</th>
3434
<th scope="col" data-sort="num">Size</th>
3535
<th scope="col" class="d-none d-sm-table-cell" data-sort="requester">Requester</th>
3636
<th scope="col" class="d-none d-sm-table-cell" data-sort="ad">AD</th>

ietf/templates/nomcom/private_index.html

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ <h2 class="mt-3">Nomination status</h2>
1313
<tr>
1414
<th scope="col" data-sort="position">Position</th>
1515
<th scope="col" data-sort="open">Open</th>
16-
<th scope="col" data-sort="accepting">Accepting nominations</th>
17-
<th scope="col" data-sort="accepting">Accepting feedback</th>
18-
<th scope="col" data-sort="num">Nominations</th>
19-
<th scope="col" data-sort="num">Unique nominees</th>
20-
<th scope="col" data-sort="num">Accepted</th>
21-
<th scope="col" data-sort="num">Declined</th>
22-
<th scope="col" data-sort="num">Pending</th>
23-
<th scope="col" data-sort="num">Questionnaire responses</th>
24-
<th scope="col" data-sort="num">Comments</th>
16+
<th scope="col" data-sort="accepting-nom-num">Accepting nominations</th>
17+
<th scope="col" data-sort="accepting-fb-num">Accepting feedback</th>
18+
<th scope="col" data-sort="nom-num">Nominations</th>
19+
<th scope="col" data-sort="uniq-num">Unique nominees</th>
20+
<th scope="col" data-sort="acc-num">Accepted</th>
21+
<th scope="col" data-sort="decl-num">Declined</th>
22+
<th scope="col" data-sort="pend-num">Pending</th>
23+
<th scope="col" data-sort="resp-num">Questionnaire responses</th>
24+
<th scope="col" data-sort="comm-num">Comments</th>
2525
</tr>
2626
</thead>
2727
{% if stats %}
@@ -246,4 +246,4 @@ <h2 class="mt-3">
246246
{% endblock %}
247247
{% block js %}
248248
<script src="{% static "ietf/js/list.js" %}"></script>
249-
{% endblock %}
249+
{% endblock %}

ietf/templates/nomcom/view_feedback.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ <h3 class="mt-5" id="declined">Declined each nominated position</h3>
2424
<th scope="col" data-sort="first">First name</th>
2525
<th scope="col" data-sort="last">Last name</th>
2626
<th scope="col" data-sort="email">Email</th>
27-
{% for ft in nominee_feedback_types %}<th scope="col" data-sort="num">{{ ft.name }}</th>{% endfor %}
27+
{% for ft in nominee_feedback_types %}<th scope="col" data-sort="{{ ft.name|slugify }}-num">{{ ft.name }}</th>{% endfor %}
2828
</tr>
2929
</thead>
3030
<tbody>
@@ -61,7 +61,7 @@ <h2 class="mt-5" id="topics">Feedback related to topics</h2>
6161
<thead>
6262
<tr>
6363
<th scope="col" data-sort="topic">Topic</th>
64-
{% for ft in topic_feedback_types %}<th scope="col" data-sort="num">{{ ft.name }}</th>{% endfor %}
64+
{% for ft in topic_feedback_types %}<th scope="col" data-sort="{{ ft.name|slugify }}-num">{{ ft.name }}</th>{% endfor %}
6565
</tr>
6666
</thead>
6767
<tbody>
@@ -88,7 +88,7 @@ <h2 class="mt-5" id="misc">Feedback not related to Nominees</h2>
8888
<thead>
8989
<tr>
9090
<th scope="col"></th>
91-
{% for ft in independent_feedback_types %}<th scope="col" data-sort="num">{{ ft.name }}</th>{% endfor %}
91+
{% for ft in independent_feedback_types %}<th scope="col" data-sort="{{ ft.name|slugify }}-num">{{ ft.name }}</th>{% endfor %}
9292
</tr>
9393
</thead>
9494
<tbody>
@@ -104,4 +104,4 @@ <h2 class="mt-5" id="misc">Feedback not related to Nominees</h2>
104104
{% endblock %}
105105
{% block js %}
106106
<script src="{% static "ietf/js/list.js" %}"></script>
107-
{% endblock %}
107+
{% endblock %}

ietf/templates/person/profile.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ <h2 class="mt-5" id="rfcs">
8585
<th scope="col" data-sort="rfc">RFC</th>
8686
<th scope="col" data-sort="date">Date</th>
8787
<th scope="col" data-sort="title">Title</th>
88-
<th scope="col" data-sort="title">Cited by</th>
88+
<th scope="col" data-sort="citedby">Cited by</th>
8989
</thead>
9090
<tbody>
9191
{% for doc in person.rfcs %}
@@ -172,4 +172,4 @@ <h2 class="mt-5">
172172
});
173173
});
174174
</script>
175-
{% endblock %}
175+
{% endblock %}

ietf/templates/stats/document_stats_author_affiliation.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ <h2>Data</h2>
4545
<thead>
4646
<tr>
4747
<th scope="col" data-sort="affiliation">Affiliation</th>
48-
<th scope="col" data-sort="num">Percentage of authors</th>
49-
<th scope="col" data-sort="num">Authors</th>
48+
<th scope="col" data-sort="percent">Percentage of authors</th>
49+
<th scope="col" data-sort="count">Authors</th>
5050
</tr>
5151
</thead>
5252
{% if table_data %}
@@ -110,4 +110,4 @@ <h2>Affiliation Aliases</h2>
110110
<p>
111111
<a href="{{ show_aliases_url }}" class="btn btn-primary">Show generated aliases</a>
112112
</p>
113-
{% endif %}
113+
{% endif %}

0 commit comments

Comments
 (0)