misuzu/templates/manage/macros.twig

56 lines
2.3 KiB
Twig
Raw Permalink Normal View History

2022-09-13 13:14:49 +00:00
{% macro manage_navigation(nav) %}
{% from 'macros.twig' import container_title %}
{% for name, value in nav %}
<div class="container manage__navigation">
{{ container_title(name) }}
<div class="manage__navigation__links">
{% for title, link in value %}
<a href="{{ link }}" class="manage__navigation__link">{{ title }}</a>
{% endfor %}
</div>
</div>
{% endfor %}
{% endmacro %}
2023-08-30 22:37:21 +00:00
{% macro permissions_table(lists, infos, readonly) %}
2022-09-13 13:14:49 +00:00
{% from '_layout/input.twig' import input_checkbox %}
<div class="permissions">
2023-08-30 22:37:21 +00:00
{% for list in lists %}
2022-09-13 13:14:49 +00:00
<div class="permissions__line permissions__line--header">
<div class="permissions__title">
2023-08-30 22:37:21 +00:00
{{ list.title }}
2022-09-13 13:14:49 +00:00
</div>
<div class="permissions__choice">
Yes
</div>
<div class="permissions__choice">
No
</div>
<div class="permissions__choice">
Never
</div>
</div>
2023-08-30 22:37:21 +00:00
{% for perm in list.perms %}
2022-09-13 13:14:49 +00:00
<div class="permissions__line">
<div class="permissions__title">
{{ perm.title }}
</div>
<div class="permissions__choice__wrapper">
2023-08-30 22:37:21 +00:00
{{ input_checkbox(perm.name, '', infos[perm.category].checkAllow(perm.value) ?? false, 'permissions__choice permissions__choice--radio permissions__choice--yes', 'yes', true, null, readonly) }}
2022-09-13 13:14:49 +00:00
</div>
<div class="permissions__choice__wrapper">
2023-08-30 22:37:21 +00:00
{{ input_checkbox(perm.name, '', infos[perm.category].checkNeutral(perm.value) ?? true, 'permissions__choice permissions__choice--radio permissions__choice--no', 'no', true, null, readonly) }}
2022-09-13 13:14:49 +00:00
</div>
<div class="permissions__choice__wrapper">
2023-08-30 22:37:21 +00:00
{{ input_checkbox(perm.name, '', infos[perm.category].checkDeny(perm.value) ?? false, 'permissions__choice permissions__choice--radio permissions__choice--never', 'never', true, null, readonly) }}
2022-09-13 13:14:49 +00:00
</div>
</div>
{% endfor %}
{% endfor %}
</div>
{% endmacro %}