Skip to content

Commit 53c0d22

Browse files
author
Peter Musgrave
committed
Add column IPR to doc table for WG docs and by AD docs
- Legacy-Id: 2608
1 parent e1134da commit 53c0d22

7 files changed

Lines changed: 62 additions & 8 deletions

File tree

peter/ietf/idrfc/idrfc_wrapper.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232

3333
from ietf.idtracker.models import InternetDraft, IDInternal, BallotInfo, IESGDiscuss, IESGLogin, DocumentComment, Acronym
3434
from ietf.idrfc.models import RfcEditorQueue
35+
from ietf.ipr.models import IprRfc, IprDraft, IprDetail
36+
3537
import re
3638
from datetime import date
3739
from django.utils import simplejson as json
@@ -484,11 +486,23 @@ def state_change_notice_to(self):
484486
class IdRfcWrapper:
485487
rfc = None
486488
id = None
489+
iprCount = None
490+
iprUrl = None
487491

488492
def __init__(self, id, rfc):
489493
self.id = id
490494
self.rfc = rfc
491-
495+
if id:
496+
iprs = IprDraft.objects.filter(document=self.id.tracker_id)
497+
self.iprUrl = "../../ipr/search?option=document_search&id_document_tag=" + str(self.id.tracker_id)
498+
elif rfc:
499+
iprs = IprRfc.objects.filter(rfc_number=self.rfc.rfc_number)
500+
self.iprUrl = "../../ipr/search?option=rfc_search&rfc_search=" + str(elf.rfc.rfc_number)
501+
else:
502+
raise ValueError("Construction with null id and rfc")
503+
# iprs is a list of docs which contain IPR
504+
self.iprCount = len(iprs)
505+
492506
def title(self):
493507
if self.rfc:
494508
return self.rfc.title

peter/ietf/templates/idrfc/by_ad.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ <h1>Internet-Drafts and RFCs for {{ ad_name }}</h1>
4141
{% regroup docs by view_sort_group as grouped_docs %}
4242

4343
<table class="ietf-table ietf-doctable">
44-
<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>
44+
<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>
4545
{% for doc_group in grouped_docs %}
46-
<tr class="header"><td colspan="6">{{doc_group.grouper}}s</td></tr>
46+
<tr class="header"><td colspan="7">{{doc_group.grouper}}s</td></tr>
4747

4848
{% for doc in doc_group.list %}
4949
{% include "idrfc/search_result_row.html" %}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{% comment %}
2+
Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
3+
All rights reserved. Contact: Pasi Eronen <pasi.eronen@nokia.com>
4+
5+
Redistribution and use in source and binary forms, with or without
6+
modification, are permitted provided that the following conditions
7+
are met:
8+
9+
* Redistributions of source code must retain the above copyright
10+
notice, this list of conditions and the following disclaimer.
11+
12+
* Redistributions in binary form must reproduce the above
13+
copyright notice, this list of conditions and the following
14+
disclaimer in the documentation and/or other materials provided
15+
with the distribution.
16+
17+
* Neither the name of the Nokia Corporation and/or its
18+
subsidiary(-ies) nor the names of its contributors may be used
19+
to endorse or promote products derived from this software
20+
without specific prior written permission.
21+
22+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33+
{% endcomment %}
34+
{% load ietf_filters %}<td class="ipr">
35+
{% if doc.iprCount %}<a href="{{ doc.iprUrl }}" rel="nofollow"> {{ doc.iprCount }} </a>{% endif %}
36+
</td>

peter/ietf/templates/idrfc/search_result_row.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
<td class="title">{{ doc.title }}</td>
4545
{% include "idrfc/date_column.html" %}
4646
{% include "idrfc/status_columns.html" %}
47+
{% include "idrfc/ipr_column.html" %}
4748
{# <td class="ad">{% if doc.ad_name %}{{ doc.ad_name }}{% else %}&nbsp;{% endif %}</td> #}
4849
<td class="ad">{{ doc.ad_name|default:"" }}</td>
4950

peter/ietf/templates/wginfo/wg_documents.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@
3939
{% regroup docs by view_sort_group as grouped_docs %}
4040

4141
<table class="ietf-table ietf-doctable" style="margin-top:16px;">
42-
<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>
42+
<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>
4343
{% for doc_group in grouped_docs %}
44-
<tr class="header"><td colspan="6">{{doc_group.grouper}}s</td></tr>
44+
<tr class="header"><td colspan="7">{{doc_group.grouper}}s</td></tr>
4545

4646
{% for doc in doc_group.list %}
4747
{% include "idrfc/search_result_row.html" %}
@@ -53,9 +53,9 @@
5353
{% regroup docs_related by view_sort_group as grouped_docs_related %}
5454

5555
<table class="ietf-table ietf-doctable" style="margin-top:16px;">
56-
<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>
56+
<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>
5757
{% for doc_group in grouped_docs_related %}
58-
<tr class="header"><td colspan="6">{{doc_group.grouper}}s</td></tr>
58+
<tr class="header"><td colspan="7">{{doc_group.grouper}}s</td></tr>
5959

6060
{% for doc in doc_group.list %}
6161
{% include "idrfc/search_result_row.html" %}

peter/ietf/wginfo/views.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
from django.http import HttpResponse
3939
from ietf.idrfc.views_search import SearchForm, search_query
4040
from ietf.idrfc.idrfc_wrapper import IdRfcWrapper
41+
from ietf.ipr.models import IprDetail
42+
4143

4244
def wg_summary_acronym(request):
4345
areas = Area.active_areas()
@@ -81,7 +83,7 @@ def wg_documents(request, acronym):
8183
if ( len(parts) >= 3):
8284
if parts[1] != "ietf" and parts[2].startswith(wg.group_acronym.acronym+"-"):
8385
docs_related_pruned.append(d)
84-
86+
8587
return render_to_response('wginfo/wg_documents.html', {'wg': wg, 'concluded':concluded, 'selected':'documents', 'docs':docs, 'meta':meta,
8688
'docs_related':docs_related_pruned, 'meta_related':meta_related}, RequestContext(request))
8789

peter/static/css/base2.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ table.ietf-table { border-collapse:collapse; border:1px solid #7f7f7f; }
104104
.ietf-doctable th.title, .ietf-doctable td.title { min-width: 20em; max-width: 35em; }
105105
.ietf-doctable th.date, .ietf-doctable td.date { white-space:nowrap; min-width: 6em;}
106106
.ietf-doctable th.status, .ietf-doctable td.status { min-width: 20em;}
107+
.ietf-doctable th.ipr, .ietf-doctable td.status { font-variant: small-caps; }
107108
.ietf-doctable th.ad, .ietf-doctable td.ad { white-space:nowrap; min-width: 6em; }
108109
.ietf-doctable td.ballot { border-left: hidden; min-width: 37px; }
109110

0 commit comments

Comments
 (0)