{% comment %} Grouped permission checkbox widget for TenantRoleForm. Renders permissions grouped by app_label > model, with each verb as a checkbox. System permissions (from AppConfig) are shown as disabled checked boxes. Live-filter input at the top: case-insensitive substring match against ``" "`` per checkbox, powered by Alpine. Hidden individual checkboxes still submit their value (system perms via ````) — filtering is purely visual, no data loss. Empty model / app groups hide themselves via CSS :has(), so the layout stays clean while typing. Context: widget.grouped_choices — list of (app_label, [(model_verbose, [perm_dict, ...])]) widget.name — HTML input name {% endcomment %} {% load i18n %}
{% for app_label, models in widget.grouped_choices %}

{{ app_label }}

{% for model_verbose, perms in models %}
{{ model_verbose }}
{% for perm in perms %} {% with search=app_label|add:" "|add:model_verbose|add:" "|add:perm.verb %} {% endwith %} {% endfor %}
{% endfor %}
{% empty %}

{% trans "No permissions available." %}

{% endfor %}