{%- import 'apostrophe-ui:components/buttons.html' as buttons -%} {% for item in data.choices %} {# If the join has relationship properties, we need to go one more step to #} {# get to the item itself. The relationship properties are in #} {# item.relationship. -Tom #} {% set choice = item.item or item %} {% set relationship = item.relationship %}
{% include data.choiceTemplate %} {% if not item.readOnly %}
{{ buttons.inGroup('', { icon: 'arrow-up', action: 'raise-item', value: choice._id}) }} {{ buttons.inGroup('', { icon: 'arrow-down', action: 'lower-item', value: choice._id }) }} {%- if data.relationship and (apos.utils.filterEmpty(data.relationship, 'inline').length) -%} {{ buttons.inGroup('', { icon: 'list', action: 'relate-item' , value: choice._id}) }} {%- endif -%} {%- if item._edit or item.item._edit -%} {{ buttons.inGroup('', { icon: 'pencil', action: 'edit-item', value: choice._id}) }} {%- endif -%} {{ buttons.inGroup('', { icon: 'trash', action: 'delete-item', value: choice._id }) }}
{% endif %}
{% endfor %}