diff farol/templates/producttree/view.j2 @ 80:c00f20bd90ba

Allow deletion of (orphaned) Branches
author Benoît Allard <benoit.allard@greenbone.net>
date Thu, 09 Oct 2014 12:16:55 +0200
parents e39fd204eb33
children e02724c84bae
line wrap: on
line diff
--- a/farol/templates/producttree/view.j2	Thu Oct 09 12:16:16 2014 +0200
+++ b/farol/templates/producttree/view.j2	Thu Oct 09 12:16:55 2014 +0200
@@ -24,7 +24,7 @@
 -#}
 
 {% extends "base.j2" %}
-{% from "macros.j2" import panel, modal %}
+{% from "macros.j2" import panel, modal, delete_button %}
 {% block title %}Product Tree{% endblock %}
 
 {% set active = 'product' %}
@@ -50,7 +50,7 @@
 {% call panel(heading="Branches", badge=producttree._branches | length, title=4, extended=True) %}
   {% for branch in producttree._branches recursive %}
     {% call panel() %}
-      <p>{{ branch._type}}: <em>{{ branch._name }}</em> (<a href="{{ url_for('.edit_branch', path=branch.getPath() | join('/')) }}">edit</a>)</p>
+      <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>
       {% if branch._product %}
         <p><strong><a href="{{ url_for('.view_product', productid=branch._product._productid) }}">{{ branch._product._name }}</a></strong></p>
       {% else %}

http://farol.wald.intevation.org