IETF 78 Sprint code from Peter Musgrave: Add related documents section to the wg documents page (e.g., /wg/sipclf/).

- Legacy-Id: 2414
This commit is contained in:
Henrik Levkowetz 2010-07-24 17:32:43 +00:00
parent ee3c38d0d2
commit fdab931d2c
2 changed files with 28 additions and 1 deletions

View file

@ -50,5 +50,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
{% endfor %}
</table>
{% regroup docs_related by view_sort_group as grouped_docs_related %}
<table class="ietf-table ietf-doctable" style="margin-top:16px;">
<tr><th class="doc">Related Documents</th><th class="title">Title</th><th class="date">Date</th><th class="status" colspan="2">Status</th><th class="ad">Area Director</th></tr>
{% for doc_group in grouped_docs_related %}
<tr class="header"><td colspan="6">{{doc_group.grouper}}s</td></tr>
{% for doc in doc_group.list %}
{% include "idrfc/search_result_row.html" %}
{% endfor %}
{% endfor %}
</table>
{% endblock wg_content %}

View file

@ -37,6 +37,7 @@ from django.shortcuts import get_object_or_404, render_to_response
from django.template import RequestContext, loader
from django.http import HttpResponse
from ietf.idrfc.views_search import SearchForm, search_query
from ietf.idrfc.idrfc_wrapper import IdRfcWrapper
def wg_summary_acronym(request):
areas = Area.active_areas()
@ -67,7 +68,19 @@ def wg_documents(request, acronym):
if not form.is_valid():
raise ValueError("form did not validate")
(docs,meta) = search_query(form.cleaned_data)
return render_to_response('wginfo/wg_documents.html', {'wg': wg, 'concluded':concluded, 'selected':'documents', 'docs':docs, 'meta':meta}, RequestContext(request))
# get the related docs
form_related = SearchForm({'by':'group', 'name':'-'+str(wg.group_acronym.acronym)+'-', 'activeDrafts':'on'})
if not form_related.is_valid():
raise ValueError("form_related did not validate")
(docs_related,meta_related) = search_query(form_related.cleaned_data)
docs_related_pruned = []
for d in docs_related:
if d.id.draft_name_and_revision().count('-ietf-') == 0:
docs_related_pruned.append(d)
return render_to_response('wginfo/wg_documents.html', {'wg': wg, 'concluded':concluded, 'selected':'documents', 'docs':docs, 'meta':meta,
'docs_related':docs_related_pruned, 'meta_related':meta_related}, RequestContext(request))
def wg_charter(request, acronym):
wg = get_object_or_404(IETFWG, group_acronym__acronym=acronym, group_type=1)