Inital commit

This commit is contained in:
2020-11-19 15:36:28 +01:00
parent 71f32f83d3
commit 66ce4ee218
18077 changed files with 2166122 additions and 35184 deletions

View File

@@ -10,7 +10,9 @@
{block name="page-title"}{intl l='Coupons'}{/block}
{block name="main-content"}
<div class="coupons">
{$coupon_page = {$smarty.get.page|default:1}}
<div class="coupons">
<div id="wrapper" class="container">
@@ -22,7 +24,7 @@
</ul>
</nav>
{module_include location='coupon_top'}
{hook name="coupon.top" location="coupon_top" }
<div class="row">
<div class="col-md-12">
@@ -33,10 +35,10 @@
<caption>
{intl l='Coupons'}
{module_include location='coupon_list_caption'}
{hook name="coupon.list-caption" location="coupon_list_caption" }
{loop type="auth" name="can_create" role="ADMIN" resource="admin.coupon" access="CREATE"}
<a class="btn btn-default btn-primary action-btn" title="{intl l='Create a new coupon'}" href="{url path='/admin/coupon/create'}">
<a class="btn btn-primary action-btn" title="{intl l='Create a new coupon'}" href="{url path='/admin/coupon/create'}">
<span class="glyphicon glyphicon-plus-sign"></span>
</a>
{/loop}
@@ -74,6 +76,16 @@
}
</th>
<th class="text-center">{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'}"
}
</th>
<th class="text-center">{admin_sortable_header
current_order=$coupon_order
order='expiration-date'
@@ -104,17 +116,17 @@
}
</th>
{module_include location='coupon_table_header'}
{hook name="coupon.table-header" location="coupon_table_header" }
<th>&nbsp;</th>
<th>{intl l="Actions"}</th>
</tr>
</thead>
<tbody>
{loop type="coupon" name="list_coupon" order={$coupon_order|default:'code'} backend_context="true"}
{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"}
<tr>
<td>
{loop type="auth" name="can_change" role="ADMIN" resource="admin.coupon" access="UPDATE"}
<a title="{intl l='Change this coupon'}" href="{url path="/admin/coupon/update/$ID"}">{$CODE}</a>
<a title="{intl l='Change this coupon'}" href="{url path="/admin/coupon/update/%id" id=$ID}">{$CODE}</a>
{/loop}
{elseloop rel="can_change"}
{$CODE}
@@ -131,6 +143,14 @@
{/if}
</td>
<td class="text-center">
{if $START_DATE == null}
/
{else}
{format_date date=$START_DATE output="date"}
{/if}
</td>
<td class="text-center">{format_date date=$EXPIRATION_DATE output="date"}</td>
<td class="text-center">
@@ -151,27 +171,78 @@
{/if}
</td>
{module_include location='coupon_table_row'}
{hook name="coupon.table-row" location="coupon_table_row" coupon_id={$ID} }
<td class="text-center">
{loop type="auth" name="can_change" role="ADMIN" resource="admin.coupon" access="UPDATE"}
<a title="{intl l='Change this coupon'}" href="{url path="/admin/coupon/update/$ID"}"><i class="glyphicon glyphicon-edit"></i></a>
{/loop}
<td class="actions">
<div class="btn-toolbar btn toolbar-primary">
<span class="glyphicon glyphicon-cog"></span>
</div>
<div class="toolbar-options hidden">
{loop type="auth" name="can_change" role="ADMIN" resource="admin.coupon" access="UPDATE"}
<a title="{intl l='Change this coupon'}" href="{url path="/admin/coupon/update/%id" id=$ID}"><span class="glyphicon glyphicon-edit"></span></a>
{/loop}
{loop type="auth" name="can_delete" role="ADMIN" resource="admin.coupon" access="DELETE"}
<a title="{intl l='Delete this coupon'}" class="delete_coupon_btn" href="#delete_coupon" data-target="#delete_coupon" data-id="{$ID}" data-toggle="modal">
<span class="glyphicon glyphicon-trash"></span>
</a>
{/loop}
</div>
</td>
</tr>
{/loop}
{elseloop rel="list_coupon"}
<tr>
<td colspan="100">
<div class="alert alert-info text-center">
<p>{intl l="No coupon is currently defined. Please use the (+) button above to create your first coupon."}</p>
</div>
</td>
</tr>
{/elseloop}
</tbody>
{ifloop rel="list_coupon"}
<tfoot>
<tr>
<td colspan="100">
{include
file = "includes/pagination.html"
loop_ref = "list_coupon"
max_page_count = 10
page_url = {url path="/admin/coupon" orders_order=$coupon_order}
}
</td>
</tr>
</tfoot>
{/ifloop}
</table>
</div>
</div>
{module_include location='coupon_bottom'}
{hook name="coupon.bottom" location="coupon_bottom" }
</div>
</div>
</div> <!-- #wrapper -->
{* DELETE MODAL *}
{capture "delete_dialog"}
<input type="hidden" name="coupon_id" id="coupon_delete_id" value="" />
{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}
}
</div>
{/block}
@@ -199,11 +270,15 @@
<script src="{$asset_url}"></script>
{/javascripts}
{javascripts file='assets/js/main.js'}
<script src="{$asset_url}"></script>
{/javascripts}
<script>
$(document).ready(function() {
$(".delete_coupon_btn").click(function() {
$("#coupon_delete_id").val($(this).data("id"));
});
});
</script>
{/block}
{block name="javascript-last-call"}
{module_include location='coupon-list-js'}
{hook name="coupon.list-js" location="coupon-list-js" }
{/block}