IPR Form display now works with the same template as data display.

Using some more logic in views.py, less in the templated.

 * Some tweaks in FormattingForm rendering.
 * Selection of which sections to show is now table driven in views.py
 * Some minor refactoring and cleanup in views.py
 * Some more form subclassing in ipr/views.py in order to support form
   validation.
 * Removed style information from ipr/details.html template, and added
   ipr/style.html
 * Cleanup of details.html
 * Fixed ipr/formfield.html to display error messages, and with the right
   class.
 - Legacy-Id: 105
This commit is contained in:
Henrik Levkowetz 2007-05-06 19:18:17 +00:00
parent 68d4a58fa7
commit e8980df65f
6 changed files with 265 additions and 147 deletions

View file

@ -7,7 +7,7 @@ urlpatterns = patterns('',
(r'^ipr-(?P<ipr_id>\d+)/$', views.show),
(r'^update/$', views.updatelist),
(r'^update/(?P<ipr_id>\d+)/$', views.update),
(r'^new-(?P<type>(specific|generic|thirdpty))/$', views.new),
(r'^new-(?P<type>(specific|generic|third_party))/$', views.new),
)
queryset = models.IprDetail.objects.all()

View file

@ -1,6 +1,7 @@
import models
from django.shortcuts import render_to_response as render
import django.newforms as forms
from django.utils.html import escape, linebreaks
import ietf.utils
import syslog
@ -30,31 +31,60 @@ def list(request, template):
'thirdpty_disclosures': thirdpty_disclosures.order_by(* ['-submitted_date', ] ),
} )
# Details views
section_table = {
"index": { "index": True },
"specific": { "index": False, "title": True,
"legacy_intro": False, "new_intro": True, "form_intro": False,
"holder": True, "holder_contact": True, "ietf_contact": True,
"ietf_doc": True, "patent_info": True, "licensing": True,
"submitter": True, "notes": True, "form_submit": False,
},
"generic": { "index": False, "title": True,
"legacy_intro": False, "new_intro": True, "form_intro": False,
"holder": True, "holder_contact": True, "ietf_contact": False,
"ietf_doc": False, "patent_info": True, "licensing": True,
"submitter": True, "notes": True, "form_submit": False,
},
"third_party": {"index": False, "title": True,
"legacy_intro": False, "new_intro": True, "form_intro": False,
"holder": True, "holder_contact": False, "ietf_contact": True,
"ietf_doc": True, "patent_info": True, "licensing": False,
"submitter": False, "notes": False, "form_submit": False,
},
"legacy": { "index": False, "title": True,
"legacy_intro": True, "new_intro": False, "form_intro": False,
"holder": True, "holder_contact": True, "ietf_contact": False,
"ietf_doc": True, "patent_info": False, "licensing": False,
"submitter": False, "notes": False, "form_submit": False,
},
}
def show(request, ipr_id=None):
"""Show a specific IPR disclosure"""
assert ipr_id != None
ipr = models.IprDetail.objects.filter(ipr_id=ipr_id)[0]
ipr.disclosure_type = get_disclosure_type(ipr)
try:
ipr.holder_contact = ipr.contact.filter(contact_type=1)[0]
except IndexError:
ipr.holder_contact = ""
try:
ipr.ietf_contact = ipr.contact.filter(contact_type=2)[0]
except IndexError:
ipr.ietf_contact = ""
try:
ipr.submitter = ipr.contact.filter(contact_type=3)[0]
except IndexError:
ipr.submitter = ""
section_list = get_section_list(ipr)
contacts = ipr.contact.all()
for contact in contacts:
if contact.contact_type == 1:
ipr.holder_contact = contact
elif contact.contact_type == 2:
ipr.ietf_contact = contact
elif contact.contact_type == 3:
ipr.submitter = contact
else:
raise KeyError("Unexpected contact_type in ipr_contacts: ipr_id=%s" % ipr.ipr_id)
# do escaping and line-breaking here instead of in the template,
# so that we can use the template for the form display, too.
ipr.p_notes = linebreaks(escape(ipr.p_notes))
ipr.discloser_identify = linebreaks(escape(ipr.discloser_identify))
ipr.comments = linebreaks(escape(ipr.comments))
ipr.other_notes = linebreaks(escape(ipr.other_notes))
if ipr.generic:
return render("ipr/details_generic.html", {"ipr": ipr})
if ipr.third_party:
return render("ipr/details_thirdpty.html", {"ipr": ipr})
else:
return render("ipr/details_specific.html", {"ipr": ipr})
return render("ipr/details.html", {"ipr": ipr, "section_list": section_list})
def update(request, ipr_id=None):
"""Update a specific IPR disclosure"""
@ -65,34 +95,55 @@ def new(request, type):
"""Make a new IPR disclosure"""
debug = ""
# CustomForm = mk_formatting_form(format="%(errors)s%(field)s%(help_text)s")
CustomForm = ietf.utils.makeFormattingForm(template="ipr/formfield.html")
BaseIprForm = forms.form_for_model(models.IprDetail, form=CustomForm, formfield_callback=detail_field_fixup)
ContactForm = forms.form_for_model(models.IprContact, form=CustomForm)
BaseContactForm = forms.form_for_model(models.IprContact, form=CustomForm)
section_list = section_table[type]
section_list.update({"title":False, "new_intro":False, "form_intro":True, "form_submit":True, })
# Some subclassing:
class MultiformWidget(forms.Widget):
def value_from_datadict(self, data, name):
return data
class ContactForm(BaseContactForm):
widget = MultiformWidget()
def add_prefix(self, field_name):
return self.prefix and ('%s_%s' % (self.prefix, field_name)) or field_name
def clean(self, *value):
if value:
return self.full_clean()
else:
return self.clean_data
class IprForm(BaseIprForm):
holder_contact = None
rfclist = forms.CharField(required=False)
draftlist = forms.CharField(required=False)
stdonly_license = forms.BooleanField(required=False)
def __init__(self, *args, **kw):
self.base_fields["holder_contact"] = ContactForm(prefix="ph", *args, **kw)
# syslog.syslog("IprForm.__init__: holder_contact: %s" % repr(self.base_fields["holder_contact"]))
self.base_fields["ietf_contact"] = ContactForm(prefix="ietf", *args, **kw)
self.base_fields["submitter"] = ContactForm(prefix="sub", *args, **kw)
for contact in ["holder_contact", "ietf_contact", "submitter"]:
if contact in section_list:
self.base_fields[contact] = ContactForm(prefix=contact[:4], *args, **kw)
BaseIprForm.__init__(self, *args, **kw)
if request.method == 'POST':
form = IprForm(request.POST)
if form.is_valid():
form.save()
#instance = form.save()
#return HttpResponseRedirect("/ipr/ipr-%s" % instance.ipr_id)
return HttpResponseRedirect("/ipr/")
else:
# Fall through, and let the partially bound form, with error
# indications, be rendered again.
pass
else:
form = IprForm()
form.unbound_form = True
return render("ipr/new_%s.html" % type, {"ipr": form, "debug": ""})
return render("ipr/details.html", {"ipr": form, "section_list":section_list, "debug": ""})
def detail_field_fixup(field):
if field.name == "licensing_option":
@ -108,7 +159,18 @@ def get_disclosure_type(ipr):
if ipr.generic:
assert not ipr.third_party
return "Generic"
if ipr.third_party:
elif ipr.third_party:
return "Third Party"
else:
return "Specific"
def get_section_list(ipr):
if ipr.old_ipr_url:
return section_table["legacy"]
elif ipr.generic:
assert not ipr.third_party
return section_table["generic"]
elif ipr.third_party:
return section_table["third_party"]
else:
return section_table["specific"]

View file

@ -2,37 +2,10 @@
{% block title %}IPR Details{% endblock %}
{% block content %}
<style type="text/css">
.ipr { width: 101ex; }
.even { }
.odd { }
.even td,th { background: #eee; color: #000; font-family: Arial, sans-serif; font-size: small; text-align: left; vertical-align: top; }
.odd td,th { background: #eed; color: #000; font-family: Arial, sans-serif; font-size: small; text-align: left; vertical-align: top; }
.even tr:first-child th { background: #aaa; color: #336; font-family: Arial, sans-serif; font-size: small; text-align: left; font-weight: bold; }
.odd tr:first-child th { background: #cca; color: #336; font-family: Arial, sans-serif; font-size: small; text-align: left; font-weight: bold; }
table.ipr {
padding:2px;
border-width:1px;
border-style:solid;
border-color:305076;
}
.ipr th { border: 0px; margin: 0px; padding: 4px; }
.ipr td { border: 0px; margin: 0px; padding: 4px; }
td.fixwidth { width: 14ex; }
td.inset{ padding-left: 14ex; }
.ipr ul { padding-left: -2ex; list-style-type: none; }
h4.ipr { text-align: center; }
input { width: 72ex; font-family: sans-serif; font-size: 11pt; font-weight: normal; }
input[type="radio"] { width: auto; }
input[type="checkbox"] { width: auto; }
input[type="submit"] { width: auto; }
textarea { width: 72ex; height: 5em; font-family: sans-serif; font-size: 11pt; font-weight: normal; }
.required { color: red; }
.errorlist { background: red; padding: 0 0 0 2px; border: 0px; margin: 0px; }
</style>
{% include "ipr/style.html" %}
{% block top_info %}
<blockquote style="margin-bottom: 0px;">
{% if section_list.title %}
<table cellpadding=0 cellspacing=0 border=0>
<tr>
<td width="720" align="center">
@ -41,7 +14,8 @@
</tr>
</table>
<hr />
{% if ipr.old_ipr_url %}
{% endif %}
{% if section_list.legacy_intro %}
<font size="3">
This IPR disclosure was submitted by e-mail.<br>
{% if not ipr.comply %}
@ -55,57 +29,114 @@
Additional information may be available in the original submission.<br>
See the <a href="{{ ipr.old_ipr_url }}">content of the original IPR disclosure</a>.<br>
</font>
{% else %}
{% endif %}
{% if section_list.new_intro %}
<font size="3"> Only those sections of the "Patent Disclosure and Licensing Declaration
Template for {{ ipr.disclosure_type }} IPR Disclosures" where the submitter provided
information are displayed.</font><br>
{% endif %}
{% if section_list.new_intro or section_list.legacy_intro %}
{% if ipr.additional_old_title1 %}
<font size="3"><a href="{{ ipr.additional_old_url1 }}">{{ ipr.additional_old_title1 }}</a></font><br>
{% endif %}
{% if ipr.additional_old_title1 %}
<font size="3"><a href="{{ ipr.additional_old_url1 }}">{{ ipr.additional_old_title1 }}</a></font><br>
{% if ipr.additional_old_title2 %}
<font size="3"><a href="{{ ipr.additional_old_url2 }}">{{ ipr.additional_old_title2 }}</a></font><br>
{% endif %}
{% for item in ipr.updates.all %}
<font size="3">
<br>
This IPR disclosure updates IPR disclosure ID #{{ item.updated.ipr_id }},
{% ifequal item.status_to_be 1 %}
"<a href="{% url ietf.ipr.views.show item.updated.ipr_id %}">{{ item.updated.document_title }}</a>".
{% else %}
"{{ item.updated.document_title }}", which was removed at the request of the submitter.
{% endifequal %}
<br>
</font>
{% endfor %}
{% for item in ipr.updated_by.all %}
{% ifequal item.processed 1 %}
<font size="3">
<br>
This IPR disclosure has been updated by IPR disclosure ID #{{ item.ipr.ipr_id }},
{% ifequal item.status_to_be 1 %}
"<a href="{% url ietf.ipr.views.show item.ipr.ipr_id %}">{{ item.ipr.document_title }}</a>".
{% else %}
"{{ item.ipr.document_title }}", which was removed at the request of the submitter.
{% endifequal %}
<br>
</font>
{% endifequal %}
{% endfor %}
<br>
Click <a href="{% url ietf.ipr.views.update ipr.ipr_id %}">here</a> to update this IPR disclosure<br>
<!-- tag 1 -->
<br>
<font size="3"><strong>Submitted Date: {{ ipr.submitted_date|date:"F j, Y" }}</strong></font>
{% endif %}
{% if ipr.additional_old_title2 %}
<font size="3"><a href="{{ ipr.additional_old_url2 }}">{{ ipr.additional_old_title2 }}</a></font><br>
{% if section_list.index %}
<p>
The IETF takes no position regarding the validity or scope of any
intellectual property rights or other rights that might be claimed to
pertain to the implementation or use of the technology described in any IETF documents or the extent to
which any license under such rights might or might not be available; nor does it represent that it has made any independent effort to identify any such rights.
</p>
<p>
There are 3 different IPR disclosures that can be made:
</p>
<p>
<img src="http://www.ietf.org/images/blue.gif" hspace="3" border="0" />
"Specific": <a href="{% url ietf.ipr.views.new_specific %}">A disclosure about your IPR related to a specific IETF contribution</a>
</p>
<p>
<img src="http://www.ietf.org/images/blue.gif" hspace="3" border="0" />
"Generic": <a href="{% url ietf.ipr.views.new_generic %}">An IPR disclosure about your IPR that is not related to a specific IETF contribution</a>
</p>
<p>
<img src="http://www.ietf.org/images/blue.gif" hspace="3" border="0" />
"Third-Party": <a href="{% url ietf.ipr.views.new_thirdpty %}">Notify the IETF of IPR other than your own which you believe may be related to a specific IETF contribution</a>
</p>
{% endif %}
{% if section_list.form_intro %}
<h4 class="ipr">The Patent Disclosure and Licensing Declaration Template for {{ ipr.disclosure_type }} IPR Disclosures</h4>
<p class="ipr">
This document is an IETF IPR Disclosure and Licensing Declaration
Template and is submitted to inform the IETF of a) patent or patent
application information regarding the IETF document or contribution
listed in Section IV, and b) an IPR Holder's intention with respect to
the licensing of its necessary patent claims. No actual license is
implied by submission of this template. Please complete and submit a
separate template for each IETF document or contribution to which the
disclosed patent information relates.
</p>
<p class="ipr">
If you wish to submit your IPR disclosure by e-mail, then please send
it to <a href="mailto:ietf-ipr@ietf.org">ietf-ipr@ietf.org</a>.
Submissions made by e-mail that do not comply with the formal
requirements of Section 6, "IPR Disclosures," of <a
href="http://www.ietf.org/rfc/rfc3979.txt?number=3979">RFC 3979</a>,
"Intellectual Property Rights in IETF Technology," will be posted, but
will be marked as "non-compliant."
</p>
<hr />
<form method="post">
{% endif %}
{% for item in ipr.updates.all %}
<font size="3">
<br>
This IPR disclosure updates IPR disclosure ID #{{ item.updated.ipr_id }},
{% ifequal item.status_to_be 1 %}
"<a href="{% url ietf.ipr.views.show item.updated.ipr_id %}">{{ item.updated.document_title }}</a>".
{% else %}
"{{ item.updated.document_title }}", which was removed at the request of the submitter.
{% endifequal %}
<br>
</font>
{% endfor %}
{% for item in ipr.updated_by.all %}
{% ifequal item.processed 1 %}
<font size="3">
<br>
This IPR disclosure has been updated by IPR disclosure ID #{{ item.ipr.ipr_id }},
{% ifequal item.status_to_be 1 %}
"<a href="{% url ietf.ipr.views.show item.ipr.ipr_id %}">{{ item.ipr.document_title }}</a>".
{% else %}
"{{ item.ipr.document_title }}", which was removed at the request of the submitter.
{% endifequal %}
<br>
</font>
{% endifequal %}
{% endfor %}
<br>
Click <a href="{% url ietf.ipr.views.update ipr.ipr_id %}">here</a> to update this IPR disclosure<br>
<!-- tag 1 -->
<br>
<font size="3"><strong>Submitted Date: {{ ipr.submitted_date|date:"F j, Y" }}</strong></font>
</blockquote>
{% endblock %}
{% block section1 %}
{% if section_list.holder %}
<blockquote class="{% cycle odd,even as parity %}" style="margin-top: 0px; ">
<table border="0" cellpadding="0" cellspacing="0" class="ipr">
<tr>
@ -122,10 +153,10 @@
</tr>
</table>
</blockquote>
{% endblock %}
{% endif %}
{% block section2 %}
{% if section_list.holder_contact %}
<blockquote class="{% cycle parity %}">
<table border="0" cellpadding="0" cellspacing="0" class="ipr person">
<tr><th colspan="2" >
@ -133,22 +164,20 @@
Patent Holder's Contact for License Application
</th>
</tr>
{% block section2_data %}
<tr><td class="fixwidth">Name:</td> <td><b>{{ ipr.holder_contact.name }}</b></td></tr>
<tr><td class="fixwidth">Title:</td> <td><b>{{ ipr.holder_contact.title }}</b></td></tr>
<tr><td class="fixwidth">Department:</td> <td><b>{{ ipr.holder_contact.department }}</b></td></tr>
<tr><td class="fixwidth">Address1:</td> <td><b>{{ ipr.holder_contact.address1 }}</b></td></tr>
<tr><td class="fixwidth">Address2:</td> <td><b>{{ ipr.holder_contact.address2 }}</b></td></tr>
<tr><td class="fixwidth">Address1:</td> <td><b>{{ ipr.holder_contact.address1 }}</b></td></tr>
<tr><td class="fixwidth">Address2:</td> <td><b>{{ ipr.holder_contact.address2 }}</b></td></tr>
<tr><td class="fixwidth">Telephone:</td> <td><b>{{ ipr.holder_contact.telephone }}</b></td></tr>
<tr><td class="fixwidth">Fax:</td> <td><b>{{ ipr.holder_contact.fax }}</b></td></tr>
<tr><td class="fixwidth">Email:</td> <td><b>{{ ipr.holder_contact.email }}</b></td></tr>
{% endblock %}
</table>
</blockquote>
{% endblock %}
{% endif %}
{% block section3 %}
{% if section_list.ietf_contact %}
<blockquote class="{% cycle parity %}">
<table border="0" cellpadding="0" cellspacing="0" class="ipr person">
<tr>
@ -157,26 +186,24 @@
Contact Information for the IETF Participant Whose Personal Belief Triggered this Disclosure:
</th>
</tr>
{% block section3_data %}
{% if not ipr.is_bound or ipr.ietf_contact.name %}
{% if ipr.ietf_contact.name %}
<tr><td class="fixwidth">Name:</td> <td><b>{{ ipr.ietf_contact.name }}</b></td></tr>
<tr><td class="fixwidth">Title:</td> <td><b>{{ ipr.ietf_contact.title }}</b></td></tr>
<tr><td class="fixwidth">Department:</td> <td><b>{{ ipr.ietf_contact.department }}</b></td></tr>
<tr><td class="fixwidth">Address1:</td> <td><b>{{ ipr.ietf_contact.address1 }}</b></td></tr>
<tr><td class="fixwidth">Address2:</td> <td><b>{{ ipr.ietf_contact.address2 }}</b></td></tr>
<tr><td class="fixwidth">Address1:</td> <td><b>{{ ipr.ietf_contact.address1 }}</b></td></tr>
<tr><td class="fixwidth">Address2:</td> <td><b>{{ ipr.ietf_contact.address2 }}</b></td></tr>
<tr><td class="fixwidth">Telephone:</td> <td><b>{{ ipr.ietf_contact.telephone }}</b></td></tr>
<tr><td class="fixwidth">Fax:</td> <td><b>{{ ipr.ietf_contact.fax }}</b></td></tr>
<tr><td class="fixwidth">Email:</td> <td><b>{{ ipr.ietf_contact.email }}</b></td></tr>
{% else %}
<tr><td colspan="2"><i>No information submitted</td></tr>
{% endif %}
{% endblock %}
</table>
</blockquote>
{% endblock %}
{% endif %}
{% block section4 %}
{% if section_list.ietf_doc %}
<blockquote class="{% cycle parity %}">
<table border="0" cellpadding="0" cellspacing="0" class="ipr">
<tr>
@ -199,9 +226,9 @@
{% endblock %}
</table>
</blockquote>
{% endblock %}
{% endif %}
{% block section5 %}
{% if section_list.patent_info %}
<blockquote class="{% cycle parity %}">
<table border="0" cellpadding="0" cellspacing="0" class="ipr">
<tr>
@ -211,25 +238,23 @@
applications required to be disclosed by Section 6 of RFC 3979)
</th>
</tr>
{% block section5_data %}
{% if ipr.p_applications or ipr.p_notes %}
<tr>
<td colspan="2"><i>
A. For granted patents or published pending patent applications,
please provide the following information:</i></td>
</tr>
<tr><td>Patent, Serial, Publication, Registration,
or Application/File number(s):</td><td><b>{{ ipr.p_applications }}</b></td></tr>
<tr><td>Date(s) granted or applied for: </td><td><b>{{ ipr.date_applied }}</b></td></tr>
<tr><td>Country: </td><td><b>{{ ipr.country }}</b></td></tr>
<tr><td>Additional Notes: </td><td><b>{{ ipr.p_notes|escape|linebreaks }}</b></td></tr>
<tr><td width="28%">Patent, Serial, Publication, Registration,
or Application/File number(s): </td><td><b>{{ ipr.p_applications }}</b></td></tr>
<tr><td>Date(s) granted or applied for: </td><td><b>{{ ipr.date_applied }}</b></td></tr>
<tr><td>Country: </td><td><b>{{ ipr.country }}</b></td></tr>
<tr><td>Additional Notes: </td><td><b>{{ ipr.p_notes }}</b></td></tr>
<tr>
<td colspan="2"><i>
B. Does this disclosure relate to an unpublished pending patent
application?: </i>
<b>{{ ipr.get_selecttype_display }}</b>
</tr>
{% block clause5c %}
<tr>
<td colspan="2"><i>
C. If an Internet-Draft or RFC includes multiple parts and it is not
@ -241,21 +266,19 @@
</td>
</tr>
{% if ipr.discloser_identify %}
<tr><td colspan="2" class="inset"><b>{{ ipr.discloser_identify|escape|linebreaks }}</b></td></tr>
<tr><td class="fixwidth"></td><td><b>{{ ipr.discloser_identify }}</b></td></tr>
{% else %}
<tr><td colspan="2" class="inset"></span><i>No information submitted</i></td></tr>
<tr><td class="fixwidth"></td><td></span><i>No information submitted</i></td></tr>
{% endif %}
{% endblock %}
{% else %}
<tr><td class="fixwidth"></td><td><b>This disclosure relates to an unpublished pending patent application.</b></td></tr>
{% endif %}
{% endblock %}
</table>
</blockquote>
{% endblock %}
{% endif %}
{% block section6 %}
{% if section_list.licensing %}
<!-- Not to be shown for third-party disclosures -->
<blockquote class="{% cycle parity %}">
<table border="0" cellpadding="0" cellspacing="0" class="ipr">
@ -274,7 +297,6 @@
specification, is as follows(select one licensing declaration option only):</i>
</td>
</tr>
{% block section6_data %}
<tr>
<td> </td><td>
<b>{{ ipr.get_licensing_option_display }}<br/>
@ -289,11 +311,10 @@
</td>
</tr>
{% if ipr.comments %}
<tr><td class="fixwidth"> </td><td><b>{{ ipr.comments|escape|linebreaks }}</b></td></tr>
<tr><td class="fixwidth"> </td><td><b>{{ ipr.comments }}</b></td></tr>
{% else %}
<tr><td class="fixwidth"> </td><td><i>No information submitted</i></td></tr>
{% endif %}
{% if ipr.lic_checkbox %}
<tr>
<td colspan="2">
@ -304,7 +325,6 @@
</td>
</tr>
{% endif %}
{% endblock %}
<tr>
<td colspan="2">
<b><i>Note: The individual submitting this template represents and warrants
@ -314,10 +334,10 @@
</tr>
</table>
</blockquote>
{% endblock %}
{% endif %}
{% block section7 %}
{% if section_list.submitter %}
<blockquote class="{% cycle parity %}">
<table border="0" cellpadding="0" cellspacing="0" class="ipr person">
<tr>
@ -327,7 +347,6 @@
IETF Participant in Section III above)
</th>
</tr>
{% block section7_data %}
{% if ipr.submitter.name %}
<tr><td class="fixwidth">Name:</td> <td><b>{{ ipr.submitter.name }}</b></td></tr>
<tr><td class="fixwidth">Title:</td> <td><b>{{ ipr.submitter.title }}</b></td></tr>
@ -340,13 +359,12 @@
{% else %}
<tr><td colspan="2"><i>No information submitted</td></tr>
{% endif %}
{% endblock %}
</table>
</blockquote>
{% endblock %}
{% endif %}
{% block section8 %}
{% if section_list.notes %}
<blockquote class="{% cycle parity %}">
<table border="0" cellpadding="0" cellspacing="0" class="ipr">
<tr>
@ -355,19 +373,25 @@
Other Notes:
</th>
</tr>
{% block section8_data %}
{% if ipr.other_notes %}
<tr><td> </td><td><b>{{ ipr.other_notes|escape|linebreaks }}</b></td></tr>
<tr><td class="fixwidth"> </td><td><b>{{ ipr.other_notes }}</b></td></tr>
{% else %}
<tr><td colspan="2"><i>No information submitted</i></td></tr>
{% endif %}
{% endblock %}
</table>
</blockquote>
{% endblock %}
{% endif %}
{% if section_list.form_submit %}
<center><input type="submit" name="submit" value="Submit"></center>
</form>
<blockquote>
<hr>
<img src="http://www.ietf.org/images/blue.gif" hspace="3" border="0"><a href="./ipr_disclosure.cgi">IPR Disclosure Page</a><br>
<img src="http://www.ietf.org/images/blue.gif" hspace="3" border="0"><a href="./ipr_list.cgi">View IPR Disclosures</a><br><br>
</blockquote>
{% endif %}
{{ debug }}
{% block bot_info %}
{% endblock %}
{% endblock %}

View file

@ -1,7 +1,7 @@
{% if errors %}
<ul>
<ul class="errorlist">
{% for error in errors %}
<li>{{ errorr }}</li>
<li>{{ error }}</li>
{% endfor %}
</ul>
{% endif %}

View file

@ -0,0 +1,27 @@
<style type="text/css">
.ipr { width: 101ex; }
.even { }
.odd { }
.even td,th { background: #eee; color: #000; font-family: Arial, sans-serif; font-size: small; text-align: left; vertical-align: top; }
.odd td,th { background: #eed; color: #000; font-family: Arial, sans-serif; font-size: small; text-align: left; vertical-align: top; }
.even tr:first-child th { background: #aaa; color: #336; font-family: Arial, sans-serif; font-size: small; text-align: left; font-weight: bold; }
.odd tr:first-child th { background: #cca; color: #336; font-family: Arial, sans-serif; font-size: small; text-align: left; font-weight: bold; }
table.ipr {
padding:2px;
border-width:1px;
border-style:solid;
border-color:305076;
}
.ipr th { border: 0px; margin: 0px; padding: 4px; }
.ipr td { border: 0px; margin: 0px; padding: 4px; }
td.fixwidth { width: 14ex; }
.ipr ul { padding-left: -2ex; list-style-type: none; }
h4.ipr { text-align: center; }
input { width: 72ex; font-family: sans-serif; font-size: 11pt; font-weight: normal; }
input[type="radio"] { width: auto; }
input[type="checkbox"] { width: auto; }
input[type="submit"] { width: auto; }
textarea { width: 72ex; height: 5em; font-family: sans-serif; font-size: 11pt; font-weight: normal; }
.required { color: red; }
.errorlist { background: red; padding: 0 0 0 2px; border: 0px; margin: 0px; }
</style>

View file

@ -1,4 +1,6 @@
import operator
import syslog
from django.utils.html import escape
# look at snippets 59, 148, 99 for newforms helpers
# http://www.djangosnippets.org/snippets/59/
@ -255,6 +257,7 @@ def makeFormattingForm(template=None):
_template = template
def __getitem__(self, name):
"Returns a BoundField with the given name."
#syslog.syslog("FormattingForm.__getitem__(%s)" % (name, ))
try:
field = self.fields[name]
except KeyError:
@ -262,5 +265,7 @@ def makeFormattingForm(template=None):
if not isinstance(field, forms.fields.Field):
return field
bf = forms.forms.BoundField(self, field, name)
return loader.render_to_string(self._template, { "errors": bf.errors, "label": bf.label, "field": unicode(bf), "help_text": field.help_text })
errors = [escape(error) for error in bf.errors]
rendering = loader.render_to_string(self._template, { "errors": errors, "label": bf.label, "field": unicode(bf), "help_text": field.help_text })
return rendering
return FormattingForm