# HG changeset patch # User BenoƮt Allard # Date 1412755685 -7200 # Node ID e6da0705a47cc53992a53a7afe2af13fb5500982 # Parent 76cba17794ab7a4351293858054adc363745a35c Unify the edit_reference pages diff -r 76cba17794ab -r e6da0705a47c farol/templates/common_edits.j2 --- a/farol/templates/common_edits.j2 Wed Oct 08 09:57:13 2014 +0200 +++ b/farol/templates/common_edits.j2 Wed Oct 08 10:08:05 2014 +0200 @@ -75,3 +75,23 @@

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

{% endcall %} {% endmacro %} + +{% macro edit_reference(types, _type, url, description) %} +

The Reference container should include references to any conferences, papers, advisories, and other resources that are related and considered to be of value to the document consumer.

+

The Reference element contains a description of a related document. This may include a plaintext or HTML version of the advisory or other related documentation, such as white papers or mitigation documentation.

+{% call selectinput("type", "Type", types, _type) %} +

The Type attribute denotes the type of the document reference relative to the given document. The following types are available:

+
+
External:
+
The default value indicates the reference is external to the document.
+
Self:
+
This indicates the related document is actually a direct reference to itself.
+
+{% endcall %} +{% call textinput("url", "URL", "http://...", url, type="url", required=True) %} +

URL is the fixed URL or location of the reference.

+{% endcall %} +{% call textinput("description", "Description", "", description, required=True) %} +

Description is a descriptive title or the name of the reference.

+{% endcall %} +{% endmacro %} diff -r 76cba17794ab -r e6da0705a47c farol/templates/document/edit_reference.j2 --- a/farol/templates/document/edit_reference.j2 Wed Oct 08 09:57:13 2014 +0200 +++ b/farol/templates/document/edit_reference.j2 Wed Oct 08 10:08:05 2014 +0200 @@ -25,26 +25,13 @@ {% extends "base.j2" %} {% from "macros.j2" import textinput, selectinput %} -{% block title %}Edit the title{% endblock %} +{% from "common_edits.j2" import edit_reference %} +{% block title %}Edit a Reference{% endblock %} {% block content %}
-{% call selectinput("type", "Type", types, _type) %} -

The Type attribute denotes the type of the document reference relative to the given document. The following types are available:

-
-
External:
-
The default value indicates the reference is external to the document.
-
Self:
-
This indicates the related document is actually a direct reference to itself.
-
-{% endcall %} -{% call textinput("url", "URL", "http://...", url, type="url", required=True) %} -

URL is the fixed URL or location of the reference.

-{% endcall %} -{% call textinput("description", "Description", "", description, required=True) %} -

Description is a descriptive title or the name of the reference.

-{% endcall %} + {{ edit_reference(types, _type, url, description) }} Cancel diff -r 76cba17794ab -r e6da0705a47c farol/templates/vulnerability/edit_reference.j2 --- a/farol/templates/vulnerability/edit_reference.j2 Wed Oct 08 09:57:13 2014 +0200 +++ b/farol/templates/vulnerability/edit_reference.j2 Wed Oct 08 10:08:05 2014 +0200 @@ -24,17 +24,14 @@ -#} {% extends "base.j2" %} -{% from "macros.j2" import textinput, selectinput %} -{% block title %}Edit the title{% endblock %} - +{% block title %}Edit a Reference{% endblock %} +{% from "common_edits.j2" import edit_reference %} {% set active = 'vulnerability' %} {% block content %} -{{ selectinput("type", "Type", types, _type) }} -{{ textinput("url", "URL", "http://...", url, type="url") }} -{{ textinput("description", "Description", "", description) }} + {{ edit_reference(types, _type, url, description) }} Cancel