# HG changeset patch # User Benoît Allard # Date 1412691343 -7200 # Node ID 5583ddcd61645b8a35034f787b3001c788d88bb6 # Parent c6753fb93b3ba12f79ed45e171857f85d41d6072 Unify the edit_note page diff -r c6753fb93b3b -r 5583ddcd6164 farol/templates/common_edits.j2 --- a/farol/templates/common_edits.j2 Tue Oct 07 15:30:22 2014 +0200 +++ b/farol/templates/common_edits.j2 Tue Oct 07 16:15:43 2014 +0200 @@ -23,7 +23,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -#} -{% from "macros.j2" import textinput, examples %} +{% from "macros.j2" import textinput, textarea, selectinput, examples %} {% macro edit_title_type(doctitle, doctype) %} {% call textinput("title", "Document Title", "", doctitle, required=True) %} @@ -36,3 +36,42 @@ {{ examples(['Vulnerability Report', 'Security Bulletin', 'Security Notice']) }} {% endcall %} {% endmacro %} + +{% macro edit_note(types, note, ordinal) %} +

Note is a place to put all manner of text blobs related to the document as a whole. It can be a concise summary of the overall document or a more compartmentalized and area-specific textual discussion. Depending on the need, there can be zero, one, or several Note elements in a given CVRF document. + +

The note should contain a compartmentalized textual discussion constrained by its Type attribute.

+{% call selectinput("type", "Type", types, note and note._type or '') %} +

Type can be one of the following:

+
+
General:
+
A general, high-level note (Title may have more information).
+
Details:
+
A low-level detailed discussion (Title may have more information).
+
Description:
+
A description of something (Title may have more information).
+
Summary:
+
A summary of something (Title may have more information).
+
FAQ:
+
A list of frequently asked questions.
+
Legal Disclaimer:
+
Any possible legal discussion, including constraints, surrounding the document.
+
Other:
+
Something that doesn’t fit (Title should have more information).
+
+{% endcall %} +{% call textinput("ordinal", "Ordinal", "", ordinal or note._ordinal, type="number", required=True, extras={'min': '1'}) %} +

Ordinal is a mandatory, locally significant value used to track notes inside a CVRF document at the root (document) level. It is provided to uniquely identify a Note.

+

There should be one of these values for every Note inside Document Notes, and it is recommended that Ordinal should be instantiated as a monotonically increasing counter, indexed from 1. Each Ordinal that tracks a Note inside Document Notes is completely independent from an Ordinal tracking a Note inside Vulnerability/Notes.

+{% endcall %} +{% call textinput("title", "Title", "", note and note._title or '') %} +

Title should be a concise description of what is contained in the text.

+{% endcall %} +{% call textinput("audience", "Audience", "", note and note._audience or '') %} +

Audience will indicate who is intended to read it.

+{% endcall %} +{% call textarea("note", "Note", "", note and note._note or '', 10, required=True) %} +

Note is a place to put all manner of text blobs related to the document as a whole. It can be a concise summary of the overall document or a more compartmentalized and area-specific textual discussion.

+

The note should contain a compartmentalized textual discussion constrained by its Type attribute.

+{% endcall %} +{% endmacro %} diff -r c6753fb93b3b -r 5583ddcd6164 farol/templates/document/edit_note.j2 --- a/farol/templates/document/edit_note.j2 Tue Oct 07 15:30:22 2014 +0200 +++ b/farol/templates/document/edit_note.j2 Tue Oct 07 16:15:43 2014 +0200 @@ -24,45 +24,14 @@ -#} {% extends "base.j2" %} -{% from "macros.j2" import textinput, textarea, selectinput %} +{% from "common_edits.j2" import edit_note %} + {% block title %}Edit the type{% endblock %} {% block content %}
-{% call selectinput("type", "Type", types, note and note._type or '') %} -

Type can be one of the following:

-
-
General:
-
A general, high-level note (Title may have more information).
-
Details:
-
A low-level detailed discussion (Title may have more information).
-
Description:
-
A description of something (Title may have more information).
-
Summary:
-
A summary of something (Title may have more information).
-
FAQ:
-
A list of frequently asked questions.
-
Legal Disclaimer:
-
Any possible legal discussion, including constraints, surrounding the document.
-
Other:
-
Something that doesn’t fit (Title should have more information).
-
-{% endcall %} -{% call textinput("ordinal", "Ordinal", "", ordinal or note._ordinal, type="number", required=True, extras={'min': '1'}) %} -

Ordinal is a mandatory, locally significant value used to track notes inside a CVRF document at the root (document) level. It is provided to uniquely identify a Note.

-

There should be one of these values for every Note inside Document Notes, and it is recommended that Ordinal should be instantiated as a monotonically increasing counter, indexed from 1. Each Ordinal that tracks a Note inside Document Notes is completely independent from an Ordinal tracking a Note inside Vulnerability/Notes.

-{% endcall %} -{% call textinput("title", "Title", "", note and note._title or '') %} -

Title should be a concise description of what is contained in the text.

-{% endcall %} -{% call textinput("audience", "Audience", "", note and note._audience or '') %} -

Audience will indicate who is intended to read it.

-{% endcall %} -{% call textarea("note", "Note", "", note and note._note or '', 10, required=True) %} -

Note is a place to put all manner of text blobs related to the document as a whole. It can be a concise summary of the overall document or a more compartmentalized and area-specific textual discussion.

-

The note should contain a compartmentalized textual discussion constrained by its Type attribute.

-{% endcall %} + {{ edit_note(types, note, ordinal) }} Cancel diff -r c6753fb93b3b -r 5583ddcd6164 farol/templates/vulnerability/edit_note.j2 --- a/farol/templates/vulnerability/edit_note.j2 Tue Oct 07 15:30:22 2014 +0200 +++ b/farol/templates/vulnerability/edit_note.j2 Tue Oct 07 16:15:43 2014 +0200 @@ -24,7 +24,7 @@ -#} {% extends "base.j2" %} -{% from "macros.j2" import textinput, textarea, selectinput %} +{% from "common_edits.j2" import edit_note %} {% block title %}Edit the type{% endblock %} {% set active = 'vulnerability' %} @@ -32,11 +32,7 @@ {% block content %} -{{ selectinput("type", "Type", types, note and note._type or '') }} -{{ textinput("ordinal", "Ordinal", "", note_ordinal or note._ordinal, type="number", extras={'min': '1'}) }} -{{ textinput("title", "Title", "", note and note._title or '') }} -{{ textinput("audience", "Audience", "", note and note._audience or '') }} -{{ textarea("note", "Note", "", note and note._note or '', 10, required=True) }} + {{ edit_note(types, note, note_ordinal) }} Cancel