rollerverbrauch/app/templates/layout.html

204 lines
10 KiB
HTML
Raw Permalink Normal View History

2015-03-17 20:57:38 +01:00
{% macro navigation() -%}
2016-04-17 09:59:34 +02:00
{% if current_user.email %}
2016-08-06 10:59:20 +02:00
<li><a id='new_pitstop_link' href='{{ url_for('select_vehicle_for_new_pitstop') }}'>Create Pitstop</a></li>
2016-11-06 13:22:54 +01:00
<li><a id='new_service_link' href='{{ url_for('select_vehicle_for_new_service') }}'>Create Service</a></li>
2021-06-17 18:28:19 +02:00
<li><a id='new_service_link' href='{{ url_for('select_vehicle_for_new_regular_cost') }}'>Create Regular Cost</a></li>
2016-08-06 10:59:20 +02:00
<li><a id='statistics_limk' href='{{ url_for('get_statistics') }}'>Statistics</a></li>
<li><a id='account_link' href='{{ url_for('get_account_page') }}'>Account</a></li>
{% if current_user.has_role('admin') %}
2016-08-06 10:59:20 +02:00
<li><a id='admin_link' href='{{ url_for('get_admin_page') }}'>Admin</a></li>
{% endif %}
2016-08-06 10:59:20 +02:00
<li><a id='logout_link' href='{{ url_for('security.logout') }}'>Logout</a></li>
{% else %}
2016-08-06 10:59:20 +02:00
<li><a id='login_link' href='{{ url_for('security.login') }}'>Login</a></li>
<li><a id='register_link' href='{{ url_for('security.register') }}'>Register</a></li>
2016-04-17 09:59:34 +02:00
{% endif %}
2015-03-17 20:57:38 +01:00
{%- endmacro %}
2021-06-17 18:28:19 +02:00
{% macro render_field_with_errors(field, include_cancel=True) %}
2016-04-17 15:06:54 +02:00
<div class="form-group">
2016-04-27 07:23:28 +02:00
{% if field.type == 'SubmitField' %}
2021-06-17 18:28:19 +02:00
<div class="col-md-3" ></div>
<div class="col-sm-6" style="align:center">
{% if include_cancel %}
<input id="{{ field.id }}_cancel" name="{{ field.id }}_cancel" class="btn btn-default" type="submit" value="Cancel" onclick="window.history.go(-1)">
{% endif %}
2016-04-27 07:23:28 +02:00
<input id="{{ field.id }}" name="{{ field.id }}" class="btn btn-default" type="submit" value="{{ field.label.text }}">
</div>
2021-06-17 18:28:19 +02:00
<div class="col-md-3" ></div>
2016-04-27 07:23:28 +02:00
{% else %}
<label class="col-sm-6 control-label">
{{ field.label }}
</label>
2016-05-22 11:47:46 +02:00
<div class="col-sm-6">
2016-04-27 07:23:28 +02:00
{% if field.type == 'SelectField' %}
<select id="{{ field.id }}" name="{{ field.id }}" class="form-control">
{% for choice in field.choices %}
2016-07-23 13:09:38 +02:00
<option value="{{ choice[0] }}" {% if choice[0] == field.default %}selected="selected"{%endif%}>{{ choice[1] }}</option>
2016-04-27 07:23:28 +02:00
{% endfor %}
</select>
2016-07-18 21:30:06 +02:00
{% elif field.type == 'SelectMultipleField' %}
<select id="{{ field.id }}" name="{{ field.id }}" class="form-control" multiple="multiple">
{% for choice in field.choices %}
2016-07-23 13:09:38 +02:00
<option value="{{ choice[0] }}" {% if choice[0] in field.default %}selected="selected"{%endif%}>{{ choice[1] }}</option>
2016-07-18 21:30:06 +02:00
{% endfor %}
</select>
2016-04-27 07:23:28 +02:00
{% elif field.type == 'BooleanField' %}
2021-06-20 08:43:46 +02:00
<input class="form-control" type="checkbox" id="{{ field.id }}" name="{{ field.id }}" value="{{ field.id }}" aria-describedby="{{ field.id }}_help" {% if field.default %}checked{% endif %}/>
2016-04-27 07:23:28 +02:00
{% elif field.type == 'StringField' %}
<input class="form-control" type="text" id="{{ field.id }}" name="{{ field.id }}" value="{{ field.default|none_filter }}" aria-describedby="{{ field.id }}_help" />
2016-04-27 07:23:28 +02:00
{% elif field.type == 'PasswordField' %}
<input class="form-control" type="password" id="{{ field.id }}" name="{{ field.id }}" value="{{ field.default|none_filter }}" aria-describedby="{{ field.id }}_help" />
2016-04-27 07:23:28 +02:00
{% elif field.type == 'DateField' %}
<input class="form-control" type="date" id="{{ field.id }}" name="{{ field.id }}" value="{{ field.default|none_filter }}" aria-describedby="{{ field.id }}_help" />
2016-04-27 07:23:28 +02:00
{% elif field.type == 'IntegerField' %}
<input class="form-control" type="number" id="{{ field.id }}" name="{{ field.id }}" value="{{ field.default|none_filter }}" step="1" aria-describedby="{{ field.id }}_help" />
2016-04-27 07:23:28 +02:00
{% elif field.type == 'DecimalField' %}
<input class="form-control" type="number" id="{{ field.id }}" name="{{ field.id }}" value="{{ field.default|none_filter }}" step="{{ 1 / 10 ** field.places}}" aria-describedby="{{ field.id }}_help" />
{% elif field.type == 'TextAreaField' %}
<textarea class="form-control" id="{{ field.id }}" name="{{ field.id }}">{{ field.default|none_filter }}</textarea>
2016-04-27 07:23:28 +02:00
{% else %}
{{ field(**kwargs)|safe }}
{% endif %}
{% if field.errors %}
<p class='error'>
{% for error in field.errors %}
{{ error }}
{% endfor %}
</p>
{% endif %}
</div>
{% endif %}
2016-05-22 11:47:46 +02:00
</div>
{% endmacro %}
2016-04-27 07:23:28 +02:00
2016-05-22 11:47:46 +02:00
{% macro render_login_form() %}
<div class="panel panel-default">
<div class="panel-body">
<h3>Login</h3>
<form class='form-horizontal' action="{{ url_for_security('login') }}" method="POST" name="login_user_form">
{{ login_user_form.hidden_tag() }}
{{ render_field_with_errors(login_user_form.email) }}
{{ render_field_with_errors(login_user_form.password) }}
{{ render_field_with_errors(login_user_form.remember) }}
{{ render_field(login_user_form.next) }}
{{ render_field_with_errors(login_user_form.submit) }}
{% if security.recoverable %}
<a href="{{ url_for_security('forgot_password') }}">Forgot password</a>
{% endif %}
</form>
</div>
2016-04-17 15:06:54 +02:00
</div>
{% endmacro %}
2016-05-02 06:42:43 +02:00
2015-03-06 21:58:53 +01:00
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang=""> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang=""> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang=""> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang=""> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
2016-05-05 15:06:29 +02:00
<title>refuel journal</title>
2015-03-06 21:58:53 +01:00
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="apple-touch-icon" href="{{ url_for('static', filename='img/apple-touch-icon-57.png') }}">
<link rel="apple-touch-icon" href="{{ url_for('static', filename='img/apple-touch-icon-60.png') }}">
<link rel="apple-touch-icon" href="{{ url_for('static', filename='img/apple-touch-icon-72.png') }}">
<link rel="apple-touch-icon" href="{{ url_for('static', filename='img/apple-touch-icon-76.png') }}">
<link rel="apple-touch-icon" href="{{ url_for('static', filename='img/apple-touch-icon-114.png') }}">
<link rel="apple-touch-icon" href="{{ url_for('static', filename='img/apple-touch-icon-120.png') }}">
<link rel="apple-touch-icon" href="{{ url_for('static', filename='img/apple-touch-icon-144.png') }}">
<link rel="apple-touch-icon" href="{{ url_for('static', filename='img/apple-touch-icon-152.png') }}">
<link rel="apple-touch-icon" href="{{ url_for('static', filename='img/apple-touch-icon-180.png') }}">
<link rel="icon" type="image/png" sizes="192x192" href="{{ url_for('static', filename='img/android-icon-192x192.png') }}">
<link rel="icon" type="image/png" sizes="32x32" href="{{ url_for('static', filename='img/favicon-32x32.png') }}">
<link rel="icon" type="image/png" sizes="96x96" href="{{ url_for('static', filename='img/favicon-96x96.png') }}">
<link rel="icon" type="image/png" sizes="16x16" href="{{ url_for('static', filename='img/favicon-16x16.png') }}">
2015-03-06 21:58:53 +01:00
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap-theme.min.css">
2015-03-22 13:31:03 +01:00
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="{{ url_for('static', filename='js/jquery.tablesorter.min.js') }}"></script>
2015-03-06 21:58:53 +01:00
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="{{ url_for('static', filename='css/main.css') }}">
2016-05-02 06:42:43 +02:00
<script src="https://www.amcharts.com/lib/3/amcharts.js"></script>
<script src="https://www.amcharts.com/lib/3/serial.js"></script>
<script src="https://www.amcharts.com/lib/3/themes/patterns.js"></script>
2017-11-25 11:11:55 +01:00
<script src="https://openlayers.org/api/OpenLayers.js"></script>
<script src="{{ url_for('static', filename='js/main.js') }}"></script>
2015-03-06 21:58:53 +01:00
</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
2016-05-18 08:17:53 +02:00
<a class="navbar-brand" href="{{ url_for('index') }}">refuel journal</a>
2015-03-06 21:58:53 +01:00
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
2015-03-17 20:57:38 +01:00
{{ navigation() }}
2015-03-06 21:58:53 +01:00
</ul>
</div><!--/.nav-collapse -->
</div>
</nav>
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
{% for category, message in messages %}
<div class="row topspace">
<div class="col-md-4" ></div>
<div class="col-md-4">
<div class="alert alert-{{category}} alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
{{ message }}
</div>
</div>
<div class="col-md-4" ></div>
</div>
{% endfor %}
{% endif %}
{% endwith %}
<div class="container topspace">
2015-03-06 21:58:53 +01:00
<div class="starter-template">
{% block body %}
{% endblock %}
</div>
</div>
<div class="container topspace">
<div class="starter-template">
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-body">
<a href="https://www.lusiardi.de/impressum/" target="_new">Impressum</a> - <a href="https://www.lusiardi.de/datenschutzerklaerung/" target="_new">Datenschutzerklärung</a>
</div>
</div>
</div>
</div>
</div>
</div>
2016-05-24 06:49:39 +02:00
{#
2016-05-22 11:47:46 +02:00
<nav class="navbar navbar-inverse navbar-fixed-bottom">
<div class="container">
<div class="navbar-footer">
<a class="navbar-brand" href="">Imprint</a>
</div>
</div>
</nav>
2016-05-24 06:49:39 +02:00
#}
2015-03-06 21:58:53 +01:00
</body>
</html>