2025-01-24 10:36:24 +01:00
|
|
|
{% macro checkbox(prefix, id, text, url, checked, delete=false) %}
|
2025-01-17 14:36:48 +01:00
|
|
|
{% if g.login.is_authenticated() %}
|
2025-01-24 10:36:24 +01:00
|
|
|
<input class="form-check-input" type="checkbox" id="{{ prefix }}-{{ id }}" {% if checked %}checked{% endif %}
|
|
|
|
{% if not delete %}
|
|
|
|
data-changer-id="{{ id }}" data-changer-prefix="{{ prefix }}" data-changer-url="{{ url }}" data-changer-parent="set"
|
|
|
|
{% else %}
|
|
|
|
disabled
|
|
|
|
{% endif %}
|
2025-01-17 11:03:00 +01:00
|
|
|
autocomplete="off">
|
2025-01-24 10:36:24 +01:00
|
|
|
<label class="form-check-label" for="{{ prefix }}-{{ id }}">
|
|
|
|
{{ text }} <i id="status-{{ prefix }}-{{ id }}" class="mb-1"></i>
|
2025-01-17 11:03:00 +01:00
|
|
|
</label>
|
2025-01-17 14:36:48 +01:00
|
|
|
{% else %}
|
|
|
|
<input class="form-check-input text-reset" type="checkbox" {% if checked %}checked{% endif %} disabled>
|
|
|
|
{{ text }}
|
2025-01-17 11:03:00 +01:00
|
|
|
{% endif %}
|
|
|
|
{% endmacro %}
|