# HG changeset patch # User BenoƮt Allard # Date 1412257238 -7200 # Node ID 9b0fb5ca7eff4297ac300863f511ef25c0a92fee # Parent 79b76911444e154b460e3ef742d5deb2f0df8a7e Replace the (%d)s with badges diff -r 79b76911444e -r 9b0fb5ca7eff farol/templates/document/view.j2 --- a/farol/templates/document/view.j2 Thu Oct 02 15:39:39 2014 +0200 +++ b/farol/templates/document/view.j2 Thu Oct 02 15:40:38 2014 +0200 @@ -102,7 +102,7 @@ {% endcall %}
- {% call panel(type="success", heading="Notes (%d)" % cvrf._notes | length , title=3) %} + {% call panel(type="success", heading="Notes", badge=cvrf._notes | length , title=3) %}
- {% call panel(type="warning", heading="References (%d)" % cvrf._references | length, title=3) %} + {% call panel(type="warning", heading="References", badge=cvrf._references | length, title=3) %}
- {% call panel(type="info", heading="Acknowledgments (%d)" % cvrf._acknowledgments | length, title=3) %} + {% call panel(type="info", heading="Acknowledgments", badge=cvrf._acknowledgments | length, title=3) %}
    {% for ack in cvrf._acknowledgments %}
  • {{ ack.getTitle() }}
  • @@ -138,7 +138,7 @@
    {% call panel(type="danger", heading="Product Tree", title=3) %} {% if cvrf._producttree %} - {% call panel(heading="Branches (%d)" % cvrf._producttree._branches | length, title=4, extended=True) %} + {% call panel(heading="Branches", badge=cvrf._producttree._branches | length, title=4, extended=True) %} {% for branch in cvrf._producttree._branches recursive %} {% call panel() %}

    {{ branch._type}}: {{ branch._name }} (edit)

    @@ -154,13 +154,13 @@ {% endfor %} add branch {% endcall %} - {% call panel(heading="Products (%d)" % cvrf._producttree.nbProducts(), title=4) %} + {% call panel(heading="Products", badge=cvrf._producttree.nbProducts(), title=4) %} {% for product in cvrf._producttree._products if product._parent is sameas cvrf._producttree %}

    {{ product._name }} (edit)

    {% endfor %} add product {% endcall %} - {% call panel(heading="Relationships (%d)" % cvrf._producttree._relationships | length, title=4) %} + {% call panel(heading="Relationships", badge=cvrf._producttree._relationships | length, title=4) %} {% for relationship in cvrf._producttree._relationships %} {% call panel() %}

    {{ cvrf.getProductForID(relationship._productreference)._name }} as {{ relationship._relationtype | lower }} {{ cvrf.getProductForID(relationship._relatestoproductreference)._name }} (edit)

    @@ -172,7 +172,7 @@ {% endfor %} add {% endcall %} - {% call panel(heading="Groups (%d)" % cvrf._producttree._groups | length, title=4) %} + {% call panel(heading="Groups", badge=cvrf._producttree._groups | length, title=4) %} {% for group in cvrf._producttree._groups %} {% call panel() %} edit @@ -198,7 +198,7 @@
    - {% call panel(type="primary", heading="Vulnerabilities (%d)" % cvrf._vulnerabilities | length, title=3) %} + {% call panel(type="primary", heading="Vulnerabilities", badge=cvrf._vulnerabilities | length, title=3) %}
      {% for vulnerability in cvrf._vulnerabilities %}
    • {{ vulnerability.getTitle() }}
    • diff -r 79b76911444e -r 9b0fb5ca7eff farol/templates/macros.j2 --- a/farol/templates/macros.j2 Thu Oct 02 15:39:39 2014 +0200 +++ b/farol/templates/macros.j2 Thu Oct 02 15:40:38 2014 +0200 @@ -76,7 +76,7 @@
    {% endmacro %} -{% macro panel(type="default", heading=None, title=0, collapsible=True, extended=False) %} +{% macro panel(type="default", heading=None, badge=None, title=0, collapsible=True, extended=False) %} {% if not heading %} {% set collapsible = False %} {% endif %} @@ -85,7 +85,7 @@
    {%- if title %}{% endif -%} {%- if collapsible %}{% endif -%} - {{ heading }} + {{ heading }}{% if badge is not none %}{{ badge }}{% endif %} {%- if collapsible %}{% endif -%} {%- if title %}{% endif -%}
    diff -r 79b76911444e -r 9b0fb5ca7eff farol/templates/vulnerability/view.j2 --- a/farol/templates/vulnerability/view.j2 Thu Oct 02 15:39:39 2014 +0200 +++ b/farol/templates/vulnerability/view.j2 Thu Oct 02 15:40:38 2014 +0200 @@ -42,7 +42,7 @@
{% endcall %} {% endif %} -{% call panel(heading="Notes (%d)" % vulnerability._notes | length, title=3) %} +{% call panel(heading="Notes", badge=vulnerability._notes | length, title=3) %}
-{% call panel(heading="Involvements (%d)" % vulnerability._involvements | length, title=3) %} +{% call panel(heading="Involvements", badge=vulnerability._involvements | length, title=3) %}