changeset 57:4ac1dd522998

Unify the edit_acknowledgment pages
author Benoît Allard <benoit.allard@greenbone.net>
date Wed, 08 Oct 2014 10:22:14 +0200
parents e6da0705a47c
children fbc413b8a46e
files farol/templates/common_edits.j2 farol/templates/document/edit_acknowledgment.j2 farol/templates/vulnerability/edit_acknowledgment.j2
diffstat 3 files changed, 25 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/farol/templates/common_edits.j2	Wed Oct 08 10:08:05 2014 +0200
+++ b/farol/templates/common_edits.j2	Wed Oct 08 10:22:14 2014 +0200
@@ -95,3 +95,22 @@
 <p><strong>Description</strong> is a descriptive title or the name of the reference.</p>
 {% endcall %}
 {% endmacro %}
+
+{% macro edit_acknowledgment(name, organization, description, url) %}
+<p><strong>Acknowledgment</strong> contains recognition of external parties that reported noncritical/low-severity security issues or provided information, observations, or suggestions that contributed to improved security or improved documentation in future releases of the document producer's products. This may also contain recognition to external parties that contributed toward producing this document.</p>
+<p>This element indicates collaboration with the security community in a positive fashion and is an important part of a notice or advisory. Care should be taken to ensure that individuals would like to be acknowledged before they are included.</p>
+
+{% call textinput("name", "Names", "", name, help="Multiple names should be comma-separated.") %}
+<p>The <strong>Name</strong> should contain the name of the party being acknowledged.</p>
+{% endcall %}
+{% call textinput("organization", "Organizations", "", organization, help="Multiple organizations should be comma-separated.") %}
+<p>The <strong>Organization</strong> should contain the organization of the party or if the <strong>Name</strong> is omitted, the organization itself that is being acknowledged.</p>
+{% endcall %}
+{% call textarea("description", "Description", "", description, 5) %}
+<p>The <strong>Description</strong> can contain any contextual details the document producers wish to make known about the acknowledgment or acknowledged parties.</p>
+{{ examples (['Vendor X would like to thank [Name 3] from [OrgName] for reporting this issue.', 'Vendor  X would like to thank the following researchers for their contributions to making this project more secure:  [Name 1], [Name 2], [Name 3]']) }}
+{% endcall %}
+{% call textinput("url", "URL", "http://...", url, type="url") %}
+<p><strong>URL</strong> is the optional URL to the person, place, or thing being acknowledged.</p>
+{% endcall %}
+{% endmacro %}
--- a/farol/templates/document/edit_acknowledgment.j2	Wed Oct 08 10:08:05 2014 +0200
+++ b/farol/templates/document/edit_acknowledgment.j2	Wed Oct 08 10:22:14 2014 +0200
@@ -24,25 +24,13 @@
 -#}
 
 {% extends "base.j2" %}
-{% from "macros.j2" import textinput, selectinput %}
-{% block title %}Edit the title{% endblock %}
+{% from "common_edits.j2" import edit_acknowledgment %}
+{% block title %}Edit an Acknowledgment{% endblock %}
 
 {% block content %}
-<p><strong>Acknowledgment</strong> contains recognition of external parties that reported noncritical/low-severity security issues or provided information, observations, or suggestions that contributed to improved security or improved documentation in future releases of the document producer's products. This may also contain recognition to external parties that contributed toward producing this document.</p>
 <form role="form" method="POST">
 
-{% call textinput("name", "Name", "", name) %}
-<p>The <strong>Name</strong> should contain the name of the party being acknowledged.</p>
-{% endcall %}
-{% call textinput("organization", "Organization", "", organization) %}
-<p>The <strong>Organization</strong> should contain the organization of the party or if the <strong>Name</strong> is omitted, the organization itself that is being acknowledged.</p>
-{% endcall %}
-{% call textinput("description", "Description", "", description) %}
-<p>The <strong>Description</strong> can contain any contextual details the document producers wish to make known about the acknowledgment or acknowledged parties.</p>
-{% endcall %}
-{% call textinput("url", "URL", "http://...", url, type="url") %}
-<p><strong>URL</strong> is the optional URL to the person, place, or thing being acknowledged.</p>
-{% endcall %}
+  {{ edit_acknowledgment(name, organization, description, url) }}
 
 <button class="btn btn-primary" type="submit">{{ action }}</button>
 <a class="btn btn-danger" href="{{ url_for('.view') }}">Cancel</a>
--- a/farol/templates/vulnerability/edit_acknowledgment.j2	Wed Oct 08 10:08:05 2014 +0200
+++ b/farol/templates/vulnerability/edit_acknowledgment.j2	Wed Oct 08 10:22:14 2014 +0200
@@ -24,18 +24,15 @@
 -#}
 
 {% extends "base.j2" %}
-{% from "macros.j2" import textinput, selectinput %}
-{% block title %}Edit the title{% endblock %}
+{% from "common_edits.j2" import edit_acknowledgment %}
+{% block title %}Edit an Acknowledgment{% endblock %}
 
 {% set active = 'vulnerability' %}
 
 {% block content %}
 <form role="form" method="POST">
 
-{{ textinput("name", "Name", "", name) }}
-{{ textinput("organization", "Organization", "", organization) }}
-{{ textinput("description", "Description", "", description) }}
-{{ textinput("url", "URL", "http://...", url, type="url") }}
+  {{ edit_acknowledgment(name, organization, description, url) }}
 
 <button class="btn btn-primary" type="submit">{{ action }}</button>
 <a class="btn btn-danger" href="{{ url_for('.view', ordinal=ordinal) }}">Cancel</a>

http://farol.wald.intevation.org