add stats
This commit is contained in:
@ -13,6 +13,10 @@
|
||||
<span class="sr-only">FAQs</span>
|
||||
</a>
|
||||
{% if loggedin_user.is_admin %}
|
||||
<a href="/stat" class="inline-flex justify-center rounded-md bg-primary-600 mx-1 px-3 py-2 text-sm font-semibold text-white hover:bg-primary-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 cursor-pointer">
|
||||
STATS
|
||||
<span class="sr-only">Logbuch</span>
|
||||
</a>
|
||||
<a href="/log" class="inline-flex justify-center rounded-md bg-primary-600 mx-1 px-3 py-2 text-sm font-semibold text-white hover:bg-primary-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 cursor-pointer">
|
||||
LOGBUCH
|
||||
<span class="sr-only">Logbuch</span>
|
||||
|
@ -43,16 +43,12 @@
|
||||
<input type="submit" />
|
||||
|
||||
<script>
|
||||
|
||||
// Get the current date and time
|
||||
const currentDate = new Date();
|
||||
|
||||
// Format the date and time as a string in the format "YYYY-MM-DDTHH:mm"
|
||||
const formattedDate = currentDate.toISOString().slice(0, 16);
|
||||
const localTime = new Date(currentDate.getTime() - (currentDate.getTimezoneOffset() * 60000));
|
||||
const formattedDate = localTime.toISOString().slice(0, 16);
|
||||
|
||||
// Set the formatted string as the value of the input field
|
||||
document.getElementById("datetime-dep").value = formattedDate;
|
||||
|
||||
</script>
|
||||
</form>
|
||||
|
||||
@ -89,6 +85,17 @@
|
||||
{{ macros::input(label="Distanz", name="distance_in_km", id="distance_in_km_home", type="number", min=0, value=log.distance_in_km) }}
|
||||
{{ macros::input(label="Kommentar", name="comments", type="text", value=log.comments) }}
|
||||
{{ macros::select(data=logtypes, select_name='logtype', default="Normal", selected_id=log.logtype) }}
|
||||
<select multiple="multiple" name="rower[]">
|
||||
{% for user in users %}
|
||||
{% set_global selected = false %}
|
||||
{% for rower in log.rowers %}
|
||||
{% if rower.id == user.id %}
|
||||
{% set_global selected = true %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
<option value="{{ user.id }}" {% if selected %}selected{% endif %} onmousedown="event.preventDefault(); this.selected = !this.selected; return false;">{{user.name}}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<input type="submit" value="AUSFAHRT BEENDEN"/>
|
||||
</form>
|
||||
{% endif %}
|
||||
|
16
templates/stat.html.tera
Normal file
16
templates/stat.html.tera
Normal file
@ -0,0 +1,16 @@
|
||||
{% import "includes/macros" as macros %}
|
||||
|
||||
{% extends "base" %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
|
||||
<div class="max-w-screen-lg w-full">
|
||||
<h1 class="h1">Statstik</h1>
|
||||
<ol>
|
||||
{% for s in stat %}
|
||||
<li>{{s.name}}: {{s.rowed_km}}km</li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
</div>
|
||||
{% endblock content%}
|
Reference in New Issue
Block a user