comparison farol/templates/producttree/view.j2 @ 76:e39fd204eb33

Remove possibility to view and edit a product (edit from the view page) and set url relative
author Benoît Allard <benoit.allard@greenbone.net>
date Thu, 09 Oct 2014 11:50:02 +0200
parents 7c4d001839e7
children c00f20bd90ba
comparison
equal deleted inserted replaced
75:95c79e518204 76:e39fd204eb33
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('producttree.edit_branch', path=branch.getPath() | join('/')) }}">edit</a>)</p> 53 <p>{{ branch._type}}: <em>{{ branch._name }}</em> (<a href="{{ url_for('.edit_branch', path=branch.getPath() | join('/')) }}">edit</a>)</p>
54 {% if branch._product %} 54 {% if branch._product %}
55 <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>) 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 %}
59 {% if branch.isOrphaned() %} 59 {% if branch.isOrphaned() %}
60 <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> 60 <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>
61 {% endif %} 61 {% endif %}
62 {% endcall %} 62 {% endcall %}
63 {% endfor %} 63 {% endfor %}
64 <a href="{{ url_for('producttree.add_branch') }}" class="pull-right">add branch</a> 64 <a href="{{ url_for('.add_branch') }}" class="pull-right">add branch</a>
65 {% endcall %} 65 {% endcall %}
66 {% call panel(heading="Products", badge=producttree.nbProducts(), title=4) %} 66 {% call panel(heading="Products", badge=producttree.nbProducts(), title=4) %}
67 {% for product in producttree._products if product._parent is sameas producttree %} 67 {% for product in producttree._products if product._parent is sameas producttree %}
68 <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> 68 <p><strong><a href="{{ url_for('.view_product', productid=product._productid) }}">{{ product._name }}</a></strong></p>
69 {% endfor %} 69 {% endfor %}
70 <a href="{{ url_for('producttree.add_product') }}" class="pull-right">add product</a> 70 <a href="{{ url_for('.add_product') }}" class="pull-right">add product</a>
71 {% endcall %} 71 {% endcall %}
72 {% call panel(heading="Relationships", badge=producttree._relationships | length, title=4) %} 72 {% call panel(heading="Relationships", badge=producttree._relationships | length, title=4) %}
73 {% for relationship in producttree._relationships %} 73 {% for relationship in producttree._relationships %}
74 {% call panel() %} 74 {% call panel() %}
75 <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> 75 <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>
76 {% 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 %} 76 {% if relationship._product %}<p><strong><a href="{{ url_for('.view_product', productid=relationship._product._productid) }}">{{ relationship._product._name }}</a></strong></p>{% endif %}
77 {% if relationship.isOrphaned() %} 77 {% if relationship.isOrphaned() %}
78 <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> 78 <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>
79 {% endif %} 79 {% endif %}
80 {% endcall %} 80 {% endcall %}
81 {% endfor %} 81 {% endfor %}
82 <a href="{{ url_for('producttree.add_relationship') }}" class="pull-right">add</a> 82 <a href="{{ url_for('.add_relationship') }}" class="pull-right">add</a>
83 {% endcall %} 83 {% endcall %}
84 {% call panel(heading="Groups", badge=producttree._groups | length, title=4) %} 84 {% call panel(heading="Groups", badge=producttree._groups | length, title=4) %}
85 {% for group in producttree._groups %} 85 {% for group in producttree._groups %}
86 {% call panel() %} 86 {% call panel() %}
87 <a href="{{ url_for('producttree.edit_group', groupid=group._groupid) }}" class="pull-right">edit</a> 87 <a href="{{ url_for('.edit_group', groupid=group._groupid) }}" class="pull-right">edit</a>
88 <ul> 88 <ul>
89 {% for productid in group._productids %} 89 {% for productid in group._productids %}
90 {% with product = cvrf.getProductForID(productid) %} 90 {% with product = cvrf.getProductForID(productid) %}
91 <li><a href="{{ url_for('producttree.view_product', productid=product._productid) }}">{{ product._name }}</a></li> 91 <li><a href="{{ url_for('.view_product', productid=product._productid) }}">{{ product._name }}</a></li>
92 {% endwith %} 92 {% endwith %}
93 {% endfor %} 93 {% endfor %}
94 </ul> 94 </ul>
95 {% if group._description %}<p class="small">{{ group._description }}</p>{% endif %} 95 {% if group._description %}<p class="small">{{ group._description }}</p>{% endif %}
96 {% endcall %} 96 {% endcall %}
97 {% endfor %} 97 {% endfor %}
98 <a href="{{ url_for('producttree.add_group') }}" class="pull-right">add</a> 98 <a href="{{ url_for('.add_group') }}" class="pull-right">add</a>
99 {% endcall %} 99 {% endcall %}
100 {% endblock %} 100 {% endblock %}

http://farol.wald.intevation.org