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
9 changes: 8 additions & 1 deletion ietf/group/tests_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

from ietf.community.models import CommunityList
from ietf.community.utils import reset_name_contains_index_for_rule
from ietf.doc.factories import WgDraftFactory, RgDraftFactory, IndividualDraftFactory, CharterFactory, BallotDocEventFactory
from ietf.doc.factories import WgDraftFactory, WgRfcFactory, RgDraftFactory, IndividualDraftFactory, CharterFactory, BallotDocEventFactory
from ietf.doc.models import Document, DocEvent, State
from ietf.doc.storage_utils import retrieve_str
from ietf.doc.utils_charter import charter_name_for_group
Expand Down Expand Up @@ -396,6 +396,7 @@ def test_group_documents(self):
draft7 = WgDraftFactory(group=group)
draft7.set_state(State.objects.get(type='draft', slug='expired'))
draft7.set_state(State.objects.get(type='draft-stream-%s' % draft7.stream_id, slug='dead')) # Expired WG draft, marked as dead
rfc = WgRfcFactory(group=group)

clist = CommunityList.objects.get(group=group)
related_docs_rule = clist.searchrule_set.get(rule_type='name_contains')
Expand Down Expand Up @@ -426,6 +427,12 @@ def test_group_documents(self):
q = PyQuery(r.content)
self.assertTrue(any([draft2.name in x.attrib['href'] for x in q('table td a.track-untrack-doc')]))

# RFC rows must use the RFC number as the sort key so that numeric sort
# is not disrupted by the page-count text that precedes the name in the cell.
# Draft rows must use the document name.
self.assertTrue(q(f'td.doc[data-sort-number="{rfc.rfc_number}"]'))
self.assertTrue(q(f'td.doc[data-sort-number="{draft.name}"]'))

# Let's also check the IRTF stream
rg = GroupFactory(type_id='rg')
setup_default_community_list_for_group(rg)
Expand Down
2 changes: 1 addition & 1 deletion ietf/templates/doc/search/search_result_row.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
</a>
{% endfor %}
</td>
<td class="doc bg-transparent">
<td class="doc bg-transparent" data-sort-number="{% if doc.type_id == "rfc" %}{{ doc.rfc_number }}{% else %}{{ doc.name }}{% endif %}">
{% if doc.pages %}<small class="float-end text-body-secondary d-none d-sm-block">{{ doc.pages }} page{{ doc.pages|pluralize }}</small>{% endif %}
<div>
<a href="{{ doc.get_absolute_url }}">
Expand Down
Loading