168 lines
6.9 KiB
HTML
168 lines
6.9 KiB
HTML
{extends file="admin-layout.tpl"}
|
|
|
|
{block name="page-title"}{intl l='Taxes rules'}{/block}
|
|
|
|
{block name="check-permissions"}admin.taxes-rules.view{/block}
|
|
|
|
{block name="main-content"}
|
|
<div class="taxes-rules">
|
|
|
|
<div id="wrapper" class="container">
|
|
|
|
<div class="clearfix">
|
|
<ul class="breadcrumb">
|
|
<li><a href="{url path='/admin/home'}">{intl l="Home"}</a></li>
|
|
<li><a href="{url path='/admin/configuration'}">{intl l="Configuration"}</a></li>
|
|
<li><a href="{url path='/admin/configuration/taxes_rules'}">{intl l="Taxes rules"}</a></li>
|
|
</ul>
|
|
</div>
|
|
|
|
{module_include location='taxes_rules_top'}
|
|
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<div class="general-block-decorator">
|
|
<div class="table-responsive">
|
|
<table class="table table-striped table-condensed table-left-aligned">
|
|
<caption class="clearfix">
|
|
{intl l="Taxes rules"}
|
|
{loop type="auth" name="can_create" roles="ADMIN" permissions="admin.taxes-rules.create"}
|
|
<a class="btn btn-default btn-primary pull-right" title="{intl l='Create a new tax rule'}" href="#tax_rule_create_dialog" data-toggle="modal">
|
|
<span class="glyphicon glyphicon-plus"></span>
|
|
</a>
|
|
{/loop}
|
|
</caption>
|
|
<thead>
|
|
<tr>
|
|
<th>{intl l="Name"}</th>
|
|
<th>{intl l="Description"}</th>
|
|
<th>{intl l="Actions"}</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
|
|
{loop type="tax-rule" name="taxes-rules"}
|
|
|
|
<tr>
|
|
<td>{$TITLE}</td>
|
|
<td>{$DESCRIPTION}</td>
|
|
<td>
|
|
<div class="btn-group">
|
|
{loop type="auth" name="can_change" roles="ADMIN" permissions="admin.configuration.taxes-rules.change"}
|
|
<a class="btn btn-default btn-xs" title="{intl l='Change this tax rule'}" href="{url path="/admin/configuration/taxes_rules/update/$ID"}"><span class="glyphicon glyphicon-edit"></span></a>
|
|
{/loop}
|
|
|
|
{loop type="auth" name="can_change" roles="ADMIN" permissions="admin.configuration.taxes-rules.change"}
|
|
<a class="btn btn-default btn-xs js-delete-tax-rule" title="{intl l='Delete this tax rule'}" href="#tax_rule_delete_dialog" data-id="{$ID}" data-toggle="modal"><span class="glyphicon glyphicon-trash"></span></a>
|
|
{/loop}
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
|
|
{/loop}
|
|
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{module_include location='taxes_rules_bottom'}
|
|
|
|
</div>
|
|
</div>
|
|
|
|
{* -- Add tax rule confirmation dialog ----------------------------------- *}
|
|
{form name="thelia.admin.taxrule.add"}
|
|
|
|
{if $form_error_message}
|
|
{$taxCreateError = true}
|
|
{else}
|
|
{$taxCreateError = false}
|
|
{/if}
|
|
|
|
{* Capture the dialog body, to pass it to the generic dialog *}
|
|
{capture "tax_rule_create_dialog"}
|
|
|
|
{form_hidden_fields form=$form}
|
|
|
|
{form_field form=$form field='locale'}
|
|
<input type="hidden" name="{$name}" value="{$edit_language_locale}" />
|
|
{/form_field}
|
|
|
|
{if $form_error}<div class="alert alert-danger">{$form_error_message}</div>{/if}
|
|
|
|
{form_field form=$form field='title'}
|
|
<div class="form-group {if $error}has-error{/if}">
|
|
<label for="{$label_attr.for}" class="control-label">{intl l=$label} : </label>
|
|
<input type="text" id="{$label_attr.for}" name="{$name}" required="required" title="{intl l='Title'}" placeholder="{intl l='Title'}" class="form-control" value="{if $error}{$value}{else}{if $IS_TRANSLATED == 1}{$TITLE}{/if}{/if}">
|
|
</div>
|
|
{/form_field}
|
|
|
|
{form_field form=$form field='description'}
|
|
<div class="form-group {if $error}has-error{/if}">
|
|
<label for="{$label_attr.for}" class="control-label">
|
|
{intl l=$label} :
|
|
<span class="label-help-block">{intl l="The detailed description."}</span>
|
|
</label>
|
|
|
|
<textarea name="{$name}" id="{$label_attr.for}" rows="10" class="form-control wysiwyg">{if $error}{$value}{else}{if $IS_TRANSLATED == 1}{$DESCRIPTION}{/if}{/if}</textarea>
|
|
</div>
|
|
{/form_field}
|
|
|
|
{/capture}
|
|
|
|
{include
|
|
file = "includes/generic-create-dialog.html"
|
|
|
|
dialog_id = "tax_rule_create_dialog"
|
|
dialog_title = {intl l="Create a new tax rule"}
|
|
dialog_body = {$smarty.capture.tax_rule_create_dialog nofilter}
|
|
|
|
dialog_ok_label = {intl l="Create"}
|
|
dialog_cancel_label = {intl l="Cancel"}
|
|
|
|
form_action = {url path="/admin/configuration/taxes_rules/add"}
|
|
form_enctype = {form_enctype form=$form}
|
|
form_error_message = $form_error_message
|
|
}
|
|
|
|
{/form}
|
|
|
|
{* -- Delete tax rule confirmation dialog ----------------------------------- *}
|
|
|
|
{capture "tax_rule_delete_dialog"}
|
|
<input type="hidden" name="tax_rule_id" id="tax_rule_delete_id" value="" />
|
|
|
|
{module_include location='tax_rule_delete_form'}
|
|
|
|
{/capture}
|
|
|
|
{include
|
|
file = "includes/generic-confirm-dialog.html"
|
|
|
|
dialog_id = "tax_rule_delete_dialog"
|
|
dialog_title = {intl l="Delete tax rule"}
|
|
dialog_message = {intl l="Do you really want to delete this tax rule ?"}
|
|
|
|
form_action = {url path='/admin/configuration/taxes_rules/delete'}
|
|
form_content = {$smarty.capture.tax_rule_delete_dialog nofilter}
|
|
}
|
|
|
|
{/block}
|
|
|
|
{block name="javascript-initialization"}
|
|
|
|
<script type="text/javascript">
|
|
|
|
{if $taxCreateError == true}
|
|
$('#tax_rule_create_dialog').modal();
|
|
{/if}
|
|
|
|
$(".js-delete-tax-rule").click(function(e){
|
|
$('#tax_rule_delete_id').val($(this).data('id'))
|
|
});
|
|
</script>
|
|
|
|
{/block} |