Skip to content

Commit 0e2df84

Browse files
evynckerjsparks
andauthored
feat: Sort IESG and IAB Statements Pages with Active Statements at the Top (ietf-tools#9198)
* Use statement.state to sort entries * remove spurious tabs * Uncomment the URL --------- Co-authored-by: Robert Sparks <rjsparks@nostrum.com>
1 parent 5731c94 commit 0e2df84

2 files changed

Lines changed: 15 additions & 6 deletions

File tree

ietf/group/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2201,7 +2201,7 @@ def statements(request, acronym, group_type=None):
22012201
).values_list("state__slug", flat=True)[:1]
22022202
)
22032203
)
2204-
.order_by("-published")
2204+
.order_by("status", "-published")
22052205
)
22062206
return render(
22072207
request,

ietf/templates/group/statements.html

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ <h2 class="my-3">{{group.acronym|upper}} Statements</h2>
1212
{% if request.user|has_role:"Secretariat" %}
1313
<div class="buttonlist">
1414
<a id="start_button"
15-
class="btn btn-primary"
16-
href="{% url 'ietf.doc.views_statement.new_statement' %}">
15+
class="btn btn-primary"
16+
href="{% url 'ietf.doc.views_statement.new_statement' %}">
1717
Start New Statement
1818
</a>
1919
</div>
@@ -25,16 +25,25 @@ <h2 class="my-3">{{group.acronym|upper}} Statements</h2>
2525
<th scope="col" data-sort="statement">Statement</th>
2626
</tr>
2727
</thead>
28+
{% regroup statements by status as grouped_statements %}
29+
{% for statement_group in grouped_statements %}
2830
<tbody>
29-
{% for statement in statements %}
31+
<tr class="table-info">
32+
<th scope="col" colspan="2">
33+
{{ statement_group.grouper|title }} {{"Statement"|plural:statement_group.list }} ({{ statement_group.list|length }} {{"hit"|plural:statement_group.list }})
34+
</th>
35+
</tr>
36+
</tbody>
37+
<tbody>
38+
{% for statement in statement_group.list %}
3039
<tr>
3140
<td title="{{ statement.published|date:'Y-m-d H:i:s O' }}">{{ statement.published|date:"Y-m-d" }}</td>
3241
<td><a href="{% url 'ietf.doc.views_doc.document_main' name=statement.name %}">{{statement.title}}</a>
33-
{% if statement.status == "replaced" %}<span class="badge rounded-pill text-bg-warning">Replaced</span>{% endif %}
3442
</td>
3543
</tr>
36-
{% endfor %}
44+
{% endfor %}
3745
</tbody>
46+
{% endfor %}
3847
</table>
3948
{% endblock %}
4049
{% block js %}

0 commit comments

Comments
 (0)