File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,11 +29,11 @@ def iprs_from_docs(aliases,**kwargs):
2929 iprdocrels += alias .document .ipr (** kwargs )
3030 return list (set ([i .disclosure for i in iprdocrels ]))
3131
32- def related_docs (alias ):
32+ def related_docs (alias , relationship = [ 'replaces' , 'obs' ] ):
3333 """Returns list of related documents"""
3434 results = list (alias .document .docalias_set .all ())
3535
36- rels = alias .document .all_relations_that_doc ([ 'replaces' , 'obs' ] )
36+ rels = alias .document .all_relations_that_doc (relationship )
3737
3838 for rel in rels :
3939 rel_aliases = list (rel .target .document .docalias_set .all ())
@@ -42,4 +42,6 @@ def related_docs(alias):
4242 x .related = rel
4343 x .relation = rel .relationship .revname
4444 results += rel_aliases
45- return list (set (results ))
45+ return list (set (results ))
46+
47+
Original file line number Diff line number Diff line change @@ -619,7 +619,8 @@ def search(request):
619619 docid = request .GET .get ("id" ) or request .GET .get ("id_document_tag" ) or ""
620620 docs = doc = None
621621 iprs = []
622-
622+ related_iprs = []
623+
623624 # set states
624625 states = request .GET .getlist ('state' ,('posted' ,'removed' ))
625626 if states == ['all' ]:
@@ -647,10 +648,12 @@ def search(request):
647648 # one match
648649 if len (start ) == 1 :
649650 first = start [0 ]
650- doc = str ( first )
651+ doc = first . document
651652 docs = related_docs (first )
652653 iprs = iprs_from_docs (docs ,states = states )
653654 template = "ipr/search_doc_result.html"
655+ updated_docs = related_docs (first , ['updates' ,])
656+ related_iprs = list (set (iprs_from_docs (updated_docs , states = states )) - set (iprs ))
654657 # multiple matches, select just one
655658 elif start :
656659 docs = start
@@ -723,11 +726,12 @@ def search(request):
723726
724727 return render (request , template , {
725728 "q" : q ,
726- "iprs" : iprs ,
727- "docs" : docs ,
728- "doc" : doc ,
729- "form" :form ,
730- "states" :states
729+ "iprs" : iprs ,
730+ "docs" : docs ,
731+ "doc" : doc ,
732+ "form" : form ,
733+ "states" : states ,
734+ "related_iprs" : related_iprs ,
731735 })
732736
733737 return HttpResponseRedirect (request .path )
Original file line number Diff line number Diff line change 88< link rel ="stylesheet " href ="{% static "jquery.tablesorter /css/theme.bootstrap.min.css" %}">
99{% endblock %}
1010
11- {% block search_header %}Draft search results{% endblock %}
11+ {% block search_header %}Document IPR search results < small > for {{doc}} </ small > {% endblock %}
1212
1313{% block search_result %}
1414 < p class ="alert alert-info "> Total number of IPR disclosures found: < b > {{ iprs|length }}</ b > .</ p >
3535 {% endfor %}
3636 </ tbody >
3737 </ table >
38+ {% if related_iprs %}
39+ < p >
40+ < i > IPR declarations exist for related documents, < a href ="#related "> see below</ a > .
41+ These cannot be assumed to apply to the current document without closer inspection.</ i >
42+ </ p >
43+ {% endif %}
3844 {% endif %}
3945
4046 < p class ="alert alert-info "> Total number of documents searched: < b > {{ docs|length}}</ b > .</ p >
8591 {% endfor %}
8692 </ table >
8793
94+ {% if related_iprs %}
95+ < p class ="alert alert-info " id ="related "> Total number of possibly related IPR disclosures found: < b > {{ related_iprs|length }}</ b > .</ p >
96+
97+ < table class ="table table-condensed table-striped tablesorter ">
98+ < thead >
99+ < tr >
100+ < th > Date</ th >
101+ < th > ID</ th >
102+ < th > Statement</ th >
103+ </ tr >
104+ </ thead >
105+
106+ < tbody >
107+ {% for ipr in related_iprs %}
108+ < tr >
109+ < td class ="text-nowrap "> {{ ipr.time|date:"Y-m-d" }}</ td >
110+ < td > {{ ipr.id }}</ td >
111+ < td > < a href ="{% url "ietf.ipr.views.show " id=ipr.id %} "> {{ ipr.title }}</ a >
112+ {% if ipr.updates %} < br /> (Updates ID#: {% for upd in ipr.updates %}{{upd.target_id}}{% if not forloop.last %}, {% endif %}{% endfor %}){% endif %}
113+ </ td >
114+ </ tr >
115+ {% endfor %}
116+ </ tbody >
117+ </ table >
118+ {% endif %}
119+
120+
88121{% endblock %}
89122
90123{% block js %}
91124< script src ="{% static "jquery.tablesorter /js/jquery.tablesorter.combined.min.js" %}"> </ script >
92- {% endblock %}
125+ {% endblock %}
You can’t perform that action at this time.
0 commit comments