Mercurial > farol > farol
comparison 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 |
comparison
equal
deleted
inserted
replaced
79:2c7786d7d14e | 80:c00f20bd90ba |
---|---|
22 # along with this program; if not, write to the Free Software | 22 # along with this program; if not, write to the Free Software |
23 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | 23 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
24 -#} | 24 -#} |
25 | 25 |
26 {% extends "base.j2" %} | 26 {% extends "base.j2" %} |
27 {% from "macros.j2" import panel, modal %} | 27 {% from "macros.j2" import panel, modal, delete_button %} |
28 {% block title %}Product Tree{% endblock %} | 28 {% block title %}Product Tree{% endblock %} |
29 | 29 |
30 {% set active = 'product' %} | 30 {% set active = 'product' %} |
31 | 31 |
32 {% block content %} | 32 {% block content %} |
48 </dl> | 48 </dl> |
49 {% endcall %} | 49 {% endcall %} |
50 {% call panel(heading="Branches", badge=producttree._branches | length, title=4, extended=True) %} | 50 {% call panel(heading="Branches", badge=producttree._branches | length, title=4, extended=True) %} |
51 {% for branch in producttree._branches recursive %} | 51 {% for branch in producttree._branches recursive %} |
52 {% call panel() %} | 52 {% call panel() %} |
53 <p>{{ branch._type}}: <em>{{ branch._name }}</em> (<a href="{{ url_for('.edit_branch', path=branch.getPath() | join('/')) }}">edit</a>)</p> | 53 <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> |
54 {% if branch._product %} | 54 {% if branch._product %} |
55 <p><strong><a href="{{ url_for('.view_product', productid=branch._product._productid) }}">{{ branch._product._name }}</a></strong></p> | 55 <p><strong><a href="{{ url_for('.view_product', productid=branch._product._productid) }}">{{ branch._product._name }}</a></strong></p> |
56 {% else %} | 56 {% else %} |
57 {{ loop(branch._childs) }} | 57 {{ loop(branch._childs) }} |
58 {% endif %} | 58 {% endif %} |