Doing a relayout of permissions to make it a bit easier to navigate

This commit is contained in:
Ian Roddis committed 2026-06-25 16:06:36 -03:00
1 parent 1549971a13
commit eba7896893
5 files changed
+138 -24

No files matched your search

+26 -3
View File
@@ -12,11 +12,34 @@
<label>Description <input type="text" name="description"></label>
<fieldset class="roles-field">
<legend>Permissions</legend>
{% for perm in permissions %}
<label class="check"><input type="checkbox" name="permission_ids" value="{{ perm.id }}"> {{ perm.name }}</label>
{% if scopes %}
<table class="perm-matrix">
<thead>
<tr>
<th></th>
{% for action in actions %}<th>{{ action }}</th>{% endfor %}
</tr>
</thead>
<tbody>
{% for scope in scopes %}
<tr>
<td class="perm-scope">{{ scope }}</td>
{% for action in actions %}
{% set key = scope ~ ':' ~ action %}
{% if key in perm_map %}
{% set p = perm_map[key] %}
<td class="perm-cell"><input type="checkbox" name="permission_ids" value="{{ p.id }}"></td>
{% else %}
<td class="perm-cell perm-na">—</td>
{% endif %}
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<span class="muted">No permissions defined. Run the seed script.</span>
{% endfor %}
{% endif %}
</fieldset>
<button type="submit" class="btn btn-primary">Add role</button>
</form>