Merged [2614] from peter.musgrave@magorcorp.com: Add column IPR to doc table for WG docs and by AD docs. Fix column in doc search results so IPR is shown correctly there too. Fixes issue #497.

- Legacy-Id: 2626
Note: SVN reference [2614] has been migrated to Git commit 6a65978a52dff343754e557dd9d094e4385c6af1
This commit is contained in:
Henrik Levkowetz 2010-11-06 08:51:32 +00:00
parent db9f5886d7
commit 06c254abe8
8 changed files with 64 additions and 10 deletions

View file

@ -32,6 +32,8 @@
from ietf.idtracker.models import InternetDraft, IDInternal, BallotInfo, IESGDiscuss, IESGLogin, DocumentComment, Acronym
from ietf.idrfc.models import RfcEditorQueue
from ietf.ipr.models import IprRfc, IprDraft, IprDetail
import re
from datetime import date
from django.utils import simplejson as json
@ -498,11 +500,23 @@ class IetfProcessData:
class IdRfcWrapper:
rfc = None
id = None
iprCount = None
iprUrl = None
def __init__(self, id, rfc):
self.id = id
self.rfc = rfc
if id:
iprs = IprDraft.objects.filter(document=self.id.tracker_id)
self.iprUrl = "../../ipr/search?option=document_search&id_document_tag=" + str(self.id.tracker_id)
elif rfc:
iprs = IprRfc.objects.filter(rfc_number=self.rfc.rfc_number)
self.iprUrl = "../../ipr/search?option=rfc_search&rfc_search=" + str(elf.rfc.rfc_number)
else:
raise ValueError("Construction with null id and rfc")
# iprs is a list of docs which contain IPR
self.iprCount = len(iprs)
def title(self):
if self.rfc:
return self.rfc.title

View file

@ -41,9 +41,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
{% regroup docs by view_sort_group as grouped_docs %}
<table class="ietf-table ietf-doctable">
<tr><th class="doc">Document</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>
<tr><th class="doc">Document</th><th class="title">Title</th><th class="date">Date</th><th class="status" colspan="2">Status</th><th class="ipr">ipr</th><th class="ad">Area Director</th></tr>
{% for doc_group in grouped_docs %}
<tr class="header"><td colspan="6">{{doc_group.grouper}}s</td></tr>
<tr class="header"><td colspan="7">{{doc_group.grouper}}s</td></tr>
{% for doc in doc_group.list %}
{% include "idrfc/search_result_row.html" %}

View file

@ -0,0 +1,36 @@
{% comment %}
Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
All rights reserved. Contact: Pasi Eronen <pasi.eronen@nokia.com>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of the Nokia Corporation and/or its
subsidiary(-ies) nor the names of its contributors may be used
to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
{% endcomment %}
{% load ietf_filters %}<td class="ipr">
{% if doc.iprCount %}<a href="{{ doc.iprUrl }}" rel="nofollow"> {{ doc.iprCount }} </a>{% endif %}
</td>

View file

@ -44,6 +44,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<td class="title">{{ doc.title }}</td>
{% include "idrfc/date_column.html" %}
{% include "idrfc/status_columns.html" %}
{% include "idrfc/ipr_column.html" %}
{# <td class="ad">{% if doc.ad_name %}{{ doc.ad_name }}{% else %}&nbsp;{% endif %}</td> #}
<td class="ad">{{ doc.ad_name|default:"" }}</td>

View file

@ -40,9 +40,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
{% else %}
{% regroup docs by view_sort_group as grouped_docs %}
<table class="ietf-table ietf-doctable">
<tr><th class="doc">Document</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>
<tr><th class="doc">Document</th><th class="title">Title</th><th class="date">Date</th><th class="status" colspan="2">Status</th><th class="ipr">ipr</th><th class="ad">Area Director</th></tr>
{% for doc_group in grouped_docs %}
<tr class="header"><td colspan="6">{{doc_group.grouper}}s</td></tr>
<tr class="header"><td colspan="7">{{doc_group.grouper}}s</td></tr>
{% for doc in doc_group.list %}
{% include "idrfc/search_result_row.html" %}

View file

@ -39,9 +39,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
{% regroup docs by view_sort_group as grouped_docs %}
<table class="ietf-table ietf-doctable" style="margin-top:16px;">
<tr><th class="doc">Document</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>
<tr><th class="doc">Document</th><th class="title">Title</th><th class="date">Date</th><th class="status" colspan="2">Status</th><th class="ipr">ipr</th><th class="ad">Area Director</th></tr>
{% for doc_group in grouped_docs %}
<tr class="header"><td colspan="6">{{doc_group.grouper}}s</td></tr>
<tr class="header"><td colspan="7">{{doc_group.grouper}}s</td></tr>
{% for doc in doc_group.list %}
{% include "idrfc/search_result_row.html" %}
@ -53,9 +53,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
{% 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>
<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="ipr">ipr</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>
<tr class="header"><td colspan="7">{{doc_group.grouper}}s</td></tr>
{% for doc in doc_group.list %}
{% include "idrfc/search_result_row.html" %}

View file

@ -38,6 +38,8 @@ 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
from ietf.ipr.models import IprDetail
def wg_summary_acronym(request):
areas = Area.active_areas()
@ -81,7 +83,7 @@ def wg_documents(request, acronym):
if ( len(parts) >= 3):
if parts[1] != "ietf" and parts[2].startswith(wg.group_acronym.acronym+"-"):
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))

View file

@ -104,6 +104,7 @@ table.ietf-table { border-collapse:collapse; border:1px solid #7f7f7f; }
.ietf-doctable th.title, .ietf-doctable td.title { min-width: 20em; max-width: 35em; }
.ietf-doctable th.date, .ietf-doctable td.date { white-space:nowrap; min-width: 6em;}
.ietf-doctable th.status, .ietf-doctable td.status { min-width: 20em;}
.ietf-doctable th.ipr, .ietf-doctable td.status { font-variant: small-caps; }
.ietf-doctable th.ad, .ietf-doctable td.ad { white-space:nowrap; min-width: 6em; }
.ietf-doctable td.ballot { border-left: hidden; min-width: 37px; }