{extends file="admin-layout.tpl"} {block name="no-return-functions"} {$admin_current_location = 'tools'} {/block} {block name="check-resource"}admin.coupon{/block} {block name="check-access"}view{/block} {block name="page-title"}{intl l='Coupons'}{/block} {block name="main-content"} {$coupon_page = {$smarty.get.page|default:1}}
{hook name="coupon.top" location="coupon_top" }

{intl l='Coupons'} {hook name="coupon.list-caption" location="coupon_list_caption" } {loop type="auth" name="can_create" role="ADMIN" resource="admin.coupon" access="CREATE"} {/loop}
{admin_sortable_header current_order=$coupon_order order='code' reverse_order='code-reverse' path={url path='/admin/coupon'} request_parameter_name='coupon_order' label="{intl l='Code'}" } | {admin_sortable_header current_order=$coupon_order order='title' reverse_order='title-reverse' path={url path='/admin/coupon'} request_parameter_name='coupon_order' label="{intl l='Title'}" } | {admin_sortable_header current_order=$coupon_order order='enabled' reverse_order='enabled-reverse' path={url path='/admin/coupon'} request_parameter_name='coupon_order' label="{intl l='Status'}" } | {admin_sortable_header current_order=$coupon_order order='start-date' reverse_order='start-date-reverse' path={url path='/admin/coupon'} request_parameter_name='coupon_order' label="{intl l='Start Date'}" } | {admin_sortable_header current_order=$coupon_order order='expiration-date' reverse_order='expiration-date-reverse' path={url path='/admin/coupon'} request_parameter_name='coupon_order' label="{intl l='Expiration date'}" } | {admin_sortable_header current_order=$coupon_order order='days-left' reverse_order='days-left-reverse' path={url path='/admin/coupon'} request_parameter_name='coupon_order' label="{intl l='Days before expiration'}" } | {admin_sortable_header current_order=$coupon_order order='usages-left' reverse_order='usages-left-reverse' path={url path='/admin/coupon'} request_parameter_name='coupon_order' label="{intl l='Usages left'}" } {hook name="coupon.table-header" location="coupon_table_header" } | {intl l="Actions"}
--- | --- | --- | --- | --- | --- | --- | ---
{loop type="coupon" name="list_coupon" page={$coupon_page} limit={config key="number_default_results_per_page.coupon_list" default=20} order={$coupon_order|default:'code'} backend_context="true"}
{loop type="auth" name="can_change" role="ADMIN" resource="admin.coupon" access="UPDATE"} {$CODE} {/loop} {elseloop rel="can_change"} {$CODE} {/elseloop} | {$TITLE} | {if $IS_ENABLED} {intl l="Enabled"} {else} {intl l="Disabled"} {/if} | {if $START_DATE == null} / {else} {format_date date=$START_DATE output="date"} {/if} | {format_date date=$EXPIRATION_DATE output="date"} | {if $DAY_LEFT_BEFORE_EXPIRATION <= 0} {intl l='Expired'} {else} {$DAY_LEFT_BEFORE_EXPIRATION} {/if} | {if $USAGE_LEFT == -1} {intl l="Unlimited"} {elseif $USAGE_LEFT} {$USAGE_LEFT} {else} 0 {/if} {hook name="coupon.table-row" location="coupon_table_row" coupon_id={$ID} } | {loop type="auth" name="can_change" role="ADMIN" resource="admin.coupon" access="UPDATE"} {/loop} {loop type="auth" name="can_delete" role="ADMIN" resource="admin.coupon" access="DELETE"} {/loop}
{/loop} {elseloop rel="list_coupon"}
{intl l="No coupon is currently defined. Please use the (+) button above to create your first coupon."}
{/elseloop}
{ifloop rel="list_coupon"}
{include file = "includes/pagination.html" loop_ref = "list_coupon" max_page_count = 10 page_url = {url path="/admin/coupon" orders_order=$coupon_order} }
{/ifloop}

{hook name="coupon.bottom" location="coupon_bottom" }
{* DELETE MODAL *} {capture "delete_dialog"} {hook name="coupon.delete-form" } {/capture} {include file = "includes/generic-confirm-dialog.html" dialog_id = "delete_coupon" dialog_title = {intl l="Delete coupon"} dialog_message = {intl l="Do you really want to delete this coupon ?"} form_action = {token_url path='/admin/coupon/delete'} form_content = {$smarty.capture.delete_dialog nofilter} }
{/block} {block name="javascript-initialization"} {javascripts file='assets/js/bootstrap-editable/bootstrap-editable.js'}
{/javascripts} {javascripts file='assets/js/tablesorter/jquery.tablesorter.min.js'}
{/javascripts} {javascripts file='assets/js/tablesorter/jquery.metadata.js'}
{/javascripts} {javascripts file='assets/js/tablesorter/jquery.tablesorter.widgets.js'}
{/javascripts} {javascripts file='assets/js/tablesorter/jquery.tablesorter.widgets-filter-formatter.js'}
{/javascripts}
{/block} {block name="javascript-last-call"} {hook name="coupon.list-js" location="coupon-list-js" } {/block}