format tera files

This commit is contained in:
philipp 2023-07-30 14:33:50 +02:00
parent 2ff7e24cbd
commit db3cf59d21
26 changed files with 889 additions and 872 deletions

View File

@ -5,15 +5,16 @@
{% block content %} {% block content %}
<div class="max-w-screen-lg w-full"> <div class="max-w-screen-lg w-full">
<h1 class="h1">Boats</h1> <h1 class="h1">Boats</h1>
{{ boat::new() }} {{ boat::new() }}
<div class="bg-primary-100 p-3 rounded-b-md grid gap-4"> <div class="bg-primary-100 p-3 rounded-b-md grid gap-4">
{% for boat in boats %} {% for boat in boats %}
{{ boat::edit(boat=boat, uuid=loop.index) }} {{ boat::edit(boat=boat, uuid=loop.index) }}
{% endfor %} {% endfor %}
</div> </div>
</div>
</div>
{% endblock content %} {% endblock content %}

View File

@ -3,69 +3,71 @@
{% extends "base" %} {% extends "base" %}
{% block content %} {% block content %}
<div class="max-w-screen-lg w-full"> <div class="max-w-screen-lg w-full">
{% if flash %} {% if flash %}
{{ macros::alert(message=flash.1, type=flash.0, class="sm:col-span-2 lg:col-span-3") }} {{ macros::alert(message=flash.1, type=flash.0, class="sm:col-span-2 lg:col-span-3") }}
{% endif %} {% endif %}
<h1 class="h1">Users</h1> <h1 class="h1">Users</h1>
<form action="/admin/user/new" method="post" class="mt-4 bg-primary-900 rounded-md text-white px-3 pb-3 pt-2 sm:flex items-end justify-between"> <form action="/admin/user/new" method="post" class="mt-4 bg-primary-900 rounded-md text-white px-3 pb-3 pt-2 sm:flex items-end justify-between">
<div class="w-full"> <div class="w-full">
<h2 class="text-md font-bold mb-2 uppercase tracking-wide">Neuen User hinzufügen</h2> <h2 class="text-md font-bold mb-2 uppercase tracking-wide">Neuen User hinzufügen</h2>
<div class="grid md:grid-cols-3"> <div class="grid md:grid-cols-3">
<div> <div>
<label for="name" class="sr-only">Name</label> <label for="name" class="sr-only">Name</label>
<input type="text" name="name" class="relative block rounded-md border-0 py-1.5 px-2 text-gray-900 ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:z-10 focus:ring-2 focus:ring-inset focus:ring-primary-600 sm:text-sm sm:leading-6 mb-2 md:mb-0" placeholder="Name"/> <input type="text" name="name" class="relative block rounded-md border-0 py-1.5 px-2 text-gray-900 ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:z-10 focus:ring-2 focus:ring-inset focus:ring-primary-600 sm:text-sm sm:leading-6 mb-2 md:mb-0" placeholder="Name"/>
</div> </div>
<div class="flex items-center"> <div class="flex items-center">
<label for="is_guest" class="flex items-center cursor-pointer hover:text-gray-100"><input type="checkbox" id="is_guest" name="is_guest" class="h-4 w-4 accent-gray-200 mr-2" checked="true"/> Gast</label> <label for="is_guest" class="flex items-center cursor-pointer hover:text-gray-100"><input type="checkbox" id="is_guest" name="is_guest" class="h-4 w-4 accent-gray-200 mr-2" checked="true"/>
</div> Gast</label>
</div> </div>
</div> </div>
<div class="text-right"> </div>
<input value="Hinzufügen" type="submit" class="w-28 mt-2 sm:mt-0 rounded-md bg-primary-500 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"/> <div class="text-right">
</div> <input value="Hinzufügen" type="submit" class="w-28 mt-2 sm:mt-0 rounded-md bg-primary-500 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"/>
</form> </div>
</form>
<!-- START filterBar --> <!-- START filterBar -->
<div class="bg-primary-200 p-3 mt-4 rounded-t-md"> <div class="bg-primary-200 p-3 mt-4 rounded-t-md">
<label for="name" class="sr-only">Suche</label> <label for="name" class="sr-only">Suche</label>
<input type="search" name="name" id="filter-js" class="w-full relative block rounded-md border-0 py-1.5 px-2 text-gray-900 ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:z-10 focus:ring-2 focus:ring-inset focus:ring-primary-600 sm:text-sm sm:leading-6 mb-2 md:mb-0" placeholder="Suchen nach..."/> <input type="search" name="name" id="filter-js" class="w-full relative block rounded-md border-0 py-1.5 px-2 text-gray-900 ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:z-10 focus:ring-2 focus:ring-inset focus:ring-primary-600 sm:text-sm sm:leading-6 mb-2 md:mb-0" placeholder="Suchen nach..."/>
</div> </div>
<!-- END filterBar --> <!-- END filterBar -->
<div class="bg-primary-100 p-3 rounded-b-md grid gap-4"> <div class="bg-primary-100 p-3 rounded-b-md grid gap-4">
<div id="filter-result-js" class="text-primary-950"></div> <div id="filter-result-js" class="text-primary-950"></div>
{% for user in users %} {% for user in users %}
<form action="/admin/user" data-filterable="true" data-filter="{{ user.name }}" method="post" class="bg-white p-3 rounded-md flex items-end md:items-center justify-between"> <form action="/admin/user" data-filterable="true" data-filter="{{ user.name }}" method="post" class="bg-white p-3 rounded-md flex items-end md:items-center justify-between">
<div class="w-full"> <div class="w-full">
<input type="hidden" name="id" value="{{ user.id }}" /> <input type="hidden" name="id" value="{{ user.id }}"/>
<div class="font-bold mb-1">{{ user.name }} <div class="font-bold mb-1">{{ user.name }}
{% if user.last_access %} {% if user.last_access %}
(last access: {{ user.last_access | date }}) (last access:
{% endif %} {{ user.last_access | date }})
</div> {% endif %}
<div class="grid md:grid-cols-3"> </div>
{{ macros::checkbox(label='Gast', name='is_guest', id=loop.index , checked=user.is_guest) }} <div class="grid md:grid-cols-3">
{{ macros::checkbox(label='Steuerberechtigter', name='is_cox', id=loop.index , checked=user.is_cox) }} {{ macros::checkbox(label='Gast', name='is_guest', id=loop.index , checked=user.is_guest) }}
{{ macros::checkbox(label='Admin', name='is_admin', id=loop.index , checked=user.is_admin) }} {{ macros::checkbox(label='Steuerberechtigter', name='is_cox', id=loop.index , checked=user.is_cox) }}
</div> {{ macros::checkbox(label='Admin', name='is_admin', id=loop.index , checked=user.is_admin) }}
{% if user.pw %} </div>
<a class="inline-block mt-1 text-primary-600 hover:text-primary-900 underline" href="/admin/user/{{ user.id }}/reset-pw">Passwort zurücksetzen</a> {% if user.pw %}
{% endif %} <a class="inline-block mt-1 text-primary-600 hover:text-primary-900 underline" href="/admin/user/{{ user.id }}/reset-pw">Passwort zurücksetzen</a>
</div> {% endif %}
<div class="grid gap-3"> </div>
<a href="/admin/user/{{ user.id }}/delete" class="inline-block btn btn-alert" onclick="return confirm('Wirklich löschen?');"> <div class="grid gap-3">
{% include "includes/delete-icon" %} <a href="/admin/user/{{ user.id }}/delete" class="inline-block btn btn-alert" onclick="return confirm('Wirklich löschen?');">
Löschen {% include "includes/delete-icon" %}
</a> Löschen
<input value="Ändern" type="submit" class="w-28 btn btn-primary"/> </a>
</div> <input value="Ändern" type="submit" class="w-28 btn btn-primary"/>
</form> </div>
{% endfor %} </form>
</div> {% endfor %}
</div>
</div> </div>
{% endblock content %} {% endblock content %}

View File

@ -1,39 +1,39 @@
{% extends "base" %} {% extends "base" %}
{% block content %} {% block content %}
<div class="w-full max-w-md space-y-8"> <div class="w-full max-w-md space-y-8">
<div> <div>
<img class="mx-auto h-16 w-auto" src="https://rudernlinz.at/wp-content/uploads/2021/02/cropped-logo.png" alt="Logo Ruderassistent"> <img class="mx-auto h-16 w-auto" src="https://rudernlinz.at/wp-content/uploads/2021/02/cropped-logo.png" alt="Logo Ruderassistent">
<h1 class="mt-6 h1">Ruderassistent</h1> <h1 class="mt-6 h1">Ruderassistent</h1>
</div> </div>
{% if flash %} {% if flash %}
{{ macros::alert(message=flash.1, type=flash.0, class="sm:col-span-2 lg:col-span-3") }} {{ macros::alert(message=flash.1, type=flash.0, class="sm:col-span-2 lg:col-span-3") }}
{% endif %} {% endif %}
<form class="mt-8 space-y-6" method="post" action="/auth"> <form class="mt-8 space-y-6" method="post" action="/auth">
<input type="hidden" name="remember" value="true"> <input type="hidden" name="remember" value="true">
<div class="-space-y-px rounded-md shadow-sm"> <div class="-space-y-px rounded-md shadow-sm">
<div> <div>
{% if name %} {% if name %}
{{ macros::input(label='Name', name='name', type='input', required=true, class='rounded-t-md',hide_label=true,value=name, autofocus=true) }} {{ macros::input(label='Name', name='name', type='input', required=true, class='rounded-t-md',hide_label=true,value=name, autofocus=true) }}
{% else %} {% else %}
{{ macros::input(label='Name', name='name', type='input', required=true, class='rounded-t-md',hide_label=true, autofocus=true) }} {{ macros::input(label='Name', name='name', type='input', required=true, class='rounded-t-md',hide_label=true, autofocus=true) }}
{% endif %} {% endif %}
</div> </div>
<div> <div>
{{ macros::input(label='Passwort', name='password', type='password', class='rounded-b-md',hide_label=true) }} {{ macros::input(label='Passwort', name='password', type='password', class='rounded-b-md',hide_label=true) }}
</div> </div>
</div> </div>
<div> <div>
<button type="submit" class="group relative flex w-full justify-center btn btn-primary"> <button type="submit" class="group relative flex w-full justify-center btn btn-primary">
<span class="absolute inset-y-0 left-0 flex items-center pl-3"> <span class="absolute inset-y-0 left-0 flex items-center pl-3">
{% include "includes/lock-icon" %} {% include "includes/lock-icon" %}
</span> </span>
Einloggen Einloggen
</button> </button>
</div> </div>
</form> </form>
</div> </div>
{% endblock content %} {% endblock content %}

View File

@ -1,30 +1,30 @@
{% extends "base" %} {% extends "base" %}
{% block content %} {% block content %}
<div class="w-full max-w-md space-y-8"> <div class="w-full max-w-md space-y-8">
<h1 class="mt-6 h1">Passwort setzen</h1> <h1 class="mt-6 h1">Passwort setzen</h1>
<form class="mt-8 space-y-6" action="/auth/set-pw" method="post"> <form class="mt-8 space-y-6" action="/auth/set-pw" method="post">
<input type="hidden" name="remember" value="true"> <input type="hidden" name="remember" value="true">
<input type="hidden" name="userid" value="{{ userid }}" /> <input type="hidden" name="userid" value="{{ userid }}"/>
<div class="-space-y-px rounded-md shadow-sm"> <div class="-space-y-px rounded-md shadow-sm">
<div> <div>
{{ macros::input(label='Passwort', name='password', type='password', required=true, class='rounded-t-md',hide_label=true) }} {{ macros::input(label='Passwort', name='password', type='password', required=true, class='rounded-t-md',hide_label=true) }}
</div> </div>
<div> <div>
{{ macros::input(label='Passwort bestätigen', name='password_confirm', type='password', required=true, class='rounded-b-md',hide_label=true) }} {{ macros::input(label='Passwort bestätigen', name='password_confirm', type='password', required=true, class='rounded-b-md',hide_label=true) }}
</div> </div>
</div> </div>
<div> <div>
<button type="submit" class="group relative flex w-full justify-center btn btn-primary"> <button type="submit" class="group relative flex w-full justify-center btn btn-primary">
<span class="absolute inset-y-0 left-0 flex items-center pl-3"> <span class="absolute inset-y-0 left-0 flex items-center pl-3">
{% include "includes/lock-icon" %} {% include "includes/lock-icon" %}
</span> </span>
Bestätigen Bestätigen
</button> </button>
</div> </div>
</form> </form>
</div> </div>
{% endblock content %} {% endblock content %}

View File

@ -2,29 +2,27 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="de"> <html lang="de">
<head> <head>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="manifest" href="public/manifest.json" /> <link rel="manifest" href="public/manifest.json"/>
<link rel="stylesheet" href="/public/main.css" /> <link rel="stylesheet" href="/public/main.css"/>
<link rel="icon" type="image/x-icon" href="/public/images/favicon.ico"> <link rel="icon" type="image/x-icon" href="/public/images/favicon.ico">
<title>Ruderassistent - ASKÖ Ruderverein Donau Linz</title> <title>Ruderassistent - ASKÖ Ruderverein Donau Linz</title>
</head> </head>
<body class="bg-gray-100"> <body class="bg-gray-100">
{%if loggedin_user %} {%if loggedin_user %}
{{ macros::header(loggedin_user=loggedin_user) }} {{ macros::header(loggedin_user=loggedin_user) }}
{%endif%} {%endif%}
<div class="flex min-h-screen {%if not loggedin_user %} items-center {% else %} items-start {% endif %} justify-center px-4 py-12 sm:px-6 lg:px-8">
{% block content %}{% endblock content %}
</div>
{%if loggedin_user %}
{% include "includes/footer" %}
{%endif%}
<script src="/public/main.js"></script>
</body>
</html>
<div class="flex min-h-screen {%if not loggedin_user %} items-center {% else %} items-start {% endif %} justify-center px-4 py-12 sm:px-6 lg:px-8"> {% block content %}{% endblock content %}
</div>
{%if loggedin_user %}
{% include "includes/footer" %}
{%endif%}
<script src="/public/main.js"></script>
</body>
</html>
</body>
</html>

View File

@ -1,17 +1,16 @@
<div class="sidebar slide-in from-right" id="sidebar" aria-modal="false"> <div class="sidebar slide-in from-right" id="sidebar" aria-modal="false">
<div class="bg-primary-900 text-white px-2 py-3 flex justify-between sidebar-header"> <div class="bg-primary-900 text-white px-2 py-3 flex justify-between sidebar-header">
<div> <div>
<span class="ps-1 header-js"> <span class="ps-1 header-js">
Überschrift (wird ersetzt) Überschrift (wird ersetzt)
</span> </span>
</div> </div>
<button type="button" title="Ausfahrt erstellen schließen" class="sidebar-close border-0 bg-primary-100 focus:bg-primary-50 text-black flex items-center justify-center transform rotate-45" <button type="button" title="Ausfahrt erstellen schließen" class="sidebar-close border-0 bg-primary-100 focus:bg-primary-50 text-black flex items-center justify-center transform rotate-45" data-trigger="sidebar">
data-trigger="sidebar"> {% include "includes/plus-icon" %}
{% include "includes/plus-icon" %} </button>
</button> </div>
</div> <div class="body-js px-2 pt-2">
<div class="body-js px-2 pt-2"> Formular wird ersetzt
Formular wird ersetzt </div>
</div>
</div> </div>
<div class="sidebar-overlay" data-trigger="sidebar"></div> <div class="sidebar-overlay" data-trigger="sidebar"></div>

View File

@ -3,21 +3,21 @@
{% extends "base" %} {% extends "base" %}
{% block content %} {% block content %}
<div class="max-w-screen-lg w-full"> <div class="max-w-screen-lg w-full">
<h1 class="h1">Infrequently asked questions</h1> <h1 class="h1">Infrequently asked questions</h1>
<div class="grid pt-8 text-left gap-10"> <div class="grid pt-8 text-left gap-10">
{% if loggedin_user.is_cox %} {% if loggedin_user.is_cox %}
{{ macros::faq( {{ macros::faq(
question='Was bedeutet "Immer anzeigen"?', question='Was bedeutet "Immer anzeigen"?',
answer='Nicht-Steuerleute sehen normale Ausfahrten 6 Tage im vorhinein. Wenn du "immer anzeigen" aktivierst, sehen Nicht-Steuerleute die Ausfahrt sofort. Die Funktion sollte nur sehr gezielt aktiviert werden (zB bei Fetzenfahrt-Anmeldung).') answer='Nicht-Steuerleute sehen normale Ausfahrten 6 Tage im vorhinein. Wenn du "immer anzeigen" aktivierst, sehen Nicht-Steuerleute die Ausfahrt sofort. Die Funktion sollte nur sehr gezielt aktiviert werden (zB bei Fetzenfahrt-Anmeldung).')
}} }}
{{ macros::faq( {{ macros::faq(
question='Wie kann ich eine erstellte Ausfahrt absagen?', question='Wie kann ich eine erstellte Ausfahrt absagen?',
answer='Du kannst bei deinen selbst angelegten Ausfahrten auf Details klicken und hier unter Ausfahrt bearbeiten die <strong>Anzahl der Ruderer auf 0 setzen</strong>. Danach wird die Ausfahrt als abgesagt markiert. Bedenke allerdings, dass dadurch nicht automatisch alle Mitruderer informiert werden. Bitte zusätzlich in die Signal Gruppe schreiben oder den Betroffenen persönlich Bescheid geben.') answer='Du kannst bei deinen selbst angelegten Ausfahrten auf Details klicken und hier unter Ausfahrt bearbeiten die <strong>Anzahl der Ruderer auf 0 setzen</strong>. Danach wird die Ausfahrt als abgesagt markiert. Bedenke allerdings, dass dadurch nicht automatisch alle Mitruderer informiert werden. Bitte zusätzlich in die Signal Gruppe schreiben oder den Betroffenen persönlich Bescheid geben.')
}} }}
{{ macros::faq( {{ macros::faq(
question='Wie kann eine Veranstaltung angelegt werden, bei der sich nicht nur Ruderer anmelden können, sondern auch Steuerleute?', question='Wie kann eine Veranstaltung angelegt werden, bei der sich nicht nur Ruderer anmelden können, sondern auch Steuerleute?',
answer='Im Moment können nur Admins eine geplante Veranstaltung anlegen. Bitte bei <strong>Marie oder Philipp</strong> mit folgenden Angaben melden, dann wird eine Veranstaltung erstellt. answer='Im Moment können nur Admins eine geplante Veranstaltung anlegen. Bitte bei <strong>Marie oder Philipp</strong> mit folgenden Angaben melden, dann wird eine Veranstaltung erstellt.
<ul class="list-disc text-primary-950 ml-4 mt-1"> <ul class="list-disc text-primary-950 ml-4 mt-1">
@ -28,42 +28,42 @@
</ul>') </ul>')
}} }}
{{ macros::faq( {{ macros::faq(
question='Wie kann ich eine Ausfahrt anlegen, bei der nicht alle Ruderer teilnehmen sollen, z.B. Tagesausflug nach Aschach?', question='Wie kann ich eine Ausfahrt anlegen, bei der nicht alle Ruderer teilnehmen sollen, z.B. Tagesausflug nach Aschach?',
answer='Du kannst beim Anlegen definieren, welchen Typ deine Ausfahrt hat. Standardmäßig wird "Reguläre Ausfahrt" verwendet, es gibt aber auch z.B. <strong>"Lange Ausfahrt"</strong>. Wenn du das für deine Ausfahrt auswählst, wird der User in einem Popup noch einmal extra gefragt, ob er wirklich daran teilnehmen möchte. Bitte führe zusätzlich die Kilometer oder die Anforderungen im Anmerkungen Feld der Ausfahrt an.') answer='Du kannst beim Anlegen definieren, welchen Typ deine Ausfahrt hat. Standardmäßig wird "Reguläre Ausfahrt" verwendet, es gibt aber auch z.B. <strong>"Lange Ausfahrt"</strong>. Wenn du das für deine Ausfahrt auswählst, wird der User in einem Popup noch einmal extra gefragt, ob er wirklich daran teilnehmen möchte. Bitte führe zusätzlich die Kilometer oder die Anforderungen im Anmerkungen Feld der Ausfahrt an.')
}} }}
{{ macros::faq( {{ macros::faq(
question='Wann sollte ich bei einer Ausfahrt "Gäste erlauben" einstellen?', question='Wann sollte ich bei einer Ausfahrt "Gäste erlauben" einstellen?',
answer='Wenn du Ruderer mitnehmen möchtest, die einen <strong>5er-Block</strong> besitzen, kannst du die jeweilige Ausfahrt damit für diese Gruppe freischalten. Wenn sich ein Gast für die Ausfahrt anmeldet, dann wird er mit "Gast" neben dem jeweiligen Namen gekennzeichnet.') answer='Wenn du Ruderer mitnehmen möchtest, die einen <strong>5er-Block</strong> besitzen, kannst du die jeweilige Ausfahrt damit für diese Gruppe freischalten. Wenn sich ein Gast für die Ausfahrt anmeldet, dann wird er mit "Gast" neben dem jeweiligen Namen gekennzeichnet.')
}} }}
{% endif %} {% endif %}
{{ macros::faq( {{ macros::faq(
question='Wie erfolgt die Absage einer Ausfahrt aufgrund ungünstiger Wetterbedingungen?', question='Wie erfolgt die Absage einer Ausfahrt aufgrund ungünstiger Wetterbedingungen?',
answer='Im Falle einer kurzfristigen Absage einer Ausfahrt - sei es aufgrund von schlechten Wetterbedingungen oder unpassendem Wasserstand - informieren wir dich rechtzeitig. Eine entsprechende Benachrichtigung wird mindestens ein paar Stunden vorher in unserem Ruderassistenten veröffentlicht. Zusätzlich gibt es eine Nachricht in unserer Signal-Gruppe. Zur Info: Leichter Regen mit trotzdem passenden Temperaturen hindern uns in der Regel nicht an einer Ausfahrt ;-)') answer='Im Falle einer kurzfristigen Absage einer Ausfahrt - sei es aufgrund von schlechten Wetterbedingungen oder unpassendem Wasserstand - informieren wir dich rechtzeitig. Eine entsprechende Benachrichtigung wird mindestens ein paar Stunden vorher in unserem Ruderassistenten veröffentlicht. Zusätzlich gibt es eine Nachricht in unserer Signal-Gruppe. Zur Info: Leichter Regen mit trotzdem passenden Temperaturen hindern uns in der Regel nicht an einer Ausfahrt ;-)')
}} }}
{{ macros::faq( {{ macros::faq(
question='Wo finde ich mehr Infos über den Verein?', question='Wo finde ich mehr Infos über den Verein?',
answer='Seit Sommer 2023 gibt es ein Handbuch mit vielen Infos über unseren Verein und Rudern im Allgemeinen. Du findest es unter https://rudernlinz.at/book') answer='Seit Sommer 2023 gibt es ein Handbuch mit vielen Infos über unseren Verein und Rudern im Allgemeinen. Du findest es unter https://rudernlinz.at/book')
}} }}
{{ macros::faq( {{ macros::faq(
question='Wann kann ich mich zu Ausfahrten anmelden?', question='Wann kann ich mich zu Ausfahrten anmelden?',
answer='Du kannst Ausfahrten bis zu 6 Tage im Voraus sehen. Vergiss nicht, dich mindestens 2 Stunden vor Beginn an- bzw. abzumelden. Gelegentlich, wie bei der Marktausfahrt am Freitag, werden Ausfahrten kurzfristiger angekündigt. Wenn du keine Ausfahrt verpassen willst, freut sich diese Seite über Aufrufe ;-)') answer='Du kannst Ausfahrten bis zu 6 Tage im Voraus sehen. Vergiss nicht, dich mindestens 2 Stunden vor Beginn an- bzw. abzumelden. Gelegentlich, wie bei der Marktausfahrt am Freitag, werden Ausfahrten kurzfristiger angekündigt. Wenn du keine Ausfahrt verpassen willst, freut sich diese Seite über Aufrufe ;-)')
}} }}
{{ macros::faq( {{ macros::faq(
question='Wann soll ich beim Bootshaus sein?', question='Wann soll ich beim Bootshaus sein?',
answer='Bitte schaue, dass du zur angegebenen Zeit abfahrbereit (d.h. bereits umgezogen) beim Bootshaus bist.') answer='Bitte schaue, dass du zur angegebenen Zeit abfahrbereit (d.h. bereits umgezogen) beim Bootshaus bist.')
}} }}
{{ macros::faq( {{ macros::faq(
question='Es sind mehrere Fahrten zur selben Zeit ausgeschrieben. Wo soll ich mich anmelden?', question='Es sind mehrere Fahrten zur selben Zeit ausgeschrieben. Wo soll ich mich anmelden?',
answer='Um das Verhältnis von Steuerleuten zu Ruderern optimal zu gestalten, schreiben wir mehrere Fahrten aus. In der Regel nehmen alle Boote, die zur selben Zeit starten, den gleichen Kurs, es sei denn, es wird in den Anmerkungen ausdrücklich anders angegeben. Die konkrete Zuordnung zu den Booten wird direkt in unserem Ruderverein vorgenommen. Bei welcher spezifischen Ausfahrt du dich anmeldest, spielt dabei keine wesentliche Rolle.') answer='Um das Verhältnis von Steuerleuten zu Ruderern optimal zu gestalten, schreiben wir mehrere Fahrten aus. In der Regel nehmen alle Boote, die zur selben Zeit starten, den gleichen Kurs, es sei denn, es wird in den Anmerkungen ausdrücklich anders angegeben. Die konkrete Zuordnung zu den Booten wird direkt in unserem Ruderverein vorgenommen. Bei welcher spezifischen Ausfahrt du dich anmeldest, spielt dabei keine wesentliche Rolle.')
}} }}
</div> </div>
</div> </div>
{% endblock content%} {% endblock content%}

View File

@ -1,17 +1,17 @@
{% import "includes/macros" as macros %} {% import "includes/macros" as macros %}
<div class="hidden"> <div class="hidden">
<form action="/admin/planned-event" method="post" class="grid gap-3" id="addEventForm"> <form action="/admin/planned-event" method="post" class="grid gap-3" id="addEventForm">
<input class="day-js" type="hidden" name="tripdetails.day" value="" /> <input class="day-js" type="hidden" name="tripdetails.day" value=""/>
{{ macros::input(label='Titel (z.B. Firmenrudern)', name='name', type='input', required=true) }} {{ macros::input(label='Titel (z.B. Firmenrudern)', name='name', type='input', required=true) }}
{{ macros::input(label='Startzeit', name='tripdetails.planned_starting_time', type='time', required=true) }} {{ macros::input(label='Startzeit', name='tripdetails.planned_starting_time', type='time', required=true) }}
{{ macros::input(label='Anzahl Steuerleute', name='planned_amount_cox', type='number', required=true, min='0') }} {{ macros::input(label='Anzahl Steuerleute', name='planned_amount_cox', type='number', required=true, min='0') }}
{{ macros::input(label='Anzahl Ruderer (ohne Steuerperson)', name='tripdetails.max_people', type='number', required=true, min='0') }} {{ macros::input(label='Anzahl Ruderer (ohne Steuerperson)', name='tripdetails.max_people', type='number', required=true, min='0') }}
{{ macros::checkbox(label='Gäste erlauben', name='tripdetails.allow_guests') }} {{ macros::checkbox(label='Gäste erlauben', name='tripdetails.allow_guests') }}
{{ macros::checkbox(label='Immer anzeigen', name='tripdetails.always_show') }} {{ macros::checkbox(label='Immer anzeigen', name='tripdetails.always_show') }}
{{ macros::input(label='Anmerkungen', name='tripdetails.notes', type='input') }} {{ macros::input(label='Anmerkungen', name='tripdetails.notes', type='input') }}
{{ macros::select(data=trip_types, select_name='tripdetails.trip_type', default='Reguläre Ausfahrt') }} {{ macros::select(data=trip_types, select_name='tripdetails.trip_type', default='Reguläre Ausfahrt') }}
<input value="Erstellen" class="w-full btn btn-primary" type="submit" /> <input value="Erstellen" class="w-full btn btn-primary" type="submit"/>
</form> </form>
</div> </div>

View File

@ -1,15 +1,15 @@
{% import "includes/macros" as macros %} {% import "includes/macros" as macros %}
<div class="hidden"> <div class="hidden">
<form action="/cox/trip" method="post" class="grid gap-3" id="sidebarForm"> <form action="/cox/trip" method="post" class="grid gap-3" id="sidebarForm">
<input class="day-js" type="hidden" name="day" value="" /> <input class="day-js" type="hidden" name="day" value=""/>
{{ macros::input(label='Startzeit (zB "10:00")', name='planned_starting_time', type='time', required=true) }} {{ macros::input(label='Startzeit (zB "10:00")', name='planned_starting_time', type='time', required=true) }}
{{ macros::input(label='Anzahl Ruderer (ohne Steuerperson)', name='max_people', type='number', required=true, min='0') }} {{ macros::input(label='Anzahl Ruderer (ohne Steuerperson)', name='max_people', type='number', required=true, min='0') }}
{{ macros::checkbox(label='Gäste erlauben', name='allow_guests') }} {{ macros::checkbox(label='Gäste erlauben', name='allow_guests') }}
{{ macros::checkbox(label='Immer anzeigen', name='always_show') }} {{ macros::checkbox(label='Immer anzeigen', name='always_show') }}
{{ macros::input(label='Anmerkungen', name='notes', type='input') }} {{ macros::input(label='Anmerkungen', name='notes', type='input') }}
{{ macros::select(data=trip_types, select_name='trip_type', default='Reguläre Ausfahrt') }} {{ macros::select(data=trip_types, select_name='trip_type', default='Reguläre Ausfahrt') }}
<input value="Erstellen" class="w-full btn btn-primary" type="submit" /> <input value="Erstellen" class="w-full btn btn-primary" type="submit"/>
</form> </form>
</div> </div>

View File

@ -1,16 +1,16 @@
{% if loggedin_user.is_cox %} {% if loggedin_user.is_cox %}
<div class="sm:col-span-2 lg:col-span-3 grid md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-3"> <div class="sm:col-span-2 lg:col-span-3 grid md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-3">
<button type="button" title="Toggle View" class="group btn btn-primary filter-trips-js" data-action="filter-days" id="filterdays-js" aria-pressed="false"> <button type="button" title="Toggle View" class="group btn btn-primary filter-trips-js" data-action="filter-days" id="filterdays-js" aria-pressed="false">
{% include "includes/funnel-icon" %} {% include "includes/funnel-icon" %}
Tage mit Ausfahrten Tage mit Ausfahrten
</button> </button>
<button type="button" title="Toggle View" class="group btn btn-primary filter-trips-js" data-action="filter-coxs" id="filtertrips-js" aria-pressed="false"> <button type="button" title="Toggle View" class="group btn btn-primary filter-trips-js" data-action="filter-coxs" id="filtertrips-js" aria-pressed="false">
{% include "includes/funnel-icon" %} {% include "includes/funnel-icon" %}
Steuerleute gesucht Steuerleute gesucht
</button> </button>
<button type="button" title="Toggle View" class="group btn btn-primary filter-trips-js" data-action="filter-months" id="filtermonth-js" aria-pressed="false" data-month="{{ now() | date(format='%m') }}"> <button type="button" title="Toggle View" class="group btn btn-primary filter-trips-js" data-action="filter-months" id="filtermonth-js" aria-pressed="false" data-month="{{ now() | date(format='%m') }}">
{% include "includes/funnel-icon" %} {% include "includes/funnel-icon" %}
Aktuellen Monat anzeigen Aktuellen Monat anzeigen
</button> </button>
</div> </div>
{% endif %} {% endif %}

View File

@ -1,4 +1,3 @@
<svg width="16" height="16" fill="currentColor" class="inline-block mr-1 h-3 w-3" viewBox="0 0 16 16" style="margin-top: -0.2rem;"> <svg width="16" height="16" fill="currentColor" class="inline-block mr-1 h-3 w-3" viewbox="0 0 16 16" style="margin-top: -0.2rem;">
<path <path d="M2 2a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v13.5a.5.5 0 0 1-.777.416L8 13.101l-5.223 2.815A.5.5 0 0 1 2 15.5V2zm2-1a1 1 0 0 0-1 1v12.566l4.723-2.482a.5.5 0 0 1 .554 0L13 14.566V2a1 1 0 0 0-1-1H4z"/>
d="M2 2a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v13.5a.5.5 0 0 1-.777.416L8 13.101l-5.223 2.815A.5.5 0 0 1 2 15.5V2zm2-1a1 1 0 0 0-1 1v12.566l4.723-2.482a.5.5 0 0 1 .554 0L13 14.566V2a1 1 0 0 0-1-1H4z" />
</svg> </svg>

Before

Width:  |  Height:  |  Size: 344 B

After

Width:  |  Height:  |  Size: 339 B

View File

@ -1,6 +1,4 @@
<svg width="16" height="16" fill="currentColor" class="inline h-4 w-4" viewBox="0 0 16 16"> <svg width="16" height="16" fill="currentColor" class="inline h-4 w-4" viewbox="0 0 16 16">
<path <path d="M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6z"/>
d="M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6z" /> <path fill-rule="evenodd" d="M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1v1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4H4.118zM2.5 3V2h11v1h-11z"/>
<path fill-rule="evenodd"
d="M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1v1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4H4.118zM2.5 3V2h11v1h-11z" />
</svg> </svg>

Before

Width:  |  Height:  |  Size: 551 B

After

Width:  |  Height:  |  Size: 540 B

View File

@ -1,10 +1,12 @@
<footer class="bg-primary-950 text-white w-full flex justify-center p-3"> <footer class="bg-primary-950 text-white w-full flex justify-center p-3">
<div class="max-w-screen-xl w-full flex justify-between"> <div class="max-w-screen-xl w-full flex justify-between">
<div> <div>
<span class="text-[#ff0000]">&hearts;</span> ASKÖ Ruderverein Donau Linz <span class="text-[#ff0000]">&hearts;</span>
</div> ASKÖ Ruderverein Donau Linz
<div> </div>
&copy; {{ now() | date(format="%Y") }} <div>
</div> &copy;
</div> {{ now() | date(format="%Y") }}
</div>
</div>
</footer> </footer>

View File

@ -1,65 +1,49 @@
{% macro new() %} {% macro new() %}
<form <form action="/admin/boat/new" method="post" class="mt-4 bg-primary-900 rounded-md text-white px-3 pb-3 pt-2 sm:flex items-end justify-between">
action="/admin/boat/new" <div class="w-full">
method="post" <h2 class="text-md font-bold mb-2 uppercase tracking-wide">
class="mt-4 bg-primary-900 rounded-md text-white px-3 pb-3 pt-2 sm:flex items-end justify-between" Neues Boot hinzufügen
> </h2>
<div class="w-full"> {{ macros::input(label="Name", name="name", type="text", required=true) }}
<h2 class="text-md font-bold mb-2 uppercase tracking-wide"> {{ macros::input(label="Anzahl Sitze", name="amount_seats", type="number", required=true, min=1) }}
Neues Boot hinzufügen {{ macros::input(label="Baujahr", name="year_built", type="number", min=1950, max=2050) }}
</h2> {{ macros::input(label="Bootsbauer", name="boatbuilder", type="text") }}
{{ macros::input(label="Name", name="name", type="text", required=true) }} {{ macros::select(data=locations, label='location', select_name='location_id', selected_id=1) }}
{{ macros::input(label="Anzahl Sitze", name="amount_seats", type="number", required=true, min=1) }} {{ macros::select(data=users, label='users', select_name='owner', default="Vereinsboot") }}
{{ macros::input(label="Baujahr", name="year_built", type="number", min=1950, max=2050) }} {{ macros::checkbox(label="Steuerperson steuert nur", name="default_shipmaster_only_steering")}}
{{ macros::input(label="Bootsbauer", name="boatbuilder", type="text") }} {{ macros::checkbox(label="Skull", name="skull", checked=true)}}
{{ macros::select(data=locations, label='location', select_name='location_id', selected_id=1) }} {{ macros::checkbox(label="Externes Boot (anderer Verein)", name="external")}}
{{ macros::select(data=users, label='users', select_name='owner', default="Vereinsboot") }} </div>
{{ macros::checkbox(label="Steuerperson steuert nur", name="default_shipmaster_only_steering")}} <div class="text-right">
{{ macros::checkbox(label="Skull", name="skull", checked=true)}} <input value="Hinzufügen" type="submit" class="w-28 mt-2 sm:mt-0 rounded-md bg-primary-500 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"/>
{{ macros::checkbox(label="Externes Boot (anderer Verein)", name="external")}} </div>
</div> </form>
<div class="text-right">
<input
value="Hinzufügen"
type="submit"
class="w-28 mt-2 sm:mt-0 rounded-md bg-primary-500 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"
/>
</div>
</form>
{% endmacro new %} {% endmacro new %}
{% macro edit(boat, uuid) %} {% macro edit(boat, uuid) %}
<form <form action="/admin/boat" data-filterable="true" method="post" class="bg-white p-3 rounded-md flex items-end md:items-center justify-between">
action="/admin/boat" <div class="w-full">
data-filterable="true" <input type="hidden" name="id" value="{{ boat.id }}"/>
method="post" <div class="font-bold mb-1">{{ boat.name }}<br/></div>
class="bg-white p-3 rounded-md flex items-end md:items-center justify-between" <div class="grid md:grid-cols-3">
> {{ macros::input(label='Name', name='name', type='text', value=boat.name) }}
<div class="w-full"> {{ macros::input(label='Amount Seats', name='amount_seats', type='number', min=0, value=boat.amount_seats) }}
<input type="hidden" name="id" value="{{ boat.id }}" /> {{ macros::select(data=locations, label='location', select_name='location_id', selected_id=boat.location_id) }}
<div class="font-bold mb-1">{{ boat.name }}<br /></div> {{ macros::select(data=users, label='users', select_name='owner', selected_id=boat.owner, default="Vereinsboot") }}
<div class="grid md:grid-cols-3"> {{ macros::input(label='Baujahr', name='year_built', type='number', min=1950, value=boat.year_built) }}
{{ macros::input(label='Name', name='name', type='text', value=boat.name) }} {{ macros::input(label='Bootsbauer', name='boatbuilder', type='text', value=boat.boatbuilder) }}
{{ macros::input(label='Amount Seats', name='amount_seats', type='number', min=0, value=boat.amount_seats) }} {{ macros::checkbox(label='default_shipmaster_only_steering', name='default_shipmaster_only_steering', id=uuid , checked=boat.default_shipmaster_only_steering) }}
{{ macros::select(data=locations, label='location', select_name='location_id', selected_id=boat.location_id) }} {{ macros::checkbox(label='skull', name='skull', id=uuid , checked=boat.skull) }}
{{ macros::select(data=users, label='users', select_name='owner', selected_id=boat.owner, default="Vereinsboot") }} {{ macros::checkbox(label='external', name='external', id=uuid , checked=boat.external) }}
{{ macros::input(label='Baujahr', name='year_built', type='number', min=1950, value=boat.year_built) }} </div>
{{ macros::input(label='Bootsbauer', name='boatbuilder', type='text', value=boat.boatbuilder) }} </div>
{{ macros::checkbox(label='default_shipmaster_only_steering', name='default_shipmaster_only_steering', id=uuid , checked=boat.default_shipmaster_only_steering) }} <div class="grid gap-3">
{{ macros::checkbox(label='skull', name='skull', id=uuid , checked=boat.skull) }} <a href="/admin/boat/{{ boat.id }}/delete" class="inline-block btn btn-alert" onclick="return confirm('Wirklich löschen?');">
{{ macros::checkbox(label='external', name='external', id=uuid , checked=boat.external) }} {% include "includes/delete-icon" %}
</div> Löschen
</div> </a>
<div class="grid gap-3"> <input value="Ändern" type="submit" class="w-28 btn btn-primary"/>
<a </div>
href="/admin/boat/{{ boat.id }}/delete" </form>
class="inline-block btn btn-alert"
onclick="return confirm('Wirklich löschen?');"
>
{% include "includes/delete-icon" %} Löschen
</a>
<input value="Ändern" type="submit" class="w-28 btn btn-primary" />
</div>
</form>
{% endmacro edit %} {% endmacro edit %}

View File

@ -1,202 +1,218 @@
{% macro new(only_ones, allow_any_shipmaster, shipmaster) %} {% macro new(only_ones, allow_any_shipmaster, shipmaster) %}
<form action="/log" method="post" id="form" class="grid grid-cols-2 gap-3"> <form action="/log" method="post" id="form" class="grid grid-cols-2 gap-3">
{{ log::boat_select(only_ones=only_ones) }} {{ log::boat_select(only_ones=only_ones) }}
{% if allow_any_shipmaster %} {% if allow_any_shipmaster %}
<select name="shipmaster" id="shipmaster" class="input rounded-md h-10"> <select name="shipmaster" id="shipmaster" class="input rounded-md h-10">
<optgroup label="Steuerpersonen"> <optgroup label="Steuerpersonen">
{% for cox in coxes %} {% for cox in coxes %}
<option value="{{ cox.id }}" {% if cox.id == shipmaster%} selected {% endif %}>{{ cox.name }}</option> <option value="{{ cox.id }}" {% if cox.id == shipmaster%} selected {% endif %}>{{ cox.name }}</option>
{% endfor %} {% endfor %}
</optgroup> </optgroup>
<optgroup label="Restliche Mitglieder"> <optgroup label="Restliche Mitglieder">
{% for user in users | filter(attribute="is_cox", value=false) %} {% for user in users | filter(attribute="is_cox", value=false) %}
<option value="{{ user.id }}" {% if user.id == shipmaster%} selected {% endif %}>{{ user.name }}</option> <option value="{{ user.id }}" {% if user.id == shipmaster%} selected {% endif %}>{{ user.name }}</option>
{% endfor %} {% endfor %}
</optgroup> </optgroup>
</select> </select>
{% else %} {% else %}
<input type="hidden" name="shipmaster" value="{{shipmaster}}" /> <input type="hidden" name="shipmaster" value="{{shipmaster}}"/>
{% endif %} {% endif %}
{% if not only_ones %} {% if not only_ones %}
{{ macros::checkbox(label='shipmaster_only_steering', name='shipmaster_only_steering') }} {{ macros::checkbox(label='shipmaster_only_steering', name='shipmaster_only_steering') }}
{% endif %} {% endif %}
{% if not only_ones %} {% if not only_ones %}
{{ log::rower_select(id="newrower", selected=[], class="col-span-2") }} {{ log::rower_select(id="newrower", selected=[], class="col-span-2") }}
{% endif %} {% endif %}
<div>Departure: <input type="datetime-local" id="datetime-dep" name="departure" required/></div> <div>Departure:
<div> Arrival: <input type="datetime-local" id="datetime-arr" name="arrival" /></div> <input type="datetime-local" id="datetime-dep" name="departure" required/></div>
<div class="col-span-2"> <div>
Destination: <input type="search" list="destinations" placeholder="Destination" name="destination" id="destination" oninput="var inputElement = document.getElementById('destination'); Arrival:
var dataList = document.getElementById('destinations'); <input type="datetime-local" id="datetime-arr" name="arrival"/></div>
var selectedValue = inputElement.value; <div class="col-span-2">
for (var i = 0; i < dataList.options.length; i++) { Destination:
if (dataList.options[i].value === selectedValue) { <input type="search" list="destinations" placeholder="Destination" name="destination" id="destination" oninput="var inputElement = document.getElementById('destination');
var distance = dataList.options[i].getAttribute('distance'); var dataList = document.getElementById('destinations');
document.getElementById('distance_in_km').value = distance; var selectedValue = inputElement.value;
break; for (var i = 0; i < dataList.options.length; i++) {
} if (dataList.options[i].value === selectedValue) {
}"> var distance = dataList.options[i].getAttribute('distance');
<datalist id="destinations"> document.getElementById('distance_in_km').value = distance;
{% for distance in distances %} break;
<option value="{{ distance.0 }}" distance={{ distance.1 }} /> }
{% endfor %} }">
</datalist> <datalist id="destinations">
</div> {% for distance in distances %}
{{ macros::input(label="Distanz", name="distance_in_km", type="number", min=0, wrapper_class="col-span-2") }} <option value="{{ distance.0 }}" distance={{ distance.1 }}/>
{{ macros::input(label="Kommentar", name="comments", type="text", wrapper_class="col-span-2") }} {% endfor %}
{{ macros::select(data=logtypes, select_name='logtype', default="Normal", class="col-span-2") }} </datalist>
<input type="submit" value="Starten" class="btn btn-primary w-100 col-span-2 m-auto" /> </div>
{{ macros::input(label="Distanz", name="distance_in_km", type="number", min=0, wrapper_class="col-span-2") }}
{{ macros::input(label="Kommentar", name="comments", type="text", wrapper_class="col-span-2") }}
{{ macros::select(data=logtypes, select_name='logtype', default="Normal", class="col-span-2") }}
<input type="submit" value="Starten" class="btn btn-primary w-100 col-span-2 m-auto"/>
<script>
const currentDate = new Date();
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>
<script> <script>
const currentDate = new Date(); document.getElementById('form').addEventListener('submit', function (e) {
const localTime = new Date(currentDate.getTime() - (currentDate.getTimezoneOffset() * 60000)); e.preventDefault();
const formattedDate = localTime.toISOString().slice(0, 16); for (let optional_elem of["datetime-arr", "distance_in_km", "comments", "logtype"]) {
let myInput = document.getElementById(optional_elem);
// Set the formatted string as the value of the input field if (myInput.value === '') {
document.getElementById("datetime-dep").value = formattedDate; myInput.removeAttribute('name');
}
}
this.submit();
});
</script> </script>
</form>
<script>
document.getElementById('form').addEventListener('submit', function(e) {
e.preventDefault();
for(let optional_elem of ["datetime-arr", "distance_in_km", "comments", "logtype"]){
let myInput = document.getElementById(optional_elem);
if (myInput.value === '') {
myInput.removeAttribute('name');
}
}
this.submit();
});
</script>
{% endmacro new %} {% endmacro new %}
{% macro show_boats(only_ones) %} {% macro show_boats(only_ones) %}
{% if only_ones %} {% if only_ones %}
{% set_global boats = boats | filter(attribute="amount_seats", value=1) %} {% set_global boats = boats | filter(attribute="amount_seats", value=1) %}
{% endif %} {% endif %}
{% for boat in boats %} {% for boat in boats %}
<div onclick="document.getElementById('boat_id').value='{{ boat.id }}';updateElementsBasedOnSelectedOption()">{{ boat.name }}</div> <div onclick="document.getElementById('boat_id').value='{{ boat.id }}';updateElementsBasedOnSelectedOption()">{{ boat.name }}</div>
{% endfor %} {% endfor %}
<script> <script>
function updateElementsBasedOnSelectedOption() { function updateElementsBasedOnSelectedOption() {
var selectElement = document.getElementById('boat_id'); var selectElement = document.getElementById('boat_id');
var selectedOption = selectElement.selectedOptions[0]; var selectedOption = selectElement.selectedOptions[0];
var shipmaster_only_steering = selectedOption.getAttribute("extra-default_shipmaster_only_steering") === 'true'; var shipmaster_only_steering = selectedOption.getAttribute("extra-default_shipmaster_only_steering") === 'true';
document.getElementById('shipmaster_only_steering').checked = shipmaster_only_steering; document.getElementById('shipmaster_only_steering').checked = shipmaster_only_steering;
document.getElementById('newrower-max_rower_allowed').innerHTML = selectedOption.getAttribute("extra-amount_seats"); document.getElementById('newrower-max_rower_allowed').innerHTML = selectedOption.getAttribute("extra-amount_seats");
} }
document.addEventListener('DOMContentLoaded', function() { document.addEventListener('DOMContentLoaded', function () {
document.getElementById('boat_id').addEventListener('change', updateElementsBasedOnSelectedOption); document.getElementById('boat_id').addEventListener('change', updateElementsBasedOnSelectedOption);
}); });
document.addEventListener('DOMContentLoaded', updateElementsBasedOnSelectedOption); document.addEventListener('DOMContentLoaded', updateElementsBasedOnSelectedOption);
</script> </script>
{% endmacro boats %} {% endmacro boats %}
{% macro boat_select(only_ones) %} {% macro boat_select(only_ones) %}
{% if not only_ones %} {% if not only_ones %}
{{ macros::select(data=boats, select_name='boat_id', display=["name", " (","amount_seats", " x)"], extras=["default_shipmaster_only_steering", "amount_seats"], class="col-span-2 md:hidden") }} {{ macros::select(data=boats, select_name='boat_id', display=["name", " (","amount_seats", " x)"], extras=["default_shipmaster_only_steering", "amount_seats"], class="col-span-2 md:hidden") }}
{% else %} {% else %}
{% set ones = boats | filter(attribute="amount_seats", value=1) %} {% set ones = boats | filter(attribute="amount_seats", value=1) %}
{{ macros::select(data=ones, select_name='boat_id', display=["name", " (","amount_seats", " x)"], extras=["default_shipmaster_only_steering", "amount_seats"], class="md:hidden") }} {{ macros::select(data=ones, select_name='boat_id', display=["name", " (","amount_seats", " x)"], extras=["default_shipmaster_only_steering", "amount_seats"], class="md:hidden") }}
{% endif %} {% endif %}
<script> <script>
function updateElementsBasedOnSelectedOption() { function updateElementsBasedOnSelectedOption() {
var selectElement = document.getElementById('boat_id'); var selectElement = document.getElementById('boat_id');
var selectedOption = selectElement.selectedOptions[0]; var selectedOption = selectElement.selectedOptions[0];
var shipmaster_only_steering = selectedOption.getAttribute("extra-default_shipmaster_only_steering") === 'true'; var shipmaster_only_steering = selectedOption.getAttribute("extra-default_shipmaster_only_steering") === 'true';
document.getElementById('shipmaster_only_steering').checked = shipmaster_only_steering; document.getElementById('shipmaster_only_steering').checked = shipmaster_only_steering;
document.getElementById('newrower-max_rower_allowed').innerHTML = selectedOption.getAttribute("extra-amount_seats"); document.getElementById('newrower-max_rower_allowed').innerHTML = selectedOption.getAttribute("extra-amount_seats");
} }
document.getElementById('boat_id').addEventListener('change', updateElementsBasedOnSelectedOption); document.getElementById('boat_id').addEventListener('change', updateElementsBasedOnSelectedOption);
document.addEventListener('DOMContentLoaded', updateElementsBasedOnSelectedOption); document.addEventListener('DOMContentLoaded', updateElementsBasedOnSelectedOption);
</script> </script>
{% endmacro boat_select %} {% endmacro boat_select %}
{% macro show(log, state, allowed_to_close=false, only_ones) %} {% macro show(log, state, allowed_to_close=false, only_ones) %}
Bootsname: {{ log.boat.name }}<br /> Bootsname:
Schiffsführer: {{ log.shipmaster_user.name }}<br /> {{ log.boat.name }}<br/>
{% if log.shipmaster_only_steering %} Schiffsführer:
Schiffsführer steuert nur {{ log.shipmaster_user.name }}<br/>
{% endif %} {% if log.shipmaster_only_steering %}
Weggefahren: {{ log.departure }}<br /> Schiffsführer steuert nur
{% if state == "completed" %} {% endif %}
Angekommen: {{ log.arrival}}<br /> Weggefahren:
{% endif %} {{ log.departure }}<br/>
{% set amount_rowers = log.rowers | length %} {% if state == "completed" %}
{% set amount_guests = log.boat.amount_seats - amount_rowers -1 %} Angekommen:
{% if allowed_to_close and state == "on_water" %} {{ log.arrival}}<br/>
{{ log::home(log=log, only_ones=only_ones) }} {% endif %}
{% else %} {% set amount_rowers = log.rowers | length %}
Ziel: {{ log.destination }}<br /> {% set amount_guests = log.boat.amount_seats - amount_rowers -1 %}
{% if state == "completed" %} {% if allowed_to_close and state == "on_water" %}
Km: {{ log.distance_in_km }}<br /> {{ log::home(log=log, only_ones=only_ones) }}
{% endif %} {% else %}
{% if log.comments %} Ziel:
Kommentare: {{ log.comments }}<br /> {{ log.destination }}<br/>
{% endif %} {% if state == "completed" %}
{% if log.logtype %} Km:
Logtype: {{ log.logtype }}<br /> {{ log.distance_in_km }}<br/>
{% endif %} {% endif %}
{% if amount_guests > 0 or log.rowers | length > 0 %} {% if log.comments %}
Ruderer: Kommentare:
{% endif %} {{ log.comments }}<br/>
{% if amount_guests > 0 %} {% endif %}
{{ amount_guests }} Gäste (ohne Account) {% if log.logtype %}
{% endif %} Logtype:
{% for rower in log.rowers %} {{ log.logtype }}<br/>
{{ rower.name }} {% endif %}
{% endfor %} {% if amount_guests > 0 or log.rowers | length > 0 %}
{% endif %} Ruderer:
{% endif %}
{% if amount_guests > 0 %}
{{ amount_guests }}
Gäste (ohne Account)
{% endif %}
{% for rower in log.rowers %}
{{ rower.name }}
{% endfor %}
{% endif %}
{% endmacro show %} {% endmacro show %}
{% macro home(log, only_ones) %} {% macro home(log, only_ones) %}
<form action="/log/{{log.id}}" method="post"> <form action="/log/{{log.id}}" method="post">
Destination: <input type="search" list="destinations" placeholder="Destination" required="required", id="destination-home" name="destination" value="{{log.destination}}" oninput="var inputElement = document.getElementById('destination-home'); Destination:
var dataList = document.getElementById('destinations'); <input type="search" list="destinations" placeholder="Destination" required="required" , id="destination-home" name="destination" value="{{log.destination}}" oninput="var inputElement = document.getElementById('destination-home');
var selectedValue = inputElement.value; var dataList = document.getElementById('destinations');
for (var i = 0; i < dataList.options.length; i++) { var selectedValue = inputElement.value;
if (dataList.options[i].value === selectedValue) { for (var i = 0; i < dataList.options.length; i++) {
var distance = dataList.options[i].getAttribute('distance'); if (dataList.options[i].value === selectedValue) {
document.getElementById('distance_in_km_home').value = distance; var distance = dataList.options[i].getAttribute('distance');
break; document.getElementById('distance_in_km_home').value = distance;
} break;
}"> }
{{ macros::input(label="Distanz", name="distance_in_km", id="distance_in_km_home", type="number", min=0, value=log.distance_in_km, required=true) }} }">
{{ macros::input(label="Kommentar", name="comments", type="text", value=log.comments) }} {{ macros::input(label="Distanz", name="distance_in_km", id="distance_in_km_home", type="number", min=0, value=log.distance_in_km, required=true) }}
{{ macros::select(data=logtypes, select_name='logtype', default="Normal", selected_id=log.logtype) }} {{ macros::input(label="Kommentar", name="comments", type="text", value=log.comments) }}
{% if not only_ones %} {{ macros::select(data=logtypes, select_name='logtype', default="Normal", selected_id=log.logtype) }}
{{ log::rower_select(id="rowers"~log.id, selected=log.rowers, amount_seats=log.boat.amount_seats) }} {% if not only_ones %}
{% endif %} {{ log::rower_select(id="rowers"~log.id, selected=log.rowers, amount_seats=log.boat.amount_seats) }}
<input type="submit" value="AUSFAHRT BEENDEN"/> {% endif %}
</form> <input type="submit" value="AUSFAHRT BEENDEN"/>
</form>
{% endmacro home %} {% endmacro home %}
{% macro rower_select(id, selected, amount_seats='', class='') %} {% macro rower_select(id, selected, amount_seats='', class='') %}
<select multiple="multiple" name="rower[]" id="{{id}}" onclick="updateSelectedRowersCount{{id}}()" onblur="updateSelectedRowersCount{{id}}()" class="{{ class }}"> <select multiple="multiple" name="rower[]" id="{{id}}" onclick="updateSelectedRowersCount{{id}}()" onblur="updateSelectedRowersCount{{id}}()" class="{{ class }}">
{% for user in users %} {% for user in users %}
{% set_global sel = false %} {% set_global sel = false %}
{% for rower in selected %} {% for rower in selected %}
{% if rower.id == user.id %} {% if rower.id == user.id %}
{% set_global sel = true %} {% set_global sel = true %}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
<option value="{{ user.id }}" {% if sel %}selected{% endif %} onmousedown="event.preventDefault();this.selected = !this.selected; return false;">{{user.name}}</option> <option value="{{ user.id }}" {% if sel %} selected {% endif %} onmousedown="event.preventDefault();this.selected = !this.selected; return false;">{{user.name}}</option>
{% endfor %} {% endfor %}
</select> </select>
<script> <script>
function updateSelectedRowersCount{{id}}() { function updateSelectedRowersCount {{ id }}
document.getElementById('{{id}}-amount_rower_selected').textContent = document.getElementById('{{id}}').selectedOptions.length+1; () {
} document.getElementById('{{ id }}-amount_rower_selected').textContent = document.getElementById('{{ id }}').selectedOptions.length + 1;
document.addEventListener('DOMContentLoaded', updateSelectedRowersCount{{id}}); }
</script> document.addEventListener('DOMContentLoaded', updateSelectedRowersCount {{ id }});
<div class="col-span-2"> </script>
<span id="{{id}}-amount_rower_selected"></span>/<span id="{{id}}-max_rower_allowed">{{amount_seats}}</span> Ruderer ausgewählt <div class="col-span-2">
</div> <span id="{{id}}-amount_rower_selected"></span>/<span id="{{id}}-max_rower_allowed">{{amount_seats}}</span>
Ruderer ausgewählt
</div>
{% endmacro rower_select %} {% endmacro rower_select %}

View File

@ -1,3 +1,3 @@
<svg width="16" height="16" fill="currentColor" class="inline h-4 w-4 text-primary-300 group-hover:text-primary-400 mr-2" viewBox="0 0 16 16" style="margin-top: -0.2rem"> <svg width="16" height="16" fill="currentColor" class="inline h-4 w-4 text-primary-300 group-hover:text-primary-400 mr-2" viewbox="0 0 16 16" style="margin-top: -0.2rem">
<path d="M1.5 1.5A.5.5 0 0 1 2 1h12a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-.128.334L10 8.692V13.5a.5.5 0 0 1-.342.474l-3 1A.5.5 0 0 1 6 14.5V8.692L1.628 3.834A.5.5 0 0 1 1.5 3.5v-2z"/> <path d="M1.5 1.5A.5.5 0 0 1 2 1h12a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-.128.334L10 8.692V13.5a.5.5 0 0 1-.342.474l-3 1A.5.5 0 0 1 6 14.5V8.692L1.628 3.834A.5.5 0 0 1 1.5 3.5v-2z"/>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 357 B

After

Width:  |  Height:  |  Size: 354 B

View File

@ -1,3 +1,3 @@
<svg class="h-5 w-5 text-primary-300 group-hover:text-primary-400" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true"> <svg class="h-5 w-5 text-primary-300 group-hover:text-primary-400" viewbox="0 0 20 20" fill="currentColor" aria-hidden="true">
<path fill-rule="evenodd" d="M10 1a4.5 4.5 0 00-4.5 4.5V9H5a2 2 0 00-2 2v6a2 2 0 002 2h10a2 2 0 002-2v-6a2 2 0 00-2-2h-.5V5.5A4.5 4.5 0 0010 1zm3 8V5.5a3 3 0 10-6 0V9h6z" clip-rule="evenodd" /> <path fill-rule="evenodd" d="M10 1a4.5 4.5 0 00-4.5 4.5V9H5a2 2 0 00-2 2v6a2 2 0 002 2h10a2 2 0 002-2v-6a2 2 0 00-2-2h-.5V5.5A4.5 4.5 0 0010 1zm3 8V5.5a3 3 0 10-6 0V9h6z" clip-rule="evenodd"/>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 330 B

After

Width:  |  Height:  |  Size: 328 B

View File

@ -1,112 +1,125 @@
{% macro header(loggedin_user) %} {% macro header(loggedin_user) %}
<header class="bg-primary-900 text-white flex justify-center p-3 fixed w-full z-10"> <header class="bg-primary-900 text-white flex justify-center p-3 fixed w-full z-10">
<div class="max-w-screen-xl w-full flex justify-between items-center"> <div class="max-w-screen-xl w-full flex justify-between items-center">
<div> <div>
<a href="/"> <a href="/">
Hü {{ loggedin_user.name }}
</a> {{ loggedin_user.name }}
</div> </a>
</div>
<div> <div>
<a href="/faq" 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"> <a href="/faq" 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">
{% include "includes/question-icon" %} {% include "includes/question-icon" %}
<span class="sr-only">FAQs</span> <span class="sr-only">FAQs</span>
</a> </a>
{% if loggedin_user.is_admin %} {% 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"> <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 STATS
<span class="sr-only">Logbuch</span> <span class="sr-only">Logbuch</span>
</a> </a>
<a href="/log/show" 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"> <a href="/log/show" 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 HISTORY LOGBUCH HISTORY
<span class="sr-only">Logbuch History</span> <span class="sr-only">Logbuch History</span>
</a> </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"> <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 LOGBUCH
<span class="sr-only">Logbuch</span> <span class="sr-only">Logbuch</span>
</a> </a>
<a href="/admin/boat" 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"> <a href="/admin/boat" 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">
BOATS BOATS
<span class="sr-only">Bootsverwaltung</span> <span class="sr-only">Bootsverwaltung</span>
</a> </a>
<a href="/admin/user" 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"> <a href="/admin/user" 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">
<svg class="inline h-4" width="16" height="16" fill="currentColor" class="bi bi-person-lines-fill" viewBox="0 0 16 16"> <path d="M6 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-5 6s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1H1zM11 3.5a.5.5 0 0 1 .5-.5h4a.5.5 0 0 1 0 1h-4a.5.5 0 0 1-.5-.5zm.5 2.5a.5.5 0 0 0 0 1h4a.5.5 0 0 0 0-1h-4zm2 3a.5.5 0 0 0 0 1h2a.5.5 0 0 0 0-1h-2zm0 3a.5.5 0 0 0 0 1h2a.5.5 0 0 0 0-1h-2z"/> </svg> <svg class="inline h-4" width="16" height="16" fill="currentColor" class="bi bi-person-lines-fill" viewbox="0 0 16 16">
<span class="sr-only">Userverwaltung</span> <path d="M6 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-5 6s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1H1zM11 3.5a.5.5 0 0 1 .5-.5h4a.5.5 0 0 1 0 1h-4a.5.5 0 0 1-.5-.5zm.5 2.5a.5.5 0 0 0 0 1h4a.5.5 0 0 0 0-1h-4zm2 3a.5.5 0 0 0 0 1h2a.5.5 0 0 0 0-1h-2zm0 3a.5.5 0 0 0 0 1h2a.5.5 0 0 0 0-1h-2z"/>
</a> </svg>
{% endif %} <span class="sr-only">Userverwaltung</span>
<a href="/auth/logout" class="inline-flex justify-center rounded-md bg-primary-600 ml-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"> </a>
<svg class="inline h-4" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-log-out"><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"></path><polyline points="16 17 21 12 16 7"></polyline><line x1="21" y1="12" x2="9" y2="12"></line></svg> {% endif %}
<span class="sr-only">Ausloggen</span> <a href="/auth/logout" class="inline-flex justify-center rounded-md bg-primary-600 ml-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">
</a> <svg class="inline h-4" width="24" height="24" viewbox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-log-out">
</div> <path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"></path>
</div> <polyline points="16 17 21 12 16 7"></polyline>
</header> <line x1="21" y1="12" x2="9" y2="12"></line>
<div class="h-8"></div> </svg>
<span class="sr-only">Ausloggen</span>
</a>
</div>
</div>
</header>
<div class="h-8"></div>
{% endmacro header %} {% endmacro header %}
{% macro input(label, name, type, required=false, class='rounded-md', value='', min='', hide_label=false, id='', autofocus=false, wrapper_class='') %} {% macro input(label, name, type, required=false, class='rounded-md', value='', min='', hide_label=false, id='', autofocus=false, wrapper_class='') %}
<div class="{{wrapper_class}}"> <div class="{{wrapper_class}}">
<label for="{{ name }}" class="{% if hide_label %} sr-only {% else %} small text-gray-600 {% endif %}">{{ label }}</label> <label for="{{ name }}" class="{% if hide_label %} sr-only {% else %} small text-gray-600 {% endif %}">{{ label }}</label>
<input {% if id %} id="{{ id }}" {% else %} id="{{ name }}" {% endif %} name="{{ name }}" type="{{ type }}" {% if required %} required {% endif %} value="{{ value }}" class="input {{ class }}" placeholder="{% if hide_label %}{{ label }}{% endif %}" {% if min %} min="{{ min }}" {% endif %}{% if autofocus %}autofocus {% endif %}> <input {% if id %} id="{{ id }}" {% else %} id="{{ name }}" {% endif %} name="{{ name }}" type="{{ type }}" {% if required %} required {% endif %} value="{{ value }}" class="input {{ class }}" placeholder="{% if hide_label %}{{ label }}{% endif %}" {% if min %} min="{{ min }}" {% endif %} {% if autofocus %} autofocus {% endif %}>
</div> </div>
{% endmacro input %} {% endmacro input %}
{% macro checkbox(label, name, id='', checked=false, class='') %} {% macro checkbox(label, name, id='', checked=false, class='') %}
<label for="{{ name }}{{ id }}" class="flex items-center cursor-pointer hover:text-gray-900 {{ class }}"> <label for="{{ name }}{{ id }}" class="flex items-center cursor-pointer hover:text-gray-900 {{ class }}">
<input type="checkbox" id="{{ name }}{{ id }}" name="{{ name }}" {% if checked %} checked {% endif %} class="h-4 w-4 accent-primary-600 mr-2"/> {{ label }} <input type="checkbox" id="{{ name }}{{ id }}" name="{{ name }}" {% if checked %} checked {% endif %} class="h-4 w-4 accent-primary-600 mr-2"/>
</label> {{ label }}
</label>
{% endmacro checkbox %} {% endmacro checkbox %}
{% macro select(data, select_name='trip_type', default='', selected_id='', display='', extras='', class='') %} {% macro select(data, select_name='trip_type', default='', selected_id='', display='', extras='', class='') %}
{% if display == '' %} {% if display == '' %}
{% set display = ["name"] %} {% set display = ["name"] %}
{% endif %} {% endif %}
<select name="{{ select_name }}" id="{{ select_name }}" class="input rounded-md h-10 {{ class }}"> <select name="{{ select_name }}" id="{{ select_name }}" class="input rounded-md h-10 {{ class }}">
{% if default %} {% if default %}
<option selected value>{{ default }}</option> <option selected value>{{ default }}</option>
{% endif %} {% endif %}
{% for d in data %} {% for d in data %}
<option value="{{ d.id }}" {% if d.id == selected_id %} selected {% endif %}{% if extras != '' %}{% for extra in extras %} extra-{{extra}}={{d[extra]}} {% endfor %}{% endif %}> <option value="{{ d.id }}" {% if d.id == selected_id %} selected {% endif %} {% if extras != '' %} {% for extra in extras %} extra- {{extra}}={{d[extra]}} {% endfor %} {% endif %}>
{% for displa in display -%} {% for displa in display -%}
{%- if d[displa] -%} {%- if d[displa] -%}
{{- d[displa] -}} {{- d[displa] -}}
{%- else -%} {%- else -%}
{{- displa -}} {{- displa -}}
{%- endif -%} {%- endif -%}
{%- endfor %} {%- endfor %}
</option> </option>
{% endfor %} {% endfor %}
</select> </select>
{% endmacro select %} {% endmacro select %}
{% macro alert(message, type, class='') %} {% macro alert(message, type, class='') %}
<div class="{{ class }} alert-{{ type }} text-white px-3 py-1 rounded-md text-center"> <div class="{{ class }} alert-{{ type }} text-white px-3 py-1 rounded-md text-center">
{{ message }} {{ message }}
</div> </div>
{% endmacro alert %} {% endmacro alert %}
{% macro box(participants, empty_seats='', header='Freie Plätze:', text='Keine Ruderer angemeldet', bg='primary-600', color='white') %} {% macro box(participants, empty_seats='', header='Freie Plätze:', text='Keine Ruderer angemeldet', bg='primary-600', color='white') %}
<div class="text-{{ color }} bg-{{ bg }} text-center p-1 mt-1 rounded-t-md">{{ header }} {{ empty_seats }}</div> <div class="text-{{ color }} bg-{{ bg }} text-center p-1 mt-1 rounded-t-md">{{ header }}
<div class="p-2 border border-t-0 border-{{ bg }} mb-4 rounded-b-md"> {{ empty_seats }}</div>
{% if participants | length > 0 %} <div class="p-2 border border-t-0 border-{{ bg }} mb-4 rounded-b-md">
{% for rower in participants %} {% if participants | length > 0 %}
{{ rower.name }} {% if rower.is_guest %} <small class="text-gray-600">(Gast)</small> {% endif %}<span class="hidden">(angemeldet seit {{ rower.registered_at }})</span><br /> {% for rower in participants %}
{% endfor %} {{ rower.name }}
{% else %} {% if rower.is_guest %}
{{ text }} <small class="text-gray-600">(Gast)</small>
{% endif %} {% endif %}
</div> <span class="hidden">(angemeldet seit
{{ rower.registered_at }})</span><br/>
{% endfor %}
{% else %}
{{ text }}
{% endif %}
</div>
{% endmacro box %} {% endmacro box %}
{% macro faq(question, answer) %} {% macro faq(question, answer) %}
<div> <div>
<h2 class="flex mb-4 text-lg font-bold text-primary-900"> <h2 class="flex mb-4 text-lg font-bold text-primary-900">
{{ question }} {{ question }}
</h2> </h2>
<p class="text-primary-950">{{ answer | safe }}</p> <p class="text-primary-950">{{ answer | safe }}</p>
</div> </div>
{% endmacro faq %} {% endmacro faq %}

View File

@ -1,3 +1,3 @@
<svg class="inline h-5 w-5" width="16" height="16" fill="currentColor" class="bi bi-plus" viewBox="0 0 16 16"> <svg class="inline h-5 w-5" width="16" height="16" fill="currentColor" class="bi bi-plus" viewbox="0 0 16 16">
<path d="M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4z"/> <path d="M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4z"/>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 236 B

After

Width:  |  Height:  |  Size: 233 B

View File

@ -1 +1,3 @@
<svg class="flex-shrink-0 w-4 h-4 inline-block" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-3a1 1 0 00-.867.5 1 1 0 11-1.731-1A3 3 0 0113 8a3.001 3.001 0 01-2 2.83V11a1 1 0 11-2 0v-1a1 1 0 011-1 1 1 0 100-2zm0 8a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg> <svg class="flex-shrink-0 w-4 h-4 inline-block" fill="currentColor" viewbox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-3a1 1 0 00-.867.5 1 1 0 11-1.731-1A3 3 0 0113 8a3.001 3.001 0 01-2 2.83V11a1 1 0 11-2 0v-1a1 1 0 011-1 1 1 0 100-2zm0 8a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path>
</svg>

Before

Width:  |  Height:  |  Size: 370 B

After

Width:  |  Height:  |  Size: 373 B

View File

@ -3,284 +3,286 @@
{% extends "base" %} {% extends "base" %}
{% block content %} {% block content %}
<div class="max-w-screen-xl w-full grid sm:grid-cols-2 lg:grid-cols-3 gap-4"> <div class="max-w-screen-xl w-full grid sm:grid-cols-2 lg:grid-cols-3 gap-4">
{% if flash %} {% if flash %}
{{ macros::alert(message=flash.1, type=flash.0, class="sm:col-span-2 lg:col-span-3") }} {{ macros::alert(message=flash.1, type=flash.0, class="sm:col-span-2 lg:col-span-3") }}
{% endif %} {% endif %}
<h1 class="h1 sm:col-span-2 lg:col-span-3">Ausfahrten</h1> <h1 class="h1 sm:col-span-2 lg:col-span-3">Ausfahrten</h1>
{% include "includes/buttons" %} {% include "includes/buttons" %}
{% for day in days %} {% for day in days %}
{% set amount_trips = day.planned_events | length + day.trips | length %} {% set amount_trips = day.planned_events | length + day.trips | length %}
{% set_global day_cox_needed = false %} {% set_global day_cox_needed = false %}
{% if day.planned_events | length > 0 %} {% if day.planned_events | length > 0 %}
{% for planned_event in day.planned_events %} {% for planned_event in day.planned_events %}
{% if planned_event.cox_needed %} {% if planned_event.cox_needed %}
{% set_global day_cox_needed = true %} {% set_global day_cox_needed = true %}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% endif %} {% endif %}
<div class="bg-white rounded-md flex justify-between flex-col shadow reset-js" style="min-height: 10rem;" data-trips="{{ amount_trips }}" data-month="{{ day.day| date(format='%m') }}" data-coxneeded="{{ day_cox_needed }}"> <div class="bg-white rounded-md flex justify-between flex-col shadow reset-js" style="min-height: 10rem;" data-trips="{{ amount_trips }}" data-month="{{ day.day| date(format='%m') }}" data-coxneeded="{{ day_cox_needed }}">
<div> <div>
<h2 class="font-bold uppercase tracking-wide text-center rounded-t-md {% if day.is_pinned %} text-white bg-primary-950 {% else %} text-primary-950 bg-gray-200 bg-opacity-80 {% endif %} text-lg px-3 py-3 ">{{ day.day| date(format="%d.%m.%Y") }} <h2 class="font-bold uppercase tracking-wide text-center rounded-t-md {% if day.is_pinned %} text-white bg-primary-950 {% else %} text-primary-950 bg-gray-200 bg-opacity-80 {% endif %} text-lg px-3 py-3 ">{{ day.day| date(format="%d.%m.%Y") }}
<small class="inline-block ml-1 text-xs {% if day.is_pinned %} text-gray-200 {% else %} text-gray-500 {% endif %}">{{ day.day | date(format="%A", locale="de_AT") }}</small> <small class="inline-block ml-1 text-xs {% if day.is_pinned %} text-gray-200 {% else %} text-gray-500 {% endif %}">{{ day.day | date(format="%A", locale="de_AT") }}</small>
</h2> </h2>
{% if day.planned_events | length > 0 or day.trips | length > 0 %} {% if day.planned_events | length > 0 or day.trips | length > 0 %}
<div class="grid grid-cols-1 gap-3 mb-3"> <div
class="grid grid-cols-1 gap-3 mb-3">
{# --- START Events --- #} {# --- START Events --- #}
{% if day.planned_events | length > 0 %} {% if day.planned_events | length > 0 %}
{% for planned_event in day.planned_events | sort(attribute="planned_starting_time") %} {% for planned_event in day.planned_events | sort(attribute="planned_starting_time") %}
{% set amount_cur_cox = planned_event.cox | length %} {% set amount_cur_cox = planned_event.cox | length %}
{% set amount_cox_missing = planned_event.planned_amount_cox - amount_cur_cox %} {% set amount_cox_missing = planned_event.planned_amount_cox - amount_cur_cox %}
<div class="pt-2 px-3 border-t" style="order: {{ planned_event.planned_starting_time | replace(from=":", to="") | trim_start_matches(pat="0") }}"> <div class="pt-2 px-3 border-t" style="order: {{ planned_event.planned_starting_time | replace(from=" :", to=" ") | trim_start_matches(pat=" 0") }}">
<div class="flex justify-between items-center"> <div class="flex justify-between items-center">
<div class="mr-1"> <div class="mr-1">
<strong class="text-primary-900"> <strong class="text-primary-900">
{{ planned_event.planned_starting_time }} Uhr {{ planned_event.planned_starting_time }}
</strong> Uhr
<small class="text-gray-600">({{ planned_event.name }}{% if planned_event.trip_type %} - {{ planned_event.trip_type.icon | safe }}{{ planned_event.trip_type.name }}{% endif %})</small><br /> </strong>
<small class="text-gray-600">({{ planned_event.name }}
{% if planned_event.trip_type %}
-
{{ planned_event.trip_type.icon | safe }}{{ planned_event.trip_type.name }}
{% endif %})</small><br/>
<a href="#" data-sidebar="true" data-trigger="sidebar" <a href="#" data-sidebar="true" data-trigger="sidebar" data-header="<strong>{{ planned_event.planned_starting_time }} Uhr</strong> ({{ planned_event.name }}){% if planned_event.trip_type %}<small class='block'>{{ planned_event.trip_type.desc }}</small>{% endif %}{% if planned_event.notes %}<small class='block'>{{ planned_event.notes }}</small>{% endif %}" data-body="#event{{ planned_event.trip_details_id }}" class="inline-block link-primary mr-3">
data-header="<strong>{{ planned_event.planned_starting_time }} Uhr</strong> ({{ planned_event.name }}){% if planned_event.trip_type %}<small class='block'>{{ planned_event.trip_type.desc }}</small>{% endif %}{% if planned_event.notes %}<small class='block'>{{ planned_event.notes }}</small>{% endif %}" Details
data-body="#event{{ planned_event.trip_details_id }}" </a>
class="inline-block link-primary mr-3"> </div>
Details <div
</a> class="text-right grid gap-2">
</div> {# --- START Row Buttons --- #}
<div class="text-right grid gap-2"> {% set_global cur_user_participates = false %}
{# --- START Row Buttons --- #} {% for rower in planned_event.rower%}
{% set_global cur_user_participates = false %} {% if rower.name == loggedin_user.name %}
{% for rower in planned_event.rower%} {% set_global cur_user_participates = true %}
{% if rower.name == loggedin_user.name %} {% endif %}
{% set_global cur_user_participates = true %} {% endfor %}
{% endif %} {% if cur_user_participates %}
{% endfor %} <a href="/remove/{{ planned_event.trip_details_id }}" class="btn btn-attention btn-fw">Abmelden</a>
{% if cur_user_participates %} {% endif %}
<a href="/remove/{{ planned_event.trip_details_id }}" class="btn btn-attention btn-fw">Abmelden</a> {% if planned_event.max_people > planned_event.rower | length %}
{% endif %} {% if cur_user_participates == false %}
{% if planned_event.max_people > planned_event.rower | length %} <a href="/join/{{ planned_event.trip_details_id }}" class="btn btn-primary btn-fw" {% if planned_event.trip_type %} onclick="return confirm('{{ planned_event.trip_type.question }}');" {% endif %}>Mitrudern</a>
{% if cur_user_participates == false %} {% endif %}
<a href="/join/{{ planned_event.trip_details_id }}" class="btn btn-primary btn-fw" {% if planned_event.trip_type %}onclick="return confirm('{{ planned_event.trip_type.question }}');"{% endif %}>Mitrudern</a> {% endif %}
{% endif %} {# --- END Row Buttons --- #}
{% endif %}
{# --- END Row Buttons --- #}
{# --- START Cox Buttons --- #} {# --- START Cox Buttons --- #}
{% if loggedin_user.is_cox %} {% if loggedin_user.is_cox %}
{% set_global cur_user_participates = false %} {% set_global cur_user_participates = false %}
{% for cox in planned_event.cox %} {% for cox in planned_event.cox %}
{% if cox.name == loggedin_user.name %} {% if cox.name == loggedin_user.name %}
{% set_global cur_user_participates = true %} {% set_global cur_user_participates = true %}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% if cur_user_participates %} {% if cur_user_participates %}
<a href="/cox/remove/{{ planned_event.id }}" class="block btn btn-attention btn-fw"> <a href="/cox/remove/{{ planned_event.id }}" class="block btn btn-attention btn-fw">
{% include "includes/cox-icon" %} {% include "includes/cox-icon" %}
Abmelden Abmelden
</a> </a>
{% else %} {% else %}
<a href="/cox/join/{{ planned_event.id }}" class="block btn {% if amount_cox_missing > 0 %} btn-dark {% else %} btn-gray {% endif %} btn-fw" {% if planned_event.trip_type %}onclick="return confirm('{{ planned_event.trip_type.question }}');"{% endif %}> <a href="/cox/join/{{ planned_event.id }}" class="block btn {% if amount_cox_missing > 0 %} btn-dark {% else %} btn-gray {% endif %} btn-fw" {% if planned_event.trip_type %} onclick="return confirm('{{ planned_event.trip_type.question }}');" {% endif %}>
{% include "includes/cox-icon" %} {% include "includes/cox-icon" %}
Steuern Steuern
</a> </a>
{% endif %} {% endif %}
{% endif %} {% endif %}
{# --- END Cox Buttons --- #} {# --- END Cox Buttons --- #}
</div> </div>
</div> </div>
{# --- START Sidebar Content --- #} {# --- START Sidebar Content --- #}
<div class="hidden"> <div class="hidden">
<div id="event{{ planned_event.trip_details_id }}"> <div
{# --- START List Coxes --- #} id="event{{ planned_event.trip_details_id }}">
{% if planned_event.planned_amount_cox > 0 %} {# --- START List Coxes --- #}
{% if amount_cox_missing > 0 %} {% if planned_event.planned_amount_cox > 0 %}
{{ macros::box(participants=planned_event.cox, empty_seats=planned_event.planned_amount_cox - amount_cur_cox, header='Noch benötigte Steuerleute:', text='Keine Steuerleute angemeldet') }} {% if amount_cox_missing > 0 %}
{% else %} {{ macros::box(participants=planned_event.cox, empty_seats=planned_event.planned_amount_cox - amount_cur_cox, header='Noch benötigte Steuerleute:', text='Keine Steuerleute angemeldet') }}
{{ macros::box(participants=planned_event.cox, empty_seats="", header='Genügend Steuerleute haben sich angemeldet :-)', text='Keine Steuerleute angemeldet') }} {% else %}
{% endif %} {{ macros::box(participants=planned_event.cox, empty_seats="", header='Genügend Steuerleute haben sich angemeldet :-)', text='Keine Steuerleute angemeldet') }}
{% endif %} {% endif %}
{# --- END List Coxes --- #} {% endif %}
{# --- END List Coxes --- #}
{# --- START List Rowers --- #} {# --- START List Rowers --- #}
{% if planned_event.max_people > 0 %} {% if planned_event.max_people > 0 %}
{% set amount_cur_rower = planned_event.rower | length %} {% set amount_cur_rower = planned_event.rower | length %}
{{ macros::box(participants=planned_event.rower, empty_seats=planned_event.max_people - amount_cur_rower, bg='primary-100', color='black') }} {{ macros::box(participants=planned_event.rower, empty_seats=planned_event.max_people - amount_cur_rower, bg='primary-100', color='black') }}
{% endif %} {% endif %}
{# --- END List Rowers --- #} {# --- END List Rowers --- #}
{% if planned_event.allow_guests %} {% if planned_event.allow_guests %}
<div class="text-primary-900 bg-primary-50 text-center p-1 mb-4">Gäste willkommen!</div> <div class="text-primary-900 bg-primary-50 text-center p-1 mb-4">Gäste willkommen!</div>
{% endif %} {% endif %}
{% if loggedin_user.is_admin %} {% if loggedin_user.is_admin %}
{# --- START Edit Form --- #} {# --- START Edit Form --- #}
<div class="bg-gray-100 p-3 mt-4 rounded-md"> <div class="bg-gray-100 p-3 mt-4 rounded-md">
<h3 class="text-primary-950 font-bold uppercase tracking-wide mb-2">Ausfahrt bearbeiten</h3> <h3 class="text-primary-950 font-bold uppercase tracking-wide mb-2">Ausfahrt bearbeiten</h3>
<form action="/admin/planned-event" method="post" class="grid gap-3"> <form action="/admin/planned-event" method="post" class="grid gap-3">
<input type="hidden" name="_method" value="put" /> <input type="hidden" name="_method" value="put"/>
<input type="hidden" name="id" value="{{ planned_event.id }}" /> <input type="hidden" name="id" value="{{ planned_event.id }}"/>
{{ macros::input(label='Anzahl Ruderer', name='max_people', type='number', required=true, value=planned_event.max_people, min='0') }} {{ macros::input(label='Anzahl Ruderer', name='max_people', type='number', required=true, value=planned_event.max_people, min='0') }}
{{ macros::input(label='Anzahl Steuerleute', name='planned_amount_cox', type='number', value=planned_event.planned_amount_cox, required=true, min='0') }} {{ macros::input(label='Anzahl Steuerleute', name='planned_amount_cox', type='number', value=planned_event.planned_amount_cox, required=true, min='0') }}
{{ macros::checkbox(label='Immer anzeigen', name='always_show', id=planned_event.id,checked=planned_event.always_show) }} {{ macros::checkbox(label='Immer anzeigen', name='always_show', id=planned_event.id,checked=planned_event.always_show) }}
{{ macros::input(label='Anmerkungen', name='notes', type='input', value=planned_event.notes) }} {{ macros::input(label='Anmerkungen', name='notes', type='input', value=planned_event.notes) }}
<input value="Speichern" class="btn btn-primary" type="submit" /> <input value="Speichern" class="btn btn-primary" type="submit"/>
</form> </form>
</div> </div>
{# --- END Edit Form --- #} {# --- END Edit Form --- #}
{# --- START Delete Btn --- #} {# --- START Delete Btn --- #}
<div class="text-right"> <div class="text-right">
<a href="/admin/planned-event/{{ planned_event.id }}/delete" class="inline-block btn btn-alert"> <a href="/admin/planned-event/{{ planned_event.id }}/delete" class="inline-block btn btn-alert">
{% include "includes/delete-icon" %} {% include "includes/delete-icon" %}
Termin löschen Termin löschen
</a> </a>
</div> </div>
{% endif %} {% endif %}
{# --- END Delete Btn --- #} {# --- END Delete Btn --- #}
</div> </div>
</div> </div>
{# --- END Sidebar Content --- #} {# --- END Sidebar Content --- #}
</div> </div>
{% endfor %} {% endfor %}
{% endif %} {% endif %}
{# --- END Events --- #} {# --- END Events --- #}
{# --- START Trips --- #} {# --- START Trips --- #}
{% if day.trips | length > 0 %} {% if day.trips | length > 0 %}
{% for trip in day.trips | sort(attribute="planned_starting_time") %} {% for trip in day.trips | sort(attribute="planned_starting_time") %}
<div class="pt-2 px-3 reset-js border-t" style="order: {{ trip.planned_starting_time | replace(from=":", to="") | trim_start_matches(pat="0") }}" data-coxneeded="false"> <div class="pt-2 px-3 reset-js border-t" style="order: {{ trip.planned_starting_time | replace(from=" :", to=" ") | trim_start_matches(pat=" 0") }}" data-coxneeded="false">
<div class="flex justify-between items-center"> <div class="flex justify-between items-center">
<div class="mr-1"> <div class="mr-1">
{% if trip.max_people == 0 %} {% if trip.max_people == 0 %}
<strong class="text-[#f43f5e]">&#9888; {{ trip.planned_starting_time }} Uhr</strong> <strong class="text-[#f43f5e]">&#9888;
<small class="text-[#f43f5e]">(Absage {{ trip.cox_name }}{% if trip.trip_type %} - {{ trip.trip_type.icon | safe }}{{ trip.trip_type.name }}{% endif %})</small> {{ trip.planned_starting_time }}
{% else %} Uhr</strong>
<strong class="text-primary-900">{{ trip.planned_starting_time }} Uhr</strong> <small class="text-[#f43f5e]">(Absage
<small class="text-gray-600">({{ trip.cox_name }}{% if trip.trip_type %} - {{ trip.trip_type.icon | safe }}{{ trip.trip_type.name }}{% endif %})</small> {{ trip.cox_name }}
{% endif %} {% if trip.trip_type %}
<br /> -
<a href="#" data-sidebar="true" data-trigger="sidebar" {{ trip.trip_type.icon | safe }}{{ trip.trip_type.name }}
data-header="<strong>{% if trip.max_people == 0 %}&#9888; {% endif %}{{ trip.planned_starting_time }} Uhr</strong> ({{ trip.cox_name }}){% if trip.trip_type %}<small class='block'>{{ trip.trip_type.desc }}</small>{% endif %}{% if trip.notes %}<small class='block'>{{ trip.notes }}</small>{% endif %}" {% endif %})</small>
data-body="#trip{{ trip.trip_details_id }}" {% else %}
class="inline-block link-primary mr-3"> <strong class="text-primary-900">{{ trip.planned_starting_time }}
Details Uhr</strong>
</a> <small class="text-gray-600">({{ trip.cox_name }}
</div> {% if trip.trip_type %}
-
{{ trip.trip_type.icon | safe }}{{ trip.trip_type.name }}
{% endif %})</small>
{% endif %}
<br/>
<a href="#" data-sidebar="true" data-trigger="sidebar" data-header="<strong>{% if trip.max_people == 0 %}&#9888; {% endif %}{{ trip.planned_starting_time }} Uhr</strong> ({{ trip.cox_name }}){% if trip.trip_type %}<small class='block'>{{ trip.trip_type.desc }}</small>{% endif %}{% if trip.notes %}<small class='block'>{{ trip.notes }}</small>{% endif %}" data-body="#trip{{ trip.trip_details_id }}" class="inline-block link-primary mr-3">
Details
</a>
</div>
<div> <div>
{% set_global cur_user_participates = false %} {% set_global cur_user_participates = false %}
{% for rower in trip.rower %} {% for rower in trip.rower %}
{% if rower.name == loggedin_user.name %} {% if rower.name == loggedin_user.name %}
{% set_global cur_user_participates = true %} {% set_global cur_user_participates = true %}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% if cur_user_participates %} {% if cur_user_participates %}
<a href="/remove/{{ trip.trip_details_id }}" <a href="/remove/{{ trip.trip_details_id }}" class="btn btn-attention btn-fw">Abmelden</a>
class="btn btn-attention btn-fw">Abmelden</a> {% endif %}
{% endif %} {% if trip.max_people > trip.rower | length and trip.cox_id != loggedin_user.id and cur_user_participates == false%}
{% if trip.max_people > trip.rower | length and trip.cox_id != loggedin_user.id and cur_user_participates == false%} <a href="/join/{{ trip.trip_details_id }}" class="btn btn-primary btn-fw" {% if trip.trip_type %} onclick="return confirm('{{ trip.trip_type.question }}');" {% endif %}>Mitrudern</a>
<a href="/join/{{ trip.trip_details_id }}" {% endif %}
class="btn btn-primary btn-fw" {% if trip.trip_type %}onclick="return confirm('{{ trip.trip_type.question }}');"{% endif %}>Mitrudern</a> </div>
{% endif %} </div>
</div> {# --- START Sidebar Content --- #}
</div> <div class="hidden">
{# --- START Sidebar Content --- #} <div id="trip{{ trip.trip_details_id }}">
<div class="hidden"> {% if trip.max_people == 0 %}
<div id="trip{{ trip.trip_details_id }}"> {# --- border-[#f43f5e] bg-[#f43f5e] --- #}
{% if trip.max_people == 0 %} {{ macros::box(participants=trip.rower,bg='[#f43f5e]',header='Absage') }}
{# --- border-[#f43f5e] bg-[#f43f5e] --- #} {% else %}
{{ macros::box(participants=trip.rower,bg='[#f43f5e]',header='Absage') }} {% set amount_cur_rower = trip.rower | length %}
{% else %} {{ macros::box(participants=trip.rower, empty_seats=trip.max_people - amount_cur_rower, bg='primary-100', color='black') }}
{% set amount_cur_rower = trip.rower | length %} {% endif %}
{{ macros::box(participants=trip.rower, empty_seats=trip.max_people - amount_cur_rower, bg='primary-100', color='black') }}
{% endif %}
{# --- START Edit Form --- #} {# --- START Edit Form --- #}
{% if trip.cox_id == loggedin_user.id %} {% if trip.cox_id == loggedin_user.id %}
<div class="bg-gray-100 p-3 mt-4 rounded-md"> <div class="bg-gray-100 p-3 mt-4 rounded-md">
<h3 class="text-primary-950 font-bold uppercase tracking-wide mb-2">Ausfahrt bearbeiten</h3> <h3 class="text-primary-950 font-bold uppercase tracking-wide mb-2">Ausfahrt bearbeiten</h3>
<form action="/cox/trip/{{ trip.id }}" method="post" class="grid gap-3"> <form action="/cox/trip/{{ trip.id }}" method="post" class="grid gap-3">
{{ macros::input(label='Anzahl Ruderer', name='max_people', type='number', required=true, value=trip.max_people, min='0') }} {{ macros::input(label='Anzahl Ruderer', name='max_people', type='number', required=true, value=trip.max_people, min='0') }}
{{ macros::input(label='Anmerkungen', name='notes', type='input', value=trip.notes) }} {{ macros::input(label='Anmerkungen', name='notes', type='input', value=trip.notes) }}
{{ macros::checkbox(label='Immer anzeigen', name='always_show', id=trip.id,checked=trip.always_show) }} {{ macros::checkbox(label='Immer anzeigen', name='always_show', id=trip.id,checked=trip.always_show) }}
{{ macros::select(select_name='trip_type', data=trip_types, default='Reguläre Ausfahrt', selected_id=trip.trip_type_id) }} {{ macros::select(select_name='trip_type', data=trip_types, default='Reguläre Ausfahrt', selected_id=trip.trip_type_id) }}
<input value="Speichern" class="btn btn-primary" type="submit" /> <input value="Speichern" class="btn btn-primary" type="submit"/>
</form> </form>
</div> </div>
{% if trip.rower | length == 0 %} {% if trip.rower | length == 0 %}
<div class="text-right mt-6"> <div class="text-right mt-6">
<a href="/cox/remove/trip/{{ trip.id }}" class="inline-block btn btn-alert"> <a href="/cox/remove/trip/{{ trip.id }}" class="inline-block btn btn-alert">
{% include "includes/delete-icon" %} {% include "includes/delete-icon" %}
Termin löschen Termin löschen
</a> </a>
</div> </div>
{% endif %} {% endif %}
{% endif %} {% endif %}
{# --- END Edit Form --- #} {# --- END Edit Form --- #}
</div> </div>
</div> </div>
{# --- END Sidebar Content --- #} {# --- END Sidebar Content --- #}
</div> </div>
{% endfor %} {% endfor %}
{% endif %} {% endif %}
{# --- END Trips --- #} {# --- END Trips --- #}
</div> </div>
{% endif %} {% endif %}
</div> </div>
{# --- START Add Buttons --- #} {# --- START Add Buttons --- #}
{% if loggedin_user.is_admin or loggedin_user.is_cox %} {% if loggedin_user.is_admin or loggedin_user.is_cox %}
<div class="grid {% if loggedin_user.is_admin %} grid-cols-2 {% endif %} text-center"> <div class="grid {% if loggedin_user.is_admin %} grid-cols-2 {% endif %} text-center">
{% if loggedin_user.is_admin %} {% if loggedin_user.is_admin %}
<a href="#" data-sidebar="true" data-trigger="sidebar" <a href="#" data-sidebar="true" data-trigger="sidebar" data-header="<strong>Event</strong> am {{ day.day| date(format='%d.%m.%Y') }} erstellen" data-day="{{ day.day }}" data-body="#addEventForm" class="relative inline-block w-full bg-primary-900 hover:bg-primary-950 focus:bg-primary-950 text-white py-2 rounded-bl-md text-sm font-semibold">
data-header="<strong>Event</strong> am {{ day.day| date(format='%d.%m.%Y') }} erstellen" <span class="absolute inset-y-0 left-0 flex items-center pl-3">
data-day="{{ day.day }}" {% include "includes/plus-icon" %}
data-body="#addEventForm" </span>
class="relative inline-block w-full bg-primary-900 hover:bg-primary-950 focus:bg-primary-950 text-white py-2 rounded-bl-md text-sm font-semibold"> Event
<span class="absolute inset-y-0 left-0 flex items-center pl-3"> </a>
{% include "includes/plus-icon" %} {% endif %}
</span>
Event
</a>
{% endif %}
{% if loggedin_user.is_cox%} {% if loggedin_user.is_cox%}
<a href="#" data-sidebar="true" data-trigger="sidebar" <a href="#" data-sidebar="true" data-trigger="sidebar" data-header="<strong>Ausfahrt</strong> am {{ day.day| date(format='%d.%m.%Y') }} erstellen" data-day="{{ day.day }}" data-body="#sidebarForm" class="relative inline-block w-full py-2 text-primary-900 hover:text-primary-950 focus:text-primary-950 text-sm font-semibold bg-gray-100 hover:bg-gray-200 focus:bg-gray-200 {% if loggedin_user.is_admin %} rounded-br-md {% else %} rounded-b-md {% endif %}">
data-header="<strong>Ausfahrt</strong> am {{ day.day| date(format='%d.%m.%Y') }} erstellen" <span class="absolute inset-y-0 left-0 flex items-center pl-3">
data-day="{{ day.day }}" {% include "includes/plus-icon" %}
data-body="#sidebarForm" </span>
class="relative inline-block w-full py-2 text-primary-900 hover:text-primary-950 focus:text-primary-950 text-sm font-semibold bg-gray-100 hover:bg-gray-200 focus:bg-gray-200 {% if loggedin_user.is_admin %} rounded-br-md {% else %} rounded-b-md {% endif %}"> Ausfahrt
<span class="absolute inset-y-0 left-0 flex items-center pl-3"> </a>
{% include "includes/plus-icon" %} {% endif %}
</span> </div>
Ausfahrt {% endif %}
</a> {# --- END Add Buttons --- #}
{% endif %} </div>
</div> {% endfor %}
{% endif %} </div>
{# --- END Add Buttons --- #}
</div>
{% endfor %}
</div>
</div> </div>
{% include "dynamics/sidebar" %} {% include "dynamics/sidebar" %}
{% if loggedin_user.is_cox %} {% if loggedin_user.is_cox %}
{% include "forms/trip" %} {% include "forms/trip" %}
{% endif %} {% endif %}
{% if loggedin_user.is_admin %} {% if loggedin_user.is_admin %}
{% include "forms/event" %} {% include "forms/event" %}
{% endif %} {% endif %}{% endblock content %}
{% endblock content %}

View File

@ -5,29 +5,29 @@
{% block content %} {% block content %}
<div class="w-full"> <div class="w-full">
<h1 class="h1">Logbuch</h1> <h1 class="h1">Logbuch</h1>
{% if flash %} {% if flash %}
{{ macros::alert(message=flash.1, type=flash.0, class="sm:col-span-2 lg:col-span-3") }} {{ macros::alert(message=flash.1, type=flash.0, class="sm:col-span-2 lg:col-span-3") }}
{% endif %} {% endif %}
<div class="w-full grid grid-cols-5 gap-3 mt-5"> <div class="w-full grid grid-cols-5 gap-3 mt-5">
<div class="bg-white p-3"> <div class="bg-white p-3">
{{ log::show_boats(only_ones=false) }} {{ log::show_boats(only_ones=false) }}
</div> </div>
<div class="col-span-3 bg-white p-3"> <div class="col-span-3 bg-white p-3">
<h2>Neue Ausfahrt starten</h2> <h2>Neue Ausfahrt starten</h2>
{{ log::new(only_ones=false, allow_any_shipmaster=true, shipmaster=-1) }} {{ log::new(only_ones=false, allow_any_shipmaster=true, shipmaster=-1) }}
</div> </div>
<div class="bg-white p-3"> <div class="bg-white p-3">
<h2 class="h2">Am Wasser</h2> <h2 class="h2">Am Wasser</h2>
{% for log in on_water %} {% for log in on_water %}
{{ log::show(log=log, state="on_water", allowed_to_close=true, only_ones=false) }} {{ log::show(log=log, state="on_water", allowed_to_close=true, only_ones=false) }}
<hr /> <hr/>
{% endfor %} {% endfor %}
</div> </div>
</div> </div>
</div> </div>
{% endblock content%} {% endblock content%}

View File

@ -5,12 +5,12 @@
{% block content %} {% block content %}
<div class="max-w-screen-lg w-full"> <div class="max-w-screen-lg w-full">
<h1 class="h1">Logbuch</h1> <h1 class="h1">Logbuch</h1>
{% for log in logs %} {% for log in logs %}
{{ log::show(log=log, state="completed", only_ones=false) }} {{ log::show(log=log, state="completed", only_ones=false) }}
<hr /> <hr/>
{% endfor %} {% endfor %}
</div> </div>
{% endblock content%} {% endblock content%}

View File

@ -4,24 +4,24 @@
{% extends "base" %} {% extends "base" %}
{% block content %} {% block content %}
{% if flash %} {% if flash %}
{{ macros::alert(message=flash.1, type=flash.0, class="sm:col-span-2 lg:col-span-3") }} {{ macros::alert(message=flash.1, type=flash.0, class="sm:col-span-2 lg:col-span-3") }}
{% endif %} {% endif %}
<div class="max-w-screen-lg w-full"> <div class="max-w-screen-lg w-full">
<h1 class="h1">Logbuch</h1> <h1 class="h1">Logbuch</h1>
<h2>Neue Ausfahrt starten</h2> <h2>Neue Ausfahrt starten</h2>
{{ log::new(only_ones=loggedin_user.is_cox==false, allow_any_shipmaster=loggedin_user.is_cox, shipmaster=loggedin_user.id) }} {{ log::new(only_ones=loggedin_user.is_cox==false, allow_any_shipmaster=loggedin_user.is_cox, shipmaster=loggedin_user.id) }}
<h2 style="font-size: 100px">Am Wasser</h2> <h2 style="font-size: 100px">Am Wasser</h2>
{% for log in on_water %} {% for log in on_water %}
{% if log.shipmaster == loggedin_user.id %} {% if log.shipmaster == loggedin_user.id %}
{{ log::show(log=log, state="on_water", allowed_to_close=true, only_ones=loggedin_user.is_cox==false) }} {{ log::show(log=log, state="on_water", allowed_to_close=true, only_ones=loggedin_user.is_cox==false) }}
{% else %} {% else %}
{{ log::show(log=log, state="on_water", only_ones=true) }} {{ log::show(log=log, state="on_water", only_ones=true) }}
{% endif %} {% endif %}
<hr /> <hr/>
{% endfor %} {% endfor %}
</div> </div>
{% endblock content%} {% endblock content%}

View File

@ -5,12 +5,13 @@
{% block content %} {% block content %}
<div class="max-w-screen-lg w-full"> <div class="max-w-screen-lg w-full">
<h1 class="h1">Statstik</h1> <h1 class="h1">Statstik</h1>
<ol> <ol>
{% for s in stat %} {% for s in stat %}
<li>{{s.name}}: {{s.rowed_km}}km</li> <li>{{s.name}}:
{% endfor %} {{s.rowed_km}}km</li>
</ol> {% endfor %}
</div> </ol>
</div>
{% endblock content%} {% endblock content%}