changeset 28:6c65b16f2680

Rework the 'new' page
author Benoît Allard <benoit.allard@greenbone.net>
date Thu, 02 Oct 2014 12:09:28 +0200
parents 69e0330c4fae
children 891ee029a899
files farol/templates/base.j2 farol/templates/new.j2
diffstat 2 files changed, 32 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/farol/templates/base.j2	Thu Oct 02 12:08:48 2014 +0200
+++ b/farol/templates/base.j2	Thu Oct 02 12:09:28 2014 +0200
@@ -27,7 +27,7 @@
 
 <html lang="en">
 <head>
-  <meta charset="utf8">
+  <meta charset="utf-8">
   <title>Farol - {% block title %}{% endblock %}</title>
   <link rel="stylesheet" href="{{ url_for('static', filename='bootstrap.css') }}">
   <link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
--- a/farol/templates/new.j2	Thu Oct 02 12:08:48 2014 +0200
+++ b/farol/templates/new.j2	Thu Oct 02 12:09:28 2014 +0200
@@ -42,7 +42,7 @@
     <div class="panel-heading">
       <h4 class="panel-title">
         <a data-toggle="collapse" data-parent="#accordion" href="#fromURL">
-          Download a document from an URL
+          Download a document
         </a>
       </h4>
     </div>
@@ -52,27 +52,39 @@
           {% for (type, placeholder) in [
                 ('RHSA', 'YYYY:nnnn'),
                 ('Oracle', 'nnnnnnn'),
-                ('Cisco', 'sa-YYYYMMDD-xxx'),
-                ('NASL', '')] %}
-          <div class="col-lg-3">
+                ('Cisco', 'sa-YYYYMMDD-xxx')] %}
+          <div class="col-lg-4">
             <form role="form" method="POST">
               <input type="hidden" name="{{ type | lower}}">
-              <div class="input-group">
-                <span class="input-group-addon">{{ type }}: </span>
-                <input type="text" class="form-control" name="id" placeholder="{{ placeholder }}">
-                <span class="input-group-btn">
-                  <button class="btn btn-primary" type="submit">Download</button>
-                </span>
-              </div><!-- /input-group -->
+              <div class="form-group">
+                <div class="input-group">
+                  <span class="input-group-addon">{{ type }}: </span>
+                  <input type="text" class="form-control" name="id" placeholder="{{ placeholder }}" id="{{ type | lower }}_id" required>
+                  <span class="input-group-btn">
+                    <button class="btn btn-primary" type="submit">Download</button>
+                  </span>
+                </div><!-- /input-group -->
+              </div>
             </form>
           </div>
           {% endfor %}
         </div>
-        <hr>
+        <div class="">
         <form role="form" method="POST">
-          {{ textinput("url", "URL", "https://...", required=True, type="url") }}
-          <button type="submit", class="btn btn-primary">Download</button>
+          <div class="form-group">
+            <div class="input-group">
+              <span class="input-group-addon">URL: </span>
+              <input type="url" class="form-control" name="url" placeholder="https://..." id="url_id" required>
+              <span class="input-group-btn">
+                <button class="btn btn-primary" type="submit">Download</button>
+              </span>
+            </div><!-- /input-group -->
+          </div>
         </form>
+        </div>
+        <hr>
+        {% set comma = joiner(', ') %}
+        <p>Some examples: {% for (name, id, value) in [('Red Hat Security Advisory: kernel security, bug fix, and enhancement update', 'rhsa', '2014:0981'), ('Oracle Critical Patch Update Advisory - April 2014', 'oracle' , '2188432'), ('Multiple Vulnerabilities in OpenSSL Affecting Cisco Products','cisco','sa-20140605-openssl'), ('Greenbone Security Advisory 2013-01', 'url', 'http://www.greenbone.net/download/gbsa/gbsa2013-01.cvrf')] %}{{ comma() }}<a href="#" onclick="$('#{{ id }}_id').val('{{ value }}')">{{ name }}</a>{% endfor %}
       </div>
     </div>
   </div>
@@ -81,7 +93,7 @@
     <div class="panel-heading">
       <h4 class="panel-title">
         <a data-toggle="collapse" data-parent="#accordion" href="#fromFile">
-          Upload document
+          Upload a document
         </a>
       </h4>
     </div>
@@ -89,7 +101,7 @@
       <div class="panel-body">
         <form role="form" method="POST" enctype="multipart/form-data">
           {{ textinput("local", "Local File", type="file", required=True) }}
-          <button type="submit", class="btn btn-primary">Upload</button>
+          <button type="submit" class="btn btn-primary">Upload</button>
         </form>
       </div>
     </div>
@@ -99,7 +111,7 @@
     <div class="panel-heading">
       <h4 class="panel-title">
         <a data-toggle="collapse" data-parent="#accordion" href="#fromText">
-          Some text
+          Raw text
         </a>
       </h4>
     </div>
@@ -129,7 +141,7 @@
     <CurrentReleaseDate>' + now.isoformat() + '</CurrentReleaseDate>
   </DocumentTracking>
 </cvrfdoc>' | escape, required=True) }}
-          <button type="submit", class="btn btn-primary">Parse</button>
+          <button type="submit" class="btn btn-primary">Parse</button>
         </form>
       </div>
     </div>
@@ -148,7 +160,7 @@
         <form role="form" method="POST">
           {{ textinput("title", "Document Title", required=True) }}
           {{ textinput("type", "Document Type", "Security Advisory", required=True) }}
-          <button type="submit", class="btn btn-primary">Create</button>
+          <button type="submit" class="btn btn-primary">Create</button>
         </form>
       </div>
     </div>

http://farol.wald.intevation.org