{%- 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 %}
{{ buttons.inGroup('', { icon: 'arrow-up', action: 'raise-item', value: choice._id}) }} {{ buttons.inGroup('', { icon: 'arrow-down', action: 'lower-item', value: choice._id }) }} {{ buttons.inGroup('', { icon: 'trash', action: 'delete-item', value: choice._id }) }} {%- if data.relationship -%} {{ buttons.inGroup('', { icon: 'list', action: 'relate-item' , value: choice._id}) }} {%- endif -%}
{% endfor %}