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: 9 additions & 7 deletions ietf/doc/utils_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def augment_docs_with_related_docs_info(docs):
originalDoc = d.related_that_doc('conflrev')[0]
d.pages = originalDoc.pages

def prepare_document_table(request, docs, query=None, max_results=200):
def prepare_document_table(request, docs, query=None, max_results=200, show_ad_and_shepherd=True):
"""Take a queryset of documents and a QueryDict with sorting info
and return list of documents with attributes filled in for
displaying a full table of information about the documents, plus
Expand Down Expand Up @@ -259,12 +259,14 @@ def num(i):
if len(docs) == max_results:
meta['max'] = max_results

meta['headers'] = [{'title': 'Document', 'key':'document'},
{'title': 'Title', 'key':'title'},
{'title': 'Date', 'key':'date'},
{'title': 'Status', 'key':'status'},
{'title': 'IPR', 'key':'ipr'},
{'title': 'AD / Shepherd', 'key':'ad'}]
meta['headers'] = [{'title': 'Document', 'key': 'document'},
{'title': 'Title', 'key': 'title'},
{'title': 'Date', 'key': 'date'},
{'title': 'Status', 'key': 'status'},
{'title': 'IPR', 'key': 'ipr'}]
if show_ad_and_shepherd:
meta['headers'].append({'title': 'AD / Shepherd', 'key': 'ad'})
meta['show_ad_and_shepherd'] = show_ad_and_shepherd

if query and hasattr(query, "urlencode"): # fed a Django QueryDict
d = query.copy()
Expand Down
7 changes: 4 additions & 3 deletions ietf/doc/views_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -591,9 +591,10 @@ def sort_key(doc):
if not ad:
raise Http404

results, meta = prepare_document_table(request, Document.objects.filter(ad=ad), max_results=500)
results, meta = prepare_document_table(
request, Document.objects.filter(ad=ad), max_results=500, show_ad_and_shepherd=False
)
results.sort(key=lambda d: sort_key(d))
del meta["headers"][-1]

# filter out some results
results = [
Expand Down Expand Up @@ -691,7 +692,7 @@ def sort_key(doc):
{
"docs": results,
"meta": meta,
"ad_name": ad.name,
"ad": ad,
"blocked_docs": blocked_docs,
"not_balloted_docs": not_balloted_docs,
},
Expand Down
10 changes: 5 additions & 5 deletions ietf/templates/doc/drafts_for_ad.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
{% block pagehead %}
<link rel="stylesheet" href="{% static "ietf/css/list.css" %}">
{% endblock %}
{% block title %}Documents for {{ ad_name }}{% endblock %}
{% block title %}Documents for {{ ad.name }}{% endblock %}
{% block content %}
{% origin %}
<h1>Documents for {{ ad_name }}</h1>
<h1>Documents for {{ ad.name }}</h1>
<a class="btn btn-primary my-3" href="{% url 'ietf.doc.views_search.ad_workload' %}">IESG dashboard</a>
{% if blocked_docs %}
<h2 class="mt-4">Blocking positions held by {{ ad_name }}</h2>
<h2 class="mt-4">Blocking positions held by {{ ad.name }}</h2>
<table class="table table-sm table-striped tablesorter">
<thead>
<tr>
Expand Down Expand Up @@ -54,7 +54,7 @@ <h2 class="mt-4">Blocking positions held by {{ ad_name }}</h2>
</table>
{% endif %}
{% if not_balloted_docs %}
<h2 class="mt-4">Missing ballot positions for {{ ad_name }}</h2>
<h2 class="mt-4">Missing ballot positions for {{ ad.name }}</h2>
<table class="table table-sm table-striped tablesorter">
<thead>
<tr>
Expand All @@ -80,7 +80,7 @@ <h2 class="mt-4">Missing ballot positions for {{ ad_name }}</h2>
</tbody>
</table>
{% endif %}
<h2 class="mt-4">Documents for {{ ad_name }}</h2>
<h2 class="mt-4">Documents for {{ ad.name }}</h2>
{% include "doc/search/search_results.html" with start_table=True end_table=True %}
{% endblock %}
{% block js %}
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 @@ -142,7 +142,7 @@
</a>
{% endif %}
</td>
{% if ad_name == None or ad_name != doc.ad.plain_name %}
{% if show_ad_and_shepherd %}
<td class="d-none d-sm-table-cell bg-transparent">
{% if doc.ad %}
{% person_link doc.ad title="Area Director" %}
Expand Down
2 changes: 1 addition & 1 deletion ietf/templates/doc/search/search_results.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
</tbody>
<tbody>
{% for doc in doc_group.list %}
{% include "doc/search/search_result_row.html" %}
{% include "doc/search/search_result_row.html" with show_ad_and_shepherd=meta.show_ad_and_shepherd %}
{% endfor %}
</tbody>
{% endfor %}
Expand Down
2 changes: 1 addition & 1 deletion ietf/templates/iesg/agenda_documents.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ <h2>
</thead>
<tbody>
{% for doc in section.docs %}
{% include "doc/search/search_result_row.html" with color_ad_position=True %}
{% include "doc/search/search_result_row.html" with color_ad_position=True show_ad_and_shepherd=True %}
{% endfor %}
</tbody>
</table>
Expand Down