Merge branch 'feature/cancelation' into 'main'

Feature/cancelation

See merge request PhilippHofer/rot!6
This commit is contained in:
PhilippHofer 2023-04-28 19:50:48 +00:00
commit 5421a3658d
3 changed files with 18 additions and 8 deletions

View File

@ -7,7 +7,6 @@
- Wanderfahrt: ⛱ - Wanderfahrt: ⛱
# Notes / Bugfixes # Notes / Bugfixes
- [] max_people = 0 -> Rot hervorheben, dass Ausfahrt abgesagt wurde?
- [] my trips for cox - [] my trips for cox
- [] add `trip_type` (id, name, desc, question, icon) with a FK to `trip_details` - [] add `trip_type` (id, name, desc, question, icon) with a FK to `trip_details`
- [] add `always_show` to `planned_trips` (e.g. for wanderfahrten) - [] add `always_show` to `planned_trips` (e.g. for wanderfahrten)

View File

@ -43,7 +43,7 @@
</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 }} {{ empty_seats }}</div>
<div class="p-2 border border-t-0 border-{{ bg }} mb-4 rounded-b-md"> <div class="p-2 border border-t-0 border-{{ bg }} mb-4 rounded-b-md">
{% if participants | length > 0 %} {% if participants | length > 0 %}

View File

@ -139,10 +139,15 @@
<div class="pt-2 reset-js" data-coxneeded="false"> <div class="pt-2 reset-js" data-coxneeded="false">
<div class="flex justify-between items-center"> <div class="flex justify-between items-center">
<div> <div>
<strong class="text-primary-900">{{ trip.planned_starting_time }} Uhr</strong> <small <strong class="text-primary-900">{% if trip.max_people == 0 %}<span class="text-[#f43f5e]">&#9888; </span>{% endif %}{{ trip.planned_starting_time }} Uhr</strong>
class="text-gray-600">({{ trip.cox_name }})</small><br /> {% if trip.max_people == 0 %}
<small class="text-[#f43f5e]">(Absage {{ trip.cox_name }})</small>
{% else %}
<small class="text-gray-600">({{ trip.cox_name }})</small>
{% endif %}
<br />
<a href="#" data-sidebar="true" data-trigger="sidebar" <a href="#" data-sidebar="true" data-trigger="sidebar"
data-header="<strong>{{ trip.planned_starting_time }} Uhr</strong> ({{ trip.cox_name }}){% if trip.notes %}<small class='block'>{{ trip.notes }}</small>{% endif %}" data-header="<strong>{% if trip.max_people == 0 %}&#9888; {% endif %}{{ trip.planned_starting_time }} Uhr</strong> ({{ trip.cox_name }}){% if trip.notes and trip.max_people > 0 %}<small class='block'>{{ trip.notes }}</small>{% endif %}{% if trip.max_people == 0 %}<small class='block'>Ausfahrt abgesagt!</small>{% endif %}"
data-body="#trip{{ trip.trip_details_id }}" data-body="#trip{{ trip.trip_details_id }}"
class="inline-block link-primary mr-3"> class="inline-block link-primary mr-3">
Details Details
@ -171,9 +176,15 @@
{# --- START Sidebar Content --- #} {# --- START Sidebar Content --- #}
<div class="hidden"> <div class="hidden">
<div id="trip{{ trip.trip_details_id }}"> <div id="trip{{ trip.trip_details_id }}">
{% set amount_cur_rower = trip.rower | length %} {% if trip.max_people == 0 %}
{{ macros::box(participants=trip.rower, empty_seats=trip.max_people - amount_cur_rower, bg='primary-100', color='black') }} {# --- border-[#f43f5e] bg-[#f43f5e] --- #}
{# --- START Edit Form --- #} {{ macros::box(participants=trip.rower,bg='[#f43f5e]',header='Absage') }}
{% else %}
{% set amount_cur_rower = trip.rower | length %}
{{ macros::box(participants=trip.rower, empty_seats=trip.max_people - amount_cur_rower, bg='primary-100', color='black') }}
{% endif %}
{# --- 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>