Mercurial > farol > farol
annotate farol/templates/producttree/view_product.j2 @ 87:e02724c84bae
Add deletion of (orphaned) relationships
author | Benoît Allard <benoit.allard@greenbone.net> |
---|---|
date | Thu, 09 Oct 2014 15:16:30 +0200 |
parents | cc836f9e869e |
children | 09915cbdf549 |
rev | line source |
---|---|
0 | 1 {# |
2 # Description: | |
3 # Web Template used in Farol Design | |
4 # | |
5 # Authors: | |
6 # BenoƮt Allard <benoit.allard@greenbone.net> | |
7 # | |
8 # Copyright: | |
9 # Copyright (C) 2014 Greenbone Networks GmbH | |
10 # | |
11 # This program is free software; you can redistribute it and/or | |
12 # modify it under the terms of the GNU General Public License | |
13 # as published by the Free Software Foundation; either version 2 | |
14 # of the License, or (at your option) any later version. | |
15 # | |
16 # This program is distributed in the hope that it will be useful, | |
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 # GNU General Public License for more details. | |
20 # | |
21 # You should have received a copy of the GNU General Public License | |
22 # along with this program; if not, write to the Free Software | |
23 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
24 -#} | |
25 | |
26 {% extends "base.j2" %} | |
84
cc836f9e869e
Allow deletion of Products
Benoît Allard <benoit.allard@greenbone.net>
parents:
0
diff
changeset
|
27 {% from "macros.j2" import panel, delete_button %} |
0 | 28 {% block title %}{{ product._name }}{% endblock %} |
29 | |
30 {% set active = 'product' %} | |
31 | |
32 {% block content %} | |
33 <a class="pull-right" href="{{ url_for('.edit_product', productid=product._productid) }}">edit</a> | |
34 <div class='page-header'> | |
35 <h1>{{ product._name }}{% if product._cpe %} <small>{{ product._cpe }}</small>{% endif %}</h1> | |
36 </div> | |
37 {% if product.isRoot() %} | |
38 <p>This product is defined without relation to other elements</p> | |
39 {% elif product.isRelationship() %} | |
40 <p>This product is part of the following relationship:</p> | |
41 {% set prodref = cvrf.getProductForID(product._parent._productreference) %} | |
42 {% set relatesto = cvrf.getProductForID(product._parent._relatestoproductreference) %} | |
43 <p><a href="{{ url_for('.view_product', productid=prodref._productid) }}">{{ prodref._name }}</a> as <em>{{ product._parent._relationtype | lower }}</em> <a href="{{ url_for('.view_product', productid=relatesto._productid) }}">{{ relatesto._name }}</a><p> | |
44 {% else %} | |
45 {% call panel(heading="Tree", title=3, collapsible=False) %} | |
46 {% for type, name in product.getTree() %} | |
47 <ul><li>{{ type }}: <em>{{ name }}</em></li> | |
48 {% if loop.last %}{{ '</ul>' * loop.index }}{% endif %} | |
49 {% endfor %} | |
50 {% endcall %} | |
51 {% endif %} | |
87
e02724c84bae
Add deletion of (orphaned) relationships
Benoît Allard <benoit.allard@greenbone.net>
parents:
84
diff
changeset
|
52 |
0 | 53 <div> |
54 <p>This product belong to the following groups:</p> | |
55 <ul> | |
56 {% for group in cvrf._producttree._groups if product._productid in group._productids %} | |
57 <li>{{ group.getTitle() }}</li> | |
87
e02724c84bae
Add deletion of (orphaned) relationships
Benoît Allard <benoit.allard@greenbone.net>
parents:
84
diff
changeset
|
58 {% else %} |
e02724c84bae
Add deletion of (orphaned) relationships
Benoît Allard <benoit.allard@greenbone.net>
parents:
84
diff
changeset
|
59 <li><em>None</em></li> |
0 | 60 {% endfor %} |
61 </ul> | |
62 </div> | |
84
cc836f9e869e
Allow deletion of Products
Benoît Allard <benoit.allard@greenbone.net>
parents:
0
diff
changeset
|
63 <div class="pull-right">{{ delete_button(url_for('.del_product', productid=product._productid)) }}</div> |
0 | 64 {% endblock %} |