{# app/modules/loyalty/templates/loyalty/shared/pins-list.html #} {# Shared staff PINs list partial. Set these variables before including: - pins_api_prefix (str): API base URL for PINs data - show_store_filter (bool): Show store/location dropdown filter - show_crud (bool): Show create/edit/delete actions (false for admin read-only) #} {% from 'shared/macros/pagination.html' import pagination %} {% 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 %} {% from 'shared/macros/inputs.html' import search_autocomplete %}

{{ _('loyalty.shared.pins.total_pins') }}

0

{{ _('loyalty.shared.pins.active_pins') }}

0

{{ _('loyalty.shared.pins.locked_pins') }}

0

{% if show_store_filter %} {% endif %}
{% call table_wrapper() %} {% if show_store_filter %} {{ table_header([_('loyalty.shared.pins.col_name'), _('loyalty.shared.pins.col_staff_id'), _('loyalty.shared.pins.col_store'), _('loyalty.shared.pins.col_status'), _('loyalty.shared.pins.col_locked'), _('loyalty.shared.pins.col_last_used'), _('loyalty.shared.pins.col_actions')]) }} {% else %} {{ table_header([_('loyalty.shared.pins.col_name'), _('loyalty.shared.pins.col_staff_id'), _('loyalty.shared.pins.col_status'), _('loyalty.shared.pins.col_locked'), _('loyalty.shared.pins.col_last_used'), _('loyalty.shared.pins.col_actions')]) }} {% endif %} {% endcall %}
{% if show_crud %} {% call modal('createPinModal', _('loyalty.shared.pins.create_pin'), 'showCreateModal', size='md', show_footer=false) %}
{{ search_autocomplete( search_var='staffSearch', results_var='staffSearchResults', show_dropdown_var='showStaffDropdown', loading_var='searchingStaff', search_action='searchStaff()', select_action='selectStaffMember(item)', display_field='full_name', secondary_field='email', placeholder=_('loyalty.shared.pins.pin_name'), min_chars=1, no_results_text=_('loyalty.shared.pins.no_staff_found'), loading_text=_('loyalty.common.loading') ) }}
{% if show_store_filter %}
{% endif %}
{% endcall %} {% call modal('editPinModal', _('loyalty.shared.pins.edit_pin'), 'showEditModal', size='md', show_footer=false) %}

{{ _('loyalty.shared.pins.pin_edit_hint') }}

{% if show_store_filter %}
{% endif %}
{% endcall %} {{ confirm_modal( 'deletePinModal', _('loyalty.shared.pins.delete_pin'), _('loyalty.shared.pins.confirm_delete'), 'deletePin()', 'showDeleteModal', confirm_text=_('loyalty.common.delete'), cancel_text=_('loyalty.common.cancel'), variant='danger' ) }} {% endif %}