2016-12-27 03:43:38 +00:00
|
|
|
{% extends "layout.html" %}
|
|
|
|
{% block body %}
|
|
|
|
|
2023-10-18 11:56:29 +00:00
|
|
|
{% if page_title %}
|
|
|
|
<h3> {{ page_title }}</h3>
|
|
|
|
{% endif %}
|
2023-12-03 21:09:50 +00:00
|
|
|
{% if timestamp_data %}
|
|
|
|
{% for point in timestamp_data %}
|
|
|
|
<b>{{ point['time']}}</b>
|
2016-12-27 03:43:38 +00:00
|
|
|
<form method="POST" action="{{ url_for('add_time') }}" class=add-time>
|
|
|
|
<div class="form group">
|
2023-12-03 21:09:50 +00:00
|
|
|
<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">
|
2016-12-27 03:43:38 +00:00
|
|
|
<div class="col-xs-4">
|
2023-12-03 21:09:50 +00:00
|
|
|
<label for="odometer">Odometer:</label>
|
|
|
|
<input type=number name="odometer" class="form-control" placeholder="Ex: 3008" value="{{ point['odometer']}}"></input>
|
2016-12-27 03:43:38 +00:00
|
|
|
</div>
|
|
|
|
<div class="col-xs-4">
|
2023-12-03 21:09:50 +00:00
|
|
|
<label for="oilhealth">Oil Health:</label>
|
|
|
|
<input type=number name="oilhealth" class="form-control" placeholder="Ex: 80" value="{{ point['oilhealth']}}">
|
2016-12-27 03:43:38 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2023-12-03 21:09:50 +00:00
|
|
|
<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">
|
2023-12-03 21:35:42 +00:00
|
|
|
TEST: {{data[0]['winter']}}
|
2023-12-03 21:09:50 +00:00
|
|
|
<div class="col-xs-4">
|
|
|
|
<label for="winter">Winter Tires:</label>
|
|
|
|
<select name="winter" class="form-control">
|
|
|
|
{% if data %}
|
2023-12-03 21:35:42 +00:00
|
|
|
{% if data[0]['winter'] == "1" or data[0]['winter'] == "True" %}
|
2023-12-03 21:09:50 +00:00
|
|
|
<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">
|
2016-12-27 03:43:38 +00:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-xs-4">
|
|
|
|
<label for="date">Date:</label>
|
2017-04-04 06:01:06 +00:00
|
|
|
<input type=date name="date" class="form-control" placeholder="Ex: 2009-11-10">
|
2016-12-27 03:43:38 +00:00
|
|
|
</div>
|
|
|
|
<div class="col-xs-4">
|
|
|
|
<label for="time">Time:</label>
|
2017-04-04 06:01:06 +00:00
|
|
|
<input type=time name="time" class="form-control" placeholder="Ex: 17:59:03">
|
2016-12-27 03:43:38 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-xs-4">
|
|
|
|
<label for="odometer">Odometer:</label>
|
2017-02-03 05:32:23 +00:00
|
|
|
<input type=number name="odometer" class="form-control" placeholder="Ex: 3008">
|
2016-12-27 03:43:38 +00:00
|
|
|
</div>
|
|
|
|
<div class="col-xs-4">
|
|
|
|
<label for="oilhealth">Oil Health:</label>
|
2017-02-03 05:32:23 +00:00
|
|
|
<input type=number name="oilhealth" class="form-control" placeholder="Ex: 80">
|
2016-12-27 03:43:38 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-xs-4">
|
|
|
|
<label for="fuel">Fuel (L):</label>
|
2017-02-12 06:55:22 +00:00
|
|
|
<input type=number step="0.001" name="fuel" class="form-control" placeholder="Ex: 70.175">
|
2016-12-27 03:43:38 +00:00
|
|
|
</div>
|
|
|
|
<div class="col-xs-4">
|
|
|
|
<label for="fuelcost">Fuel Cost ($/L):</label>
|
2017-02-12 06:55:22 +00:00
|
|
|
<input type=number step="0.001" name="fuelcost" class="form-control" placeholder="Ex: 1.059">
|
2016-12-27 03:43:38 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
2023-12-03 21:35:42 +00:00
|
|
|
TEST: {{data[0]['winter']}}
|
2016-12-27 03:43:38 +00:00
|
|
|
<div class="col-xs-4">
|
|
|
|
<label for="winter">Winter Tires:</label>
|
2022-11-03 04:06:32 +00:00
|
|
|
<select name="winter" class="form-control">
|
|
|
|
{% if data %}
|
2023-12-03 21:35:42 +00:00
|
|
|
{% if data[0]['winter'] == "1" or data[0]['winter'] == "True" %}
|
2022-11-03 04:06:32 +00:00
|
|
|
<option value="TRUE" selected>True</option>
|
|
|
|
<option value="FALSE">False</option>
|
|
|
|
|
|
|
|
{% else %}
|
|
|
|
<option value="TRUE">True</option>
|
|
|
|
<option value="FALSE" selected>False</option>
|
|
|
|
{% endif %}
|
2022-12-30 04:25:32 +00:00
|
|
|
{% else %}
|
|
|
|
<option value="TRUE">True</option>
|
|
|
|
<option value="FALSE" selected>False</option>
|
2022-11-03 04:06:32 +00:00
|
|
|
{% endif %}
|
|
|
|
</select>
|
2016-12-27 03:43:38 +00:00
|
|
|
</div>
|
2017-02-03 05:32:23 +00:00
|
|
|
</div><br>
|
2016-12-20 06:50:26 +00:00
|
|
|
<input type="submit" value="Go">
|
2022-09-24 16:00:02 +00:00
|
|
|
{% if data %}
|
2022-12-30 04:25:32 +00:00
|
|
|
<a href="{{ url_for('repeat_last_odometer', odometer=data[0]['odometer'], winter=data[0]['winter'] ) }}">Repeat</a>
|
2022-09-24 16:00:02 +00:00
|
|
|
{% endif %}
|
2016-12-27 03:43:38 +00:00
|
|
|
</div>
|
|
|
|
</form>
|
2023-12-03 21:09:50 +00:00
|
|
|
|
|
|
|
{% endif %}
|
|
|
|
|
2017-02-03 05:32:23 +00:00
|
|
|
<br>
|
|
|
|
Last Mileage
|
2022-08-12 06:25:59 +00:00
|
|
|
<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>
|
2022-11-04 19:17:16 +00:00
|
|
|
<th scope="col">$ Total</th>
|
2022-08-12 06:25:59 +00:00
|
|
|
</tr>
|
|
|
|
</thead>
|
2023-12-03 21:09:50 +00:00
|
|
|
|
2022-08-12 06:25:59 +00:00
|
|
|
<tbody>
|
|
|
|
{% for point in data %}
|
|
|
|
<tr>
|
2023-10-18 11:56:29 +00:00
|
|
|
<th scope="row"><a href="{{ url_for('edit_odometer_entry', timestamp=point['time'])}}">{{ point['odometer'] }}</a></th>
|
2022-08-12 06:25:59 +00:00
|
|
|
<td>{{ point['time'] }}</td>
|
|
|
|
<td>{{ point['oilhealth'] }}</td>
|
|
|
|
<td>{{ point['fuel'] }}</td>
|
|
|
|
<td>{{ point['fuelcost'] }}</td>
|
2022-11-04 19:17:16 +00:00
|
|
|
{% if point['fuel'] %}
|
|
|
|
<td>{{ '%0.2f' % ((point['fuel'] | float) * (point['fuelcost'] | float)) }}</td>
|
|
|
|
{% endif %}
|
2022-08-12 06:25:59 +00:00
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
2016-12-27 03:43:38 +00:00
|
|
|
{% endblock %}
|