{#
SPDX-FileCopyrightText: 2026 Martin Kirchgessner

SPDX-License-Identifier: AGPL-3.0-or-later
#}

{% macro role_input(user, name, tooltip) %}
<div class="field is-horizontal">
    <div class="field-label">
        <label for="{{ name }}" class="label">
            {{ name[4:] }}
        </label>
    </div>
    <div class="field-body">
        <div class="field">
            <div class="control">
                <input name="{{ name }}"
                    id="{{ name }}"
                    type="checkbox"
                    value="true"
                    {% if user and user.roles[name[4:]] %}
                        checked="checked"
                    {% endif %}
                    >
            </div>
            <p class="help">{{ tooltip }}</p>
        </div>
    </div>
</div>
{% endmacro %}
