annotate farol/templates/producttree/edit_product.j2 @ 163:1d63a532ccce

Add possibility to create product Tree from the cpe itself.
author Benoît Allard <benoit.allard@greenbone.net>
date Tue, 30 Dec 2014 14:34:21 +0100
parents 086e35c4aee7
children
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" %}
163
1d63a532ccce Add possibility to create product Tree from the cpe itself.
Benoît Allard <benoit.allard@greenbone.net>
parents: 46
diff changeset
27 {% from "macros.j2" import textinput, selectinput2, examples, checkbox %}
0
4a9f23230eba Initial Release
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
28 {% block title %}Edit the product{% 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 {% set active = 'product' %}
4a9f23230eba Initial Release
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
31
4a9f23230eba Initial Release
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
32 {% block content %}
46
086e35c4aee7 Add description fields for edit_product and edit_branch
Benoît Allard <benoit.allard@greenbone.net>
parents: 45
diff changeset
33 <p>The <strong>Full Product Name</strong> elements define the endpoints of the <strong>Product Tree</strong> and occur directly at the root level, at the branch level, or as the result of a relationship between two products.</p><form role="form" method="POST">
0
4a9f23230eba Initial Release
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
34
46
086e35c4aee7 Add description fields for edit_product and edit_branch
Benoît Allard <benoit.allard@greenbone.net>
parents: 45
diff changeset
35 {% call textinput('name', "Product Name", value=product._name, required=True) %}
086e35c4aee7 Add description fields for edit_product and edit_branch
Benoît Allard <benoit.allard@greenbone.net>
parents: 45
diff changeset
36 <p>The value of a <strong>Full Product Name</strong> element should be the products full canonical name, including version number and other attributes, as it would be used in a human-friendly document.</p>
086e35c4aee7 Add description fields for edit_product and edit_branch
Benoît Allard <benoit.allard@greenbone.net>
parents: 45
diff changeset
37 {{ examples(['Microsoft Host Integration Server 2006 Service Pack 1', 'Microsoft Office 2008 for Mac 12.3.1 Update']) }}
086e35c4aee7 Add description fields for edit_product and edit_branch
Benoît Allard <benoit.allard@greenbone.net>
parents: 45
diff changeset
38 {% endcall %}
086e35c4aee7 Add description fields for edit_product and edit_branch
Benoît Allard <benoit.allard@greenbone.net>
parents: 45
diff changeset
39 {% call textinput('productid', "ProductID", placeholder="1234", value=product._productid, required=True) %}
086e35c4aee7 Add description fields for edit_product and edit_branch
Benoît Allard <benoit.allard@greenbone.net>
parents: 45
diff changeset
40 <p>The <em>Product ID</em> attribute is required to identify a <strong>Full Product Name</strong> so that it can be referred to from other parts in the document. There is no predefined or required format for the <em>Product ID</em> as long as it uniquely identifies a product in the context of the current document. Examples include incremental integers or Globally Unique Identifiers (GUIDs).</p>
086e35c4aee7 Add description fields for edit_product and edit_branch
Benoît Allard <benoit.allard@greenbone.net>
parents: 45
diff changeset
41 {{ examples(['CVRFPID-0004']) }}
086e35c4aee7 Add description fields for edit_product and edit_branch
Benoît Allard <benoit.allard@greenbone.net>
parents: 45
diff changeset
42 {% endcall %}
163
1d63a532ccce Add possibility to create product Tree from the cpe itself.
Benoît Allard <benoit.allard@greenbone.net>
parents: 46
diff changeset
43 {% call textinput('cpe', "CPE", placeholder="cpe:...", value=product._cpe) %}
46
086e35c4aee7 Add description fields for edit_product and edit_branch
Benoît Allard <benoit.allard@greenbone.net>
parents: 45
diff changeset
44 <p>The Common Platform Enumeration (<em>CPE</em>) attribute refers to a method for naming platforms. The structure for CPE is described at http://cpe.mitre.org. The <em>CPE</em> can be either an integer (if MITRE has an entry for the platform in question) or a candidate string from the vendor if no MITRE entry yet exists.</p>
086e35c4aee7 Add description fields for edit_product and edit_branch
Benoît Allard <benoit.allard@greenbone.net>
parents: 45
diff changeset
45 {% endcall %}
0
4a9f23230eba Initial Release
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
46 <hr>
4a9f23230eba Initial Release
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
47 {{ selectinput2('parent_branch', "Parent Branch", orphaned_leaves , product.getParentPath()) }}
163
1d63a532ccce Add possibility to create product Tree from the cpe itself.
Benoît Allard <benoit.allard@greenbone.net>
parents: 46
diff changeset
48 <p class="text-center"><em>-- or --</em></p>
0
4a9f23230eba Initial Release
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
49 {{ selectinput2('parent_relationship', "Parent relationship", orphaned_relationships, current_rel) }}
163
1d63a532ccce Add possibility to create product Tree from the cpe itself.
Benoît Allard <benoit.allard@greenbone.net>
parents: 46
diff changeset
50 <p class="text-center"><em>-- or --</em></p>
1d63a532ccce Add possibility to create product Tree from the cpe itself.
Benoît Allard <benoit.allard@greenbone.net>
parents: 46
diff changeset
51 {% if action == "Add" %}
1d63a532ccce Add possibility to create product Tree from the cpe itself.
Benoît Allard <benoit.allard@greenbone.net>
parents: 46
diff changeset
52 {{ checkbox('from_cpe', "Create branches/relation from CPE Value") }}
1d63a532ccce Add possibility to create product Tree from the cpe itself.
Benoît Allard <benoit.allard@greenbone.net>
parents: 46
diff changeset
53 {% endif %}
0
4a9f23230eba Initial Release
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
54
4a9f23230eba Initial Release
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
55 <button class="btn btn-primary" type="submit">{{ action }}</button>
45
7c4d001839e7 Move the Display of the ProductTree to its own page
Benoît Allard <benoit.allard@greenbone.net>
parents: 12
diff changeset
56 <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
57 </form>
4a9f23230eba Initial Release
Benoît Allard <benoit.allard@greenbone.net>
parents:
diff changeset
58 {% endblock %}

http://farol.wald.intevation.org