From 06c254abe852d85d2e77739de1b7bb897ca553ad Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Sat, 6 Nov 2010 08:51:32 +0000 Subject: [PATCH] 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 --- ietf/idrfc/idrfc_wrapper.py | 16 ++++++++- ietf/templates/idrfc/by_ad.html | 4 +-- ietf/templates/idrfc/ipr_column.html | 36 +++++++++++++++++++++ ietf/templates/idrfc/search_result_row.html | 1 + ietf/templates/idrfc/search_results.html | 4 +-- ietf/templates/wginfo/wg_documents.html | 8 ++--- ietf/wginfo/views.py | 4 ++- static/css/base2.css | 1 + 8 files changed, 64 insertions(+), 10 deletions(-) create mode 100644 ietf/templates/idrfc/ipr_column.html diff --git a/ietf/idrfc/idrfc_wrapper.py b/ietf/idrfc/idrfc_wrapper.py index a9764e32a..a92eec86e 100644 --- a/ietf/idrfc/idrfc_wrapper.py +++ b/ietf/idrfc/idrfc_wrapper.py @@ -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 diff --git a/ietf/templates/idrfc/by_ad.html b/ietf/templates/idrfc/by_ad.html index 7b5cbdda0..1af0105f1 100644 --- a/ietf/templates/idrfc/by_ad.html +++ b/ietf/templates/idrfc/by_ad.html @@ -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 %} - + {% for doc_group in grouped_docs %} - + {% for doc in doc_group.list %} {% include "idrfc/search_result_row.html" %} diff --git a/ietf/templates/idrfc/ipr_column.html b/ietf/templates/idrfc/ipr_column.html new file mode 100644 index 000000000..c26f0b895 --- /dev/null +++ b/ietf/templates/idrfc/ipr_column.html @@ -0,0 +1,36 @@ +{% comment %} +Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +All rights reserved. Contact: Pasi Eronen + +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 %} diff --git a/ietf/templates/idrfc/search_result_row.html b/ietf/templates/idrfc/search_result_row.html index 779de317c..17e4eea45 100644 --- a/ietf/templates/idrfc/search_result_row.html +++ b/ietf/templates/idrfc/search_result_row.html @@ -44,6 +44,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. {% include "idrfc/date_column.html" %} {% include "idrfc/status_columns.html" %} +{% include "idrfc/ipr_column.html" %} {# #} diff --git a/ietf/templates/idrfc/search_results.html b/ietf/templates/idrfc/search_results.html index ad9c7bae9..f0b8daf71 100644 --- a/ietf/templates/idrfc/search_results.html +++ b/ietf/templates/idrfc/search_results.html @@ -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 %}
DocumentTitleDateStatusArea Director
DocumentTitleDateStatusiprArea Director
{{doc_group.grouper}}s
{{doc_group.grouper}}s
+{% if doc.iprCount %} {{ doc.iprCount }} {% endif %} +{{ doc.title }}{% if doc.ad_name %}{{ doc.ad_name }}{% else %} {% endif %}{{ doc.ad_name|default:"" }}
- + {% for doc_group in grouped_docs %} - + {% for doc in doc_group.list %} {% include "idrfc/search_result_row.html" %} diff --git a/ietf/templates/wginfo/wg_documents.html b/ietf/templates/wginfo/wg_documents.html index 8b35f4973..8a9928a62 100644 --- a/ietf/templates/wginfo/wg_documents.html +++ b/ietf/templates/wginfo/wg_documents.html @@ -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 %}
DocumentTitleDateStatusArea Director
DocumentTitleDateStatusiprArea Director
{{doc_group.grouper}}s
{{doc_group.grouper}}s
- + {% for doc_group in grouped_docs %} - + {% 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 %}
DocumentTitleDateStatusArea Director
DocumentTitleDateStatusiprArea Director
{{doc_group.grouper}}s
{{doc_group.grouper}}s
- + {% for doc_group in grouped_docs_related %} - + {% for doc in doc_group.list %} {% include "idrfc/search_result_row.html" %} diff --git a/ietf/wginfo/views.py b/ietf/wginfo/views.py index f0eb152cb..64ec4af57 100644 --- a/ietf/wginfo/views.py +++ b/ietf/wginfo/views.py @@ -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)) diff --git a/static/css/base2.css b/static/css/base2.css index 96cecb3c7..f7c840c3d 100644 --- a/static/css/base2.css +++ b/static/css/base2.css @@ -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; }
Related DocumentsTitleDateStatusArea Director
Related DocumentsTitleDateStatusiprArea Director
{{doc_group.grouper}}s
{{doc_group.grouper}}s