changeset 112:1feed9a3156e

Style update
author Benoît Allard <benoit.allard@greenbone.net>
date Wed, 15 Oct 2014 15:24:27 +0200
parents e5c047d392ca
children 57983a663cc6
files farol/templates/producttree/view.j2 farol/templates/producttree/view_product.j2
diffstat 2 files changed, 12 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/farol/templates/producttree/view.j2	Wed Oct 15 15:23:15 2014 +0200
+++ b/farol/templates/producttree/view.j2	Wed Oct 15 15:24:27 2014 +0200
@@ -100,8 +100,11 @@
     {% call panel() %}
       <div class="pull-right">
         {{ edit_button(url_for('.edit_group', groupid=group._groupid)) }}
-        {{ delete_button(url_for('.del_group', groupid=group._groupid)) }}
+        {%if cvrf.isGroupOrphan(group._groupid) %}
+          {{ delete_button(url_for('.del_group', groupid=group._groupid)) }}
+        {% endif %}
       </div>
+      {% if group._description %}<p class="small">{{ group._description }}</p>{% endif %}
       <ul>
         {% for productid in group._productids %}
           {% with product = cvrf.getProductForID(productid) %}
@@ -109,7 +112,6 @@
           {% endwith %}
         {% endfor %}
       </ul>
-      {% if group._description %}<p class="small">{{ group._description }}</p>{% endif %}
     {% endcall %}
   {% endfor %}
   <div class="pull-right">{{ add_button(url_for('.add_group')) }}</div>
--- a/farol/templates/producttree/view_product.j2	Wed Oct 15 15:23:15 2014 +0200
+++ b/farol/templates/producttree/view_product.j2	Wed Oct 15 15:24:27 2014 +0200
@@ -81,16 +81,14 @@
                vulnerability.isMentioningGroupId(groups | map(attribute="_groupid") | list)) %}
       <li>
         <a href="{{ url_for('vulnerability.view', ordinal=vulnerability._ordinal) }}">{{ vulnerability.getTitle() }}</a>
-        {% set elements = vulnerability.mentionsProdId(product._productid) | list %}
-        {% for group in groups %}
-          {{ elements.extend(vulnerability.mentionsGroupId(group._groupid) | list) or '' }}
-        {% endfor %}
-        {% set comma = joiner(', ') %}
-        (
-        {%- for grouper, list in elements | groupby('NAME') %}{{ comma() -}}
-          {{ grouper }}{% if list | length > 1 %}(x{{ list | length }}){% endif %}
-        {%- endfor -%}
-        )
+        {%- set elements = vulnerability.mentionsProdId(product._productid) | list %}
+        {%- for group in groups %}
+          {{- elements.extend(vulnerability.mentionsGroupId(group._groupid) | list) or '' }}
+        {%- endfor %}
+        {%- set comma = joiner(', ') %}
+        ({% for grouper, list in elements | groupby('NAME') %}{{ comma() -}}
+          {{ grouper }}{% if list | length > 1 %} (x{{ list | length }}){% endif %}
+        {%- endfor %})
       </li>
     {% else %}
       <li><em>None</em></li>

http://farol.wald.intevation.org