annotate farol/templates/document/edit_revision.j2 @ 126:e0830bcab004

Add (optional) regex matching to our input fields
author Benoît Allard <benoit.allard@greenbone.net>
date Thu, 23 Oct 2014 16:32:33 +0200
parents c79082d0d44d
children a7ce1660aaaf
rev   line source
0
4a9f23230eba Initial Release
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
1 {#
4a9f23230eba Initial Release
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
2 # Description:
4a9f23230eba Initial Release
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
3 # Web Template used in Farol Design
4a9f23230eba Initial Release
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
4 #
4a9f23230eba Initial Release
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
5 # Authors:
4a9f23230eba Initial Release
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
6 # Benoît Allard <benoit.allard@greenbone.net>
4a9f23230eba Initial Release
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
7 #
4a9f23230eba Initial Release
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
8 # Copyright:
4a9f23230eba Initial Release
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
9 # Copyright (C) 2014 Greenbone Networks GmbH
4a9f23230eba Initial Release
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
10 #
4a9f23230eba Initial Release
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
11 # This program is free software; you can redistribute it and/or
4a9f23230eba Initial Release
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
12 # modify it under the terms of the GNU General Public License
4a9f23230eba Initial Release
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
13 # as published by the Free Software Foundation; either version 2
4a9f23230eba Initial Release
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
14 # of the License, or (at your option) any later version.
4a9f23230eba Initial Release
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
15 #
4a9f23230eba Initial Release
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
16 # This program is distributed in the hope that it will be useful,
4a9f23230eba Initial Release
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
4a9f23230eba Initial Release
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4a9f23230eba Initial Release
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
19 # GNU General Public License for more details.
4a9f23230eba Initial Release
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
20 #
4a9f23230eba Initial Release
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
21 # You should have received a copy of the GNU General Public License
4a9f23230eba Initial Release
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
22 # along with this program; if not, write to the Free Software
4a9f23230eba Initial Release
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
23 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
4a9f23230eba Initial Release
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
24 -#}
4a9f23230eba Initial Release
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
25
4a9f23230eba Initial Release
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
26 {% extends "base.j2" %}
37
0c726d873c7a Add Description fields for the edit_revision fields
Benoît Allard <benoit.allard@greenbone.net>
parents: 10
diff changeset
27 {% from "macros.j2" import textinput, textarea, examples %}
0
4a9f23230eba Initial Release
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
28 {% block title %}Edit Revision{% endblock %}
4a9f23230eba Initial Release
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
29
4a9f23230eba Initial Release
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
30 {% block content %}
43
c79082d0d44d Add global descriptions about some containers
Benoît Allard <benoit.allard@greenbone.net>
parents: 37
diff changeset
31 <p><strong>Revision</strong> contains all the elements required to track the evolution of a CVRF document. Each change to a CVRF document should be accompanied by <strong>Number</strong>, <strong>Date</strong>, and <strong>Description</strong> elements.</p>
0
4a9f23230eba Initial Release
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
32 <form role="form" method="POST">
126
e0830bcab004 Add (optional) regex matching to our input fields
Benoît Allard <benoit.allard@greenbone.net>
parents: 43
diff changeset
33 {% call textinput("number", "Number", "a.b.c.d", number, required=True, regex='(0|[1-9][0-9]*)(\.(0|[1-9][0-9]*)){0,3}') %}
37
0c726d873c7a Add Description fields for the edit_revision fields
Benoît Allard <benoit.allard@greenbone.net>
parents: 10
diff changeset
34 <p><strong>Number</strong> should contain the numeric version of the document. Like the <strong>Version</strong> element above, it is a numeric tokenized field of the format nn with up to four fields nn.nn.nn.nn. It is recommended that this be a monotonically increasing value. Minor revisions should be used for less-significant changes (for example, <samp>1.0.0.0</samp> to <samp>1.0.0.1</samp>). Major, actionable changes should lead to a major increase of the version number (for example, <samp>1.0</samp> to <samp>2.0</samp>).</p>
0c726d873c7a Add Description fields for the edit_revision fields
Benoît Allard <benoit.allard@greenbone.net>
parents: 10
diff changeset
35 <p>Examples of such changes include:</p>
0c726d873c7a Add Description fields for the edit_revision fields
Benoît Allard <benoit.allard@greenbone.net>
parents: 10
diff changeset
36 <ul>
0c726d873c7a Add Description fields for the edit_revision fields
Benoît Allard <benoit.allard@greenbone.net>
parents: 10
diff changeset
37 <li>Any change to severity or impact</li>
0c726d873c7a Add Description fields for the edit_revision fields
Benoît Allard <benoit.allard@greenbone.net>
parents: 10
diff changeset
38 <li>The announcement of additional vulnerabilities</li>
0c726d873c7a Add Description fields for the edit_revision fields
Benoît Allard <benoit.allard@greenbone.net>
parents: 10
diff changeset
39 <li>The announcement of additional vulnerable products</li>
0c726d873c7a Add Description fields for the edit_revision fields
Benoît Allard <benoit.allard@greenbone.net>
parents: 10
diff changeset
40 <li>A significant change in remediation status</li>
0c726d873c7a Add Description fields for the edit_revision fields
Benoît Allard <benoit.allard@greenbone.net>
parents: 10
diff changeset
41 </ul>
0c726d873c7a Add Description fields for the edit_revision fields
Benoît Allard <benoit.allard@greenbone.net>
parents: 10
diff changeset
42 <p>The most recent <strong>Number</strong> element should <em>always</em> match the <strong>Version</strong> element. It is validated using the following regular expression: <code>(0|[1-9][0-9]*)(\.(0|[1-9][0-9]*)){0,3}</code>.</p>
0c726d873c7a Add Description fields for the edit_revision fields
Benoît Allard <benoit.allard@greenbone.net>
parents: 10
diff changeset
43 {% endcall %}
0c726d873c7a Add Description fields for the edit_revision fields
Benoît Allard <benoit.allard@greenbone.net>
parents: 10
diff changeset
44 {% call textinput("date", "Date", "", date and date.isoformat() or '', required=True, type="datetime") %}
0c726d873c7a Add Description fields for the edit_revision fields
Benoît Allard <benoit.allard@greenbone.net>
parents: 10
diff changeset
45 <p><strong>Date</strong> should record the date the revision was made. All dateTime values in CVRF require a time, and we recommend the inclusion of a time zone as well (ICASI endorses the use of Greenwich mean time [GMT] or Zulu time). If a time zone is excluded, Zulu should be assumed.</p>
0c726d873c7a Add Description fields for the edit_revision fields
Benoît Allard <benoit.allard@greenbone.net>
parents: 10
diff changeset
46 {% endcall %}
0c726d873c7a Add Description fields for the edit_revision fields
Benoît Allard <benoit.allard@greenbone.net>
parents: 10
diff changeset
47 {% call textarea("description", "Description", "", description, 3, required=True) %}
0c726d873c7a Add Description fields for the edit_revision fields
Benoît Allard <benoit.allard@greenbone.net>
parents: 10
diff changeset
48 <p><strong>Description</strong> should be a short description of the changes made. It can describe the conditions that prompted the change or be a short list of the items changed.</p>
0c726d873c7a Add Description fields for the edit_revision fields
Benoît Allard <benoit.allard@greenbone.net>
parents: 10
diff changeset
49 {{ examples(['initial public release']) }}
0c726d873c7a Add Description fields for the edit_revision fields
Benoît Allard <benoit.allard@greenbone.net>
parents: 10
diff changeset
50 {% endcall %}
0
4a9f23230eba Initial Release
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
51 {% if action == 'Add' %}
4a9f23230eba Initial Release
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
52 <div class="form-group">
4a9f23230eba Initial Release
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
53 <div class="checkbox">
4a9f23230eba Initial Release
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
54 <label>
4a9f23230eba Initial Release
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
55 <input name="update_tracking" type="checkbox" checked> Update Tracking Information
4a9f23230eba Initial Release
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
56 </label>
4a9f23230eba Initial Release
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
57 </div>
4a9f23230eba Initial Release
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
58 </div>
4a9f23230eba Initial Release
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
59 {% endif %}
4a9f23230eba Initial Release
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
60 <button class="btn btn-primary" type="submit">{{ action or 'Update' }}</button>
10
6594ff7c37b4 Fix a few links
Benoît Allard <benoit.allard@greenbone.net>
parents: 7
diff changeset
61 <a class="btn btn-danger" href="{{ url_for('.view') }}">Cancel</a>
0
4a9f23230eba Initial Release
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
62 </form>
4a9f23230eba Initial Release
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
63 {% endblock %}

http://farol.wald.intevation.org