Mercurial > farol > farol
annotate farol/templates/document/view.j2 @ 72:f9aa7b1e697e
Add possibility to delete References
author | Benoît Allard <benoit.allard@greenbone.net> |
---|---|
date | Thu, 09 Oct 2014 10:31:06 +0200 |
parents | 42915aaa6888 |
children | 88adf067cae1 |
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" %} | |
69
42915aaa6888
Move the delete_button to the common macros
Benoît Allard <benoit.allard@greenbone.net>
parents:
67
diff
changeset
|
27 {% from "macros.j2" import panel, label_value, delete_button %} |
0 | 28 {% block title %}Document{% endblock %} |
29 | |
7
8f41bb7f4681
Move the Document management routines to a document Blueprint
Benoît Allard <benoit.allard@greenbone.net>
parents:
0
diff
changeset
|
30 {% set active='document' %} |
8f41bb7f4681
Move the Document management routines to a document Blueprint
Benoît Allard <benoit.allard@greenbone.net>
parents:
0
diff
changeset
|
31 |
0 | 32 {% block content %} |
33 <div class='clearfix page-header'> | |
34 <h1>{{ cvrf._title }} <small>({{ cvrf._type }})</small></h1> | |
7
8f41bb7f4681
Move the Document management routines to a document Blueprint
Benoît Allard <benoit.allard@greenbone.net>
parents:
0
diff
changeset
|
35 <a class="pull-right" href="{{ url_for('.edit_title') }}">edit title</a> |
0 | 36 </div> |
37 {% call panel(heading="Publisher", title=3, collapsible=False) %} | |
7
8f41bb7f4681
Move the Document management routines to a document Blueprint
Benoît Allard <benoit.allard@greenbone.net>
parents:
0
diff
changeset
|
38 <a class="pull-right" href="{{ url_for('.edit_publisher') }}">edit</a> |
0 | 39 <div class="form-horizontal"> |
40 {% for label, value in [("Type", cvrf._publisher._type), | |
41 ("VendorID", cvrf._publisher._vendorid or ''), | |
42 ("Contact Details", (cvrf._publisher._contact or '') | replace('\n', '<br>')), | |
43 ("Issuing Authority", (cvrf._publisher._authority or '') | replace('\n', '<br>'))] %} | |
44 {{ label_value(label, value, right=8) }} {# 8: so that we reserve place for the floating 'edit'#} | |
45 {% endfor %} | |
46 </div> | |
47 {% endcall %} | |
48 {% call panel(heading="Document Tracking", title=3, collapsible=False) %} | |
7
8f41bb7f4681
Move the Document management routines to a document Blueprint
Benoît Allard <benoit.allard@greenbone.net>
parents:
0
diff
changeset
|
49 <a class="pull-right" href="{{ url_for('.edit_tracking') }}">edit</a> |
0 | 50 <div class="form-horizontal"> |
51 {% for label, value in [("Identification", cvrf._tracking._identification), | |
52 ("Status", cvrf._tracking._status), | |
53 ("Version", cvrf._tracking._version | join('.'))] %} | |
54 {{ label_value(label, value, right=8) }} | |
55 {% endfor %} | |
56 </div> | |
31
79b76911444e
Improve the display of the history
Benoît Allard <benoit.allard@greenbone.net>
parents:
7
diff
changeset
|
57 <ul class="list-group"> |
79b76911444e
Improve the display of the history
Benoît Allard <benoit.allard@greenbone.net>
parents:
7
diff
changeset
|
58 <li class="list-group-item"><a class="a-block" data-toggle="collapse" href="#history">Revision History <span class="pull-right badge">{{ cvrf._tracking._history | length }}</span></li> |
79b76911444e
Improve the display of the history
Benoît Allard <benoit.allard@greenbone.net>
parents:
7
diff
changeset
|
59 <div id="history" class="collapse"> |
0 | 60 {% for revision in cvrf._tracking._history %} |
31
79b76911444e
Improve the display of the history
Benoît Allard <benoit.allard@greenbone.net>
parents:
7
diff
changeset
|
61 <li class="list-group-item"> |
0 | 62 <div class="form-horizontal"> |
67
023080ffd995
Allow deletion of revisions
Benoît Allard <benoit.allard@greenbone.net>
parents:
45
diff
changeset
|
63 <div class="pull-right"> |
023080ffd995
Allow deletion of revisions
Benoît Allard <benoit.allard@greenbone.net>
parents:
45
diff
changeset
|
64 <a href="{{ url_for('.edit_revision', index=loop.index0) }}"><span class="label label-default">edit</span></a> |
69
42915aaa6888
Move the delete_button to the common macros
Benoît Allard <benoit.allard@greenbone.net>
parents:
67
diff
changeset
|
65 {{ delete_button(url_for('.del_revision'), {'index': loop.index0}) }} |
67
023080ffd995
Allow deletion of revisions
Benoît Allard <benoit.allard@greenbone.net>
parents:
45
diff
changeset
|
66 </div> |
0 | 67 {{ label_value('Number', revision._number | join('.'), right=8) }} |
68 {{ label_value('Date', revision._date) }} | |
69 {{ label_value('Description', revision._description) }} | |
70 </div> | |
31
79b76911444e
Improve the display of the history
Benoît Allard <benoit.allard@greenbone.net>
parents:
7
diff
changeset
|
71 </li> |
0 | 72 {% endfor %} |
31
79b76911444e
Improve the display of the history
Benoît Allard <benoit.allard@greenbone.net>
parents:
7
diff
changeset
|
73 <li class="list-group-item clearfix"> |
79b76911444e
Improve the display of the history
Benoît Allard <benoit.allard@greenbone.net>
parents:
7
diff
changeset
|
74 <a class="pull-right" href="{{ url_for('.add_revision') }}">add revision</a> |
79b76911444e
Improve the display of the history
Benoît Allard <benoit.allard@greenbone.net>
parents:
7
diff
changeset
|
75 </li> |
79b76911444e
Improve the display of the history
Benoît Allard <benoit.allard@greenbone.net>
parents:
7
diff
changeset
|
76 </div> |
79b76911444e
Improve the display of the history
Benoît Allard <benoit.allard@greenbone.net>
parents:
7
diff
changeset
|
77 </ul> |
0 | 78 <div class="form-horizontal"> |
79 {% for label, value in [("Initial Release Date", cvrf._tracking._initialDate), | |
80 ("Current Release Date", cvrf._tracking._currentDate)] %} | |
81 {{ label_value(label, value) }} | |
82 {% endfor %} | |
83 </div> | |
84 {% if cvrf._tracking._generator %} | |
85 {% call panel(heading="Generator", title=4, collapsible=False) %} | |
86 <div class="form-horizontal"> | |
87 {% if cvrf._tracking._generator._engine %}{{ label_value('Engine', cvrf._tracking._generator._engine) }}{% endif %} | |
88 {% if cvrf._tracking._generator._date %}{{ label_value('Date', cvrf._tracking._generator._date) }}{% endif %} | |
89 </div> | |
90 {% endcall %} | |
91 {% endif %} | |
92 {% endcall %} | |
93 {% call panel(heading="Distribution", title=3, collapsible=False) %} | |
7
8f41bb7f4681
Move the Document management routines to a document Blueprint
Benoît Allard <benoit.allard@greenbone.net>
parents:
0
diff
changeset
|
94 <a class="pull-right" href="{{ url_for('.edit_distribution') }}">edit</a> |
0 | 95 <p>{{ (cvrf._distribution or '') | replace('\n', '<br>') }}</p> |
96 {% endcall %} | |
97 {% call panel(heading="Aggregate Severity", title=3, collapsible=False) %} | |
98 <div class="form-horizontal"> | |
7
8f41bb7f4681
Move the Document management routines to a document Blueprint
Benoît Allard <benoit.allard@greenbone.net>
parents:
0
diff
changeset
|
99 <a class="pull-right" href="{{ url_for('.edit_severity') }}">edit</a> |
0 | 100 {% if cvrf._aggregateseverity %} |
101 {{ label_value('Namespace', (cvrf._aggregateseverity._namespace or '') | urlize, right=8) }} | |
102 {{ label_value('Severity', cvrf._aggregateseverity._severity) }} | |
103 {% endif %} | |
104 </div> | |
105 {% endcall %} | |
106 <div class="clearfix"> | |
107 <div class="col-sm-4"> | |
32
9b0fb5ca7eff
Replace the (%d)s with badges
Benoît Allard <benoit.allard@greenbone.net>
parents:
31
diff
changeset
|
108 {% call panel(type="success", heading="Notes", badge=cvrf._notes | length , title=3) %} |
0 | 109 <ul> |
110 {% for note in cvrf._notes %} | |
7
8f41bb7f4681
Move the Document management routines to a document Blueprint
Benoît Allard <benoit.allard@greenbone.net>
parents:
0
diff
changeset
|
111 <li><a href="{{ url_for('.view_note', ordinal=note._ordinal) }}">{{ note.getTitle() }}</a></li> |
0 | 112 {% endfor %} |
113 </ul> | |
7
8f41bb7f4681
Move the Document management routines to a document Blueprint
Benoît Allard <benoit.allard@greenbone.net>
parents:
0
diff
changeset
|
114 <a class="pull-right" href="{{ url_for('.add_note') }}">add</a> |
0 | 115 {% endcall %} |
116 </div> | |
117 <div class="col-sm-4"> | |
32
9b0fb5ca7eff
Replace the (%d)s with badges
Benoît Allard <benoit.allard@greenbone.net>
parents:
31
diff
changeset
|
118 {% call panel(type="warning", heading="References", badge=cvrf._references | length, title=3) %} |
0 | 119 <ul> |
120 {% for reference in cvrf._references %} | |
72
f9aa7b1e697e
Add possibility to delete References
Benoît Allard <benoit.allard@greenbone.net>
parents:
69
diff
changeset
|
121 <li><a href="{{ reference._url }}" target="_blank">{{ reference._description }}{% if reference._type %} ({{ reference._type }}){% endif %}</a> (<a href="{{ url_for('.edit_reference', index=loop.index0) }}">edit</a>){{ delete_button(url_for('.del_reference'), {'index': loop.index0}) }}</li> |
0 | 122 {% endfor %} |
123 </ul> | |
7
8f41bb7f4681
Move the Document management routines to a document Blueprint
Benoît Allard <benoit.allard@greenbone.net>
parents:
0
diff
changeset
|
124 <a class="pull-right" href="{{ url_for('.add_reference') }}">add</a> |
0 | 125 {% endcall %} |
126 </div> | |
127 <div class="col-sm-4"> | |
32
9b0fb5ca7eff
Replace the (%d)s with badges
Benoît Allard <benoit.allard@greenbone.net>
parents:
31
diff
changeset
|
128 {% call panel(type="info", heading="Acknowledgments", badge=cvrf._acknowledgments | length, title=3) %} |
0 | 129 <ul> |
130 {% for ack in cvrf._acknowledgments %} | |
7
8f41bb7f4681
Move the Document management routines to a document Blueprint
Benoît Allard <benoit.allard@greenbone.net>
parents:
0
diff
changeset
|
131 <li><a href="{{ url_for('.view_acknowledgment', index=loop.index0) }}">{{ ack.getTitle() }}</a></li> |
0 | 132 {% endfor %} |
133 </ul> | |
7
8f41bb7f4681
Move the Document management routines to a document Blueprint
Benoît Allard <benoit.allard@greenbone.net>
parents:
0
diff
changeset
|
134 <a class="pull-right" href="{{ url_for('.add_acknowledgment') }}">add</a> |
0 | 135 {% endcall %} |
136 </div> | |
137 </div> | |
138 | |
139 | |
140 <div class="clearfix"> | |
141 <div class="col-md-6"> | |
45
7c4d001839e7
Move the Display of the ProductTree to its own page
Benoît Allard <benoit.allard@greenbone.net>
parents:
32
diff
changeset
|
142 {% call panel(type="danger", heading="Product Tree", title=3, collapsible=False) %} |
0 | 143 {% if cvrf._producttree %} |
45
7c4d001839e7
Move the Display of the ProductTree to its own page
Benoît Allard <benoit.allard@greenbone.net>
parents:
32
diff
changeset
|
144 <p>{{ cvrf._producttree._products | length }} Products defined</p> |
7c4d001839e7
Move the Display of the ProductTree to its own page
Benoît Allard <benoit.allard@greenbone.net>
parents:
32
diff
changeset
|
145 <a href="{{ url_for('producttree.view') }}">View</a> |
0 | 146 {% else %} |
147 <em>No Product tree present</em> | |
148 <form action="{{ url_for('producttree.create') }}" method="POST" name="createProdTree"> | |
149 <a href="#" onclick="createProdTree.submit()" class="pull-right">create</a> | |
150 </form> | |
151 {% endif %} | |
152 {% endcall %} | |
153 </div> | |
154 | |
155 <div class="col-md-6"> | |
32
9b0fb5ca7eff
Replace the (%d)s with badges
Benoît Allard <benoit.allard@greenbone.net>
parents:
31
diff
changeset
|
156 {% call panel(type="primary", heading="Vulnerabilities", badge=cvrf._vulnerabilities | length, title=3) %} |
0 | 157 <ul> |
158 {% for vulnerability in cvrf._vulnerabilities %} | |
159 <li><a href="{{ url_for('vulnerability.view', ordinal=vulnerability._ordinal) }}">{{ vulnerability.getTitle() }}</a></li> | |
160 {% endfor %} | |
161 </ul> | |
162 <a href="{{ url_for('vulnerability.add') }}" class="pull-right">add</a> | |
163 {% endcall %} | |
164 </div> | |
165 </div> | |
166 {% endblock %} |