Mercurial > farol > farol
comparison farol/templates/vulnerability/view.j2 @ 105:09915cbdf549
Unify the add / edit / delete buttons
author | Benoît Allard <benoit.allard@greenbone.net> |
---|---|
date | Tue, 14 Oct 2014 14:36:31 +0200 |
parents | 9b525f33080a |
children |
comparison
equal
deleted
inserted
replaced
104:0e0572780aff | 105:09915cbdf549 |
---|---|
22 # along with this program; if not, write to the Free Software | 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. | 23 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
24 -#} | 24 -#} |
25 | 25 |
26 {% extends "base.j2" %} | 26 {% extends "base.j2" %} |
27 {% from "macros.j2" import panel, label_value, delete_button %} | 27 {% from "macros.j2" import panel, label_value, add_button, edit_button, delete_button %} |
28 {% block title %}{{ vulnerability._title or '' }}{% endblock %} | 28 {% block title %}{{ vulnerability._title or '' }}{% endblock %} |
29 | 29 |
30 {% set active = 'vulnerability' %} | 30 {% set active = 'vulnerability' %} |
31 | 31 |
32 {% block content %} | 32 {% block content %} |
33 <a class="pull-right" href="{{ url_for('.edit', ordinal=vulnerability._ordinal) }}">edit</a> | 33 <div class="pull-right">{{ edit_button(url_for('.edit', ordinal=vulnerability._ordinal)) }}</div> |
34 <div class='page-header'> | 34 <div class='page-header'> |
35 <h1>{{ vulnerability._title or '' }} <small>{{ vulnerability._type or '' }} (#{{ vulnerability._ordinal }})</small></h1> | 35 <h1>{{ vulnerability._title or '' }} <small>{{ vulnerability._type or '' }} (#{{ vulnerability._ordinal }})</small></h1> |
36 </div> | 36 </div> |
37 {% if vulnerability._id %} | 37 {% if vulnerability._id %} |
38 {% call panel(heading="ID", title=3, collapsible=False) %} | 38 {% call panel(heading="ID", title=3, collapsible=False) %} |
46 <ul> | 46 <ul> |
47 {% for note in vulnerability._notes %} | 47 {% for note in vulnerability._notes %} |
48 <li><a href="{{ url_for('.view_note', ordinal=vulnerability._ordinal, note_ordinal=note._ordinal)}}">{{ note.getTitle() }}</a></li> | 48 <li><a href="{{ url_for('.view_note', ordinal=vulnerability._ordinal, note_ordinal=note._ordinal)}}">{{ note.getTitle() }}</a></li> |
49 {% endfor %} | 49 {% endfor %} |
50 </ul> | 50 </ul> |
51 <a href="{{ url_for('.add_note', ordinal=vulnerability._ordinal) }}" class="pull-right">add</a> | 51 <div class="pull-right">{{ add_button(url_for('.add_note', ordinal=vulnerability._ordinal)) }}</div> |
52 {% endcall %} | 52 {% endcall %} |
53 <div class="form-horizontal"> | 53 <div class="form-horizontal"> |
54 {% if vulnerability._discoverydate %}{{ label_value("Discovery Date", vulnerability._discoverydate) }}{% endif %} | 54 {% if vulnerability._discoverydate %}{{ label_value("Discovery Date", vulnerability._discoverydate) }}{% endif %} |
55 {% if vulnerability._releasedate %}{{ label_value("Release Date", vulnerability._releasedate) }}{% endif %} | 55 {% if vulnerability._releasedate %}{{ label_value("Release Date", vulnerability._releasedate) }}{% endif %} |
56 </div> | 56 </div> |
58 <ul> | 58 <ul> |
59 {% for involvement in vulnerability._involvements %} | 59 {% for involvement in vulnerability._involvements %} |
60 <li><a href="{{ url_for('.view_involvement', ordinal=vulnerability._ordinal, index=loop.index0) }}">{{ involvement.getTitle() }}</a></li> | 60 <li><a href="{{ url_for('.view_involvement', ordinal=vulnerability._ordinal, index=loop.index0) }}">{{ involvement.getTitle() }}</a></li> |
61 {% endfor %} | 61 {% endfor %} |
62 </ul> | 62 </ul> |
63 <a href="{{ url_for('.add_involvement', ordinal=vulnerability._ordinal) }}" class="pull-right">add</a> | 63 <div class="pull-right">{{ add_button(url_for('.add_involvement', ordinal=vulnerability._ordinal)) }}</div> |
64 {% endcall %} | 64 {% endcall %} |
65 {% if vulnerability._cve %} | 65 {% if vulnerability._cve %} |
66 <div class="form-horizontal"> | 66 <div class="form-horizontal"> |
67 {{ label_value("CVE", vulnerability._cve) }} | 67 {{ label_value("CVE", vulnerability._cve) }} |
68 </div> | 68 </div> |
69 {% endif %} | 69 {% endif %} |
70 {% call panel(heading="CWE", badge=vulnerability._cwes | length, title=3) %} | 70 {% call panel(heading="CWE", badge=vulnerability._cwes | length, title=3) %} |
71 <ul> | 71 <ul> |
72 {% for cwe in vulnerability._cwes %} | 72 {% for cwe in vulnerability._cwes %} |
73 <li><div>{{ cwe._id }} - {{ cwe._value}} (<a href="{{ url_for('.edit_cwe', ordinal=vulnerability._ordinal, index=loop.index0) }}">edit</a>){{ delete_button(url_for('.del_cwe', ordinal=vulnerability._ordinal, index=loop.index0)) }}</div></li> | 73 <li> |
74 <div> | |
75 {{ cwe._id }} - {{ cwe._value}} | |
76 {{ edit_button(url_for('.edit_cwe', ordinal=vulnerability._ordinal, index=loop.index0)) }} | |
77 {{ delete_button(url_for('.del_cwe', ordinal=vulnerability._ordinal, index=loop.index0)) }} | |
78 </div> | |
79 </li> | |
74 {% endfor %} | 80 {% endfor %} |
75 <a href="{{ url_for('.add_cwe', ordinal=vulnerability._ordinal) }}" class="pull-right">add</a> | 81 <div class="pull-right">{{ add_button(url_for('.add_cwe', ordinal=vulnerability._ordinal)) }}</div> |
76 {% endcall %} | 82 {% endcall %} |
77 {% call panel(heading="Product Statuses", badge=vulnerability._productstatuses | length, title=3) %} | 83 {% call panel(heading="Product Statuses", badge=vulnerability._productstatuses | length, title=3) %} |
78 <ul> | 84 <ul> |
79 {% for status in vulnerability._productstatuses %} | 85 {% for status in vulnerability._productstatuses %} |
80 <li><a href="{{ url_for('.view_status', ordinal=vulnerability._ordinal, index=loop.index0) }}">{{ status.getTitle() }}</a></li> | 86 <li><a href="{{ url_for('.view_status', ordinal=vulnerability._ordinal, index=loop.index0) }}">{{ status.getTitle() }}</a></li> |
81 {% endfor %} | 87 {% endfor %} |
82 </ul> | 88 </ul> |
83 <a href="{{ url_for('.add_status', ordinal=vulnerability._ordinal) }}" class="pull-right">add</a> | 89 <div class="pull-right">{{ add_button(url_for('.add_status', ordinal=vulnerability._ordinal)) }}</div> |
84 {% endcall %} | 90 {% endcall %} |
85 {% call panel(heading="Threats", badge=vulnerability._threats | length, title=3) %} | 91 {% call panel(heading="Threats", badge=vulnerability._threats | length, title=3) %} |
86 <ul> | 92 <ul> |
87 {% for threat in vulnerability._threats %} | 93 {% for threat in vulnerability._threats %} |
88 <li><a href="{{ url_for('.view_threat', ordinal=vulnerability._ordinal, index=loop.index0) }}">{{ threat.getTitle() }}</a></li> | 94 <li><a href="{{ url_for('.view_threat', ordinal=vulnerability._ordinal, index=loop.index0) }}">{{ threat.getTitle() }}</a></li> |
89 {% endfor %} | 95 {% endfor %} |
90 </ul> | 96 </ul> |
91 <a href="{{ url_for('.add_threat', ordinal=vulnerability._ordinal) }}" class="pull-right">add</a> | 97 <div class="pull-right">{{ add_button(url_for('.add_threat', ordinal=vulnerability._ordinal)) }}</div> |
92 {% endcall %} | 98 {% endcall %} |
93 {% call panel(heading="CVSS Score Sets", badge=vulnerability._cvsss | length, title=3) %} | 99 {% call panel(heading="CVSS Score Sets", badge=vulnerability._cvsss | length, title=3) %} |
94 <ul> | 100 <ul> |
95 {% for cvss in vulnerability._cvsss %} | 101 {% for cvss in vulnerability._cvsss %} |
96 <li><a href="{{ url_for('.view_cvss', ordinal=vulnerability._ordinal, index=loop.index0) }}">{{ cvss._vector }} ({{ cvss._basescore }})</a></li> | 102 <li><a href="{{ url_for('.view_cvss', ordinal=vulnerability._ordinal, index=loop.index0) }}">{{ cvss._vector }} ({{ cvss._basescore }})</a></li> |
97 {% endfor %} | 103 {% endfor %} |
98 </ul> | 104 </ul> |
99 <a href="{{ url_for('.add_cvss', ordinal=vulnerability._ordinal) }}" class="pull-right">add</a> | 105 <div class="pull-right">{{ add_button(url_for('.add_cvss', ordinal=vulnerability._ordinal)) }}</div> |
100 {% endcall %} | 106 {% endcall %} |
101 {% call panel(heading="Remediations", badge=vulnerability._remediations | length, title=3) %} | 107 {% call panel(heading="Remediations", badge=vulnerability._remediations | length, title=3) %} |
102 <ul> | 108 <ul> |
103 {% for remediation in vulnerability._remediations %} | 109 {% for remediation in vulnerability._remediations %} |
104 <li><a href="{{ url_for('.view_remediation', ordinal=vulnerability._ordinal, index=loop.index0) }}">{{ remediation.getTitle() }}</a></li> | 110 <li><a href="{{ url_for('.view_remediation', ordinal=vulnerability._ordinal, index=loop.index0) }}">{{ remediation.getTitle() }}</a></li> |
105 {% endfor %} | 111 {% endfor %} |
106 </ul> | 112 </ul> |
107 <a href="{{ url_for('.add_remediation', ordinal=vulnerability._ordinal) }}" class="pull-right">add</a> | 113 <div class="pull-right">{{ add_button(url_for('.add_remediation', ordinal=vulnerability._ordinal)) }}</div> |
108 {% endcall %} | 114 {% endcall %} |
109 {% call panel(heading="References", badge=vulnerability._references | length , title=3) %} | 115 {% call panel(heading="References", badge=vulnerability._references | length , title=3) %} |
110 <ul> | 116 <ul> |
111 {% for reference in vulnerability._references %} | 117 {% for reference in vulnerability._references %} |
112 <li><div><a href="{{ reference._url }}" target="_blank">{{ reference._description }}{% if reference._type %} ({{ reference._type }}){% endif %}</a> (<a href="{{ url_for('.edit_reference', ordinal=vulnerability._ordinal, index=loop.index0) }}">edit</a>){{ delete_button(url_for('.del_reference', ordinal=vulnerability._ordinal, index=loop.index0)) }}</div></li> | 118 <li> |
119 <div> | |
120 <a href="{{ reference._url }}" target="_blank"> | |
121 {{ reference._description }}{% if reference._type %} ({{ reference._type }}){% endif %} | |
122 </a> | |
123 {{ edit_button(url_for('.edit_reference', ordinal=vulnerability._ordinal, index=loop.index0)) }} | |
124 {{ delete_button(url_for('.del_reference', ordinal=vulnerability._ordinal, index=loop.index0)) }} | |
125 </div> | |
126 </li> | |
113 {% endfor %} | 127 {% endfor %} |
114 </ul> | 128 </ul> |
115 <a class="pull-right" href="{{ url_for('.add_reference', ordinal=vulnerability._ordinal) }}">add</a> | 129 <div class="pull-right">{{ add_button(url_for('.add_reference', ordinal=vulnerability._ordinal)) }}</div> |
116 {% endcall %} | 130 {% endcall %} |
117 {% call panel(heading="Acknowledgments", badge=vulnerability._acknowledgments | length, title=3) %} | 131 {% call panel(heading="Acknowledgments", badge=vulnerability._acknowledgments | length, title=3) %} |
118 <ul> | 132 <ul> |
119 {% for ack in vulnerability._acknowledgments %} | 133 {% for ack in vulnerability._acknowledgments %} |
120 <li><a href="{{ url_for('.view_acknowledgment', ordinal=vulnerability._ordinal, index=loop.index0)}}">{{ ack.getTitle() }}</a></li> | 134 <li><a href="{{ url_for('.view_acknowledgment', ordinal=vulnerability._ordinal, index=loop.index0)}}">{{ ack.getTitle() }}</a></li> |
121 {% endfor %} | 135 {% endfor %} |
122 </ul> | 136 </ul> |
123 <a class="pull-right" href="{{ url_for('.add_acknowledgment', ordinal=vulnerability._ordinal) }}">add</a> | 137 <div class="pull-right">{{ add_button(url_for('.add_acknowledgment', ordinal=vulnerability._ordinal)) }}</div> |
124 {% endcall %} | 138 {% endcall %} |
125 <div class="pull-right">{{ delete_button(url_for('.delete', ordinal=vulnerability._ordinal), text="delete vulnerability definition") }}</div> | 139 <div class="pull-right">{{ delete_button(url_for('.delete', ordinal=vulnerability._ordinal), text="delete vulnerability definition") }}</div> |
126 {% endblock %} | 140 {% endblock %} |