forked from Ruderverein-Donau-Linz/rowt
Allow to add real guests
This commit is contained in:
@ -103,7 +103,7 @@
|
||||
</div>
|
||||
{% 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', trip_details_id='', allow_removing=false) %}
|
||||
<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">
|
||||
@ -111,7 +111,13 @@
|
||||
{% for rower in participants %}
|
||||
{{ rower.name }}
|
||||
{% if rower.is_guest %}
|
||||
<small class="text-gray-600">(Scheckbuch)</small>
|
||||
{% endif %}
|
||||
{% if rower.is_real_guest %}
|
||||
<small class="text-gray-600">(Gast)</small>
|
||||
{% if allow_removing %}
|
||||
<a href="/remove/{{ trip_details_id }}/{{ rower.name }}" class="btn btn-attention btn-fw">Abmelden</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<span class="hidden">(angemeldet seit
|
||||
{{ rower.registered_at }})</span><br/>
|
||||
|
@ -115,10 +115,18 @@
|
||||
{# --- START List Rowers --- #}
|
||||
{% if planned_event.max_people > 0 %}
|
||||
{% 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', trip_details_id=planned_event.trip_details_id, allow_removing=loggedin_user.is_admin) }}
|
||||
{% endif %}
|
||||
{# --- END List Rowers --- #}
|
||||
|
||||
{% if loggedin_user.is_admin %}
|
||||
<form action="/join/{{ planned_event.trip_details_id }}" method="get" />
|
||||
{{ macros::input(label='Gast', name='user_note', type='text', required=true) }}
|
||||
<input value="Gast hinzufügen" class="btn btn-primary" type="submit"/>
|
||||
</form>
|
||||
{% endif %}
|
||||
|
||||
|
||||
{% if planned_event.allow_guests %}
|
||||
<div class="text-primary-900 bg-primary-50 text-center p-1 mb-4">Gäste willkommen!</div>
|
||||
{% endif %}
|
||||
@ -213,7 +221,13 @@
|
||||
{{ 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') }}
|
||||
{{ macros::box(participants=trip.rower, empty_seats=trip.max_people - amount_cur_rower, bg='primary-100', color='black', trip_details_id=trip.trip_details_id, allow_removing=loggedin_user.id == trip.cox_id) }}
|
||||
{% if trip.cox_id == loggedin_user.id %}
|
||||
<form action="/join/{{ trip.trip_details_id }}" method="get" />
|
||||
{{ macros::input(label='Gast', name='user_note', type='text', required=true) }}
|
||||
<input value="Gast hinzufügen" class="btn btn-primary" type="submit"/>
|
||||
</form>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{# --- START Edit Form --- #}
|
||||
|
Reference in New Issue
Block a user