BrickTracker/templates/macro/form.html

14 lines
684 B
HTML
Raw Normal View History

2025-01-17 11:03:00 +01:00
{% macro checkbox(kind, id, text, url, checked, delete=false) %}
{% if g.login.is_readonly() %}
<input class="form-check-input text-reset" type="checkbox" {% if checked %}checked{% endif %} disabled>
{{ text }}
{% else %}
<input class="form-check-input" type="checkbox" id="{{ kind }}-{{ id }}" {% if checked %}checked{% endif %}
{% if not delete %}onchange="change_set_checkbox_status(this, '{{ kind }}', '{{ id }}', '{{ url }}')"{% else %}disabled{% endif %}
autocomplete="off">
<label class="form-check-label" for="{{ kind }}-{{ id }}">
{{ text }} <i id="status-{{ kind }}-{{ id }}" class="mb-1"></i>
</label>
{% endif %}
{% endmacro %}