{# options: propagate: include the "apply to subpages" checkbox noWorkflow: don't present the "can publish" option even if workflow is on for the project as a whole which: if present, an array which may contain "view" and "edit". If not present, both types of permissions are presented #} {% include "formMacros.html" %} {% macro permissionsEditor(options) %} {% set selectiveOptions = { propagate: options.propagate } %} {% if workflow and not options.noWorkflow %} {% set selectiveOptions = { propagate: options.propagate, extras: [ { name: 'publish', type: 'boolean', label: 'Can publish' } ] } %} {% endif %} {% if (not options.which) or aposContains(options.which, 'view') %} {# Toggles open apos-view-permissions #}
{# I'm commenting this out for now, as it's a decent design pattern #} {#
{{ __('Who can see this?') }}
#}
{# js shows this class when "Certain People" is chosen #}
{{ formSelective('viewGroupIds', 'Groups', selectiveOptions, { placeholder: "Type a group's name" }) }} {{ formSelective('viewPersonIds', 'Individuals', selectiveOptions, { placeholder: "Type a person's name" }) }}

{{ __('Admins can always see everything.') }}

{% endif %} {% if (not options.which) or aposContains(options.which, 'edit') %} {# This outer div is for hiding the entirety of edit permissions via JS. -Tom #}
{# Toggles open data-edit-permissions #}
{#
{{ __('Who can edit this?') }}
#}
{{ formSelective('editGroupIds', 'Groups', selectiveOptions, { placeholder: "Type a group's name" }) }} {{ formSelective('editPersonIds', 'Individuals', selectiveOptions, { placeholder: "Type a person's name" }) }} {# This won't be true for some site somewhere, give it a class #}

{{ __('Admins can always edit everything.') }}

{% endif %} {% endmacro %}