Mercurial > farol > farol
annotate farol/templates/document/view.j2 @ 45:7c4d001839e7
Move the Display of the ProductTree to its own page
author | Benoît Allard <benoit.allard@greenbone.net> |
---|---|
date | Tue, 07 Oct 2014 13:01:10 +0200 |
parents | 9b0fb5ca7eff |
children | 023080ffd995 |
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" %} | |
27 {% from "macros.j2" import panel, label_value %} | |
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"> |
7
8f41bb7f4681
Move the Document management routines to a document Blueprint
Benoît Allard <benoit.allard@greenbone.net>
parents:
0
diff
changeset
|
63 <a class="pull-right" href="{{ url_for('.edit_revision', index=loop.index0) }}">edit revision</a> |
0 | 64 {{ label_value('Number', revision._number | join('.'), right=8) }} |
65 {{ label_value('Date', revision._date) }} | |
66 {{ label_value('Description', revision._description) }} | |
67 </div> | |
31
79b76911444e
Improve the display of the history
Benoît Allard <benoit.allard@greenbone.net>
parents:
7
diff
changeset
|
68 </li> |
0 | 69 {% endfor %} |
31
79b76911444e
Improve the display of the history
Benoît Allard <benoit.allard@greenbone.net>
parents:
7
diff
changeset
|
70 <li class="list-group-item clearfix"> |
79b76911444e
Improve the display of the history
Benoît Allard <benoit.allard@greenbone.net>
parents:
7
diff
changeset
|
71 <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
|
72 </li> |
79b76911444e
Improve the display of the history
Benoît Allard <benoit.allard@greenbone.net>
parents:
7
diff
changeset
|
73 </div> |
79b76911444e
Improve the display of the history
Benoît Allard <benoit.allard@greenbone.net>
parents:
7
diff
changeset
|
74 </ul> |
0 | 75 <div class="form-horizontal"> |
76 {% for label, value in [("Initial Release Date", cvrf._tracking._initialDate), | |
77 ("Current Release Date", cvrf._tracking._currentDate)] %} | |
78 {{ label_value(label, value) }} | |
79 {% endfor %} | |
80 </div> | |
81 {% if cvrf._tracking._generator %} | |
82 {% call panel(heading="Generator", title=4, collapsible=False) %} | |
83 <div class="form-horizontal"> | |
84 {% if cvrf._tracking._generator._engine %}{{ label_value('Engine', cvrf._tracking._generator._engine) }}{% endif %} | |
85 {% if cvrf._tracking._generator._date %}{{ label_value('Date', cvrf._tracking._generator._date) }}{% endif %} | |
86 </div> | |
87 {% endcall %} | |
88 {% endif %} | |
89 {% endcall %} | |
90 {% 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
|
91 <a class="pull-right" href="{{ url_for('.edit_distribution') }}">edit</a> |
0 | 92 <p>{{ (cvrf._distribution or '') | replace('\n', '<br>') }}</p> |
93 {% endcall %} | |
94 {% call panel(heading="Aggregate Severity", title=3, collapsible=False) %} | |
95 <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
|
96 <a class="pull-right" href="{{ url_for('.edit_severity') }}">edit</a> |
0 | 97 {% if cvrf._aggregateseverity %} |
98 {{ label_value('Namespace', (cvrf._aggregateseverity._namespace or '') | urlize, right=8) }} | |
99 {{ label_value('Severity', cvrf._aggregateseverity._severity) }} | |
100 {% endif %} | |
101 </div> | |
102 {% endcall %} | |
103 <div class="clearfix"> | |
104 <div class="col-sm-4"> | |
32
9b0fb5ca7eff
Replace the (%d)s with badges
Benoît Allard <benoit.allard@greenbone.net>
parents:
31
diff
changeset
|
105 {% call panel(type="success", heading="Notes", badge=cvrf._notes | length , title=3) %} |
0 | 106 <ul> |
107 {% 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
|
108 <li><a href="{{ url_for('.view_note', ordinal=note._ordinal) }}">{{ note.getTitle() }}</a></li> |
0 | 109 {% endfor %} |
110 </ul> | |
7
8f41bb7f4681
Move the Document management routines to a document Blueprint
Benoît Allard <benoit.allard@greenbone.net>
parents:
0
diff
changeset
|
111 <a class="pull-right" href="{{ url_for('.add_note') }}">add</a> |
0 | 112 {% endcall %} |
113 </div> | |
114 <div class="col-sm-4"> | |
32
9b0fb5ca7eff
Replace the (%d)s with badges
Benoît Allard <benoit.allard@greenbone.net>
parents:
31
diff
changeset
|
115 {% call panel(type="warning", heading="References", badge=cvrf._references | length, title=3) %} |
0 | 116 <ul> |
117 {% for reference in cvrf._references %} | |
7
8f41bb7f4681
Move the Document management routines to a document Blueprint
Benoît Allard <benoit.allard@greenbone.net>
parents:
0
diff
changeset
|
118 <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>)</li> |
0 | 119 {% endfor %} |
120 </ul> | |
7
8f41bb7f4681
Move the Document management routines to a document Blueprint
Benoît Allard <benoit.allard@greenbone.net>
parents:
0
diff
changeset
|
121 <a class="pull-right" href="{{ url_for('.add_reference') }}">add</a> |
0 | 122 {% endcall %} |
123 </div> | |
124 <div class="col-sm-4"> | |
32
9b0fb5ca7eff
Replace the (%d)s with badges
Benoît Allard <benoit.allard@greenbone.net>
parents:
31
diff
changeset
|
125 {% call panel(type="info", heading="Acknowledgments", badge=cvrf._acknowledgments | length, title=3) %} |
0 | 126 <ul> |
127 {% 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
|
128 <li><a href="{{ url_for('.view_acknowledgment', index=loop.index0) }}">{{ ack.getTitle() }}</a></li> |
0 | 129 {% endfor %} |
130 </ul> | |
7
8f41bb7f4681
Move the Document management routines to a document Blueprint
Benoît Allard <benoit.allard@greenbone.net>
parents:
0
diff
changeset
|
131 <a class="pull-right" href="{{ url_for('.add_acknowledgment') }}">add</a> |
0 | 132 {% endcall %} |
133 </div> | |
134 </div> | |
135 | |
136 | |
137 <div class="clearfix"> | |
138 <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
|
139 {% call panel(type="danger", heading="Product Tree", title=3, collapsible=False) %} |
0 | 140 {% 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
|
141 <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
|
142 <a href="{{ url_for('producttree.view') }}">View</a> |
0 | 143 {% else %} |
144 <em>No Product tree present</em> | |
145 <form action="{{ url_for('producttree.create') }}" method="POST" name="createProdTree"> | |
146 <a href="#" onclick="createProdTree.submit()" class="pull-right">create</a> | |
147 </form> | |
148 {% endif %} | |
149 {% endcall %} | |
150 </div> | |
151 | |
152 <div class="col-md-6"> | |
32
9b0fb5ca7eff
Replace the (%d)s with badges
Benoît Allard <benoit.allard@greenbone.net>
parents:
31
diff
changeset
|
153 {% call panel(type="primary", heading="Vulnerabilities", badge=cvrf._vulnerabilities | length, title=3) %} |
0 | 154 <ul> |
155 {% for vulnerability in cvrf._vulnerabilities %} | |
156 <li><a href="{{ url_for('vulnerability.view', ordinal=vulnerability._ordinal) }}">{{ vulnerability.getTitle() }}</a></li> | |
157 {% endfor %} | |
158 </ul> | |
159 <a href="{{ url_for('vulnerability.add') }}" class="pull-right">add</a> | |
160 {% endcall %} | |
161 </div> | |
162 </div> | |
163 {% endblock %} |