diff --git a/ietf/doc/utils_search.py b/ietf/doc/utils_search.py index 5a6a43a63..8e89139e3 100644 --- a/ietf/doc/utils_search.py +++ b/ietf/doc/utils_search.py @@ -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 @@ -259,12 +259,14 @@ def prepare_document_table(request, docs, query=None, max_results=200): 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() diff --git a/ietf/doc/views_search.py b/ietf/doc/views_search.py index 0117886f7..28be793a1 100644 --- a/ietf/doc/views_search.py +++ b/ietf/doc/views_search.py @@ -591,9 +591,10 @@ def docs_for_ad(request, name): 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 = [ @@ -691,7 +692,7 @@ def docs_for_ad(request, name): { "docs": results, "meta": meta, - "ad_name": ad.name, + "ad": ad, "blocked_docs": blocked_docs, "not_balloted_docs": not_balloted_docs, }, diff --git a/ietf/templates/doc/drafts_for_ad.html b/ietf/templates/doc/drafts_for_ad.html index 28ebb2225..18e5960e8 100644 --- a/ietf/templates/doc/drafts_for_ad.html +++ b/ietf/templates/doc/drafts_for_ad.html @@ -6,13 +6,13 @@ {% block pagehead %} {% endblock %} -{% block title %}Documents for {{ ad_name }}{% endblock %} +{% block title %}Documents for {{ ad.name }}{% endblock %} {% block content %} {% origin %} -

Documents for {{ ad_name }}

+

Documents for {{ ad.name }}

IESG dashboard {% if blocked_docs %} -

Blocking positions held by {{ ad_name }}

+

Blocking positions held by {{ ad.name }}

@@ -54,7 +54,7 @@
{% endif %} {% if not_balloted_docs %} -

Missing ballot positions for {{ ad_name }}

+

Missing ballot positions for {{ ad.name }}

@@ -80,7 +80,7 @@
{% endif %} -

Documents for {{ ad_name }}

+

Documents for {{ ad.name }}

{% include "doc/search/search_results.html" with start_table=True end_table=True %} {% endblock %} {% block js %} diff --git a/ietf/templates/doc/search/search_result_row.html b/ietf/templates/doc/search/search_result_row.html index 57ad1f01a..c27315346 100644 --- a/ietf/templates/doc/search/search_result_row.html +++ b/ietf/templates/doc/search/search_result_row.html @@ -142,7 +142,7 @@ {% endif %} - {% if ad_name == None or ad_name != doc.ad.plain_name %} + {% if show_ad_and_shepherd %} {% if doc.ad %} {% person_link doc.ad title="Area Director" %} diff --git a/ietf/templates/doc/search/search_results.html b/ietf/templates/doc/search/search_results.html index 7a1e149a5..bd6b072f0 100644 --- a/ietf/templates/doc/search/search_results.html +++ b/ietf/templates/doc/search/search_results.html @@ -55,7 +55,7 @@ {% 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 %} {% endfor %} diff --git a/ietf/templates/iesg/agenda_documents.html b/ietf/templates/iesg/agenda_documents.html index c388c16ba..80dd9956f 100644 --- a/ietf/templates/iesg/agenda_documents.html +++ b/ietf/templates/iesg/agenda_documents.html @@ -55,7 +55,7 @@ {% 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 %}