Mercurial > farol > farol
view farol/templates/document/view.j2 @ 73:88adf067cae1
Fix delete urls
author | Benoît Allard <benoit.allard@greenbone.net> |
---|---|
date | Thu, 09 Oct 2014 11:14:50 +0200 |
parents | f9aa7b1e697e |
children | 09915cbdf549 |
line wrap: on
line source
{# # Description: # Web Template used in Farol Design # # Authors: # BenoƮt Allard <benoit.allard@greenbone.net> # # Copyright: # Copyright (C) 2014 Greenbone Networks GmbH # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -#} {% extends "base.j2" %} {% from "macros.j2" import panel, label_value, delete_button %} {% block title %}Document{% endblock %} {% set active='document' %} {% block content %} <div class='clearfix page-header'> <h1>{{ cvrf._title }} <small>({{ cvrf._type }})</small></h1> <a class="pull-right" href="{{ url_for('.edit_title') }}">edit title</a> </div> {% call panel(heading="Publisher", title=3, collapsible=False) %} <a class="pull-right" href="{{ url_for('.edit_publisher') }}">edit</a> <div class="form-horizontal"> {% for label, value in [("Type", cvrf._publisher._type), ("VendorID", cvrf._publisher._vendorid or ''), ("Contact Details", (cvrf._publisher._contact or '') | replace('\n', '<br>')), ("Issuing Authority", (cvrf._publisher._authority or '') | replace('\n', '<br>'))] %} {{ label_value(label, value, right=8) }} {# 8: so that we reserve place for the floating 'edit'#} {% endfor %} </div> {% endcall %} {% call panel(heading="Document Tracking", title=3, collapsible=False) %} <a class="pull-right" href="{{ url_for('.edit_tracking') }}">edit</a> <div class="form-horizontal"> {% for label, value in [("Identification", cvrf._tracking._identification), ("Status", cvrf._tracking._status), ("Version", cvrf._tracking._version | join('.'))] %} {{ label_value(label, value, right=8) }} {% endfor %} </div> <ul class="list-group"> <li class="list-group-item"><a class="a-block" data-toggle="collapse" href="#history">Revision History <span class="pull-right badge">{{ cvrf._tracking._history | length }}</span></li> <div id="history" class="collapse"> {% for revision in cvrf._tracking._history %} <li class="list-group-item"> <div class="form-horizontal"> <div class="pull-right"> <a href="{{ url_for('.edit_revision', index=loop.index0) }}"><span class="label label-default">edit</span></a> {{ delete_button(url_for('.del_revision', index=loop.index0)) }} </div> {{ label_value('Number', revision._number | join('.'), right=8) }} {{ label_value('Date', revision._date) }} {{ label_value('Description', revision._description) }} </div> </li> {% endfor %} <li class="list-group-item clearfix"> <a class="pull-right" href="{{ url_for('.add_revision') }}">add revision</a> </li> </div> </ul> <div class="form-horizontal"> {% for label, value in [("Initial Release Date", cvrf._tracking._initialDate), ("Current Release Date", cvrf._tracking._currentDate)] %} {{ label_value(label, value) }} {% endfor %} </div> {% if cvrf._tracking._generator %} {% call panel(heading="Generator", title=4, collapsible=False) %} <div class="form-horizontal"> {% if cvrf._tracking._generator._engine %}{{ label_value('Engine', cvrf._tracking._generator._engine) }}{% endif %} {% if cvrf._tracking._generator._date %}{{ label_value('Date', cvrf._tracking._generator._date) }}{% endif %} </div> {% endcall %} {% endif %} {% endcall %} {% call panel(heading="Distribution", title=3, collapsible=False) %} <a class="pull-right" href="{{ url_for('.edit_distribution') }}">edit</a> <p>{{ (cvrf._distribution or '') | replace('\n', '<br>') }}</p> {% endcall %} {% call panel(heading="Aggregate Severity", title=3, collapsible=False) %} <div class="form-horizontal"> <a class="pull-right" href="{{ url_for('.edit_severity') }}">edit</a> {% if cvrf._aggregateseverity %} {{ label_value('Namespace', (cvrf._aggregateseverity._namespace or '') | urlize, right=8) }} {{ label_value('Severity', cvrf._aggregateseverity._severity) }} {% endif %} </div> {% endcall %} <div class="clearfix"> <div class="col-sm-4"> {% call panel(type="success", heading="Notes", badge=cvrf._notes | length , title=3) %} <ul> {% for note in cvrf._notes %} <li><a href="{{ url_for('.view_note', ordinal=note._ordinal) }}">{{ note.getTitle() }}</a></li> {% endfor %} </ul> <a class="pull-right" href="{{ url_for('.add_note') }}">add</a> {% endcall %} </div> <div class="col-sm-4"> {% call panel(type="warning", heading="References", badge=cvrf._references | length, title=3) %} <ul> {% for reference in cvrf._references %} <li><a href="{{ reference._url }}" target="_blank">{{ reference._description }}{% if reference._type %} ({{ reference._type }}){% endif %}</a> (<a href="{{ url_for('.edit_reference', index=loop.index0) }}">edit</a>){{ delete_button(url_for('.del_reference', index=loop.index0)) }}</li> {% endfor %} </ul> <a class="pull-right" href="{{ url_for('.add_reference') }}">add</a> {% endcall %} </div> <div class="col-sm-4"> {% call panel(type="info", heading="Acknowledgments", badge=cvrf._acknowledgments | length, title=3) %} <ul> {% for ack in cvrf._acknowledgments %} <li><a href="{{ url_for('.view_acknowledgment', index=loop.index0) }}">{{ ack.getTitle() }}</a></li> {% endfor %} </ul> <a class="pull-right" href="{{ url_for('.add_acknowledgment') }}">add</a> {% endcall %} </div> </div> <div class="clearfix"> <div class="col-md-6"> {% call panel(type="danger", heading="Product Tree", title=3, collapsible=False) %} {% if cvrf._producttree %} <p>{{ cvrf._producttree._products | length }} Products defined</p> <a href="{{ url_for('producttree.view') }}">View</a> {% else %} <em>No Product tree present</em> <form action="{{ url_for('producttree.create') }}" method="POST" name="createProdTree"> <a href="#" onclick="createProdTree.submit()" class="pull-right">create</a> </form> {% endif %} {% endcall %} </div> <div class="col-md-6"> {% call panel(type="primary", heading="Vulnerabilities", badge=cvrf._vulnerabilities | length, title=3) %} <ul> {% for vulnerability in cvrf._vulnerabilities %} <li><a href="{{ url_for('vulnerability.view', ordinal=vulnerability._ordinal) }}">{{ vulnerability.getTitle() }}</a></li> {% endfor %} </ul> <a href="{{ url_for('vulnerability.add') }}" class="pull-right">add</a> {% endcall %} </div> </div> {% endblock %}