changeset 125:67c4b299736e

Update look-and-feel
author Benoît Allard <benoit.allard@greenbone.net>
date Thu, 23 Oct 2014 16:18:30 +0200
parents 98cf4a6457f4
children e0830bcab004
files farol/main.py farol/templates/about.j2 farol/templates/base.j2 farol/templates/welcome.j2
diffstat 4 files changed, 45 insertions(+), 34 deletions(-) [+]
line wrap: on
line diff
--- a/farol/main.py	Fri Oct 17 16:09:09 2014 +0200
+++ b/farol/main.py	Thu Oct 23 16:18:30 2014 +0200
@@ -89,7 +89,13 @@
 
 @app.route('/')
 def welcome():
-    return render_template('welcome.j2')
+    return render_template('welcome.j2',
+        version=__version__,
+        imports=[('New', 100), ('CVRF', 100)],
+        exports=[('CVRF', 100), ('OpenVAS NASL from RHSA', 85), ('OVAL', 5) ],
+        use_cases=[('Create a security advisory and publish as CVRF', 100),
+                   ('Edit a security advisory in CVRF format', 100)]
+    )
 
 def set_url(url):
     try: content = urlopen(url).read()
--- a/farol/templates/about.j2	Fri Oct 17 16:09:09 2014 +0200
+++ b/farol/templates/about.j2	Thu Oct 23 16:18:30 2014 +0200
@@ -30,14 +30,12 @@
 
 {% block content %}
 <div class="page-header">
-<h1>Farol <small>A Security Advisory Management (Web) Platform</small></h1>
+<h1>Farol <small>The Security Advisory Management Platform</small></h1>
 </div>
 
 <div>
-  <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>In the current version, Advisories not currently saved are kept in memory of the running process. If the process terminates, and they are not saved, documents are lost.</p>
+  <p>This web platform offers to review, create, edit and transform security advisories supporting various input and output formats.</p>
+  <p>During your session the advisory is stored in a cache from which you should save your changes to your local file system.</p>
   {% if config.DEBUG and not config.DEBUG_SURE %}
     <hr>
     <h3 id="debug">Debug Mode</h3>
--- a/farol/templates/base.j2	Fri Oct 17 16:09:09 2014 +0200
+++ b/farol/templates/base.j2	Thu Oct 23 16:18:30 2014 +0200
@@ -65,7 +65,7 @@
                 <a role="menuitem" tabindex="-1" href="{{ url_for('producttree.view') }}">View Product Tree</a>
               </li>
               <li role="presentation" class="divider"></li>
-              {% for name, productid in products %}
+              {% for name, productid in products | sort %}
                 <li><a href="{{ url_for('producttree.view_product', productid=productid) }}">{{ name }}</a></li>
               {% endfor %}
             </ul>
@@ -84,15 +84,15 @@
         </ul>
         {% if has_current %}
           {% if error %}
-            <p class="navbar-text">Document is <a id="error-popover" href="#" tabindex="0" class="navbar-link" data-toggle="popover" data-trigger="focus" data-placement="bottom" title="First Error:" data-content="{{ error }}"><strong>invalid</strong></a></p>
+            <p class="navbar-text">Document is <a id="error-popover" href="#" tabindex="0" class="navbar-link" data-toggle="popover" data-trigger="focus" data-placement="bottom" title="First Error:" data-content="{{ error }}"><strong>invalid</strong></a> <span class="badge progress-bar-danger"><strong>&#x2717;</strong></span></p>
           {% else %}
-            <p class="navbar-text">Document looks valid</p>
+            <p class="navbar-text">Document looks valid <span class="badge progress-bar-success"><strong>&#x2713;</strong></span></p>
           {% endif %}
         {% endif %}
         <ul class="nav navbar-nav navbar-right">
           {% if has_current %}
           <li class="dropdown{{ ' active' if active == 'render' }}">
-            <a href="#" class="dropdown-toggle" data-toggle="dropdown">Render <span class="caret"></span></a>
+            <a href="#" class="dropdown-toggle" data-toggle="dropdown">Export <span class="caret"></span></a>
             <ul class="dropdown-menu" role="menu">
               {% for format in ('cvrf', 'nasl', 'oval') %}<li><a href="{{ url_for('render', format_=format)}}">as {{ format | upper }}</a></li>{% endfor %}
             </ul>
--- a/farol/templates/welcome.j2	Fri Oct 17 16:09:09 2014 +0200
+++ b/farol/templates/welcome.j2	Thu Oct 23 16:18:30 2014 +0200
@@ -24,36 +24,43 @@
 -#}
 
 {% extends "base.j2" %}
+{% from "macros.j2" import panel %}
+
+{% macro progress_label(progress) -%}
+<span class="label label-
+{%- if progress < 70 %}danger{% elif progress < 95 %}warning{% else %}success{% endif -%}
+">{{ progress }}%</span>
+{%- endmacro %}
 
 {% block title %}Welcome{% endblock %}
 
 {% block content %}
-<div class="jumbotron">
-  <h1>Farol <small>A Security Advisory Management Platform</small></h1>
-  <p>Farol is a web platform to manipulate Security Advisories. The main structure is highly inspired from the structure of a CVRF document.</p>
-  <p>This platform is meant as a way to review / create / edit / publish Security Advisories in an accessible way.</p>
-  <p><a class="btn btn-primary btn-lg" role="button" href="{{ url_for('new') }}">Start !</a></p>
+<div class="well well-lg">
+  <h1>Farol <small>The Security Advisory Management Platform</small></h1>
+  <div class="pull-right"><a class="btn btn-primary btn-lg" role="button" href="{{ url_for('new') }}" >Start !</a></div>
+  <p>This web platform offers to review, create, edit and transform security advisories supporting various input and output formats. During your session the advisory is stored in a cache from which you should save your changes to your local file system.</p>
 </div>
-<img src="{{ url_for('static', filename="flower.png") }}" class="img-responsive img-thumbnail" alt="Security Advisories interactions">
 <div class="row">
-  <div class="col-sm-6">
-    <div class="thumbnail">
-      <h3>Security Advisories</h3>
-      <p>A Security Advisory is about the <em>communication</em> of the information that some <em>vulnerability</em> is present in some <em>product</em>.</p>
-      <dl>
-        <dt>communication</dt>
-        <dd>In order to be fully effective, Security Advisories should be sahred.</dd>
-        <dt>vulnerability</dt>
-        <dd>A vulnerability is a weakness which allows an attacker to reduce a system's information assurance. <cite>(Wikipedia)</cite></dd>
-        <dt>product</dt>
-        <dd>A product contains vulnerabilities.</dd>
-    </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 class="col-sm-9"><img src="{{ url_for('static', filename="flower.png") }}" class="img-responsive img-thumbnail" alt="Security Advisories interactions"></div>
+  <div class="col-sm-3">
+    {% call panel(heading="Platform status", collapsible=False) %}
+    <div><span class="pull-right badge">{{ version }}</span>Farol version:</div>
+    {% endcall %}
+    {% call panel(heading="Supported input formats", collapsible=False) %}
+      {% for format, progress in imports %}
+        <div>{{ format }} <span class="pull-right">{{ progress_label(progress) }}</span></div>
+      {% endfor %}
+    {% endcall %}
+    {% call panel(heading="Supported output formats", collapsible=False) %}
+      {% for format, progress in exports %}
+        <div>{{ format }} <span class="pull-right">{{ progress_label(progress) }}</span></div>
+      {% endfor %}
+    {% endcall %}
+    {% call panel(heading="Supported use cases", collapsible=False) %}
+      {% for use_case, progress in use_cases %}
+        <div><span class="pull-right">{{ progress_label(progress) }}</span>{{ use_case }}</div>
+      {% endfor %}
+    {% endcall %}
   </div>
 </div>
 {% endblock %}

http://farol.wald.intevation.org