changeset 35:537d25b1593c

Add Descriptions to the fields of the edit_publisher page
author Benoît Allard <benoit.allard@greenbone.net>
date Mon, 06 Oct 2014 14:24:25 +0200
parents 22d89f53e34c
children 3b49063d76e0
files farol/templates/document/edit_publisher.j2 farol/templates/macros.j2
diffstat 2 files changed, 43 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/farol/templates/document/edit_publisher.j2	Mon Oct 06 14:09:57 2014 +0200
+++ b/farol/templates/document/edit_publisher.j2	Mon Oct 06 14:24:25 2014 +0200
@@ -24,16 +24,34 @@
 -#}
 
 {% extends "base.j2" %}
-{% from "macros.j2" import textinput, textarea, selectinput %}
+{% from "macros.j2" import textinput, textarea, selectinput, examples %}
 {% block title %}Edit the type{% endblock %}
 
 {% block content %}
 <form role="form" method="POST">
 
-{{ selectinput("type", "Type", types, publisher._type) }}
-{{ textinput("vendorid", "Vendor ID", "", publisher._vendorid or '') }}
-{{ textarea("contact", "Contacts Details", "", publisher._contact or '', 3) }}
-{{ textarea("authority", "Issuing Authority", "", publisher._authority or '', 3) }}
+{% call selectinput("type", "Type", types, publisher._type) %}
+<p>The <strong>Document Publisher</strong> <em>Type</em> attribute is an enumerated list containing an array of different document publisher types. Types include:</p>
+<ul>
+  <li><strong>Vendor</strong>: Developers or maintainers of information system products or services. This includes all authoritative product vendors, Product Security Incident Response Teams (PSIRTs), and product resellers and distributors, including authoritative vendor partners.</li>
+  <li><strong>Discoverer</strong>: Individuals or organizations that find vulnerabilities or security weaknesses. This includes all manner of researchers.</li>
+  <li><strong>Coordinator</strong>: Individuals or organizations that manage a single vendor’s response or multiple vendors’ responses to a vulnerability, a security flaw, or an incident. This includes all Computer Emergency/Incident Response Teams (CERTs/CIRTs) or agents acting on the behalf of a researcher.</li>
+  <li><strong>User</strong>: Everyone using a vendor’s product.</li>
+  <li><strong>Other</strong>: Catchall for everyone else. Currently this includes forwarders, republishers, language translators, and miscellaneous contributors.</li>
+</ul>
+{% endcall %}
+{% call textinput("vendorid", "Vendor ID", "", publisher._vendorid or '') %}
+<p>The optional <em>Vendor ID</em> attribute is a unique identifier (OID) that a vendor uses as issued by FIRST under the auspices of IETF. At the time of this writing, OID is a work in progress.</p>
+{{ examples(['MarcusCom']) }}
+{% endcall %}
+{% call textarea("contact", "Contacts Details", "", publisher._contact or '', 3) %}
+<p><strong>Contact Details</strong> contains information required to contact the document publisher.</p>
+{{ examples(['Name: Captain Sledge Fisthammer<br>Organization: International Space Explorers of America<br>Phone Number: 555-123-4567<br>Fax Number: 555-123-4568<br>Email Address: sledge@foo.com']) }}
+{% endcall %}
+{% call textarea("authority", "Issuing Authority", "", publisher._authority or '', 3) %}
+<p><strong>Issuing Authority</strong> states the name of the issuing party and that party’s authority to release the document. In particular, it addresses the party’s constituency and responsibilities or other obligations. This element should also include instructions for contacting the issuer.</p>
+{{ examples(['The Juniper SIRT (Juniper Networks Security Incident Response Team) is the sole authority regarding vulnerabilities in any Juniper Networks products or services, and coordinates the handling of all aspects of such vulnerabilities from initial discovery or report through public announcements and any subsequent follow-on activities. Additional information is available at http://www.juniper.net/support/security/report_vulnerability.html']) }}
+{% endcall %}
 
 <button class="btn btn-primary" type="submit">Update</button>
 <a class="btn btn-danger" href="{{ url_for('.view') }}">Cancel</a>
--- a/farol/templates/macros.j2	Mon Oct 06 14:09:57 2014 +0200
+++ b/farol/templates/macros.j2	Mon Oct 06 14:24:25 2014 +0200
@@ -78,14 +78,32 @@
 
 {% macro textarea(name, label, placeholder="", value=None, rows=10, required=False) %}
 <div class="form-group">
-  <label for="{{ name }}">{{ label }}:{% if required %}<span class="text-danger"> *</span>{% endif %}</label>
+  {% if caller %}
+    {% set content=caller () %}
+    {% call modal(name + "_modal", label) %}
+      {{ content }}
+    {% endcall %}
+  {% endif %}
+  <label for="{{ name }}">
+    {{ label }}:
+    {% if required %}<span class="text-danger"> *</span>{% endif %}
+    {% if caller %}<a href="#{{ name }}_modal" data-toggle="modal">?</a>{% endif %}
+  </label>
   <textarea class="form-control" rows={{ rows }} id="{{ name }}" name="{{ name }}" placeholder="{{ placeholder }}"{% if required %} required{% endif %}>{% if value %}{{ value }}{% endif %}</textarea>
 </div>
 {% endmacro %}
 
 {% macro selectinput(name, label, choices, value) %}
 <div class="form-group">
-  <label for="{{ name }}">{{ label }}:</label>
+  {% if caller %}
+    {% set content=caller () %}
+    {% call modal(name + "_modal", label) %}
+      {{ content }}
+    {% endcall %}
+  {% endif %}
+  <label for="{{ name }}">{{ label }}:
+    {% if caller %}<a href="#{{ name }}_modal" data-toggle="modal">?</a>{% endif %}
+  </label>
   <select class="form-control" name="{{name}}", id="{{ name }}">
     {% for choice in choices %}<option{% if value==choice %} selected{% endif %}>{{ choice }}</option>{% endfor %}
   </select>

http://farol.wald.intevation.org