164 lines
5.5 KiB
HTML
164 lines
5.5 KiB
HTML
{% extends "layout.html" %}
|
|
{% block body %}
|
|
|
|
{% if page_title %}
|
|
<h3> {{ page_title }}</h3>
|
|
{% endif %}
|
|
{% if timestamp_data %}
|
|
{% for point in timestamp_data %}
|
|
<b>{{ point['time']}}</b>
|
|
<form method="POST" action="{{ url_for('add_time') }}" class=add-time>
|
|
<div class="form group">
|
|
<div class="row">
|
|
<div class="col-xs-4">
|
|
<label for="date">Date:</label>
|
|
<input type=date name="date" class="form-control" placeholder="Ex: 2009-11-10" value="{{ point['time'].strftime('%Y-%m-%d')}}">
|
|
</div>
|
|
<div class="col-xs-4">
|
|
<label for="time">Time:</label>
|
|
<input type=time name="time" class="form-control" placeholder="Ex: 17:59:03" step="1" value="{{ point['time'].strftime('%H:%M:%S')}}">
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-xs-4">
|
|
<label for="odometer">Odometer:</label>
|
|
<input type=number name="odometer" class="form-control" placeholder="Ex: 3008" value="{{ point['odometer']}}"></input>
|
|
</div>
|
|
<div class="col-xs-4">
|
|
<label for="oilhealth">Oil Health:</label>
|
|
<input type=number name="oilhealth" class="form-control" placeholder="Ex: 80" value="{{ point['oilhealth']}}">
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-xs-4">
|
|
<label for="fuel">Fuel (L):</label>
|
|
<input type=number step="0.001" name="fuel" class="form-control" placeholder="Ex: 70.175" value="{{ point['fuel']}}">
|
|
</div>
|
|
<div class="col-xs-4">
|
|
<label for="fuelcost">Fuel Cost ($/L):</label>
|
|
<input type=number step="0.001" name="fuelcost" class="form-control" placeholder="Ex: 1.059" value="{{ point['fuelcost']}}">
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-xs-4">
|
|
<label for="winter">Winter Tires:</label>
|
|
<select name="winter" class="form-control">
|
|
{% if data %}
|
|
{% if data[0]['winter'] == "True" %}
|
|
<option value="TRUE" selected>True</option>
|
|
<option value="FALSE">False</option>
|
|
|
|
{% else %}
|
|
<option value="TRUE">True</option>
|
|
<option value="FALSE" selected>False</option>
|
|
{% endif %}
|
|
{% else %}
|
|
<option value="TRUE">True</option>
|
|
<option value="FALSE" selected>False</option>
|
|
{% endif %}
|
|
</select>
|
|
</div>
|
|
</div><br>
|
|
<input type="submit" value="Go">
|
|
{% if data %}
|
|
<a href="{{ url_for('repeat_last_odometer', odometer=data[0]['odometer'], winter=data[0]['winter'] ) }}">Repeat</a>
|
|
{% endif %}
|
|
</div>
|
|
</form>
|
|
{% endfor %}
|
|
|
|
{% else %}
|
|
|
|
<form method="POST" action="{{ url_for('add_time') }}" class=add-time>
|
|
<div class="form group">
|
|
<div class="row">
|
|
<div class="col-xs-4">
|
|
<label for="date">Date:</label>
|
|
<input type=date name="date" class="form-control" placeholder="Ex: 2009-11-10">
|
|
</div>
|
|
<div class="col-xs-4">
|
|
<label for="time">Time:</label>
|
|
<input type=time name="time" class="form-control" placeholder="Ex: 17:59:03">
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-xs-4">
|
|
<label for="odometer">Odometer:</label>
|
|
<input type=number name="odometer" class="form-control" placeholder="Ex: 3008">
|
|
</div>
|
|
<div class="col-xs-4">
|
|
<label for="oilhealth">Oil Health:</label>
|
|
<input type=number name="oilhealth" class="form-control" placeholder="Ex: 80">
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-xs-4">
|
|
<label for="fuel">Fuel (L):</label>
|
|
<input type=number step="0.001" name="fuel" class="form-control" placeholder="Ex: 70.175">
|
|
</div>
|
|
<div class="col-xs-4">
|
|
<label for="fuelcost">Fuel Cost ($/L):</label>
|
|
<input type=number step="0.001" name="fuelcost" class="form-control" placeholder="Ex: 1.059">
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-xs-4">
|
|
<label for="winter">Winter Tires:</label>
|
|
<select name="winter" class="form-control">
|
|
{% if data %}
|
|
{% if data[0]['winter'] == "True" %}
|
|
<option value="TRUE" selected>True</option>
|
|
<option value="FALSE">False</option>
|
|
|
|
{% else %}
|
|
<option value="TRUE">True</option>
|
|
<option value="FALSE" selected>False</option>
|
|
{% endif %}
|
|
{% else %}
|
|
<option value="TRUE">True</option>
|
|
<option value="FALSE" selected>False</option>
|
|
{% endif %}
|
|
</select>
|
|
</div>
|
|
</div><br>
|
|
<input type="submit" value="Go">
|
|
{% if data %}
|
|
<a href="{{ url_for('repeat_last_odometer', odometer=data[0]['odometer'], winter=data[0]['winter'] ) }}">Repeat</a>
|
|
{% endif %}
|
|
</div>
|
|
</form>
|
|
|
|
{% endif %}
|
|
|
|
<br>
|
|
Last Mileage
|
|
<table class="table table-striped">
|
|
<thead>
|
|
<tr>
|
|
<th scope="col">Odometer</th>
|
|
<th scope="col">Time</th>
|
|
<th scope="col">Oil</th>
|
|
<th scope="col">Litres</th>
|
|
<th scope="col">$/Litre</th>
|
|
<th scope="col">$ Total</th>
|
|
</tr>
|
|
</thead>
|
|
|
|
<tbody>
|
|
{% for point in data %}
|
|
<tr>
|
|
<th scope="row"><a href="{{ url_for('edit_odometer_entry', timestamp=point['time'])}}">{{ point['odometer'] }}</a></th>
|
|
<td>{{ point['time'] }}</td>
|
|
<td>{{ point['oilhealth'] }}</td>
|
|
<td>{{ point['fuel'] }}</td>
|
|
<td>{{ point['fuelcost'] }}</td>
|
|
{% if point['fuel'] %}
|
|
<td>{{ '%0.2f' % ((point['fuel'] | float) * (point['fuelcost'] | float)) }}</td>
|
|
{% endif %}
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
|
|
{% endblock %}
|