view farol/templates/vulnerability/view.j2 @ 105:09915cbdf549

Unify the add / edit / delete buttons
author Benoît Allard <benoit.allard@greenbone.net>
date Tue, 14 Oct 2014 14:36:31 +0200
parents 9b525f33080a
children
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, add_button, edit_button, delete_button %}
{% block title %}{{ vulnerability._title or '' }}{% endblock %}

{% set active = 'vulnerability' %}

{% block content %}
<div class="pull-right">{{ edit_button(url_for('.edit', ordinal=vulnerability._ordinal)) }}</div>
<div class='page-header'>
  <h1>{{ vulnerability._title or '' }} <small>{{ vulnerability._type or '' }} (#{{ vulnerability._ordinal }})</small></h1>
</div>
{% if vulnerability._id %}
  {% call panel(heading="ID", title=3, collapsible=False) %}
    <div class="form-horizontal">
      {{ label_value("System Name", vulnerability._id._systemname) }}
      {{ label_value("Value", vulnerability._id._value) }}
    </div>
  {% endcall %}
{% endif %}
{% call panel(heading="Notes", badge=vulnerability._notes | length, title=3) %}
  <ul>
    {% for note in vulnerability._notes %}
      <li><a href="{{ url_for('.view_note', ordinal=vulnerability._ordinal, note_ordinal=note._ordinal)}}">{{ note.getTitle() }}</a></li>
    {% endfor %}
  </ul>
  <div class="pull-right">{{ add_button(url_for('.add_note', ordinal=vulnerability._ordinal)) }}</div>
{% endcall %}
<div class="form-horizontal">
  {% if vulnerability._discoverydate %}{{ label_value("Discovery Date", vulnerability._discoverydate) }}{% endif %}
  {% if vulnerability._releasedate %}{{ label_value("Release Date", vulnerability._releasedate) }}{% endif %}
</div>
{% call panel(heading="Involvements",  badge=vulnerability._involvements | length, title=3) %}
  <ul>
    {% for involvement in vulnerability._involvements %}
      <li><a href="{{ url_for('.view_involvement', ordinal=vulnerability._ordinal, index=loop.index0) }}">{{ involvement.getTitle() }}</a></li>
    {% endfor %}
  </ul>
  <div class="pull-right">{{ add_button(url_for('.add_involvement', ordinal=vulnerability._ordinal)) }}</div>
{% endcall %}
{% if vulnerability._cve %}
<div class="form-horizontal">
  {{ label_value("CVE", vulnerability._cve) }}
</div>
{% endif %}
{% call panel(heading="CWE", badge=vulnerability._cwes | length, title=3) %}
  <ul>
  {% for cwe in vulnerability._cwes %}
    <li>
      <div>
        {{ cwe._id }} - {{ cwe._value}}
        {{ edit_button(url_for('.edit_cwe', ordinal=vulnerability._ordinal, index=loop.index0)) }}
        {{ delete_button(url_for('.del_cwe', ordinal=vulnerability._ordinal, index=loop.index0)) }}
      </div>
    </li>
  {% endfor %}
  <div class="pull-right">{{ add_button(url_for('.add_cwe', ordinal=vulnerability._ordinal)) }}</div>
{% endcall %}
{% call panel(heading="Product Statuses", badge=vulnerability._productstatuses | length, title=3) %}
  <ul>
    {% for status in vulnerability._productstatuses %}
      <li><a href="{{ url_for('.view_status', ordinal=vulnerability._ordinal, index=loop.index0) }}">{{ status.getTitle() }}</a></li>
    {% endfor %}
  </ul>
  <div class="pull-right">{{ add_button(url_for('.add_status', ordinal=vulnerability._ordinal)) }}</div>
{% endcall %}
{% call panel(heading="Threats", badge=vulnerability._threats | length, title=3) %}
  <ul>
    {% for threat in vulnerability._threats %}
      <li><a href="{{ url_for('.view_threat', ordinal=vulnerability._ordinal, index=loop.index0) }}">{{ threat.getTitle() }}</a></li>
    {% endfor %}
  </ul>
  <div class="pull-right">{{ add_button(url_for('.add_threat', ordinal=vulnerability._ordinal)) }}</div>
{% endcall %}
{% call panel(heading="CVSS Score Sets", badge=vulnerability._cvsss | length, title=3) %}
  <ul>
    {% for cvss in vulnerability._cvsss %}
      <li><a href="{{ url_for('.view_cvss', ordinal=vulnerability._ordinal, index=loop.index0) }}">{{ cvss._vector }} ({{ cvss._basescore }})</a></li>
    {% endfor %}
  </ul>
  <div class="pull-right">{{ add_button(url_for('.add_cvss', ordinal=vulnerability._ordinal)) }}</div>
{% endcall %}
{% call panel(heading="Remediations", badge=vulnerability._remediations | length, title=3) %}
  <ul>
    {% for remediation in vulnerability._remediations %}
      <li><a href="{{ url_for('.view_remediation', ordinal=vulnerability._ordinal, index=loop.index0) }}">{{ remediation.getTitle() }}</a></li>
    {% endfor %}
  </ul>
  <div class="pull-right">{{ add_button(url_for('.add_remediation', ordinal=vulnerability._ordinal)) }}</div>
{% endcall %}
{% call panel(heading="References", badge=vulnerability._references | length , title=3) %}
  <ul>
    {% for reference in vulnerability._references %}
      <li>
        <div>
          <a href="{{ reference._url }}" target="_blank">
            {{ reference._description }}{% if reference._type %} ({{ reference._type }}){% endif %}
          </a>
          {{ edit_button(url_for('.edit_reference', ordinal=vulnerability._ordinal, index=loop.index0)) }}
          {{ delete_button(url_for('.del_reference', ordinal=vulnerability._ordinal, index=loop.index0)) }}
        </div>
      </li>
    {% endfor %}
  </ul>
  <div class="pull-right">{{ add_button(url_for('.add_reference', ordinal=vulnerability._ordinal)) }}</div>
{% endcall %}
{% call panel(heading="Acknowledgments", badge=vulnerability._acknowledgments | length, title=3) %}
  <ul>
    {% for ack in vulnerability._acknowledgments %}
      <li><a href="{{ url_for('.view_acknowledgment', ordinal=vulnerability._ordinal, index=loop.index0)}}">{{ ack.getTitle() }}</a></li>
    {% endfor %}
  </ul>
  <div class="pull-right">{{ add_button(url_for('.add_acknowledgment', ordinal=vulnerability._ordinal)) }}</div>
{% endcall %}
<div class="pull-right">{{ delete_button(url_for('.delete', ordinal=vulnerability._ordinal), text="delete vulnerability definition") }}</div>
{% endblock %}

http://farol.wald.intevation.org