changeset 7:8f41bb7f4681

Move the Document management routines to a document Blueprint
author Benoît Allard <benoit.allard@greenbone.net>
date Thu, 25 Sep 2014 17:03:35 +0200
parents bb7334ff114a
children 2ce3676c9b2e
files farol/document.py farol/main.py farol/static/style.css farol/templates/base.j2 farol/templates/doc.j2 farol/templates/document/edit_acknowledgment.j2 farol/templates/document/edit_distribution.j2 farol/templates/document/edit_note.j2 farol/templates/document/edit_publisher.j2 farol/templates/document/edit_reference.j2 farol/templates/document/edit_revision.j2 farol/templates/document/edit_severity.j2 farol/templates/document/edit_title.j2 farol/templates/document/edit_tracking.j2 farol/templates/document/view.j2 farol/templates/document/view_acknowledgment.j2 farol/templates/document/view_note.j2 farol/templates/edit_acknowledgment.j2 farol/templates/edit_distribution.j2 farol/templates/edit_note.j2 farol/templates/edit_publisher.j2 farol/templates/edit_reference.j2 farol/templates/edit_revision.j2 farol/templates/edit_severity.j2 farol/templates/edit_title.j2 farol/templates/edit_tracking.j2 farol/templates/load.j2 farol/templates/save.j2 farol/templates/view_acknowledgment.j2 farol/templates/view_note.j2 farol/templates/welcome.j2
diffstat 31 files changed, 993 insertions(+), 895 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/farol/document.py	Thu Sep 25 17:03:35 2014 +0200
@@ -0,0 +1,272 @@
+# -*- encoding: utf-8 -*-
+# Description:
+# The Document Blueprint
+#
+# 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.
+
+from flask import (Blueprint, render_template, abort, redirect, request,
+    url_for)
+
+from farolluz.parsers.cvrf import parseDate, parseVersion
+from farolluz.cvrf import (CVRFNote, CVRFReference, CVRFAcknowledgment,
+    CVRFPublisher, CVRFTracking, CVRFTrackingID, CVRFGenerator, CVRFRevision,
+    CVRFAggregateSeverity)
+from farolluz.renderer import utcnow
+
+from .session import document_required, get_current
+
+
+document = Blueprint('document', __name__)
+
+@document.route('/')
+@document_required
+def view():
+    cvrf = get_current()
+    return render_template('document/view.j2', cvrf=cvrf)
+
+@document.route('/title/edit', methods=['GET', 'POST'])
+@document_required
+def edit_title():
+    if request.method != 'POST':
+        return render_template('document/edit_title.j2', title = get_current()._title, _type = get_current()._type)
+
+
+    get_current()._title = request.form['title']
+    get_current()._type = request.form['type']
+    return redirect(url_for('.view'))
+
+@document.route('/publisher/edit', methods=['GET', 'POST'])
+@document_required
+def edit_publisher():
+    if request.method != 'POST':
+        return render_template('document/edit_publisher.j2', publisher = get_current()._publisher or CVRFPublisher(''), types=CVRFPublisher.TYPES)
+
+    publisher = CVRFPublisher(request.form['type'], request.form['vendorid'] or None)
+    publisher.setContact(request.form['contact'] or None)
+    publisher.setAuthority(request.form['authority'] or None)
+    get_current().setPublisher(publisher)
+    return redirect(url_for('.view'))
+
+@document.route('/tracking/edit', methods=['GET', 'POST'])
+@document_required
+def edit_tracking():
+    wasNone = False
+    tracking = get_current()._tracking
+    if tracking is None:
+        wasNone = True
+        tracking = CVRFTracking(CVRFTrackingID(''), 'Draft', (0,), utcnow(), utcnow())
+    generator = tracking._generator
+    if not tracking._generator:
+        generator = CVRFGenerator()
+    if request.method != 'POST':
+        return render_template('document/edit_tracking.j2', tracking=tracking, version='.'.join('%s'%v for v in tracking._version), generator=generator, now=utcnow(), statuses=tracking.STATUSES)
+
+    tracking._identification._id = request.form['id']
+    aliases = []
+    if request.form['id_aliases']:
+        aliases = [a.strip() for a in request.form['id_aliases'].split(',')]
+    tracking._identification._aliases = aliases
+    tracking._status = request.form['status']
+    tracking._version = parseVersion(request.form['version'])
+    tracking._initialDate = parseDate(request.form['initial'])
+    tracking._currentDate = parseDate(request.form['current'])
+    if wasNone:
+        get_current().setTracking(tracking)
+    if (not request.form['gen_engine']) and (not request.form['gen_date']):
+        generator = None
+    else:
+        generator._engine = request.form['gen_engine'] or None
+        if request.form['gen_date']:
+            generator._date = parseDate(request.form['gen_date'])
+        else:
+            generator._date = None
+    tracking.setGenerator(generator)
+    return redirect(url_for('.view'))
+
+@document.route('/revision/<int:index>/edit', methods=['GET', 'POST'])
+@document_required
+def edit_revision(index):
+    cvrf = get_current()
+    if cvrf._tracking is None:
+        abort(404)
+    try:
+        revision = cvrf._tracking._history[index]
+    except IndexError:
+        abort(404)
+    if request.method != 'POST':
+        return render_template('document/edit_revision.j2', number='.'.join('%s'%v for v in revision._number), date=revision._date, description=revision._description, action='Update')
+
+    revision._number = parseVersion(request.form['number'])
+    revision._date = parseDate(request.form['date'])
+    revision._description = request.form['description']
+    return redirect(url_for('.view'))
+
+@document.route('/revision/add', methods=['GET', 'POST'])
+@document_required
+def add_revision():
+    tracking = get_current()._tracking
+    if request.method != 'POST':
+        version = tracking._version
+        version = version[:-1] + (version[-1] + 1,)
+        return render_template('document/edit_revision.j2', number='.'.join("%d"%v for v in version), date=utcnow(), action='Add')
+
+    version = parseVersion(request.form['number'])
+    date = parseDate(request.form['date'])
+    revision = CVRFRevision(version, date, request.form['description'])
+    tracking.addRevision(revision)
+    if 'update_tracking' in request.form:
+        tracking._version = version
+        tracking._currentDate = date
+    return redirect(url_for('.view'))
+
+@document.route('/distribution/edit', methods=['GET', 'POST'])
+@document_required
+def edit_distribution():
+    if request.method != 'POST':
+        return render_template('document/edit_distribution.j2', distribution=get_current()._distribution)
+
+    get_current().setDistribution(request.form['distribution'])
+    return redirect(url_for('.view'))
+
+@document.route('/severity/edit', methods=['GET', 'POST'])
+@document_required
+def edit_severity():
+    severity = get_current()._aggregateseverity
+    if severity is None:
+        severity = CVRFAggregateSeverity('')
+    if request.method != 'POST':
+        return render_template('document/edit_severity.j2', severity=severity)
+    if not request.form['severity']:
+        severity = None
+    else:
+        severity._severity = request.form['severity']
+        severity.setNamespace(request.form['namespace'] or None)
+    get_current().setAggregateSeverity(severity)
+    return redirect(url_for('.view'))
+
+@document.route('/note/<int:ordinal>')
+@document_required
+def view_note(ordinal):
+    note = get_current().getNote(ordinal)
+    if note is None:
+        abort(404)
+    return render_template('document/view_note.j2', note=note)
+
+@document.route('/note/<int:ordinal>/edit', methods=['GET', 'POST'])
+@document_required
+def edit_note(ordinal):
+    note = get_current().getNote(ordinal)
+    if note is None:
+        abort(404)
+    if request.method != 'POST':
+        return render_template('document/edit_note.j2', note=note, types = note.TYPES)
+
+    note._type = request.form['type']
+    note._ordinal = int(request.form['ordinal'])
+    note._note = request.form['note']
+    note._title = request.form['title'] or None
+    note._audience = request.form['audience'] or None
+    return redirect(url_for('.view_note', ordinal=note._ordinal ))
+
+
+@document.route('/note/add', methods=['GET', 'POST'])
+@document_required
+def add_note():
+    if request.method != 'POST':
+        next_ordinal = 1
+        notes = get_current()._notes
+        if notes:
+            next_ordinal = notes[-1]._ordinal + 1
+        return render_template('document/edit_note.j2', ordinal=next_ordinal, types=CVRFNote.TYPES, action='Add')
+
+    title = None
+    audience = None
+    title = request.form['title'] or None
+    audience = request.form['audience'] or None
+
+    note = CVRFNote(request.form['type'], int(request.form['ordinal']), request.form['note'], title, audience)
+    get_current().addNote(note)
+    return redirect(url_for('.view'))
+
+@document.route('/reference/<int:index>/edit', methods=['GET', 'POST'])
+@document_required
+def edit_reference(index):
+    try:
+        ref = get_current()._references[index]
+    except IndexError:
+        abort(404)
+    if request.method != 'POST':
+        return render_template('document/edit_reference.j2', _type=ref._type, url=ref._url, description=ref._description, types=('',) + ref.TYPES)
+
+    ref._type = request.form['type'] or None
+    ref._url = request.form['url']
+    ref._description = request.form['description']
+    return redirect(url_for('.view'))
+
+
+@document.route('/reference/add', methods=['GET', 'POST'])
+@document_required
+def add_reference():
+    if request.method != 'POST':
+        return render_template('document/edit_reference.j2', action='Add', types=('',) + CVRFReference.TYPES)
+
+    ref = CVRFReference(request.form['url'], request.form['description'], request.form['type'] or None)
+    get_current().addReference(ref)
+    return redirect(url_for('.view'))
+
+@document.route('/acknowledgment/<int:index>')
+@document_required
+def view_acknowledgment(index):
+    try:
+        ack = get_current()._acknowledgments[index]
+    except IndexError:
+        abort(404)
+    return render_template('document/view_acknowledgment.j2', acknowledgment=ack, index=index, action='Update')
+
+@document.route('/acknowledgment/<int:index>/edit', methods=['GET', 'POST'])
+@document_required
+def edit_acknowledgment(index):
+    try:
+        ack = get_current()._acknowledgments[index]
+    except IndexError:
+        abort(404)
+    if request.method != 'POST':
+        return render_template('document/edit_acknowledgment.j2', name=ack._name, organization=ack._organization, description=ack._description, url=ack._url, action='Update')
+
+    ack._name = request.form['name'] or None
+    ack._organization = request.form['organization'] or None
+    ack._description = request.form['description'] or None
+    ack._url = request.form['url'] or None
+    return redirect(url_for('.view'))
+
+@document.route('/acknowledgment/add', methods=['GET', 'POST'])
+@document_required
+def add_acknowledgment():
+    if request.method != 'POST':
+        return render_template('document/edit_acknowledgment.j2', action='Add')
+
+    ack = CVRFAcknowledgment()
+    ack._name = request.form['name'] or None
+    ack._organization = request.form['organization'] or None
+    ack._description = request.form['description'] or None
+    ack._url = request.form['url'] or None
+    get_current().addAcknowledgment(ack)
+    return redirect(url_for('.view'))
--- a/farol/main.py	Thu Sep 25 15:49:33 2014 +0200
+++ b/farol/main.py	Thu Sep 25 17:03:35 2014 +0200
@@ -24,17 +24,16 @@
 
 import os
 
-from farolluz.cvrf import (CVRF, CVRFPublisher, CVRFTracking, CVRFTrackingID,
-    CVRFGenerator, CVRFRevision, CVRFReference, CVRFAcknowledgment, CVRFNote,
-    ValidationError, CVRFAggregateSeverity)
-from farolluz.parsers.cvrf import parse, parseVersion, parseDate
+from farolluz.cvrf import CVRF, ValidationError
+from farolluz.parsers.cvrf import parse
 from farolluz.py2 import urlopen
 from farolluz.renderer import render as render_cvrf
 from farolluz.utils import utcnow
 
-from flask import Flask, request, render_template, redirect, url_for, flash, abort
+from flask import Flask, request, render_template, redirect, url_for, flash
 from werkzeug import secure_filename
 
+from .document import document
 from .session import get_current, set_current, has_current, del_current, document_required
 from .vulnerability import vulnerability
 from .producttree import producttree
@@ -44,6 +43,7 @@
 app.config.from_object('farol.config.Config')
 app.config.from_pyfile('farol.cfg', silent=True)
 
+app.register_blueprint(document, url_prefix='/document')
 app.register_blueprint(vulnerability, url_prefix='/vulnerability')
 app.register_blueprint(producttree, url_prefix='/producttree')
 
@@ -83,6 +83,10 @@
 def makeId(string):
     return secure_filename(string)
 
+@app.route('/')
+def welcome():
+    return render_template('welcome.j2')
+
 @app.route('/new', methods=['GET', 'POST'])
 def new():
     if request.method != 'POST':
@@ -104,243 +108,7 @@
         set_current(parse(request.form['text'].encode('utf-8')))
     else:
         set_current(CVRF(request.form['title'], request.form['type']))
-    return redirect(url_for('document'))
-
-@app.route('/')
-@document_required
-def document():
-    cvrf = get_current()
-    return render_template('doc.j2', cvrf=cvrf)
-
-@app.route('/title/edit', methods=['GET', 'POST'])
-@document_required
-def edit_title():
-    if request.method != 'POST':
-        return render_template('edit_title.j2', title = get_current()._title, _type = get_current()._type)
-
-
-    get_current()._title = request.form['title']
-    get_current()._type = request.form['type']
-    return redirect(url_for('document'))
-
-@app.route('/publisher/edit', methods=['GET', 'POST'])
-@document_required
-def edit_publisher():
-    if request.method != 'POST':
-        return render_template('edit_publisher.j2', publisher = get_current()._publisher or CVRFPublisher(''), types=CVRFPublisher.TYPES)
-
-    publisher = CVRFPublisher(request.form['type'], request.form['vendorid'] or None)
-    publisher.setContact(request.form['contact'] or None)
-    publisher.setAuthority(request.form['authority'] or None)
-    get_current().setPublisher(publisher)
-    return redirect(url_for('document'))
-
-@app.route('/tracking/edit', methods=['GET', 'POST'])
-@document_required
-def edit_tracking():
-    wasNone = False
-    tracking = get_current()._tracking
-    if tracking is None:
-        wasNone = True
-        tracking = CVRFTracking(CVRFTrackingID(''), 'Draft', (0,), utcnow(), utcnow())
-    generator = tracking._generator
-    if not tracking._generator:
-        generator = CVRFGenerator()
-    if request.method != 'POST':
-        return render_template('edit_tracking.j2', tracking=tracking, version='.'.join('%s'%v for v in tracking._version), generator=generator, now=utcnow(), statuses=tracking.STATUSES)
-
-    tracking._identification._id = request.form['id']
-    aliases = []
-    if request.form['id_aliases']:
-        aliases = [a.strip() for a in request.form['id_aliases'].split(',')]
-    tracking._identification._aliases = aliases
-    tracking._status = request.form['status']
-    tracking._version = parseVersion(request.form['version'])
-    tracking._initialDate = parseDate(request.form['initial'])
-    tracking._currentDate = parseDate(request.form['current'])
-    if wasNone:
-        get_current().setTracking(tracking)
-    if (not request.form['gen_engine']) and (not request.form['gen_date']):
-        generator = None
-    else:
-        generator._engine = request.form['gen_engine'] or None
-        if request.form['gen_date']:
-            generator._date = parseDate(request.form['gen_date'])
-        else:
-            generator._date = None
-    tracking.setGenerator(generator)
-    return redirect(url_for('document'))
-
-@app.route('/revision/<int:index>/edit', methods=['GET', 'POST'])
-@document_required
-def edit_revision(index):
-    cvrf = get_current()
-    if cvrf._tracking is None:
-        abort(404)
-    try:
-        revision = cvrf._tracking._history[index]
-    except IndexError:
-        abort(404)
-    if request.method != 'POST':
-        return render_template('edit_revision.j2', number='.'.join('%s'%v for v in revision._number), date=revision._date, description=revision._description, action='Update')
-
-    revision._number = parseVersion(request.form['number'])
-    revision._date = parseDate(request.form['date'])
-    revision._description = request.form['description']
-    return redirect(url_for('document'))
-
-@app.route('/revision/add', methods=['GET', 'POST'])
-@document_required
-def add_revision():
-    tracking = get_current()._tracking
-    if request.method != 'POST':
-        version = tracking._version
-        version = version[:-1] + (version[-1] + 1,)
-        return render_template('edit_revision.j2', number='.'.join("%d"%v for v in version), date=utcnow(), action='Add')
-
-    version = parseVersion(request.form['number'])
-    date = parseDate(request.form['date'])
-    revision = CVRFRevision(version, date, request.form['description'])
-    tracking.addRevision(revision)
-    if 'update_tracking' in request.form:
-        tracking._version = version
-        tracking._currentDate = date
-    return redirect(url_for('document'))
-
-@app.route('/distribution/edit', methods=['GET', 'POST'])
-@document_required
-def edit_distribution():
-    if request.method != 'POST':
-        return render_template('edit_distribution.j2', distribution=get_current()._distribution)
-
-    get_current().setDistribution(request.form['distribution'])
-    return redirect(url_for('document'))
-
-@app.route('/severity/edit', methods=['GET', 'POST'])
-@document_required
-def edit_severity():
-    severity = get_current()._aggregateseverity
-    if severity is None:
-        severity = CVRFAggregateSeverity('')
-    if request.method != 'POST':
-        return render_template('edit_severity.j2', severity=severity)
-    if not request.form['severity']:
-        severity = None
-    else:
-        severity._severity = request.form['severity']
-        severity.setNamespace(request.form['namespace'] or None)
-    get_current().setAggregateSeverity(severity)
-    return redirect(url_for('document'))
-
-@app.route('/note/<int:ordinal>')
-@document_required
-def view_note(ordinal):
-    note = get_current().getNote(ordinal)
-    if note is None:
-        abort(404)
-    return render_template('view_note.j2', note=note)
-
-@app.route('/note/<int:ordinal>/edit', methods=['GET', 'POST'])
-@document_required
-def edit_note(ordinal):
-    note = get_current().getNote(ordinal)
-    if note is None:
-        abort(404)
-    if request.method != 'POST':
-        return render_template('edit_note.j2', note=note, types = note.TYPES)
-
-    note._type = request.form['type']
-    note._ordinal = int(request.form['ordinal'])
-    note._note = request.form['note']
-    note._title = request.form['title'] or None
-    note._audience = request.form['audience'] or None
-    return redirect(url_for('view_note', ordinal=note._ordinal ))
-
-
-@app.route('/note/add', methods=['GET', 'POST'])
-@document_required
-def add_note():
-    if request.method != 'POST':
-        next_ordinal = 1
-        notes = get_current()._notes
-        if notes:
-            next_ordinal = notes[-1]._ordinal + 1
-        return render_template('edit_note.j2', ordinal=next_ordinal, types=CVRFNote.TYPES, action='Add')
-
-    title = None
-    audience = None
-    title = request.form['title'] or None
-    audience = request.form['audience'] or None
-
-    note = CVRFNote(request.form['type'], int(request.form['ordinal']), request.form['note'], title, audience)
-    get_current().addNote(note)
-    return redirect(url_for('document'))
-
-@app.route('/reference/<int:index>/edit', methods=['GET', 'POST'])
-@document_required
-def edit_reference(index):
-    try:
-        ref = get_current()._references[index]
-    except IndexError:
-        abort(404)
-    if request.method != 'POST':
-        return render_template('edit_reference.j2', _type=ref._type, url=ref._url, description=ref._description, types=('',) + ref.TYPES)
-
-    ref._type = request.form['type'] or None
-    ref._url = request.form['url']
-    ref._description = request.form['description']
-    return redirect(url_for('document'))
-
-
-@app.route('/reference/add', methods=['GET', 'POST'])
-@document_required
-def add_reference():
-    if request.method != 'POST':
-        return render_template('edit_reference.j2', action='Add', types=('',) + CVRFReference.TYPES)
-
-    ref = CVRFReference(request.form['url'], request.form['description'], request.form['type'] or None)
-    get_current().addReference(ref)
-    return redirect(url_for('document'))
-
-@app.route('/acknowledgment/<int:index>')
-@document_required
-def view_acknowledgment(index):
-    try:
-        ack = get_current()._acknowledgments[index]
-    except IndexError:
-        abort(404)
-    return render_template('view_acknowledgment.j2', acknowledgment=ack, index=index, action='Update')
-
-@app.route('/acknowledgment/<int:index>/edit', methods=['GET', 'POST'])
-@document_required
-def edit_acknowledgment(index):
-    try:
-        ack = get_current()._acknowledgments[index]
-    except IndexError:
-        abort(404)
-    if request.method != 'POST':
-        return render_template('edit_acknowledgment.j2', name=ack._name, organization=ack._organization, description=ack._description, url=ack._url, action='Update')
-
-    ack._name = request.form['name'] or None
-    ack._organization = request.form['organization'] or None
-    ack._description = request.form['description'] or None
-    ack._url = request.form['url'] or None
-    return redirect(url_for('document'))
-
-@app.route('/acknowledgment/add', methods=['GET', 'POST'])
-@document_required
-def add_acknowledgment():
-    if request.method != 'POST':
-        return render_template('edit_acknowledgment.j2', action='Add')
-
-    ack = CVRFAcknowledgment()
-    ack._name = request.form['name'] or None
-    ack._organization = request.form['organization'] or None
-    ack._description = request.form['description'] or None
-    ack._url = request.form['url'] or None
-    get_current().addAcknowledgment(ack)
-    return redirect(url_for('document'))
-
+    return redirect(url_for('document.view'))
 
 @app.route('/render/<format_>')
 @document_required
@@ -380,7 +148,7 @@
     os.remove(fpath)
     flash('"%s" has been removed from cache' % element)
     # Get some kind of id, and load the file.
-    return redirect(url_for('document'))
+    return redirect(url_for('document.view'))
 
 @app.route('/about')
 def about():
--- a/farol/static/style.css	Thu Sep 25 15:49:33 2014 +0200
+++ b/farol/static/style.css	Thu Sep 25 17:03:35 2014 +0200
@@ -3,6 +3,7 @@
     display: block;
 }
 /*
+// Try to push the footer to the bottom of the page
 html, body {
   height: 100%;
 }
--- a/farol/templates/base.j2	Thu Sep 25 15:49:33 2014 +0200
+++ b/farol/templates/base.j2	Thu Sep 25 17:03:35 2014 +0200
@@ -45,13 +45,16 @@
           <span class="icon-bar"></span>
           <span class="icon-bar"></span>
         </button>
-        <a class="navbar-brand" href="{{ url_for('document') }}">Farol</a>
+        <a class="navbar-brand" href="{{ url_for('welcome') }}">Farol</a>
       </div>
 
       {# Collect the nav links, forms, and other content for toggling #}
       <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
         <ul class="nav navbar-nav">
           <li{% if active == 'new' %} class="active"{% endif %}><a href="{{ url_for('new') }}">New</a></li>
+          {% if has_current %}
+          <li{% if active == 'document' %} class="active"{% endif %}><a href="{{ url_for('document.view') }}">Document</a></li>
+          {% endif %}
           {% if products %}
           <li class="dropdown{{ ' active' if active == 'product' }}">
             <a href="#" class="dropdown-toggle" data-toggle="dropdown">Products <span class="caret"></span></a>
--- a/farol/templates/doc.j2	Thu Sep 25 15:49:33 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,204 +0,0 @@
-{#
-# 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 %}
-{% block title %}Document{% endblock %}
-
-{% 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>
-  {% call panel(heading="Revision History (%d)" % cvrf._tracking._history | length, title=4) %}
-    {% for revision in cvrf._tracking._history %}
-      {% call panel() %}
-        <div class="form-horizontal">
-          <a class="pull-right" href="{{ url_for('edit_revision', index=loop.index0) }}">edit revision</a>
-          {{ label_value('Number', revision._number | join('.'), right=8) }}
-          {{ label_value('Date', revision._date) }}
-          {{ label_value('Description', revision._description) }}
-        </div>
-      {% endcall %}
-    {% endfor %}
-    <a class="pull-right" href="{{ url_for('add_revision') }}">add revision</a>
-  {% endcall %}
-  <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 (%d)" % 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 (%d)" % 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>)</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 (%d)" % 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) %}
-      {% if cvrf._producttree %}
-        {% call panel(heading="Branches (%d)" % cvrf._producttree._branches | length, title=4, extended=True) %}
-          {% for branch in cvrf._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>
-              {% 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>)
-              {% 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>
-              {% endif %}
-            {% endcall %}
-          {% endfor %}
-          <a href="{{ url_for('producttree.add_branch') }}" class="pull-right">add branch</a>
-        {% endcall %}
-        {% call panel(heading="Products (%d)" % cvrf._producttree.nbProducts(), title=4) %}
-          {% for product in cvrf._producttree._products if product._parent is sameas cvrf._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>
-          {% endfor %}
-          <a href="{{ url_for('producttree.add_product') }}" class="pull-right">add product</a>
-        {% endcall %}
-        {% call panel(heading="Relationships (%d)" % cvrf._producttree._relationships | length, title=4) %}
-          {% for relationship in cvrf._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 %}
-              {% 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>
-              {% endif %}
-            {% endcall %}
-          {% endfor %}
-          <a href="{{ url_for('producttree.add_relationship') }}" class="pull-right">add</a>
-        {% endcall %}
-        {% call panel(heading="Groups (%d)" % cvrf._producttree._groups | length, title=4) %}
-          {% for group in cvrf._producttree._groups %}
-            {% call panel() %}
-              <a href="{{ url_for('producttree.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>
-                  {% 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>
-        {% endcall %}
-      {% 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 (%d)" % 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 %}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/farol/templates/document/edit_acknowledgment.j2	Thu Sep 25 17:03:35 2014 +0200
@@ -0,0 +1,41 @@
+{#
+# 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, selectinput %}
+{% block title %}Edit the title{% endblock %}
+
+{% block content %}
+<form role="form" method="POST">
+
+{{ textinput("name", "Name", "", name) }}
+{{ textinput("organization", "Organization", "", organization) }}
+{{ textinput("description", "Description", "", description) }}
+{{ textinput("url", "URL", "http://...", url, type="url") }}
+
+<button class="btn btn-primary" type="submit">{{ action }}</button>
+<a class="btn btn-danger" href="{{ url_for('document') }}">Cancel</a>
+</form>
+{% endblock %}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/farol/templates/document/edit_distribution.j2	Thu Sep 25 17:03:35 2014 +0200
@@ -0,0 +1,36 @@
+{#
+# 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 textarea %}
+{% block title %}Edit the title{% endblock %}
+
+{% block content %}
+<form role="form" method="POST">
+{{ textarea("distribution", "Document Distribution", "", distribution) }}
+<button class="btn btn-primary" type="submit">Update</button>
+<a class="btn btn-danger" href="{{ url_for('document') }}">Cancel</a>
+</form>
+{% endblock %}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/farol/templates/document/edit_note.j2	Thu Sep 25 17:03:35 2014 +0200
@@ -0,0 +1,42 @@
+{#
+# 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, textarea, selectinput %}
+{% block title %}Edit the type{% endblock %}
+
+{% block content %}
+<form role="form" method="POST">
+
+{{ selectinput("type", "Type", types, note and note._type or '') }}
+{{ textinput("ordinal", "Ordinal", "", ordinal or note._ordinal, type="number", extras={'min': '1'}) }}
+{{ textinput("title", "Title", "", note and note._title or '') }}
+{{ textinput("audience", "Audience", "", note and note._audience or '') }}
+{{ textarea("note", "Note", "", note and note._note or '', 10, required=True) }}
+
+<button class="btn btn-primary" type="submit">{{ action or 'Update' }}</button>
+<a class="btn btn-danger" href="{% if action=='Add' %}{{ url_for('document') }}{% else %}{{ url_for('view_note', ordinal=note._ordinal) }}{% endif %}">Cancel</a>
+</form>
+{% endblock %}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/farol/templates/document/edit_publisher.j2	Thu Sep 25 17:03:35 2014 +0200
@@ -0,0 +1,41 @@
+{#
+# 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, textarea, selectinput %}
+{% block title %}Edit the type{% endblock %}
+
+{% block content %}
+<form role="form" method="POST">
+
+{{ selectinput("type", "Type", types, publisher._type) }}
+{{ textinput("vendorid", "Vendor ID", "", publisher._vendorid or '') }}
+{{ textarea("contact", "Contacts Details", "", publisher._contact or '', 3) }}
+{{ textarea("authority", "Issuing Authority", "", publisher._authority or '', 3) }}
+
+<button class="btn btn-primary" type="submit">Update</button>
+<a class="btn btn-danger" href="{{ url_for('document') }}">Cancel</a>
+</form>
+{% endblock %}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/farol/templates/document/edit_reference.j2	Thu Sep 25 17:03:35 2014 +0200
@@ -0,0 +1,40 @@
+{#
+# 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, selectinput %}
+{% block title %}Edit the title{% endblock %}
+
+{% block content %}
+<form role="form" method="POST">
+
+{{ selectinput("type", "Type", types, _type) }}
+{{ textinput("url", "URL", "http://...", url, type="url", required=True) }}
+{{ textinput("description", "Description", "", description, required=True) }}
+
+<button class="btn btn-primary" type="submit">{{ action or 'Update' }}</button>
+<a class="btn btn-danger" href="{{ url_for('document') }}">Cancel</a>
+</form>
+{% endblock %}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/farol/templates/document/edit_revision.j2	Thu Sep 25 17:03:35 2014 +0200
@@ -0,0 +1,47 @@
+{#
+# 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, textarea %}
+{% block title %}Edit Revision{% endblock %}
+
+{% block content %}
+<form role="form" method="POST">
+  {{ textinput("number", "Version", "a.b.c.d", number, required=True) }}
+  {{ textinput("date", "Date", "", date and date.isoformat() or '', required=True, type="datetime") }}
+  {{ textarea("description", "Description", "", description, 3, required=True) }}
+  {% if action == 'Add' %}
+    <div class="form-group">
+      <div class="checkbox">
+        <label>
+          <input name="update_tracking" type="checkbox" checked> Update Tracking Information
+        </label>
+      </div>
+    </div>
+  {% endif %}
+  <button class="btn btn-primary" type="submit">{{ action or 'Update' }}</button>
+  <a class="btn btn-danger" href="{{ url_for('document') }}">Cancel</a>
+</form>
+{% endblock %}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/farol/templates/document/edit_severity.j2	Thu Sep 25 17:03:35 2014 +0200
@@ -0,0 +1,37 @@
+{#
+# 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 %}
+{% block title %}Edit the Severity{% endblock %}
+
+{% block content %}
+<form role="form" method="POST">
+{{ textinput("namespace", "Namespace", "https://", severity._namespace, type='url') }}
+{{ textinput("severity", "Severity", "", severity._severity, help="If left empty, no Aggregate Severity will be set (i.e. no Namespace either).") }}
+<button class="btn btn-primary" type="submit">Update</button>
+<a class="btn btn-danger" href="{{ url_for('document') }}">Cancel</a>
+</form>
+{% endblock %}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/farol/templates/document/edit_title.j2	Thu Sep 25 17:03:35 2014 +0200
@@ -0,0 +1,37 @@
+{#
+# 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 %}
+{% block title %}Edit the title{% endblock %}
+
+{% block content %}
+<form role="form" method="POST">
+{{ textinput("title", "Document Title", "", title, required=True) }}
+{{ textinput("type", "Document Type", "", _type, required=True) }}
+<button class="btn btn-primary" type="submit">Update</button>
+<a class="btn btn-danger" href="{{ url_for('document') }}">Cancel</a>
+</form>
+{% endblock %}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/farol/templates/document/edit_tracking.j2	Thu Sep 25 17:03:35 2014 +0200
@@ -0,0 +1,48 @@
+{#
+# 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, textarea, selectinput, panel %}
+{% block title %}Edit the type{% endblock %}
+
+{% block content %}
+<form role="form" method="POST">
+
+{{ textinput("id", "ID", value=tracking._identification._id, required=True) }}
+{{ textinput("id_aliases", "Aliases", value=', '.join(tracking._identification._aliases)) }}
+{{ selectinput("status", "Status", statuses, tracking._status) }}
+{{ textinput("version", "Version", value=version, required=True) }}
+{{ textinput("initial", "Initial Release Date", value=tracking._initialDate.isoformat(), required=True, type="datetime") }}
+{{ textinput("current", "Current Release Date", value=tracking._currentDate.isoformat(), required=True, type="datetime") }}
+
+{% call panel(heading="Generator", title=3, collapsible=False) %}
+  {{ textinput("gen_engine", "Generator Engine", value=generator._engine or '') }}
+  {{ textinput("gen_date", "Generator Date", now.isoformat(), generator._date and generator._date.isoformat() or None, type="datetime") }}
+{% endcall %}
+
+<button class="btn btn-primary" type="submit">Update</button>
+<a class="btn btn-danger" href="{{ url_for('document') }}">Cancel</a>
+</form>
+{% endblock %}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/farol/templates/document/view.j2	Thu Sep 25 17:03:35 2014 +0200
@@ -0,0 +1,206 @@
+{#
+# 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 %}
+{% 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>
+  {% call panel(heading="Revision History (%d)" % cvrf._tracking._history | length, title=4) %}
+    {% for revision in cvrf._tracking._history %}
+      {% call panel() %}
+        <div class="form-horizontal">
+          <a class="pull-right" href="{{ url_for('.edit_revision', index=loop.index0) }}">edit revision</a>
+          {{ label_value('Number', revision._number | join('.'), right=8) }}
+          {{ label_value('Date', revision._date) }}
+          {{ label_value('Description', revision._description) }}
+        </div>
+      {% endcall %}
+    {% endfor %}
+    <a class="pull-right" href="{{ url_for('.add_revision') }}">add revision</a>
+  {% endcall %}
+  <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 (%d)" % 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 (%d)" % 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>)</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 (%d)" % 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) %}
+      {% if cvrf._producttree %}
+        {% call panel(heading="Branches (%d)" % cvrf._producttree._branches | length, title=4, extended=True) %}
+          {% for branch in cvrf._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>
+              {% 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>)
+              {% 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>
+              {% endif %}
+            {% endcall %}
+          {% endfor %}
+          <a href="{{ url_for('producttree.add_branch') }}" class="pull-right">add branch</a>
+        {% endcall %}
+        {% call panel(heading="Products (%d)" % cvrf._producttree.nbProducts(), title=4) %}
+          {% for product in cvrf._producttree._products if product._parent is sameas cvrf._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>
+          {% endfor %}
+          <a href="{{ url_for('producttree.add_product') }}" class="pull-right">add product</a>
+        {% endcall %}
+        {% call panel(heading="Relationships (%d)" % cvrf._producttree._relationships | length, title=4) %}
+          {% for relationship in cvrf._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 %}
+              {% 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>
+              {% endif %}
+            {% endcall %}
+          {% endfor %}
+          <a href="{{ url_for('producttree.add_relationship') }}" class="pull-right">add</a>
+        {% endcall %}
+        {% call panel(heading="Groups (%d)" % cvrf._producttree._groups | length, title=4) %}
+          {% for group in cvrf._producttree._groups %}
+            {% call panel() %}
+              <a href="{{ url_for('producttree.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>
+                  {% 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>
+        {% endcall %}
+      {% 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 (%d)" % 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 %}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/farol/templates/document/view_acknowledgment.j2	Thu Sep 25 17:03:35 2014 +0200
@@ -0,0 +1,39 @@
+{#
+# 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 label_value %}
+{% block title %}{{ acknowledgment.getTitle() }}{% endblock %}
+
+{% block content %}
+<a class="pull-right" href="{{ url_for('.edit_acknowledgment', index=index) }}">edit</a>
+<div class='page-header'>
+  <h1>{{ acknowledgment._name }} <small>{{ acknowledgment._organization }}</small></h1>
+</div>
+<div class="form-horizontal">
+  {{ label_value('Description', acknowledgment._description or '') }}
+  {{ label_value('URL', (acknowledgment._url or '') | urlize) }}
+</div>
+{% endblock %}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/farol/templates/document/view_note.j2	Thu Sep 25 17:03:35 2014 +0200
@@ -0,0 +1,37 @@
+{#
+# 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" %}
+
+{% block title %}{{ note._title }}{% endblock %}
+
+{% block content %}
+<a class="pull-right" href="{{ url_for('.edit_note', ordinal=note._ordinal) }}">edit</a>
+<div class='page-header'>
+  <h1>{{ note._title or '' }} <small>{{ note._type }} (#{{ note._ordinal }})</small></h1>
+</div>
+{% if note._audience %}<p>Audience: <em>{{ note._audience }}</em></p>{% endif %}
+<p>{{ note._note | replace('\n', '<br>') }}</p>
+{% endblock %}
--- a/farol/templates/edit_acknowledgment.j2	Thu Sep 25 15:49:33 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-{#
-# 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, selectinput %}
-{% block title %}Edit the title{% endblock %}
-
-{% block content %}
-<form role="form" method="POST">
-
-{{ textinput("name", "Name", "", name) }}
-{{ textinput("organization", "Organization", "", organization) }}
-{{ textinput("description", "Description", "", description) }}
-{{ textinput("url", "URL", "http://...", url, type="url") }}
-
-<button class="btn btn-primary" type="submit">{{ action }}</button>
-<a class="btn btn-danger" href="{{ url_for('document') }}">Cancel</a>
-</form>
-{% endblock %}
--- a/farol/templates/edit_distribution.j2	Thu Sep 25 15:49:33 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-{#
-# 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 textarea %}
-{% block title %}Edit the title{% endblock %}
-
-{% block content %}
-<form role="form" method="POST">
-{{ textarea("distribution", "Document Distribution", "", distribution) }}
-<button class="btn btn-primary" type="submit">Update</button>
-<a class="btn btn-danger" href="{{ url_for('document') }}">Cancel</a>
-</form>
-{% endblock %}
--- a/farol/templates/edit_note.j2	Thu Sep 25 15:49:33 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-{#
-# 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, textarea, selectinput %}
-{% block title %}Edit the type{% endblock %}
-
-{% block content %}
-<form role="form" method="POST">
-
-{{ selectinput("type", "Type", types, note and note._type or '') }}
-{{ textinput("ordinal", "Ordinal", "", ordinal or note._ordinal, type="number", extras={'min': '1'}) }}
-{{ textinput("title", "Title", "", note and note._title or '') }}
-{{ textinput("audience", "Audience", "", note and note._audience or '') }}
-{{ textarea("note", "Note", "", note and note._note or '', 10, required=True) }}
-
-<button class="btn btn-primary" type="submit">{{ action or 'Update' }}</button>
-<a class="btn btn-danger" href="{% if action=='Add' %}{{ url_for('document') }}{% else %}{{ url_for('view_note', ordinal=note._ordinal) }}{% endif %}">Cancel</a>
-</form>
-{% endblock %}
--- a/farol/templates/edit_publisher.j2	Thu Sep 25 15:49:33 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-{#
-# 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, textarea, selectinput %}
-{% block title %}Edit the type{% endblock %}
-
-{% block content %}
-<form role="form" method="POST">
-
-{{ selectinput("type", "Type", types, publisher._type) }}
-{{ textinput("vendorid", "Vendor ID", "", publisher._vendorid or '') }}
-{{ textarea("contact", "Contacts Details", "", publisher._contact or '', 3) }}
-{{ textarea("authority", "Issuing Authority", "", publisher._authority or '', 3) }}
-
-<button class="btn btn-primary" type="submit">Update</button>
-<a class="btn btn-danger" href="{{ url_for('document') }}">Cancel</a>
-</form>
-{% endblock %}
--- a/farol/templates/edit_reference.j2	Thu Sep 25 15:49:33 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-{#
-# 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, selectinput %}
-{% block title %}Edit the title{% endblock %}
-
-{% block content %}
-<form role="form" method="POST">
-
-{{ selectinput("type", "Type", types, _type) }}
-{{ textinput("url", "URL", "http://...", url, type="url", required=True) }}
-{{ textinput("description", "Description", "", description, required=True) }}
-
-<button class="btn btn-primary" type="submit">{{ action or 'Update' }}</button>
-<a class="btn btn-danger" href="{{ url_for('document') }}">Cancel</a>
-</form>
-{% endblock %}
--- a/farol/templates/edit_revision.j2	Thu Sep 25 15:49:33 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-{#
-# 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, textarea %}
-{% block title %}Edit Revision{% endblock %}
-
-{% block content %}
-<form role="form" method="POST">
-  {{ textinput("number", "Version", "a.b.c.d", number, required=True) }}
-  {{ textinput("date", "Date", "", date and date.isoformat() or '', required=True, type="datetime") }}
-  {{ textarea("description", "Description", "", description, 3, required=True) }}
-  {% if action == 'Add' %}
-    <div class="form-group">
-      <div class="checkbox">
-        <label>
-          <input name="update_tracking" type="checkbox" checked> Update Tracking Information
-        </label>
-      </div>
-    </div>
-  {% endif %}
-  <button class="btn btn-primary" type="submit">{{ action or 'Update' }}</button>
-  <a class="btn btn-danger" href="{{ url_for('document') }}">Cancel</a>
-</form>
-{% endblock %}
--- a/farol/templates/edit_severity.j2	Thu Sep 25 15:49:33 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-{#
-# 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 %}
-{% block title %}Edit the Severity{% endblock %}
-
-{% block content %}
-<form role="form" method="POST">
-{{ textinput("namespace", "Namespace", "https://", severity._namespace, type='url') }}
-{{ textinput("severity", "Severity", "", severity._severity, help="If left empty, no Aggregate Severity will be set (i.e. no Namespace either).") }}
-<button class="btn btn-primary" type="submit">Update</button>
-<a class="btn btn-danger" href="{{ url_for('document') }}">Cancel</a>
-</form>
-{% endblock %}
--- a/farol/templates/edit_title.j2	Thu Sep 25 15:49:33 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-{#
-# 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 %}
-{% block title %}Edit the title{% endblock %}
-
-{% block content %}
-<form role="form" method="POST">
-{{ textinput("title", "Document Title", "", title, required=True) }}
-{{ textinput("type", "Document Type", "", _type, required=True) }}
-<button class="btn btn-primary" type="submit">Update</button>
-<a class="btn btn-danger" href="{{ url_for('document') }}">Cancel</a>
-</form>
-{% endblock %}
--- a/farol/templates/edit_tracking.j2	Thu Sep 25 15:49:33 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-{#
-# 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, textarea, selectinput, panel %}
-{% block title %}Edit the type{% endblock %}
-
-{% block content %}
-<form role="form" method="POST">
-
-{{ textinput("id", "ID", value=tracking._identification._id, required=True) }}
-{{ textinput("id_aliases", "Aliases", value=', '.join(tracking._identification._aliases)) }}
-{{ selectinput("status", "Status", statuses, tracking._status) }}
-{{ textinput("version", "Version", value=version, required=True) }}
-{{ textinput("initial", "Initial Release Date", value=tracking._initialDate.isoformat(), required=True, type="datetime") }}
-{{ textinput("current", "Current Release Date", value=tracking._currentDate.isoformat(), required=True, type="datetime") }}
-
-{% call panel(heading="Generator", title=3, collapsible=False) %}
-  {{ textinput("gen_engine", "Generator Engine", value=generator._engine or '') }}
-  {{ textinput("gen_date", "Generator Date", now.isoformat(), generator._date and generator._date.isoformat() or None, type="datetime") }}
-{% endcall %}
-
-<button class="btn btn-primary" type="submit">Update</button>
-<a class="btn btn-danger" href="{{ url_for('document') }}">Cancel</a>
-</form>
-{% endblock %}
--- a/farol/templates/load.j2	Thu Sep 25 15:49:33 2014 +0200
+++ b/farol/templates/load.j2	Thu Sep 25 17:03:35 2014 +0200
@@ -31,6 +31,6 @@
 <p>You asked to load {{ element }}, but you still have an unsaved document loaded. Do you want to <a href="{{ url_for('save') }}">save</a> it first ?</p>
 <form role="form" method="POST">
 <button class="btn btn-primary" type="submit">Load "{{ element }}"</button>
-<a class="btn btn-danger" href="{{ url_for('document') }}">Cancel</a>
+<a class="btn btn-danger" href="{{ url_for('welcome') }}">Cancel</a>
 </form>
 {% endblock %}
--- a/farol/templates/save.j2	Thu Sep 25 15:49:33 2014 +0200
+++ b/farol/templates/save.j2	Thu Sep 25 17:03:35 2014 +0200
@@ -31,6 +31,6 @@
 <form role="form" method="POST">
 {{ textinput("fname", "File name", "doc1", id_, required=True) }}
 <button class="btn btn-primary" type="submit">Save</button>
-<a class="btn btn-danger" href="{{ url_for('document') }}">Cancel</a>
+<a class="btn btn-danger" href="{{ url_for('document.view') }}">Cancel</a>
 </form>
 {% endblock %}
--- a/farol/templates/view_acknowledgment.j2	Thu Sep 25 15:49:33 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-{#
-# 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 label_value %}
-{% block title %}{{ acknowledgment.getTitle() }}{% endblock %}
-
-{% block content %}
-<a class="pull-right" href="{{ url_for('.edit_acknowledgment', index=index) }}">edit</a>
-<div class='page-header'>
-  <h1>{{ acknowledgment._name }} <small>{{ acknowledgment._organization }}</small></h1>
-</div>
-<div class="form-horizontal">
-  {{ label_value('Description', acknowledgment._description or '') }}
-  {{ label_value('URL', (acknowledgment._url or '') | urlize) }}
-</div>
-{% endblock %}
--- a/farol/templates/view_note.j2	Thu Sep 25 15:49:33 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-{#
-# 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" %}
-
-{% block title %}{{ note._title }}{% endblock %}
-
-{% block content %}
-<a class="pull-right" href="{{ url_for('.edit_note', ordinal=note._ordinal) }}">edit</a>
-<div class='page-header'>
-  <h1>{{ note._title or '' }} <small>{{ note._type }} (#{{ note._ordinal }})</small></h1>
-</div>
-{% if note._audience %}<p>Audience: <em>{{ note._audience }}</em></p>{% endif %}
-<p>{{ note._note | replace('\n', '<br>') }}</p>
-{% endblock %}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/farol/templates/welcome.j2	Thu Sep 25 17:03:35 2014 +0200
@@ -0,0 +1,52 @@
+{#
+# 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" %}
+
+{% block title %}Welcome{% endblock %}
+
+{% block content %}
+<div class="jumbotron">
+  <h1>Farol <small>A Security Advisory Management Platform</small></h1>
+  <p>Security Advisories have existed for ever. Whenever someone discovered a danger, a vulnerability, he immediately started spreading the words about it.</p>
+  <p>In the IT World, each Party involved with security vulnerabilities have its own way of dealing with the matter, and although standards exist they aren't used much to their full extend.<p>
+  <p>This Platform is an attempt at bringing all those worlds together.<p>
+  <p><a class="btn btn-primary btn-lg" role="button" href="{{ url_for('new') }}">Start !</a></p>
+</div>
+<div class="row">
+  <div class="col-sm-6">
+    <div class="thumbnail">
+      <h3>Security Advisories</h3>
+      <p>A Security Advisory is ...</p>
+    </div>
+  </div>
+  <div class="col-sm-6">
+    <div class="thumbnail">
+      <h3>Advisory formats</h3>
+      <p>Each Party publish Advisories in a format that fit them ...</p>
+    </div>
+  </div>
+</div>
+{% endblock %}

http://farol.wald.intevation.org