misuzu/templates/manage/macros.twig

56 lines
2.4 KiB
Twig
Raw 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 %}
{% macro permissions_table(permissions, readonly) %}
{% from '_layout/input.twig' import input_checkbox %}
<div class="permissions">
{% for perms in permissions %}
<div class="permissions__line permissions__line--header">
<div class="permissions__title">
{{ perms.title }}
</div>
<div class="permissions__choice">
Yes
</div>
<div class="permissions__choice">
No
</div>
<div class="permissions__choice">
Never
</div>
</div>
{% for perm in perms.perms %}
<div class="permissions__line">
<div class="permissions__title">
{{ perm.title }}
</div>
<div class="permissions__choice__wrapper">
{{ input_checkbox('perms[' ~ perms.section ~ '][' ~ perm.section ~ '][value]', '', perm.value == 'yes', 'permissions__choice permissions__choice--radio permissions__choice--yes', 'yes', true, null, readonly) }}
</div>
<div class="permissions__choice__wrapper">
{{ input_checkbox('perms[' ~ perms.section ~ '][' ~ perm.section ~ '][value]', '', perm.value == 'no', 'permissions__choice permissions__choice--radio permissions__choice--no', 'no', true, null, readonly) }}
</div>
<div class="permissions__choice__wrapper">
{{ input_checkbox('perms[' ~ perms.section ~ '][' ~ perm.section ~ '][value]', '', perm.value == 'never', 'permissions__choice permissions__choice--radio permissions__choice--never', 'never', true, null, readonly) }}
</div>
</div>
{% endfor %}
{% endfor %}
</div>
{% endmacro %}