comparison 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
comparison
equal deleted inserted replaced
-1:000000000000 0:4a9f23230eba
1 {#
2 # Description:
3 # Web Template used in Farol Design
4 #
5 # Authors:
6 # BenoƮt Allard <benoit.allard@greenbone.net>
7 #
8 # Copyright:
9 # Copyright (C) 2014 Greenbone Networks GmbH
10 #
11 # This program is free software; you can redistribute it and/or
12 # modify it under the terms of the GNU General Public License
13 # as published by the Free Software Foundation; either version 2
14 # of the License, or (at your option) any later version.
15 #
16 # This program is distributed in the hope that it will be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 # GNU General Public License for more details.
20 #
21 # You should have received a copy of the GNU General Public License
22 # along with this program; if not, write to the Free Software
23 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
24 -#}
25
26 <!doctype html>
27
28 <html lang="en">
29 <head>
30 <meta charset="utf8">
31 <title>Farol - {% block title %}{% endblock %}</title>
32 <link rel="stylesheet" href="{{ url_for('static', filename='bootstrap.css') }}">
33 <link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
34 </head>
35 <body>
36 <script src="{{ url_for('static', filename='jquery-2.1.1.min.js') }}"></script>
37 <script src="{{ url_for('static', filename='bootstrap.js') }}"></script>
38 <nav class="navbar navbar-default" role="navigation">
39 <div class="container">
40 {# Brand and toggle get grouped for better mobile display #}
41 <div class="navbar-header">
42 <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
43 <span class="sr-only">Toggle navigation</span>
44 <span class="icon-bar"></span>
45 <span class="icon-bar"></span>
46 <span class="icon-bar"></span>
47 </button>
48 <a class="navbar-brand" href="{{ url_for('document') }}">Farol</a>
49 </div>
50
51 {# Collect the nav links, forms, and other content for toggling #}
52 <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
53 <ul class="nav navbar-nav">
54 <li{% if active == 'new' %} class="active"{% endif %}><a href="{{ url_for('new') }}">New</a></li>
55 {% if products %}
56 <li class="dropdown{{ ' active' if active == 'product' }}">
57 <a href="#" class="dropdown-toggle" data-toggle="dropdown">Products <span class="caret"></span></a>
58 <ul class="dropdown-menu" role="menu">
59 {% for name, productid in products %}
60 <li><a href="{{ url_for('producttree.view_product', productid=productid) }}">{{ name }}</a></li>
61 {% endfor %}
62 </ul>
63 </li>
64 {% endif %}
65 {% if vulnerabilities %}
66 <li class="dropdown{{ ' active' if active == 'vulnerability' }}">
67 <a href="#" class="dropdown-toggle" data-toggle="dropdown">Vulnerabilities <span class="caret"></span></a>
68 <ul class="dropdown-menu" role="menu">
69 {% for name, ord in vulnerabilities %}
70 <li><a href="{{ url_for('vulnerability.view', ordinal=ord) }}">{{ name }}</a></li>
71 {% endfor %}
72 </ul>
73 </li>
74 {% endif %}
75 {% if has_current %}
76 {% if error %}
77 <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>
78 {% else %}
79 <p class="navbar-text">Document looks valid</p>
80 {% endif %}
81 {% endif %}
82 </ul>
83 <ul class="nav navbar-nav navbar-right">
84 <li class="dropdown{{ ' disabled' if not has_current }}{{ ' active' if active == 'render' }}">
85 <a href="#" class="dropdown-toggle{{ ' disabled' if not has_current }}" data-toggle="dropdown">Render <span class="caret"></span></a>
86 <ul class="dropdown-menu" role="menu">
87 {% for format in ('cvrf', 'nasl', 'oval') %}<li><a href="{{ url_for('render', format_=format)}}">as {{ format | upper }}</a></li>{% endfor %}
88 </ul>
89 </li>
90 <li>
91 <form action="{{ url_for('save') }}">
92 <button class="btn btn-success navbar-btn"{% if not has_current %} disabled="disabled"{% endif %}>Save</button>
93 </form>
94 </li>
95 <li class="dropdown">
96 <a href="#" class="dropdown-toggle" data-toggle="dropdown">Cache <span class="caret"></span></a>
97 <ul class="dropdown-menu" role="menu">
98 {% for element in cache | sort %}<li><a href="{{ url_for('load', element=element)}}">{{ element | capitalize }}</a></li>{% endfor %}
99 </ul>
100 </li>
101 </ul>
102 </div>{# /.navbar-collapse #}
103 </div>{# /.container-fluid #}
104 </nav>
105 <div class="main container">
106 {% with messages = get_flashed_messages(with_categories=True) %}
107 {% if messages %}
108 <div class="flashes">
109 {% for category, message in messages %}
110 {% if category == 'message' %}{% set category = "info" %}{% endif %}
111 <div class="alert alert-{{ category }}">{{ message }}</div>
112 {% endfor %}
113 </div>
114 {% endif %}
115 {% endwith %}
116 <div>
117 <script>$("#error-popover").popover();</script>
118 {% block content %}{% endblock %}
119 </div>
120 </div>
121 <footer class="footer container-fluid">
122 <a class="pull-right" href="{{ url_for('about') }}">About ...</a>
123 <p class="text-muted">Copyright &copy; 2014 <a href="http://greenbone.net">Greenbone Networks GmbH</a></p>
124 </footer>
125 </body>
126 </html>

http://farol.wald.intevation.org