switched to bootstrap

This commit is contained in:
joachim lusiardi
2015-03-05 08:02:57 +01:00
parent 927abf425e
commit a8b6789295
5 changed files with 109 additions and 526 deletions

View File

@@ -9,46 +9,52 @@
<title>Rollerverbrauch</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="apple-touch-icon" href="{{ url_for('static', filename='apple-touch-icon.png') }}">
<!-- <link rel="apple-touch-icon" href="{{ url_for('static', filename='apple-touch-icon.png') }}">
<link rel="stylesheet" href="{{ url_for('static', filename='normalize.min.css') }}">
<link rel="stylesheet" href="{{ url_for('static', filename='main.css') }}">
<script src="{{ url_for('static', filename='modernizr-2.8.3-respond-1.4.2.min.js') }}"></script>
<script src="{{ url_for('static', filename='modernizr-2.8.3-respond-1.4.2.min.js') }}"></script>-->
<!-- 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">
<!-- 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='main.css') }}">
</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>
<a class="navbar-brand" href="{{ url_for('getPitStops') }}">Rollerverbrauch</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
{% block navigation %}
{% endblock %}
</ul>
</div><!--/.nav-collapse -->
</div>
</nav>
<div class="header-container">
<header class="wrapper clearfix">
<h1 class="title">Rollerverbrauch</h1>
<nav>
<ul>
{% block navigation %}
{% endblock %}
</ul>
</nav>
</header>
</div>
<div class="main-container">
<div class="main wrapper clearfix">
<div class="container">
<div class="starter-template">
{% block body %}
{% endblock %}
</div> <!-- #main -->
</div> <!-- #main-container -->
<div class="footer-container">
<footer class="wrapper">
<h3>RollerVerbrauch ©2015 by Joachim Lusiardi</h3>
</footer>
</div>
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="{{ url_for('static', filename='jquery-1.11.2.min.js') }}"><\/script>')</script>
<script src="{{ url_for('static', filename='main.js') }}"></script>
</body>
</html>

View File

@@ -1,6 +1,8 @@
{% extends "layout.html" %}
{% block navigation %}
<li><a href='{{ url_for('getPitStops') }}'>Home</a></li>
<li><a href='{{ url_for('createPitStopForm') }}' class="active">Create Pitstop</a></li>
{% endblock %}
{% block body %}
@@ -9,24 +11,46 @@
<p class='error'><strong>Error:</strong> {{ data.error }}</p>
</div>
{% endif %}
<form class="form" action="{{ url_for('createPitStop') }}" method='post'>
<ul>
<li>
<label for='date'>Date of Pitstop:</label>
<input type='date' name='date' id='date' value='{{ data.last.date }}'/>
</li>
<li>
<label for='odometer'>Odometer:</label>
<input type='text' name='odometer' id='odometer' value='{{ data.last.odometer }}'/>
</li>
<li>
<label for='litres'>Litres fuelled:</label>
<input type='text' name='litres' id='litres' value='{{ data.last.litres }}'/>
</li>
<li>
<button class="submit" type="submit">Log pit stop</button>
<a href="{{ url_for('getPitStops') }}">Abort</a>
</li>
</ul>
</form>
<form class="form-horizontal" id='createPitStop' action="{{ url_for('createPitStop') }}" method='post'>
<fieldset>
<!-- Form Name -->
<legend>Create Pitstop</legend>
<!-- Text input-->
<div class="control-group">
<label class="control-label" for="date">Date of Pitstop</label>
<div class="controls">
<input id="date" name="date" placeholder="" class="input-large" required="" type="date" value='{{ data.last.date }}' />
</div>
</div>
<!-- Text input-->
<div class="control-group">
<label class="control-label" for="odometer">Odometer</label>
<div class="controls">
<input id="odometer" name="odometer" placeholder="" class="input-large" required="" type="text" value='{{ data.last.odometer }}' />
</div>
</div>
<!-- Text input-->
<div class="control-group">
<label class="control-label" for="litres">Litres</label>
<div class="controls">
<input id="litres" name="litres" placeholder="" class="input-large" required="" type="text" value='{{ data.last.litres }}' />
</div>
</div>
<!-- Button (Double) -->
<div class="control-group">
<label class="control-label" for="buttonLogId"></label>
<div class="controls">
<button id="buttonLogId" name="buttonLogId" class="btn btn-success" onclick="document.getElementById('createPitStop').submit();">Log Pitstop</button>
<button id="buttonAbortId" type="button" name="buttonAbortId" class="btn btn-warning" onclick="window.location.href='{{ url_for('getPitStops') }}'">Abort</button>
</div>
</div>
</fieldset>
</form>
{% endblock %}

View File

@@ -1,6 +1,7 @@
{% extends "layout.html" %}
{% block navigation %}
<li><a href='{{ url_for('getPitStops') }}' class="active">Home</a></li>
<li><a href='{{ url_for('createPitStopForm') }}'>Create Pitstop</a></li>
{% endblock %}
@@ -10,6 +11,9 @@
<th>
Date
</th>
<th>
Day
</th>
<th>
Odometer
</th>
@@ -28,16 +32,19 @@
<td>
{{pitstop.date}}
</td>
<td class='right-aligned'>
<td>
{% if pitstop.days %}{{pitstop.days}}{% else %} --{% endif %} days
</td>
<td>
{{pitstop.odometer}} km
</td>
<td class='right-aligned'>
<td>
{% if pitstop.distance %}{{pitstop.distance}}{% else %} --{% endif %} km
</td>
<td class='right-aligned'>
<td>
{{pitstop.litres}} l
</td>
<td class='right-aligned'>
<td>
{% if pitstop.average %}{{pitstop.average}}{% else %} --{% endif %} l/100km
</td>
</tr>