work+htmx
This commit is contained in:
parent
34f3367a08
commit
d248c99242
11 changed files with 111 additions and 29 deletions
|
@ -1,43 +1,50 @@
|
|||
<html>
|
||||
<head>
|
||||
<title>Azube</title>
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
{% include 'head.html' %}
|
||||
</head>
|
||||
<body>
|
||||
{{ user.display_name }}
|
||||
|
||||
<div class="bg-gray-100">
|
||||
<div class="bg-gray-100 min-h-screen">
|
||||
<h1 class="text-2xl justify-center flex pt-5">Deine Berichtshefte</h1>
|
||||
|
||||
{% if late_reports > 1 %}
|
||||
<div class="bg-yellow-100 border-l-4 border-yellow-500 text-yellow-700 p-4 mr-10 ml-10 mt-6" role="alert">
|
||||
<p class="font-bold"> Du bist nicht aktuell! </p>
|
||||
<p> Du hast noch {{ late_reports }} Berichtshefte nachzuschreiben. </p>
|
||||
</div>
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% if reports|length == 0 %}
|
||||
|
||||
<h3>wau, such empty!</h3>
|
||||
<h3 class="text-xl justify-center flex m-10 p-5">wau, such empty!</h3>
|
||||
|
||||
<button onclick="location = '/write'" class="{{ style.red_btn }}">
|
||||
<button onclick="location = '/write'" class="{{ style.red_btn }} justify-center">
|
||||
Füge dein erstes Berichtsheft hinzu!
|
||||
</button>
|
||||
{% else %}
|
||||
|
||||
<div
|
||||
class="min-h-screen flex items-center justify-center grid grid-cols-5"
|
||||
class="mb-5 flex items-center justify-center grid lg:grid-cols-6 md:grid-cols-3"
|
||||
>
|
||||
{% for report in reports %}
|
||||
|
||||
<a href="/report/{{ report.id }}" class="{{ style.card }}">
|
||||
{% if approved %}
|
||||
<div
|
||||
class="absolute top-0 right-0 translate-y-3 -translate-x-3 bg-green-500 text-white rounded-full w-6 h-6 flex items-center justify-center scale-[1.5]"
|
||||
>
|
||||
✓
|
||||
</div>
|
||||
{% endif %} {{ report }}
|
||||
{% if forloop.first %} {% if report.week != week_now %}
|
||||
<a href="/write" class="{{ style.card }} flex items-center justify-center" title="Neues Berichtsheft">
|
||||
<span class="text-9xl font-bold"> + </span>
|
||||
</a>
|
||||
{% endif %} {% endif %}
|
||||
|
||||
{% include 'component/report.html' with report=report %}
|
||||
|
||||
{% endfor %}
|
||||
|
||||
<div hx-get="/reports?page=2"
|
||||
hx-trigger="revealed"
|
||||
hx-swap="outerHTML">
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% if forloop.last %} {% if report.week != week_now %}
|
||||
<button onclick="location = '/write'" class="{{ style.red_btn }}">
|
||||
Berichtsheft schreiben
|
||||
</button>
|
||||
{% endif %} {% endif %} {% endfor %} {% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue