# HG changeset patch # User BenoƮt Allard <benoit.allard@greenbone.net> # Date 1412848202 -7200 # Node ID e39fd204eb333614fc57192c07c221a747973ff9 # Parent 95c79e518204c0e7ae4f772b52405957560c781e Remove possibility to view and edit a product (edit from the view page) and set url relative diff -r 95c79e518204 -r e39fd204eb33 farol/templates/producttree/view.j2 --- a/farol/templates/producttree/view.j2 Thu Oct 09 11:17:27 2014 +0200 +++ b/farol/templates/producttree/view.j2 Thu Oct 09 11:50:02 2014 +0200 @@ -50,51 +50,51 @@ {% 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('producttree.edit_branch', path=branch.getPath() | join('/')) }}">edit</a>)</p> + <p>{{ branch._type}}: <em>{{ branch._name }}</em> (<a href="{{ url_for('.edit_branch', path=branch.getPath() | join('/')) }}">edit</a>)</p> {% if branch._product %} - <strong><a href="{{ url_for('producttree.view_product', productid=branch._product._productid) }}">{{ branch._product._name }}</a></strong> (<a href="{{ url_for('producttree.edit_product', productid=branch._product._productid) }}">edit</a>) + <p><strong><a href="{{ url_for('.view_product', productid=branch._product._productid) }}">{{ branch._product._name }}</a></strong></p> {% else %} {{ loop(branch._childs) }} {% endif %} {% if branch.isOrphaned() %} - <p class="text-danger">This branch is <em>orphaned</em>. A <a href="{{ url_for('producttree.add_product') }}">product</a> or a new <a href="{{ url_for('producttree.add_branch') }}">branch</a> should be created as child of this one.</p> + <p class="text-danger">This branch is <em>orphaned</em>. A <a href="{{ url_for('.add_product') }}">product</a> or a new <a href="{{ url_for('.add_branch') }}">branch</a> should be created as child of this one.</p> {% endif %} {% endcall %} {% endfor %} - <a href="{{ url_for('producttree.add_branch') }}" class="pull-right">add branch</a> + <a href="{{ url_for('.add_branch') }}" class="pull-right">add branch</a> {% endcall %} {% call panel(heading="Products", badge=producttree.nbProducts(), title=4) %} {% for product in producttree._products if product._parent is sameas producttree %} - <p><strong><a href="{{ url_for('producttree.view_product', productid=product._productid) }}">{{ product._name }}</a></strong> (<a href="{{ url_for('producttree.edit_product', productid=product._productid) }}">edit</a>)</p> + <p><strong><a href="{{ url_for('.view_product', productid=product._productid) }}">{{ product._name }}</a></strong></p> {% endfor %} - <a href="{{ url_for('producttree.add_product') }}" class="pull-right">add product</a> + <a href="{{ url_for('.add_product') }}" class="pull-right">add product</a> {% endcall %} {% call panel(heading="Relationships", badge=producttree._relationships | length, title=4) %} {% for relationship in producttree._relationships %} {% call panel() %} - <p><em>{{ cvrf.getProductForID(relationship._productreference)._name }}</em> as {{ relationship._relationtype | lower }} <em>{{ cvrf.getProductForID(relationship._relatestoproductreference)._name }}</em> (<a href="{{ url_for('producttree.edit_relationship', index=loop.index0) }}">edit</a>)</p> - {% if relationship._product %}<p><strong><a href="{{ url_for('producttree.view_product', productid=relationship._product._productid) }}">{{ relationship._product._name }}</a></strong> (<a href="{{ url_for('producttree.edit_product', productid=relationship._product._productid) }}">edit</a>)</p>{% endif %} + <p><em>{{ cvrf.getProductForID(relationship._productreference)._name }}</em> as {{ relationship._relationtype | lower }} <em>{{ cvrf.getProductForID(relationship._relatestoproductreference)._name }}</em> (<a href="{{ url_for('.edit_relationship', index=loop.index0) }}">edit</a>)</p> + {% if relationship._product %}<p><strong><a href="{{ url_for('.view_product', productid=relationship._product._productid) }}">{{ relationship._product._name }}</a></strong></p>{% endif %} {% if relationship.isOrphaned() %} - <p class="text-danger">This relationship is <em>orphaned</em>. A product should be <a href="{{ url_for('producttree.add_product') }}">created</a> as child of this one.</p> + <p class="text-danger">This relationship is <em>orphaned</em>. A product should be <a href="{{ url_for('.add_product') }}">created</a> as child of this one.</p> {% endif %} {% endcall %} {% endfor %} - <a href="{{ url_for('producttree.add_relationship') }}" class="pull-right">add</a> + <a href="{{ url_for('.add_relationship') }}" class="pull-right">add</a> {% endcall %} {% call panel(heading="Groups", badge=producttree._groups | length, title=4) %} {% for group in producttree._groups %} {% call panel() %} - <a href="{{ url_for('producttree.edit_group', groupid=group._groupid) }}" class="pull-right">edit</a> + <a href="{{ url_for('.edit_group', groupid=group._groupid) }}" class="pull-right">edit</a> <ul> {% for productid in group._productids %} {% with product = cvrf.getProductForID(productid) %} - <li><a href="{{ url_for('producttree.view_product', productid=product._productid) }}">{{ product._name }}</a></li> + <li><a href="{{ url_for('.view_product', productid=product._productid) }}">{{ product._name }}</a></li> {% endwith %} {% endfor %} </ul> {% if group._description %}<p class="small">{{ group._description }}</p>{% endif %} {% endcall %} {% endfor %} - <a href="{{ url_for('producttree.add_group') }}" class="pull-right">add</a> + <a href="{{ url_for('.add_group') }}" class="pull-right">add</a> {% endcall %} {% endblock %}