nicer sort @ boat reservation
This commit is contained in:
@@ -73,8 +73,18 @@
|
||||
class="btn btn-primary w-full col-span-4 m-auto" />
|
||||
</form>
|
||||
{% endmacro new %}
|
||||
{% macro boat_select(id="boat_id") %}
|
||||
{{ macros::select(label="Boot", data=boats, name="boat_id", required=true, id=id, display=["name", " (","cat",")"], extras=["default_shipmaster_only_steering", "amount_seats", "on_water", "default_destination"], wrapper_class="col-span-4", show_seats=true, nonSelectableDefault=" -- Wähle ein Boot aus ---") }}
|
||||
{% macro boat_select(id="boat_id", allow_on_water=false, grouped_by_boattype=false) %}
|
||||
{% if grouped_by_boattype %}
|
||||
<div class="col-span-4">
|
||||
<label class="text-sm text-gray-600 dark:text-gray-100">Boot</label>
|
||||
<select name="boat_id" id="{{ id }}" class="input rounded-md" required>
|
||||
<option disabled selected value> -- Wähle ein Boot aus ---</option>
|
||||
{% for cat, g in boats | group_by(attribute="cat") %}<optgroup label="{{ cat }}">{% for b in g %}<option value="{{ b.id }}">{{ b.name }}{% if b.on_water %} (am Wasser){% endif %}</option>{% endfor %}</optgroup>{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
{% else %}
|
||||
{{ macros::select(label="Boot", data=boats, name="boat_id", required=true, id=id, display=["name", " (","cat",")"], extras=["default_shipmaster_only_steering", "amount_seats", "on_water", "default_destination"], wrapper_class="col-span-4", show_seats=true, nonSelectableDefault=" -- Wähle ein Boot aus ---", allow_on_water=allow_on_water) }}
|
||||
{% endif %}
|
||||
{% endmacro boat_select %}
|
||||
{% macro rower_select(id, selected, amount_seats='', class='', init='false', cox_on_boat='', steering_person_id='') %}
|
||||
{#{% if not amount_seats or amount_seats > 1 %}#}
|
||||
|
||||
Reference in New Issue
Block a user