forked from Ruderverein-Donau-Linz/rowt
[TASK] set boat status
This commit is contained in:
@ -91,22 +91,20 @@
|
||||
{% if only_ones %}
|
||||
{% set_global boats = boats | filter(attribute="amount_seats", value=1) %}
|
||||
{% endif %}
|
||||
{% for boat in boats %}
|
||||
{% set status = 'good' %}
|
||||
|
||||
{% if loop.index == 3 %}
|
||||
{% set status = 'locked' %}
|
||||
{% endif %}
|
||||
|
||||
{% if loop.index == 1 %}
|
||||
{% set status = 'alert' %}
|
||||
{% endif %}
|
||||
|
||||
<div id="boat-{{ boat.id }}" {% if status != 'locked' %} onclick="document.getElementById('boat_id').value='{{ boat.id }}';updateElementsBasedOnSelectedOption()"{% endif %}>
|
||||
<span class="status status-{{ status }}"></span>
|
||||
<span {% if status == 'locked' %} class="opacity-50" {% endif %}>{{ boat.name }}</span>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% for amount_seats, grouped_boats in boats | group_by(attribute="amount_seats") %}
|
||||
<div class="pb-2">
|
||||
<div class="bg-gray-100 text-primary-950 text-center text-sm mb-2">
|
||||
<strong>{{ amount_seats }}x</strong>
|
||||
</div>
|
||||
{% for boat in grouped_boats %}
|
||||
<div id="boat-{{ boat.id }}" {% if boat.damage != 'locked' %} onclick="document.getElementById('boat_id').value='{{ boat.id }}';updateElementsBasedOnSelectedOption()"{% endif %} class="px-3">
|
||||
<span class="status-damage status-damage-{{ boat.damage }}"></span>
|
||||
<span {% if boat.damage == 'locked' or boat.on_water %} class="opacity-50" {% endif %}>{{ boat.name }}</span>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
<script>
|
||||
function updateElementsBasedOnSelectedOption() {
|
||||
var selectElement = document.getElementById('boat_id');
|
||||
|
Reference in New Issue
Block a user