diff farol/templates/base.j2 @ 0:4a9f23230eba

Initial Release
author Benoît Allard <benoit.allard@greenbone.net>
date Wed, 24 Sep 2014 10:07:49 +0200
parents
children 63b00c10ada8
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/farol/templates/base.j2	Wed Sep 24 10:07:49 2014 +0200
@@ -0,0 +1,126 @@
+{#
+# 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.
+-#}
+
+<!doctype html>
+
+<html lang="en">
+<head>
+  <meta charset="utf8">
+  <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') }}">
+</head>
+<body>
+  <script src="{{ url_for('static', filename='jquery-2.1.1.min.js') }}"></script>
+  <script src="{{ url_for('static', filename='bootstrap.js') }}"></script>
+  <nav class="navbar navbar-default" role="navigation">
+    <div class="container">
+      {# Brand and toggle get grouped for better mobile display #}
+      <div class="navbar-header">
+        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
+          <span class="sr-only">Toggle navigation</span>
+          <span class="icon-bar"></span>
+          <span class="icon-bar"></span>
+          <span class="icon-bar"></span>
+        </button>
+        <a class="navbar-brand" href="{{ url_for('document') }}">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 products %}
+          <li class="dropdown{{ ' active' if active == 'product' }}">
+            <a href="#" class="dropdown-toggle" data-toggle="dropdown">Products <span class="caret"></span></a>
+            <ul class="dropdown-menu" role="menu">
+              {% for name, productid in products %}
+                <li><a href="{{ url_for('producttree.view_product', productid=productid) }}">{{ name }}</a></li>
+              {% endfor %}
+            </ul>
+          </li>
+          {% endif %}
+          {% if vulnerabilities %}
+          <li class="dropdown{{ ' active' if active == 'vulnerability' }}">
+            <a href="#" class="dropdown-toggle" data-toggle="dropdown">Vulnerabilities <span class="caret"></span></a>
+            <ul class="dropdown-menu" role="menu">
+              {% for name, ord in vulnerabilities %}
+                <li><a href="{{ url_for('vulnerability.view', ordinal=ord) }}">{{ name }}</a></li>
+              {% endfor %}
+            </ul>
+          </li>
+          {% endif %}
+          {% 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>
+            {% else %}
+              <p class="navbar-text">Document looks valid</p>
+            {% endif %}
+          {% endif %}
+        </ul>
+        <ul class="nav navbar-nav navbar-right">
+          <li class="dropdown{{ ' disabled' if not has_current }}{{ ' active' if active == 'render' }}">
+            <a href="#" class="dropdown-toggle{{ ' disabled' if not has_current }}" data-toggle="dropdown">Render <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>
+          </li>
+          <li>
+            <form action="{{ url_for('save') }}">
+              <button class="btn btn-success navbar-btn"{% if not has_current %} disabled="disabled"{% endif %}>Save</button>
+            </form>
+          </li>
+          <li class="dropdown">
+            <a href="#" class="dropdown-toggle" data-toggle="dropdown">Cache <span class="caret"></span></a>
+            <ul class="dropdown-menu" role="menu">
+              {% for element in cache | sort %}<li><a href="{{ url_for('load', element=element)}}">{{ element | capitalize }}</a></li>{% endfor %}
+            </ul>
+          </li>
+        </ul>
+      </div>{# /.navbar-collapse #}
+    </div>{# /.container-fluid #}
+  </nav>
+  <div class="main container">
+    {% with messages = get_flashed_messages(with_categories=True) %}
+      {% if messages %}
+      <div class="flashes">
+      {% for category, message in messages %}
+        {% if category == 'message' %}{% set category = "info" %}{% endif %}
+        <div class="alert alert-{{ category }}">{{ message }}</div>
+      {% endfor %}
+      </div>
+      {% endif %}
+    {% endwith %}
+    <div>
+      <script>$("#error-popover").popover();</script>
+      {% block content %}{% endblock %}
+    </div>
+  </div>
+  <footer class="footer container-fluid">
+    <a class="pull-right" href="{{ url_for('about') }}">About ...</a>
+    <p class="text-muted">Copyright &copy; 2014 <a href="http://greenbone.net">Greenbone Networks GmbH</a></p>
+  </footer>
+</body>
+</html>

http://farol.wald.intevation.org