{# app/modules/loyalty/templates/loyalty/shared/devices-list.html #} {# Shared terminal-devices list partial. Set these variables before including: - devices_api_prefix (str): API base URL for device data - show_store_filter (bool): Show store dropdown filter (true for merchant view) - show_crud (bool): Show pair/revoke/delete actions (false for admin read-only) #} {% from 'shared/macros/alerts.html' import loading_state, error_state %} {% from 'shared/macros/tables.html' import table_wrapper, table_header %} {% from 'shared/macros/modals.html' import modal, confirm_modal_dynamic %}
{% if show_store_filter %} {% endif %}
{% call table_wrapper() %} {% if show_store_filter %} {{ table_header([ _('loyalty.terminal_devices.col_label'), _('loyalty.terminal_devices.col_store'), _('loyalty.terminal_devices.col_status'), _('loyalty.terminal_devices.col_last_seen'), _('loyalty.terminal_devices.col_expires'), _('loyalty.terminal_devices.col_actions'), ]) }} {% else %} {{ table_header([ _('loyalty.terminal_devices.col_label'), _('loyalty.terminal_devices.col_status'), _('loyalty.terminal_devices.col_last_seen'), _('loyalty.terminal_devices.col_expires'), _('loyalty.terminal_devices.col_actions'), ]) }} {% endif %} {% endcall %}
{% if show_crud %} {% call modal('pairDeviceModal', _('loyalty.terminal_devices.pair_device'), 'showPairModal', size='md', show_footer=false) %}
{% if show_store_filter %}
{% endif %}

{{ _('loyalty.terminal_devices.pair_hint') }}

{% endcall %} {% call modal('pairingQrModal', _('loyalty.terminal_devices.pairing_qr'), 'showQrModal', size='md', show_footer=false, close_on_backdrop=false) %}

{{ _('loyalty.terminal_devices.qr_warning_title') }} {{ _('loyalty.terminal_devices.qr_warning_body') }}

{% endcall %} {{ confirm_modal_dynamic( 'revokeDeviceModal', _('loyalty.terminal_devices.revoke_title'), 'revokeConfirmMessage', 'revokeDevice()', 'showRevokeModal', confirm_text=_('loyalty.terminal_devices.revoke'), cancel_text=_('loyalty.common.cancel'), variant='warning' ) }} {{ confirm_modal_dynamic( 'deleteDeviceModal', _('loyalty.terminal_devices.delete_title'), 'deleteConfirmMessage', 'deleteDevice()', 'showDeleteModal', confirm_text=_('loyalty.common.delete'), cancel_text=_('loyalty.common.cancel'), variant='danger' ) }} {% endif %}