changeset 110:f68944a92b5e

Only allow producttree deletion if possible
author Benoît Allard <benoit.allard@greenbone.net>
date Wed, 15 Oct 2014 09:35:32 +0200
parents ce64f90e58c4
children e5c047d392ca
files farol/templates/producttree/view.j2
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/farol/templates/producttree/view.j2	Wed Oct 15 08:58:47 2014 +0200
+++ b/farol/templates/producttree/view.j2	Wed Oct 15 09:35:32 2014 +0200
@@ -114,5 +114,11 @@
   {% endfor %}
   <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>
+<div class="pull-right">
+{% if cvrf.isProductTreeOrphan() %}
+  {{ delete_button(url_for('.delete'), text="delete whole Product Tree") }}
+{% else %}
+  <p class="text-danger"><small>The Product Treecannot be deleted as some of its elements are referenced in the Document</small></p>
+{% endif %}
+</div>
 {% endblock %}

http://farol.wald.intevation.org