diff --git a/ietf/ipr/search.py b/ietf/ipr/search.py
index 78bdc9422..fa38dc52a 100644
--- a/ietf/ipr/search.py
+++ b/ietf/ipr/search.py
@@ -2,7 +2,7 @@ import re
import django.utils.html
from django.shortcuts import render_to_response as render
from ietf.idtracker.models import IETFWG, InternetDraft, Rfc
-from ietf.ipr.models import IprRfc, IprDraft
+from ietf.ipr.models import IprRfc, IprDraft, IprDetail
from ietf.ipr.related import related_docs
from ietf.utils import log
@@ -20,6 +20,8 @@ def search(request, type="", q="", id=""):
id = value
if type and q or id:
log("Got query: type=%s, q=%s, id=%s" % (type, q, id))
+
+ # Search by RFC number or draft-identifier
if type in ["document_search", "rfc_search"]:
if type == "document_search":
if q:
@@ -47,20 +49,40 @@ def search(request, type="", q="", id=""):
doc.iprs = disclosures
iprs += disclosures
iprs = list(set(iprs))
- return render("ipr/search_doc_result.html", {"first": first, "iprs": iprs, "docs": docs})
+ return render("ipr/search_doc_result.html", {"q": q, "first": first, "iprs": iprs, "docs": docs})
elif start.count():
- return render("ipr/search_doc_list.html", {"docs": start })
+ return render("ipr/search_doc_list.html", {"q": q, "docs": start })
else:
raise ValueError("Missing or malformed search parameters, or internal error")
+
+ # Search by legal name
elif type == "patent_search":
- pass
+ iprs = IprDetail.objects.filter(legal_name__icontains=q, status__in=[1,3]).order_by("-submitted_date", "-ipr_id")
+ count = iprs.count()
+ iprs = [ ipr for ipr in iprs if not ipr.updated_by.all() ]
+ # Some extra information, to help us render 'and' between the
+ # last two documents in a sequence
+ for ipr in iprs:
+ if ipr.drafts.count():
+ ipr.last_draft = ipr.drafts.all()[int(ipr.drafts.count())-1]
+ if ipr.rfcs.count():
+ ipr.last_rfc = ipr.rfcs.all()[int(ipr.rfcs.count())-1]
+ return render("ipr/search_holder_result.html", {"q": q, "iprs": iprs, "count": count } )
+
+ # Search by content of email or pagent_info field
elif type == "patent_info_search":
pass
+
+ # Search by wg acronym
elif type == "wg_search":
pass
+
+ # Search by rfc and id title
elif type == "title_search":
pass
- elif type == "ip_title_search":
+
+ # Search by title of IPR disclosure
+ elif type == "ipr_title_search":
pass
else:
raise ValueError("Unexpected search type in IPR query: %s" % type)
diff --git a/ietf/ipr/testurl.list b/ietf/ipr/testurl.list
index 48cbc57ea..5df55a4db 100644
--- a/ietf/ipr/testurl.list
+++ b/ietf/ipr/testurl.list
@@ -14,6 +14,8 @@
200,sort /ipr/search/?rfc_search=1034&option=rfc_search https://datatracker.ietf.org/public/ipr_search.cgi?option=rfc_search&rfc_search=1034 # Loong result, RFC search
200 /ipr/search/?rfc_search=4444&option=rfc_search https://datatracker.ietf.org/public/ipr_search.cgi?option=rfc_search&rfc_search=4444 # Empty result, RFC search
200 /ipr/about/ https://datatracker.ietf.org/public/ipr_disclosure.cgi
+200 /ipr/search/?option=patent_search&patent_search=nortel https://datatracker.ietf.org/public/ipr_search.cgi?option=patent_search&patent_search=nortel
+
200 /ipr/2006/
200 /ipr/2006/feb/
200 /ipr/by-date/
diff --git a/ietf/templates/base.html b/ietf/templates/base.html
index 825930d7f..b59f9010c 100644
--- a/ietf/templates/base.html
+++ b/ietf/templates/base.html
@@ -11,7 +11,8 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
{% block css %}{% endblock %}
// -->
-
+
+
diff --git a/ietf/templates/ipr/search.html b/ietf/templates/ipr/search.html
index baca2b496..17ff38de2 100644
--- a/ietf/templates/ipr/search.html
+++ b/ietf/templates/ipr/search.html
@@ -1,7 +1,7 @@
-
-IPR Search Engine
-
-
+{% extends "base.html" %}
+{% block doctype %}{% endblock %}
+{% block title %}IPR Search{% endblock %}
+{% block content %}
Document Search
@@ -108,9 +108,6 @@
-
IPR Disclosure Page
-
-
-
-
-
+
IPR Disclosure Page
+
+{% endblock %}
diff --git a/ietf/templates/ipr/search_doc_result.html b/ietf/templates/ipr/search_doc_result.html
index 87fda89c0..e6677c6c2 100644
--- a/ietf/templates/ipr/search_doc_result.html
+++ b/ietf/templates/ipr/search_doc_result.html
@@ -3,8 +3,6 @@
{% block search_result %}
-
-
Total number of IPR disclosures found: {{ iprs|length }} |
{% for ipr in iprs|dictsort:"submitted_date" %}
diff --git a/ietf/templates/ipr/search_holder_result.html b/ietf/templates/ipr/search_holder_result.html
new file mode 100644
index 000000000..1025ae0f8
--- /dev/null
+++ b/ietf/templates/ipr/search_holder_result.html
@@ -0,0 +1,52 @@
+{% extends "ipr/search_result.html" %}
+{% load ietf_filters %}
+{% block search_result %}
+
+
+ Patent Owner/Applicant Search Result |
+ {% if not iprs %}
+
+ |
+ No IPR disclosures have been submitted by {{ q }} |
+
+ {% else %}
+ Total number of IPR disclosures found: {{ count }} |
+
+ {% for ipr in iprs %}
+
+
+ IPR that was submitted by {{ q }}, and is related to
+ {% for doc in ipr.drafts.all %}
+ {% ifnotequal ipr.drafts.count 1 %}{% ifequal doc ipr.last_draft %} and {% endifequal %}{% endifnotequal %}
+ {{ doc.document }}, "{{ doc.document.title }},"
+ {% endfor %}
+ {% for doc in ipr.rfcs.all %}
+ {% ifnotequal ipr.rfcs.count 1 %}{% ifequal doc ipr.last_rfc %} and {% endifequal %}{% endifnotequal %}
+ {{ doc.document }}, "{{ doc.document.title }},"
+ {% endfor %}
+ |
+
+
+ {{ ipr.submitted_date }} |
+ ID # {{ ipr.ipr_id }} |
+ "{{ ipr.title }}" |
+
+ {% for upd in ipr.updates.all %}
+ {% ifnotequal upd ipr %}
+
+ {{ upd.updated.submitted_date }} |
+ ID # {{ upd.updated.ipr_id }} |
+
+ IPR disclosure ID# {{ ipr.ipr_id }} "{{ ipr.title }}"
+ Updates {{ upd.updated.title }}
+ |
+
+ {% endifnotequal %}
+ {% endfor %}
+
+ {% endfor %}
+
+ {% endif %}
+
+
+{% endblock %}
diff --git a/ietf/templates/ipr/search_result.html b/ietf/templates/ipr/search_result.html
index 0c91bb668..3f9a09b1b 100644
--- a/ietf/templates/ipr/search_result.html
+++ b/ietf/templates/ipr/search_result.html
@@ -1,5 +1,6 @@
-{% extends "base.html"}
+{% extends "base.html" %}
{% block doctype %}{% endblock %}
+{% block title %}IPR Search Result{% endblock %}
{% block content %}
IPR Disclosures