rowt/templates/index.html.tera

410 lines
26 KiB
Plaintext
Raw Normal View History

{% import "includes/macros" as macros %}
2024-05-16 22:35:26 +02:00
{% import "includes/forms/log" as log %}
2023-04-03 16:11:26 +02:00
{% extends "base" %}
{% block content %}
2024-03-04 13:28:42 +01:00
<div class="max-w-screen-lg w-full">
2024-05-16 22:35:26 +02:00
<h1 class="h1">Ruder&shy;assistent</h1>
<div class="grid gap-3 my-5">
2024-03-21 20:47:48 +01:00
<div class="m-auto">
2024-10-25 20:54:43 +02:00
<a href="/planned" style="display:inline-flex;"
class="btn btn-primary flex items-center justify-between w-80 max-w-full">
<span class="text-2xl">🚣‍♀️</span>
2024-03-21 20:47:48 +01:00
<span class="text-xl px-3">Geplante Ausfahrten</span>
2024-10-25 20:54:43 +02:00
<span class="text-2xl">🚣‍♂️</span>
2024-03-21 20:47:48 +01:00
</a>
</div>
2024-10-19 22:16:28 +02:00
{% if show_quick_ergo_button %}
<div class="m-auto">
2024-10-25 20:54:43 +02:00
<a href="/ergo" style="display:inline-flex;"
class="btn btn-primary flex items-center justify-between w-80 max-w-full">
<span class="text-2xl">💪</span>
<span class="text-xl px-3">Ergo Challenge</span>
2024-10-25 20:54:43 +02:00
<span class="text-2xl">💪🏿</span>
2024-10-19 22:16:28 +02:00
</a>
</div>
{% endif %}
2024-05-16 22:35:26 +02:00
{% if notifications %}
<div id="notification"
class="bg-white dark:bg-primary-900 text-black dark:text-white rounded-md block shadow mt-5"
role="alert">
<h2 class="h2">Nachrichten</h2>
{% if loggedin_user.amount_unread_notifications > 10 %}
<div class="text-primary-950 dark:text-white bg-gray-200 dark:bg-primary-950 bg-opacity-80 text-center pb-3 px-3">
Du hast viele ungelesene Benachrichtigungen. Um deine Oberfläche übersichtlich zu halten und wichtige Updates nicht zu verpassen, nimm dir bitte einen Moment Zeit sie zu überprüfen und als gelesen zu markieren (&#10003;).
</div>
{% endif %}
<div class="divide-y">
2024-03-21 20:47:48 +01:00
{% for notification in notifications %}
2024-05-16 22:35:26 +02:00
{% if not notification.read_at %}
<div class="relative flex justify-between items-center p-3">
<div class="grow me-4">
<small class="uppercase text-gray-600 dark:text-gray-100">
<strong>{{ notification.category }}</strong> &bullet; {{ notification.created_at | date(format="%d.%m.%Y %H:%M",) }}
</small>
<div class="mt-1">{{ notification.message | safe }}</div>
</div>
<div>
{% if notification.link %}
<a href="{{ notification.link }}" class="inline-block">
2024-08-19 11:57:51 +02:00
<button class="btn btn-primary" type="button">🔗</button>
</a>
{% endif %}
2024-05-16 22:35:26 +02:00
{% if not notification.read_at %}
<a href="/notification/{{ notification.id }}/read" class="inline-block">
<button class="btn btn-primary" type="button">
&#10003;
<span class="sr-only">Notification gelesen</span>
</button>
</a>
{% endif %}
</div>
2024-03-21 20:47:48 +01:00
</div>
{% endif %}
{% endfor %}
</div>
2024-05-16 22:35:26 +02:00
<details class="py-3 border-t rounded-b-md">
<summary class="px-3 cursor-pointer">Vergangene Nachrichten (14 Tage)</summary>
<div class="divide-y text-sm">
{% for notification in notifications %}
{% if notification.read_at %}
<div class="p-3 relative">
<small class="uppercase text-gray-600 dark:text-gray-100">
<strong>{{ notification.category }}</strong> &bullet; {{ notification.created_at | date(format="%d.%m.%Y %H:%M") }}
</small>
<div class="mt-1">{{ notification.message | safe }}</div>
{% if notification.link %}
<a href="{{ notification.link }}" class="inline-block">
2024-08-19 11:57:51 +02:00
<button class="btn btn-primary" type="button">🔗</button>
</a>
{% endif %}
2024-05-16 22:35:26 +02:00
</div>
{% endif %}
{% endfor %}
</div>
</details>
</div>
{% endif %}
2024-03-21 20:47:48 +01:00
{% if "Donau Linz" in loggedin_user.roles and "Unterstützend" not in loggedin_user.roles and "Förderndes Mitglied" not in loggedin_user.roles %}
2024-09-04 20:47:43 +02:00
<dialog id="call-for-action"
class="max-w-screen-sm dark:bg-primary-600 dark:text-white rounded-md"
onclick="document.getElementById('call-for-action').close()">
<div onclick="event.stopPropagation();" class="p-3">
<button type="button"
onclick="document.getElementById('call-for-action').close()"
title="Schließen"
class="sidebar-close border-0 bg-primary-100 focus:bg-primary-50 text-black flex items-center justify-center transform rotate-45 absolute right-0 mr-3">
<svg class="inline h-5 w-5"
width="16"
height="16"
fill="currentColor"
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>
</svg>
</button>
<div class="mt-8">
<p>
Du hast Ideen für sinnvolle neue Funktionen für diese Ruderapp? Melde dich bei Philipp, Marie oder <a href="mailto:it@rudernlinz.at" class="underline">it@rudernlinz.at</a>.
</p>
<p class="mt-3">
Wenn du darüber hinaus Lust hast, deine Skills in ein Projekt zu stecken, das Wellen schlagen wird (😀), dann komm an Bord! Wir sind offen für frische Ideen, haben jedoch auch selber noch genügend; langweilig wird uns bestimmt nicht.
</p>
</div>
</div>
2024-09-04 19:53:08 +02:00
</dialog>
2024-09-04 09:01:59 +02:00
<div class="bg-white dark:bg-primary-900 text-black dark:text-white rounded-md block shadow mt-5"
role="alert">
2024-09-04 19:53:08 +02:00
<h2 class="h2">
2024-09-11 19:10:02 +02:00
Deine Ruderkarriere
2024-09-04 19:53:08 +02:00
<span class="text-xl"
onclick="document.getElementById('call-for-action').showModal()">💡</span>
</h2>
2024-09-04 09:01:59 +02:00
<div class="mx-2 divide-y divide-gray-200 dark:divide-primary-600">
<div class="py-3">
<details>
<summary>
<h3 class="inline">
<span class="text-xl">
{% if achievements.rowingbadge and achievements.rowingbadge.achieved %}
&#127881;
{% else %}
📋
{% endif %}
</span>
Fahrtenabzeichen
{% if achievements.rowingbadge %}{{ achievements.rowingbadge.year }}{% endif %}
<span><a href="http://www.rudern.at/OFFICE/Downloads/Ausschreibungen/2022/Wanderfahrten//Fahrtenabzeichen%20%C3%84quatorpreis%20und%20Danubius%202022.pdf"
2024-09-04 14:10:58 +02:00
target="_blank"
2024-09-04 19:53:08 +02:00
class="w-6 h-6 inline-flex align-center justify-center rounded-full bg-primary-500 ml-2 text-white">?</a></span>
</h3>
</summary>
{% if achievements.rowingbadge %}
{% set badge = achievements.rowingbadge %}
<div class="mb-3">{{ badge.category }}</div>
<label for="rowingbadge" class="label">Kilometer ({{ badge.rowed_km }} / {{ badge.required_km }} km)</label>
<progress id="rowingbadge"
class="w-full block my-3"
value="{{ badge.rowed_km }}"
max="{{ badge.required_km }}"></progress>
<h4 class="font-bold mt-4">Wanderfahrten</h4>
2024-09-04 19:00:25 +02:00
<div>Nur eine der folgenden Optionen muss erreicht werden:</div>
<ol class="list-decimal ml-4 my-3">
<li>
{% if badge.multi_day_trips_over_required_distance | length >= 1 %}
&#9989;
{% else %}
&#10060;
{% endif %}
1 mehrtägige Wanderfahrt > {{ badge.multi_day_trips_required_distance }} km
</li>
<li>
{% if badge.single_day_trips_over_required_distance | length >= 2 %}
&#9989;
{% else %}
&#10060;
{% endif %}
2 eintägige Wanderfahrten > {{ badge.single_day_trips_required_distance }} km
</li>
</ol>
<details>
<summary>Details zu den Wanderfahrten</summary>
<div class="mt-3">
{% for log in badge.single_day_trips_over_required_distance %}
{{ log::show_old(log=log, state="completed", only_ones=false, index=loop.index) }}
{% endfor %}
{% for log in badge.multi_day_trips_over_required_distance %}
{{ log::show_old(log=log, state="completed", only_ones=false, index=loop.index) }}
{% endfor %}
</div>
</details>
{% else %}
2024-09-04 14:10:58 +02:00
<div class="mt-3">
Wir haben leider kein Geburtsdatum von dir und können dir leider deinen heurigen Status für das Fahrtenabzeichen nicht anzeigen. Wenn du dein Geburtsdatum an <a href="mailto:it@rudernlinz.at" class="underline">it@rudernlinz.at</a> schreibst, lässt sich das ändern :-)
2024-09-04 14:10:58 +02:00
</div>
{% endif %}
</details>
2024-09-04 14:10:58 +02:00
</div>
<div class="py-3">
<details>
<summary>
<h3 class="mb-3 inline">
{% set price = achievements.equatorprice %}
<span class="text-xl">
{% if achievements.curr_equatorprice_name == "-" %}
📋
{% elif achievements.curr_equatorprice_name == "Bronze" %}
🥉
{% elif achievements.curr_equatorprice_name == "Silber" %}
🥈
{% elif achievements.curr_equatorprice_name == "Gold" %}
🥇
{% elif achievements.curr_equatorprice_name == "Diamant" %}
💍
{% endif %}
</span>
Äquatorpreis
<span><a href="http://www.rudern.at/OFFICE/Downloads/Ausschreibungen/2022/Wanderfahrten//Fahrtenabzeichen%20%C3%84quatorpreis%20und%20Danubius%202022.pdf"
2024-09-04 14:10:58 +02:00
target="_blank"
2024-09-04 19:53:08 +02:00
class="w-6 h-6 inline-flex align-center justify-center rounded-full bg-primary-500 ml-2 text-white">?</a></span>
</h3>
</summary>
<div class="mt-3">
{% if price.level == "DONE" %}
Gratuliere, du hast alles in deinem Rudererleben erreicht, was es (beim Äquatorpreis) zu erreichen gibt.
{% else %}
<label for="equatorprice" class="label">{{ price.desc }} ({{ price.rowed_km }} / {{ price.required_km }} km)</label>
<progress id="equatorprice"
class="w-full block my-3"
value="{{ price.rowed_km }}"
max="{{ price.required_km }}"></progress>
<details>
<summary>Details</summary>
Du bist insgesamt {{ price.rowed_km }} km gerudert. Um den Äquatorpreis in {{ price.desc }} zu erhalten, benötigst du noch {{ price.missing_km }} km um die notwendigen {{ price.required_km }} km zu erreichen.
</details>
{% endif %}
</div>
</details>
2024-09-04 09:01:59 +02:00
</div>
2024-09-09 20:51:01 +02:00
<div class="py-3">
<p>
<details>
2024-09-10 23:46:59 +02:00
<summary>
<span class="text-xl">&nbsp;&#128197;&nbsp;</span>&nbsp;Kalender
</summary>
<p class="mt-3">
Du möchtest immer up-to-date mit den Events und Ausfahrten bleiben? Wir bieten 3 verschiedene Arten von Kalender an:
</p>
<ol class="list-decimal ml-5 my-3">
<li>
<strong>Alle Events und Ausfahrten</strong>, zu denen du dich angemeldet hast: <a class="underline break-all"
2024-09-10 23:46:59 +02:00
href="https://app.rudernlinz.at/cal/personal/{{ loggedin_user.id }}/{{ loggedin_user.user_token }}">https://app.rudernlinz.at/cal/personal/{{ loggedin_user.id }}/{{ loggedin_user.user_token }}</a>
<br />
<small>Dieser Link enthält einen zufällig generierten Teil, damit nur du (und jene, denen du diesen Link weitergibst) Zugang zu diesen Daten hast.</small>
</li>
<li>
<strong>Allgemeiner Kalender</strong>, zB save-the-dates (Wanderfahrten, ...): <a href="https://rudernlinz.at/cal" class="break-all underline">https://rudernlinz.at/cal</a>
2024-09-10 23:46:59 +02:00
</li>
<li>
<strong>Alle Events</strong>: <a class="break-all underline" href="https://app.rudernlinz.at/cal">https://app.rudernlinz.at/cal</a>
2024-09-10 23:46:59 +02:00
<br />
<small>Beachte, dass dieser Kalender keine Ausfahrten enthält, die von einzelnen Steuerpersonen augeschrieben werden. Dieser Kalender wird zB auf <a href="https://rudernlinz.at/termine" class="underline">https://rudernlinz.at/termine</a> verwendet und wir möchten keine persönlichen Daten (Namen etc.) leaken.</small>
</li>
</ol>
Du kannst die Kalender einfach in deinen Kalender als "externen Kalender" synchronisieren. Die genauen Schritte hängen von deiner verwendeten Software ab.
2024-09-09 20:51:01 +02:00
</details>
</p>
</div>
2024-09-04 09:01:59 +02:00
</div>
</div>
2024-03-04 13:28:42 +01:00
<div class="bg-white dark:bg-primary-900 text-black dark:text-white rounded-md block shadow mt-5"
role="alert">
<h2 class="h2">Aktives Vereinsmitglied</h2>
<ul class="list-none ms-2 divide-y divide-gray-200 dark:divide-primary-600">
<li class="py-1">
<a href="/planned" class="block w-100 py-2 hover:text-primary-600">Geplante Ausfahrten</a>
</li>
<li class="py-1">
<a href="/log" class="block w-100 py-2 hover:text-primary-600">Ausfahrt eintragen</a>
</li>
<li class="py-1">
<a href="/log/show" class="block w-100 py-2 hover:text-primary-600">Logbuch</a>
</li>
<li class="py-1">
<a href="/stat" class="block w-100 py-2 hover:text-primary-600">Statistik</a>
</li>
<li class="py-1">
<a href="/stat/boats" class="block w-100 py-2 hover:text-primary-600">Bootsauswertung</a>
</li>
<li class="py-1">
<a href="/boatdamage" class="block w-100 py-2 hover:text-primary-600">Bootsschaden</a>
</li>
2024-03-30 01:36:37 +01:00
<li class="py-1">
<a href="/boatreservation"
class="block w-100 py-2 hover:text-primary-600">Bootsreservierung</a>
</li>
<li class="py-1">
<a href="/trailerreservation"
class="block w-100 py-2 hover:text-primary-600">Hängerreservierung</a>
</li>
2024-04-06 18:27:20 +02:00
<li class="py-1">
<a href="/steering" class="block w-100 py-2 hover:text-primary-600">Steuerleute & Co</a>
</li>
</ul>
2024-03-04 13:28:42 +01:00
</div>
2024-03-21 20:47:48 +01:00
{% endif %}
{% if "scheckbuch" in loggedin_user.roles %}
2024-05-16 22:35:26 +02:00
<div class="grid gap-3 mb-4">
<div class="bg-white dark:bg-primary-900 text-black dark:text-white rounded-md block shadow mt-5"
role="alert">
<h2 class="h2">Scheckbuch</h2>
{% if "paid" not in loggedin_user.roles %}
<div class="p-3 dark:text-white bg-white dark:bg-primary-900">
Bitte nimm zur nächsten Ausfahrt die {{ costs_scheckbuch / 100 }}&nbsp;€ für das Scheckbuch mit. Falls du das bereits gemacht hast, gibt uns bitte kurz Bescheid, dass dies noch nicht eingetragen wurde.
</div>
{% endif %}
<div class="text-sm p-3 bg-gray-200 bg-opacity-80 dark:bg-primary-950 dark:text-white text-primary-950">
<h3>Du hast bisher an {{ last_trips | length }} deiner 5 Scheckbuch-Ausfahrten teilgenommen.</h3>
{% if last_trips %}
<ol class="mt-3">
{% for last_trip in last_trips %}
<li>{{ log::show_old(log=last_trip, state="completed", only_ones=false, index=loop.index) }}</li>
{% endfor %}
</ol>
{% endif %}
</div>
</div>
2024-03-04 13:28:42 +01:00
</div>
2024-03-21 20:47:48 +01:00
{% endif %}
<div class="bg-white dark:bg-primary-900 text-black dark:text-white rounded-md block shadow mt-5"
role="alert">
<h2 class="h2">Ergo</h2>
<div class="p-3">
<ul class="list-none ms-2">
<li class="py-1">
<a href="/ergo" class="block w-100 py-2 hover:text-primary-600">Ergo</a>
</li>
</ul>
</div>
</div>
2024-03-21 20:47:48 +01:00
{% if "schnupper-betreuer" in loggedin_user.roles %}
2024-03-06 15:55:13 +01:00
<div class="bg-white dark:bg-primary-900 text-black dark:text-white rounded-md block shadow mt-5"
role="alert">
<h2 class="h2">Schnupper-Betreuer</h2>
2024-03-21 20:47:48 +01:00
<ul class="list-none ms-2 divide-y divide-gray-200 dark:divide-primary-600">
<li class="py-1">
2024-03-21 20:47:48 +01:00
<a href="/admin/schnupper"
class="block w-100 py-2 hover:text-primary-600">Schnuppern</a>
</li>
</ul>
2024-03-06 15:55:13 +01:00
</div>
2024-03-21 20:47:48 +01:00
{% endif %}
{% if "Vorstand" in loggedin_user.roles %}
2024-03-04 13:28:42 +01:00
<div class="bg-white dark:bg-primary-900 text-black dark:text-white rounded-md block shadow mt-5"
role="alert">
<h2 class="h2">Vorstand</h2>
<ul class="list-none ms-2 divide-y divide-gray-200 dark:divide-primary-600">
<li class="py-1">
2024-03-21 20:47:48 +01:00
<a href="/admin/user/fees"
class="block w-100 py-2 hover:text-primary-600">Übersicht User Gebühren</a>
</li>
<li class="py-1">
2024-03-21 20:47:48 +01:00
<a href="/admin/user/scheckbuch"
class="block w-100 py-2 hover:text-primary-600">Scheckbuch</a>
</li>
<li class="py-1">
<a href="/admin/user" class="block w-100 py-2 hover:text-primary-600">User</a>
</li>
<li class="py-1">
2024-03-21 20:47:48 +01:00
<a href="/board/boathouse"
class="block w-100 py-2 hover:text-primary-600">Bootshaus</a>
</li>
<li class="py-1">
<a href="/admin/mail" class="block w-100 py-2 hover:text-primary-600">Mail ausschicken</a>
</li>
<li class="py-1">
<a href="/admin/notification"
class="block w-100 py-2 hover:text-primary-600">Nachricht ausschreiben</a>
</li>
2024-09-04 14:10:58 +02:00
<li class="py-1">
<a href="/board/achievement"
class="block w-100 py-2 hover:text-primary-600">Abzeichen</a>
</li>
</ul>
2024-03-04 13:28:42 +01:00
</div>
2024-03-21 20:47:48 +01:00
{% endif %}
{% if "admin" in loggedin_user.roles %}
2024-03-04 13:28:42 +01:00
<div class="bg-white dark:bg-primary-900 text-black dark:text-white rounded-md block shadow mt-5"
role="alert">
<h2 class="h2">Admin</h2>
<ul class="list-none ms-2 divide-y divide-gray-200 dark:divide-primary-600">
<li class="py-1">
<a href="/admin/boat" class="block w-100 py-2 hover:text-primary-600">Boote</a>
</li>
<li class="py-1">
<a href="/admin/user" class="block w-100 py-2 hover:text-primary-600">User</a>
</li>
<li class="py-1">
<a href="/admin/rss" class="block w-100 py-2 hover:text-primary-600">Logs</a>
</li>
<li class="py-1">
<a href="/admin/list" class="block w-100 py-2 hover:text-primary-600">Fingerabdruck-Liste überprüfen</a>
</li>
</ul>
2024-03-04 13:28:42 +01:00
</div>
2024-03-21 20:47:48 +01:00
{% endif %}
<div class="bg-white dark:bg-primary-900 text-black dark:text-white rounded-md block shadow mt-5"
role="alert">
<h2 class="h2">Allgemein</h2>
<div class="p-3">
<ul class="list-none ms-2">
<li class="py-1">
<a href="https://wiki.rudernlinz.at/ruderassistent#faq"
target="_blank"
class="block w-100 py-2 hover:text-primary-600">FAQ (extern)</a>
</li>
</ul>
</div>
2024-03-21 20:47:48 +01:00
</div>
</div>
2024-03-21 21:58:27 +01:00
</div>
{% endblock content %}