changeset 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 0e0572780aff
children 4ea7966dcc99
files farol/templates/document/view.j2 farol/templates/document/view_acknowledgment.j2 farol/templates/document/view_note.j2 farol/templates/macros.j2 farol/templates/producttree/view.j2 farol/templates/producttree/view_product.j2 farol/templates/vulnerability/view.j2 farol/templates/vulnerability/view_acknowledgment.j2 farol/templates/vulnerability/view_cvss.j2 farol/templates/vulnerability/view_involvement.j2 farol/templates/vulnerability/view_note.j2 farol/templates/vulnerability/view_productstatus.j2 farol/templates/vulnerability/view_remediation.j2 farol/templates/vulnerability/view_threat.j2
diffstat 14 files changed, 100 insertions(+), 58 deletions(-) [+]
line wrap: on
line diff
--- a/farol/templates/document/view.j2	Tue Oct 14 10:36:58 2014 +0200
+++ b/farol/templates/document/view.j2	Tue Oct 14 14:36:31 2014 +0200
@@ -24,7 +24,7 @@
 -#}
 
 {% extends "base.j2" %}
-{% from "macros.j2" import panel, label_value, delete_button %}
+{% from "macros.j2" import panel, label_value, add_button, edit_button, delete_button %}
 {% block title %}Document{% endblock %}
 
 {% set active='document' %}
@@ -32,10 +32,10 @@
 {% block content %}
 <div class='clearfix page-header'>
   <h1>{{ cvrf._title }} <small>({{ cvrf._type }})</small></h1>
-  <a class="pull-right" href="{{ url_for('.edit_title') }}">edit title</a>
+  <div class="pull-right">{{ edit_button(url_for('.edit_title'), "edit title") }}</div>
 </div>
 {% call panel(heading="Publisher", title=3, collapsible=False) %}
-  <a class="pull-right" href="{{ url_for('.edit_publisher') }}">edit</a>
+  <div class="pull-right">{{ edit_button(url_for('.edit_publisher')) }}</div>
   <div class="form-horizontal">
     {% for label, value in [("Type", cvrf._publisher._type),
                             ("VendorID", cvrf._publisher._vendorid or ''),
@@ -46,7 +46,7 @@
   </div>
 {% endcall %}
 {% call panel(heading="Document Tracking", title=3, collapsible=False) %}
-  <a class="pull-right" href="{{ url_for('.edit_tracking') }}">edit</a>
+  <div class="pull-right">{{ edit_button(url_for('.edit_tracking')) }}</div>
   <div class="form-horizontal">
     {% for label, value in [("Identification", cvrf._tracking._identification),
                             ("Status", cvrf._tracking._status),
@@ -61,7 +61,7 @@
       <li class="list-group-item">
         <div class="form-horizontal">
           <div class="pull-right">
-            <a  href="{{ url_for('.edit_revision', index=loop.index0) }}"><span class="label label-default">edit</span></a>
+            {{ edit_button(url_for('.edit_revision', index=loop.index0)) }}
             {{ delete_button(url_for('.del_revision', index=loop.index0)) }}
           </div>
           {{ label_value('Number', revision._number | join('.'), right=8) }}
@@ -71,7 +71,7 @@
       </li>
     {% endfor %}
     <li class="list-group-item clearfix">
-      <a class="pull-right" href="{{ url_for('.add_revision') }}">add revision</a>
+      <div class="pull-right">{{ add_button(url_for('.add_revision'), "add revision") }}</div>
     </li>
     </div>
   </ul>
@@ -91,12 +91,12 @@
   {% endif %}
 {% endcall %}
 {% call panel(heading="Distribution", title=3, collapsible=False) %}
-  <a class="pull-right" href="{{ url_for('.edit_distribution') }}">edit</a>
+  <div class="pull-right">{{ edit_button(url_for('.edit_distribution')) }}</div>
   <p>{{ (cvrf._distribution or '') | replace('\n', '<br>') }}</p>
 {% endcall %}
 {% call panel(heading="Aggregate Severity", title=3, collapsible=False) %}
   <div class="form-horizontal">
-  <a class="pull-right" href="{{ url_for('.edit_severity') }}">edit</a>
+  <div class="pull-right">{{ edit_button(url_for('.edit_severity')) }}</div>
   {% if cvrf._aggregateseverity %}
     {{ label_value('Namespace', (cvrf._aggregateseverity._namespace or '') | urlize, right=8) }}
     {{ label_value('Severity', cvrf._aggregateseverity._severity) }}
@@ -111,17 +111,23 @@
       <li><a href="{{ url_for('.view_note', ordinal=note._ordinal) }}">{{ note.getTitle() }}</a></li>
     {% endfor %}
     </ul>
-    <a class="pull-right" href="{{ url_for('.add_note') }}">add</a>
+    <div class="pull-right">{{ add_button(url_for('.add_note')) }}</div>
     {% endcall %}
   </div>
   <div class="col-sm-4">
     {% call panel(type="warning", heading="References", badge=cvrf._references | length, title=3) %}
     <ul>
     {% for reference in cvrf._references %}
-      <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>
+      <li>
+        <a href="{{ reference._url }}" target="_blank">
+          {{ reference._description }}{% if reference._type %} ({{ reference._type }}){% endif %}
+        </a>
+        {{ edit_button(url_for('.edit_reference', index=loop.index0)) }}
+        {{ delete_button(url_for('.del_reference', index=loop.index0)) }}
+      </li>
     {% endfor %}
     </ul>
-    <a class="pull-right" href="{{ url_for('.add_reference') }}">add</a>
+    <div class="pull-right">{{ add_button(url_for('.add_reference')) }}</div>
     {% endcall %}
   </div>
   <div class="col-sm-4">
@@ -131,7 +137,7 @@
       <li><a href="{{ url_for('.view_acknowledgment', index=loop.index0) }}">{{ ack.getTitle() }}</a></li>
     {% endfor %}
     </ul>
-    <a class="pull-right" href="{{ url_for('.add_acknowledgment') }}">add</a>
+    <div class="pull-right">{{ add_button(url_for('.add_acknowledgment')) }}</div>
     {% endcall %}
   </div>
 </div>
@@ -159,7 +165,7 @@
         <li><a href="{{ url_for('vulnerability.view', ordinal=vulnerability._ordinal) }}">{{ vulnerability.getTitle() }}</a></li>
       {% endfor %}
     </ul>
-    <a href="{{ url_for('vulnerability.add') }}" class="pull-right">add</a>
+    <div class="pull-right">{{ add_button(url_for('vulnerability.add')) }}</div>
     {% endcall %}
   </div>
 </div>
--- a/farol/templates/document/view_acknowledgment.j2	Tue Oct 14 10:36:58 2014 +0200
+++ b/farol/templates/document/view_acknowledgment.j2	Tue Oct 14 14:36:31 2014 +0200
@@ -24,11 +24,11 @@
 -#}
 
 {% extends "base.j2" %}
-{% from "macros.j2" import label_value, delete_button %}
+{% from "macros.j2" import label_value, edit_button, delete_button %}
 {% block title %}{{ acknowledgment.getTitle() }}{% endblock %}
 
 {% block content %}
-<a class="pull-right" href="{{ url_for('.edit_acknowledgment', index=index) }}">edit</a>
+<div class="pull-right">{{ edit_button(url_for('.edit_acknowledgment', index=index)) }}</div>
 <div class='page-header'>
   <h1>{{ acknowledgment._names | join(', ') }} <small>{{ acknowledgment._organizations | join(', ') }}</small></h1>
 </div>
--- a/farol/templates/document/view_note.j2	Tue Oct 14 10:36:58 2014 +0200
+++ b/farol/templates/document/view_note.j2	Tue Oct 14 14:36:31 2014 +0200
@@ -24,11 +24,11 @@
 -#}
 
 {% extends "base.j2" %}
-{% from "macros.j2" import delete_button %}
+{% from "macros.j2" import edit_button, delete_button %}
 {% block title %}{{ note._title }}{% endblock %}
 
 {% block content %}
-<a class="pull-right" href="{{ url_for('.edit_note', ordinal=note._ordinal) }}">edit</a>
+<div class="pull-right">{{ edit_button(url_for('.edit_note', ordinal=note._ordinal)) }}</div>
 <div class='page-header'>
   <h1>{{ note._title or '' }} <small>{{ note._type }} (#{{ note._ordinal }})</small></h1>
 </div>
--- a/farol/templates/macros.j2	Tue Oct 14 10:36:58 2014 +0200
+++ b/farol/templates/macros.j2	Tue Oct 14 14:36:31 2014 +0200
@@ -185,6 +185,14 @@
 </form>
 {% endmacro %}
 
-{% macro delete_button(url, hiddens={}, text="delete") %}
+{% macro edit_button(url, text="edit") -%}
+  <a href="{{ url }}" class="btn btn-default btn-xs" role="btn">{{ text }}</a>
+{%- endmacro %}
+
+{% macro add_button(url, text="add") -%}
+  <a href="{{ url }}" class="btn btn-success btn-xs" role="btn">{{ text }}</a>
+{%- endmacro %}
+
+{% macro delete_button(url, hiddens={}, text="delete") -%}
   {{ POST_button(url, text, hiddens, style="btn-danger btn-xs") }}
-{% endmacro %}
+{%- endmacro %}
--- a/farol/templates/producttree/view.j2	Tue Oct 14 10:36:58 2014 +0200
+++ b/farol/templates/producttree/view.j2	Tue Oct 14 14:36:31 2014 +0200
@@ -24,7 +24,7 @@
 -#}
 
 {% extends "base.j2" %}
-{% from "macros.j2" import panel, modal, delete_button %}
+{% from "macros.j2" import panel, modal, add_button, edit_button, delete_button %}
 {% block title %}Product Tree{% endblock %}
 
 {% set active = 'product' %}
@@ -50,7 +50,13 @@
 {% call panel(heading="Branches", badge=producttree._branches | length, title=4, extended=True) %}
   {% for branch in producttree._branches recursive %}
     {% call panel() %}
-      <div>{{ branch._type}}: <em>{{ branch._name }}</em> (<a href="{{ url_for('.edit_branch', path=branch.getPath() | join('/')) }}">edit</a>){% if branch.isOrphaned() %}{{ delete_button(url_for('.del_branch', path=branch.getPath() | join('/'))) }}{% endif %}</div>
+      <div>
+        {{ branch._type}}: <em>{{ branch._name }}</em>
+        {{ edit_button(url_for('.edit_branch', path=branch.getPath() | join('/'))) }}
+        {% if branch.isOrphaned() %}
+          {{ delete_button(url_for('.del_branch', path=branch.getPath() | join('/'))) }}
+        {% endif %}
+      </div>
       {% if branch._product %}
         <p><strong><a href="{{ url_for('.view_product', productid=branch._product._productid) }}">{{ branch._product._name }}</a></strong></p>
       {% else %}
@@ -61,31 +67,39 @@
       {% endif %}
     {% endcall %}
   {% endfor %}
-  <a href="{{ url_for('.add_branch') }}" class="pull-right">add branch</a>
+  <div class="pull-right">{{ add_button(url_for('.add_branch')) }}</div>
 {% endcall %}
 {% call panel(heading="Products", badge=producttree.nbProducts(), title=4) %}
   {% for product in producttree._products if product._parent is sameas producttree %}
     <p><strong><a href="{{ url_for('.view_product', productid=product._productid) }}">{{ product._name }}</a></strong></p>
   {% endfor %}
-  <a href="{{ url_for('.add_product') }}" class="pull-right">add product</a>
+  <div class="pull-right">{{ add_button(url_for('.add_product')) }}</div>
 {% endcall %}
 {% call panel(heading="Relationships", badge=producttree._relationships | length, title=4) %}
   {% for relationship in producttree._relationships %}
     {% call panel() %}
-      <div><em>{{ cvrf.getProductForID(relationship._productreference)._name }}</em> as {{ relationship._relationtype | lower }} <em>{{ cvrf.getProductForID(relationship._relatestoproductreference)._name }}</em> (<a href="{{ url_for('.edit_relationship', index=loop.index0) }}">edit</a>){% if relationship.isOrphaned() %}{{ delete_button(url_for('.del_relationship', index=loop.index0)) }}{% endif %}</div>
-      {% if relationship._product %}<p><strong><a href="{{ url_for('.view_product', productid=relationship._product._productid) }}">{{ relationship._product._name }}</a></strong></p>{% endif %}
+      <div>
+        <em>{{ cvrf.getProductForID(relationship._productreference)._name }}</em> as {{ relationship._relationtype | lower }} <em>{{ cvrf.getProductForID(relationship._relatestoproductreference)._name }}</em>
+        {{ edit_button(url_for('.edit_relationship', index=loop.index0)) }}
+        {% if relationship.isOrphaned() %}
+          {{ delete_button(url_for('.del_relationship', index=loop.index0)) }}
+        {% endif %}
+      </div>
+      {% if relationship._product %}
+        <p><strong><a href="{{ url_for('.view_product', productid=relationship._product._productid) }}">{{ relationship._product._name }}</a></strong></p>
+      {% endif %}
       {% if relationship.isOrphaned() %}
         <p class="text-danger">This relationship is <em>orphaned</em>. A product should be <a href="{{ url_for('.add_product') }}">created</a> as child of this one.</p>
       {% endif %}
     {% endcall %}
   {% endfor %}
-  <a href="{{ url_for('.add_relationship') }}" class="pull-right">add</a>
+  <div class="pull-right">{{ add_button(url_for('.add_relationship')) }}</div>
 {% endcall %}
 {% call panel(heading="Groups", badge=producttree._groups | length, title=4) %}
   {% for group in producttree._groups %}
     {% call panel() %}
       <div class="pull-right">
-        <a href="{{ url_for('.edit_group', groupid=group._groupid) }}"><span class="label label-default">edit</span></a>
+        {{ edit_button(url_for('.edit_group', groupid=group._groupid)) }}
         {{ delete_button(url_for('.del_group', groupid=group._groupid)) }}
       </div>
       <ul>
@@ -98,7 +112,7 @@
       {% if group._description %}<p class="small">{{ group._description }}</p>{% endif %}
     {% endcall %}
   {% endfor %}
-  <a href="{{ url_for('.add_group') }}" class="pull-right">add</a>
+  <div class="pull-right">{{ add_button(url_for('.add_group')) }}</div>
 {% endcall %}
 <div class="pull-right">{{ delete_button(url_for('.delete'), text="delete whole Product Tree") }}</div>
 {% endblock %}
--- a/farol/templates/producttree/view_product.j2	Tue Oct 14 10:36:58 2014 +0200
+++ b/farol/templates/producttree/view_product.j2	Tue Oct 14 14:36:31 2014 +0200
@@ -24,13 +24,13 @@
 -#}
 
 {% extends "base.j2" %}
-{% from "macros.j2" import panel, delete_button %}
+{% from "macros.j2" import panel, edit_button, delete_button %}
 {% block title %}{{ product._name }}{% endblock %}
 
 {% set active = 'product' %}
 
 {% block content %}
-<a class="pull-right" href="{{ url_for('.edit_product', productid=product._productid) }}">edit</a>
+<div class="pull-right">{{ edit_button(url_for('.edit_product', productid=product._productid)) }}</div>
 <div class='page-header'>
   <h1>{{ product._name }}{% if product._cpe %} <small>{{ product._cpe }}</small>{% endif %}</h1>
 </div>
--- a/farol/templates/vulnerability/view.j2	Tue Oct 14 10:36:58 2014 +0200
+++ b/farol/templates/vulnerability/view.j2	Tue Oct 14 14:36:31 2014 +0200
@@ -24,13 +24,13 @@
 -#}
 
 {% extends "base.j2" %}
-{% from "macros.j2" import panel, label_value, delete_button %}
+{% from "macros.j2" import panel, label_value, add_button, edit_button, delete_button %}
 {% block title %}{{ vulnerability._title or '' }}{% endblock %}
 
 {% set active = 'vulnerability' %}
 
 {% block content %}
-<a class="pull-right" href="{{ url_for('.edit', ordinal=vulnerability._ordinal) }}">edit</a>
+<div class="pull-right">{{ edit_button(url_for('.edit', ordinal=vulnerability._ordinal)) }}</div>
 <div class='page-header'>
   <h1>{{ vulnerability._title or '' }} <small>{{ vulnerability._type or '' }} (#{{ vulnerability._ordinal }})</small></h1>
 </div>
@@ -48,7 +48,7 @@
       <li><a href="{{ url_for('.view_note', ordinal=vulnerability._ordinal, note_ordinal=note._ordinal)}}">{{ note.getTitle() }}</a></li>
     {% endfor %}
   </ul>
-  <a href="{{ url_for('.add_note', ordinal=vulnerability._ordinal) }}" class="pull-right">add</a>
+  <div class="pull-right">{{ add_button(url_for('.add_note', ordinal=vulnerability._ordinal)) }}</div>
 {% endcall %}
 <div class="form-horizontal">
   {% if vulnerability._discoverydate %}{{ label_value("Discovery Date", vulnerability._discoverydate) }}{% endif %}
@@ -60,7 +60,7 @@
       <li><a href="{{ url_for('.view_involvement', ordinal=vulnerability._ordinal, index=loop.index0) }}">{{ involvement.getTitle() }}</a></li>
     {% endfor %}
   </ul>
-  <a href="{{ url_for('.add_involvement', ordinal=vulnerability._ordinal) }}" class="pull-right">add</a>
+  <div class="pull-right">{{ add_button(url_for('.add_involvement', ordinal=vulnerability._ordinal)) }}</div>
 {% endcall %}
 {% if vulnerability._cve %}
 <div class="form-horizontal">
@@ -70,9 +70,15 @@
 {% call panel(heading="CWE", badge=vulnerability._cwes | length, title=3) %}
   <ul>
   {% for cwe in vulnerability._cwes %}
-    <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>
+    <li>
+      <div>
+        {{ cwe._id }} - {{ cwe._value}}
+        {{ edit_button(url_for('.edit_cwe', ordinal=vulnerability._ordinal, index=loop.index0)) }}
+        {{ delete_button(url_for('.del_cwe', ordinal=vulnerability._ordinal, index=loop.index0)) }}
+      </div>
+    </li>
   {% endfor %}
-  <a href="{{ url_for('.add_cwe', ordinal=vulnerability._ordinal) }}" class="pull-right">add</a>
+  <div class="pull-right">{{ add_button(url_for('.add_cwe', ordinal=vulnerability._ordinal)) }}</div>
 {% endcall %}
 {% call panel(heading="Product Statuses", badge=vulnerability._productstatuses | length, title=3) %}
   <ul>
@@ -80,7 +86,7 @@
       <li><a href="{{ url_for('.view_status', ordinal=vulnerability._ordinal, index=loop.index0) }}">{{ status.getTitle() }}</a></li>
     {% endfor %}
   </ul>
-  <a href="{{ url_for('.add_status', ordinal=vulnerability._ordinal) }}" class="pull-right">add</a>
+  <div class="pull-right">{{ add_button(url_for('.add_status', ordinal=vulnerability._ordinal)) }}</div>
 {% endcall %}
 {% call panel(heading="Threats", badge=vulnerability._threats | length, title=3) %}
   <ul>
@@ -88,7 +94,7 @@
       <li><a href="{{ url_for('.view_threat', ordinal=vulnerability._ordinal, index=loop.index0) }}">{{ threat.getTitle() }}</a></li>
     {% endfor %}
   </ul>
-  <a href="{{ url_for('.add_threat', ordinal=vulnerability._ordinal) }}" class="pull-right">add</a>
+  <div class="pull-right">{{ add_button(url_for('.add_threat', ordinal=vulnerability._ordinal)) }}</div>
 {% endcall %}
 {% call panel(heading="CVSS Score Sets", badge=vulnerability._cvsss | length, title=3) %}
   <ul>
@@ -96,7 +102,7 @@
       <li><a href="{{ url_for('.view_cvss', ordinal=vulnerability._ordinal, index=loop.index0) }}">{{ cvss._vector }} ({{ cvss._basescore }})</a></li>
     {% endfor %}
   </ul>
-  <a href="{{ url_for('.add_cvss', ordinal=vulnerability._ordinal) }}" class="pull-right">add</a>
+  <div class="pull-right">{{ add_button(url_for('.add_cvss', ordinal=vulnerability._ordinal)) }}</div>
 {% endcall %}
 {% call panel(heading="Remediations", badge=vulnerability._remediations | length, title=3) %}
   <ul>
@@ -104,15 +110,23 @@
       <li><a href="{{ url_for('.view_remediation', ordinal=vulnerability._ordinal, index=loop.index0) }}">{{ remediation.getTitle() }}</a></li>
     {% endfor %}
   </ul>
-  <a href="{{ url_for('.add_remediation', ordinal=vulnerability._ordinal) }}" class="pull-right">add</a>
+  <div class="pull-right">{{ add_button(url_for('.add_remediation', ordinal=vulnerability._ordinal)) }}</div>
 {% endcall %}
 {% call panel(heading="References", badge=vulnerability._references | length , title=3) %}
   <ul>
     {% for reference in vulnerability._references %}
-      <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>
+      <li>
+        <div>
+          <a href="{{ reference._url }}" target="_blank">
+            {{ reference._description }}{% if reference._type %} ({{ reference._type }}){% endif %}
+          </a>
+          {{ edit_button(url_for('.edit_reference', ordinal=vulnerability._ordinal, index=loop.index0)) }}
+          {{ delete_button(url_for('.del_reference', ordinal=vulnerability._ordinal, index=loop.index0)) }}
+        </div>
+      </li>
     {% endfor %}
   </ul>
-  <a class="pull-right" href="{{ url_for('.add_reference', ordinal=vulnerability._ordinal) }}">add</a>
+  <div class="pull-right">{{ add_button(url_for('.add_reference', ordinal=vulnerability._ordinal)) }}</div>
 {% endcall %}
 {% call panel(heading="Acknowledgments", badge=vulnerability._acknowledgments | length, title=3) %}
   <ul>
@@ -120,7 +134,7 @@
       <li><a href="{{ url_for('.view_acknowledgment', ordinal=vulnerability._ordinal, index=loop.index0)}}">{{ ack.getTitle() }}</a></li>
     {% endfor %}
   </ul>
-  <a class="pull-right" href="{{ url_for('.add_acknowledgment', ordinal=vulnerability._ordinal) }}">add</a>
+  <div class="pull-right">{{ add_button(url_for('.add_acknowledgment', ordinal=vulnerability._ordinal)) }}</div>
 {% endcall %}
 <div class="pull-right">{{ delete_button(url_for('.delete', ordinal=vulnerability._ordinal), text="delete vulnerability definition") }}</div>
 {% endblock %}
--- a/farol/templates/vulnerability/view_acknowledgment.j2	Tue Oct 14 10:36:58 2014 +0200
+++ b/farol/templates/vulnerability/view_acknowledgment.j2	Tue Oct 14 14:36:31 2014 +0200
@@ -24,11 +24,11 @@
 -#}
 
 {% extends "vulnerability/base.j2" %}
-{% from "macros.j2" import label_value, delete_button %}
+{% from "macros.j2" import label_value, edit_button, delete_button %}
 {% block title %}{{ acknowledgment.getTitle() }}{% endblock %}
 
 {% block i_content %}
-<a class="pull-right" href="{{ url_for('.edit_acknowledgment', ordinal=ordinal, index=index) }}">edit</a>
+<div class="pull-right">{{ edit_button(url_for('.edit_acknowledgment', ordinal=ordinal, index=index)) }}</div>
 <div class='page-header'>
   <h1>{{ acknowledgment._names | join(', ') }} <small>{{ acknowledgment._organizations | join(', ') }}</small></h1>
 </div>
--- a/farol/templates/vulnerability/view_cvss.j2	Tue Oct 14 10:36:58 2014 +0200
+++ b/farol/templates/vulnerability/view_cvss.j2	Tue Oct 14 14:36:31 2014 +0200
@@ -24,11 +24,11 @@
 -#}
 
 {% extends "vulnerability/base.j2" %}
-{% from "macros.j2" import label_value, delete_button %}
+{% from "macros.j2" import label_value, edit_button, delete_button %}
 {% block title %}CVSS: {{ cvss._basescore }}{% endblock %}
 
 {% block i_content %}
-<a class="pull-right" href="{{ url_for('.edit_cvss', ordinal=ordinal, index=index) }}">edit</a>
+<div class="pull-right">{{ edit_button(url_for('.edit_cvss', ordinal=ordinal, index=index)) }}</div>
 <div class='page-header'>
   <h1>{{ cvss._vector }}</h1>
 </div>
--- a/farol/templates/vulnerability/view_involvement.j2	Tue Oct 14 10:36:58 2014 +0200
+++ b/farol/templates/vulnerability/view_involvement.j2	Tue Oct 14 14:36:31 2014 +0200
@@ -24,11 +24,11 @@
 -#}
 
 {% extends "vulnerability/base.j2" %}
-{% from "macros.j2" import delete_button %}
+{% from "macros.j2" import edit_button, delete_button %}
 {% block title %}{{ involvement.getTitle() }}{% endblock %}
 
 {% block i_content %}
-<a class="pull-right" href="{{ url_for('.edit_involvement', ordinal=ordinal, index=index) }}">edit</a>
+<div class="pull-right">{{ edit_button(url_for('.edit_involvement', ordinal=ordinal, index=index)) }}</div>
 <div class='page-header'>
   <h1>{{ involvement._party }} <small>{{ involvement._status }}</small></h1>
 </div>
--- a/farol/templates/vulnerability/view_note.j2	Tue Oct 14 10:36:58 2014 +0200
+++ b/farol/templates/vulnerability/view_note.j2	Tue Oct 14 14:36:31 2014 +0200
@@ -24,11 +24,11 @@
 -#}
 
 {% extends "vulnerability/base.j2" %}
-{% from "macros.j2" import delete_button %}
+{% from "macros.j2" import edit_button, delete_button %}
 {% block title %}{{ note._title }}{% endblock %}
 
 {% block i_content %}
-<a class="pull-right" href="{{ url_for('.edit_note', ordinal=ordinal, note_ordinal=note._ordinal) }}">edit</a>
+<div class="pull-right">{{ edit_button(url_for('.edit_note', ordinal=ordinal, note_ordinal=note._ordinal)) }}</div>
 <div class='page-header'>
   <h1>{{ note._title or '' }} <small>{{ note._type }} (#{{ note._ordinal }})</small></h1>
 </div>
--- a/farol/templates/vulnerability/view_productstatus.j2	Tue Oct 14 10:36:58 2014 +0200
+++ b/farol/templates/vulnerability/view_productstatus.j2	Tue Oct 14 14:36:31 2014 +0200
@@ -24,11 +24,11 @@
 -#}
 
 {% extends "vulnerability/base.j2" %}
-{% from "macros.j2" import delete_button %}
+{% from "macros.j2" import edit_button, delete_button %}
 {% block title %}{{ status.getTitle() }}{% endblock %}
 
 {% block i_content %}
-<a class="pull-right" href="{{ url_for('.edit_status', ordinal=ordinal, index=index) }}">edit</a>
+<div class="pull-right">{{ edit_button(url_for('.edit_status', ordinal=ordinal, index=index)) }}</div>
 <div class='page-header'>
   <h1>{{ status._type }}</h1>
 </div>
--- a/farol/templates/vulnerability/view_remediation.j2	Tue Oct 14 10:36:58 2014 +0200
+++ b/farol/templates/vulnerability/view_remediation.j2	Tue Oct 14 14:36:31 2014 +0200
@@ -24,11 +24,11 @@
 -#}
 
 {% extends "vulnerability/base.j2" %}
-{% from "macros.j2" import label_value, panel, delete_button %}
+{% from "macros.j2" import label_value, panel, edit_button, delete_button %}
 {% block title %}{{ remediation.getTitle() }}{% endblock %}
 
 {% block i_content %}
-<a class="pull-right" href="{{ url_for('.edit_remediation', ordinal=ordinal, index=index) }}">edit</a>
+<div class="pull-right">{{ edit_button(url_for('.edit_remediation', ordinal=ordinal, index=index)) }}</div>
 <div class='page-header'>
   <h1>{{ remediation._type }}</h1>
 </div>
@@ -39,7 +39,7 @@
   {{ label_value('URL', remediation._url | urlize) }}
 </div>
 {% if remediation._productids or remediation._groupids %}
-  {% call panel(heading="Products (%d)" % remediation._productids | length, title=2) %}
+  {% call panel(heading="Products", badge=remediation._productids | length, title=2) %}
   <ul>
     {% for productid in remediation._productids %}
       <li><a href="{{ url_for('producttree.view_product', productid=productid) }}">{{ cvrf.getProductForID(productid)._name }}</a></li>
--- a/farol/templates/vulnerability/view_threat.j2	Tue Oct 14 10:36:58 2014 +0200
+++ b/farol/templates/vulnerability/view_threat.j2	Tue Oct 14 14:36:31 2014 +0200
@@ -24,11 +24,11 @@
 -#}
 
 {% extends "vulnerability/base.j2" %}
-{% from "macros.j2" import panel, label_value, delete_button %}
+{% from "macros.j2" import panel, label_value, edit_button, delete_button %}
 {% block title %}Edit {{ threat.getTitle() }}{% endblock %}
 
 {% block i_content %}
-<a class="pull-right" href="{{ url_for('.edit_threat', ordinal=ordinal, index=index) }}">edit</a>
+<div class="pull-right">{{ edit_button(url_for('.edit_threat', ordinal=ordinal, index=index)) }}</div>
 <div class='page-header'>
   <h1>{{ threat._type }}</h1>
 </div>

http://farol.wald.intevation.org