Add more data to model and login
This commit is contained in:
parent
783e5e92cb
commit
522322b1e1
8 changed files with 147 additions and 6 deletions
|
@ -14,12 +14,12 @@
|
|||
<div class="uk-flex uk-flex-between uk-flex-middle uk-margin-small-bottom">
|
||||
<a href="{% url 'fuelpurchase_list' prev_year prev_month %}" class="uk-button uk-button-default">← Previous</a>
|
||||
|
||||
<form method="get" action="" onChange="if(this.value) window.location.href=this.value;" class="uk-form-horizontal">
|
||||
<select class="uk-select">
|
||||
<form method="get" action="" class="uk-form-horizontal">
|
||||
<select class="uk-select" onchange="if(this.value) window.location.href=this.value;">
|
||||
{% for month_date in available_months %}
|
||||
<option value="{% url 'fuelpurchase_list' month_date.year month_date.month %}"
|
||||
{% if month_date.year == current_year and month_date.month == current_month %}selected{% endif %}>
|
||||
{{ month_date|date:"F Y" }}
|
||||
{{ month_date|date:"Y F" }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
|
@ -32,7 +32,7 @@
|
|||
<div class="uk-card uk-card-default uk-card-body uk-margin-bottom">
|
||||
<h4 class="uk-card-title">Summary</h4>
|
||||
<ul class="uk-list uk-list-divider">
|
||||
<li><strong>Total Cost:</strong> {{ summary.total_cost_sum|default:"0.00" }} €</li>
|
||||
<li><strong>Total Cost:</strong> {{ summary.total_cost_sum|floatformat:2|default:"0.00" }} €</li>
|
||||
<li><strong>Total Litres:</strong> {{ summary.total_litres_sum|floatformat:2|default:"0.00" }} L</li>
|
||||
<li><strong>Average Litre Price:</strong> {{ summary.avg_price|floatformat:3|default:"0.000" }} €</li>
|
||||
<li><strong>Min Litre Price:</strong> {{ summary.min_price|floatformat:3|default:"0.000" }} €</li>
|
||||
|
@ -49,6 +49,9 @@
|
|||
<th>Total Cost (€)</th>
|
||||
<th>Litre Price (€)</th>
|
||||
<th>Amount (litres)</th>
|
||||
<th>Octane</th>
|
||||
<th>Gas Station</th>
|
||||
<th>Car</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
@ -58,6 +61,9 @@
|
|||
<td>{{ purchase.total_cost }}</td>
|
||||
<td>{{ purchase.price_per_litre }}</td>
|
||||
<td>{{ purchase.amount_litres }}</td>
|
||||
<td>{{ purchase.octane }}</td>
|
||||
<td>{{ purchase.get_gas_station_display }}</td>
|
||||
<td>{{ purchase.get_car_display }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
|
|
38
main/templates/registration/login.html
Normal file
38
main/templates/registration/login.html
Normal file
|
@ -0,0 +1,38 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="uk-flex uk-flex-center uk-margin-large-top">
|
||||
<form method="post" class="uk-form-stacked uk-card uk-card-default uk-card-body uk-width-1-3@m">
|
||||
{% csrf_token %}
|
||||
<fieldset class="uk-fieldset">
|
||||
|
||||
<legend class="uk-legend uk-text-center">Kirjaudu sisään</legend>
|
||||
|
||||
{% if form.errors %}
|
||||
<div class="uk-alert-danger" uk-alert>
|
||||
<p>Virheellinen käyttäjätunnus tai salasana.</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="uk-margin">
|
||||
<label class="uk-form-label" for="id_username">Käyttäjätunnus</label>
|
||||
<div class="uk-form-controls">
|
||||
<input class="uk-input" type="text" name="username" autofocus required id="id_username" value="{{ form.username.value|default_if_none:'' }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="uk-margin">
|
||||
<label class="uk-form-label" for="id_password">Salasana</label>
|
||||
<div class="uk-form-controls">
|
||||
<input class="uk-input" type="password" name="password" required id="id_password">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="uk-margin uk-text-center">
|
||||
<button type="submit" class="uk-button uk-button-primary uk-width-1-1">Kirjaudu</button>
|
||||
</div>
|
||||
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
{% endblock %}
|
Loading…
Add table
Add a link
Reference in a new issue