view farol/templates/producttree/edit_product.j2 @ 163:1d63a532ccce

Add possibility to create product Tree from the cpe itself.
author Benoît Allard <benoit.allard@greenbone.net>
date Tue, 30 Dec 2014 14:34:21 +0100
parents 086e35c4aee7
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 textinput, selectinput2, examples, checkbox %}
{% block title %}Edit the product{% endblock %}

{% set active = 'product' %}

{% block content %}
<p>The <strong>Full Product Name</strong> elements define the endpoints of the <strong>Product Tree</strong> and occur directly at the root level, at the branch level, or as the result of a relationship between two products.</p><form role="form" method="POST">

{% call textinput('name', "Product Name", value=product._name, required=True) %}
<p>The value of a <strong>Full Product Name</strong> element should be the products full canonical name, including version number and other attributes, as it would be used in a human-friendly document.</p>
{{ examples(['Microsoft Host Integration Server 2006 Service Pack 1', 'Microsoft Office 2008 for Mac 12.3.1 Update']) }}
{% endcall %}
{% call textinput('productid', "ProductID", placeholder="1234", value=product._productid, required=True) %}
<p>The <em>Product ID</em> attribute is required to identify a <strong>Full Product Name</strong> so that it can be referred to from other parts in the document. There is no predefined or required format for the <em>Product ID</em> as long as it uniquely identifies a product in the context of the current document. Examples include incremental integers or Globally Unique Identifiers (GUIDs).</p>
{{ examples(['CVRFPID-0004']) }}
{% endcall %}
{% call textinput('cpe', "CPE", placeholder="cpe:...", value=product._cpe) %}
<p>The Common Platform Enumeration (<em>CPE</em>) attribute refers to a method for naming platforms. The structure for CPE is described at http://cpe.mitre.org. The <em>CPE</em> can be either an integer (if MITRE has an entry for the platform in question) or a candidate string from the vendor if no MITRE entry yet exists.</p>
{% endcall %}
<hr>
{{ selectinput2('parent_branch', "Parent Branch", orphaned_leaves , product.getParentPath()) }}
<p class="text-center"><em>-- or --</em></p>
{{ selectinput2('parent_relationship', "Parent relationship", orphaned_relationships, current_rel) }}
<p class="text-center"><em>-- or --</em></p>
{% if action == "Add" %}
  {{ checkbox('from_cpe', "Create branches/relation from CPE Value") }}
{% endif %}

<button class="btn btn-primary" type="submit">{{ action }}</button>
<a class="btn btn-danger" href="{{ url_for('.view') }}">Cancel</a>
</form>
{% endblock %}

http://farol.wald.intevation.org