diff --git a/ietf/ipr/views.py b/ietf/ipr/views.py index 91a4221c3..224a6e671 100644 --- a/ietf/ipr/views.py +++ b/ietf/ipr/views.py @@ -1,12 +1,19 @@ import re import models import ietf.utils +import django.utils.html import django.newforms as forms from django.shortcuts import render_to_response as render -from django.utils.html import escape, linebreaks +from django.utils.html import escape from ietf.contrib.form_decorator import form_decorator from ietf.utils import log as log +def linebreaks(value): + if value: + return django.utils.html.linebreaks(value) + else: + return value + def default(request): """Default page, with links to sub-pages""" return render("ipr/disclosure.html", {}) @@ -37,25 +44,25 @@ def list(request, template): section_table = { "index": { "index": True }, - "specific": { "index": False, "title": True, + "specific": { "index": False, "title": True, "specific": 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, + "generic": { "index": False, "title": True, "generic": 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, + "third_party": {"index": False, "title": True, "third_party": 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": { "index": False, "title": True, "legacy": 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, @@ -85,8 +92,10 @@ def show(request, ipr_id=None): ipr.discloser_identify = linebreaks(escape(ipr.discloser_identify)) ipr.comments = linebreaks(escape(ipr.comments)) ipr.other_notes = linebreaks(escape(ipr.other_notes)) + ipr.licensing_option = dict(models.LICENSE_CHOICES)[ipr.licensing_option] ipr.selecttype = dict(models.SELECT_CHOICES)[ipr.selecttype] + if ipr.selectowned: ipr.selectowned = dict(models.SELECT_CHOICES)[ipr.selectowned] return render("ipr/details.html", {"ipr": ipr, "section_list": section_list}) @@ -103,9 +112,9 @@ def new(request, type): # define callback methods for special field cases. def ipr_detail_form_callback(field, **kwargs): if field.name == "licensing_option": - return forms.IntegerField(widget=forms.RadioSelect(choices=models.LICENSE_CHOICES)) + return forms.IntegerField(widget=forms.RadioSelect(choices=models.LICENSE_CHOICES), required=False) if field.name in ["selecttype", "selectowned"]: - return forms.IntegerField(widget=forms.RadioSelect(choices=((1, "YES"), (2, "NO")))) + return forms.IntegerField(widget=forms.RadioSelect(choices=((1, "YES"), (2, "NO"))), required=False) return field.formfield(**kwargs) def ipr_contact_form_callback(field, **kwargs): @@ -181,12 +190,10 @@ def new(request, type): data = request.POST.copy() if "ietf_contact_is_submitter" in data: for subfield in ["name", "title", "department", "address1", "address2", "telephone", "fax", "email"]: - log("Fixing subfield subm_%s ..."%subfield) try: data["subm_%s"%subfield] = data["ietf_%s"%subfield] - log("Set to %s"%data["ietf_%s"%subfield]) except Exception, e: - log("Caught exception: %s"%e) + #log("Caught exception: %s"%e) pass form = IprForm(data) if form.ietf_contact_is_submitter: @@ -194,8 +201,11 @@ def new(request, type): if form.is_valid(): #instance = form.save() #return HttpResponseRedirect("/ipr/ipr-%s" % instance.ipr_id) - return HttpResponseRedirect("/ipr/") + #return HttpResponseRedirect("/ipr/") + pass else: + for error in form.errors: + log("Form error: %s"%error) # Fall through, and let the partially bound form, with error # indications, be rendered again. pass diff --git a/ietf/templates/base.html b/ietf/templates/base.html index 43c358cbc..5da143e42 100644 --- a/ietf/templates/base.html +++ b/ietf/templates/base.html @@ -3,7 +3,7 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> {% block title %}IETF Data{% endblock %} - WCF -
+
diff --git a/ietf/templates/ipr/details.html b/ietf/templates/ipr/details.html index 9f6954df6..56bb036af 100644 --- a/ietf/templates/ipr/details.html +++ b/ietf/templates/ipr/details.html @@ -1,5 +1,6 @@ {% extends "base.html" %} {% block title %}IPR Details{% endblock %} +{% block body_attributes %}onload="toggle_submitter_info()"{% endblock %} {% block content %} {% include "ipr/style.html" %} @@ -133,7 +134,19 @@ {% endif %} - + {% if ipr.errors %} +
+ {% for error in ipr.errors %} + + + + {% endfor %} +
+
    +
  • {{ error }}
  • +
+
+ {% endif %} {% if section_list.holder %} @@ -255,6 +268,12 @@ application?: {{ ipr.selecttype }} + {% if section_list.generic %} + + C. Does this disclosure apply to all IPR owned by + the submitter?: {{ ipr.selectowned }} + + {% else %} C. If an Internet-Draft or RFC includes multiple parts and it is not @@ -270,6 +289,7 @@ {% else %} No information submitted {% endif %} + {% endif %} {% else %} This disclosure relates to an unpublished pending patent application. {% endif %} @@ -318,6 +338,7 @@ {% if ipr.lic_checkbox %} + {% ifnotequal ipr.lic_checkbox 1 %}{{ ipr.lic_checkbox }}{% endifnotequal %} The individual submitting this template represents and warrants that all terms and conditions that must be satisfied for implementers of any covered IETF specification to obtain a license have been disclosed in this @@ -352,7 +373,7 @@ Same as in Section III above: - + {% endif %} diff --git a/ietf/templates/ipr/style.html b/ietf/templates/ipr/style.html index 7d29eef1a..526c33fc1 100644 --- a/ietf/templates/ipr/style.html +++ b/ietf/templates/ipr/style.html @@ -27,7 +27,8 @@