{# area needs its own copy of the widget options as #} {# JSON, for adding new widgets #} {%- set canEdit = data.area._edit and data.options.edit != false -%} {%- set isSingleton = data.options.limit == 1 and data.options.type -%} {# data-doc-id is always present for introspection by modules like #} {# apostrophe-workflow that might need to compare it to a draft version #} {# that is editable after all #}
{%- if canEdit -%} {%- if isSingleton -%} {% include "singletonControls.html" %} {%- else -%} {% include "areaControls.html" %} {%- endif -%}
{%- endif -%} {%- for widget in data.area.items -%} {%- set widgetOptions = data.options.widgets[widget.type] or {} -%} {%- if not canEdit or widgetOptions.readOnly -%} {%- set widgetOptions = apos.utils.merge(widgetOptions, { edit: false }) -%} {%- endif -%} {{ apos.areas.widget(widget, widgetOptions) }} {%- endfor -%} {%- if canEdit %}
{% endif -%}