@@ -234,11 +235,16 @@
{intl l="Tax rule taxes will be update for the following countries :"}
{/form_field}
@@ -283,6 +289,29 @@
$('#tax_list_update_dialog').modal();
{/if}
+
+ $('.js-collapse').each(function(k, v) {
+ var h = $(v).data('collapse-height');
+ if( $(v).height() > h ) {
+ $(v).css('overflow', 'hidden').css('height', h + 'px');
+ } else {
+ $('[data-collapse-block=' + $(v).attr('id') + ']').hide();
+ }
+ });
+
+ $('.js-collapse-btn').click(function(e) {
+ e.preventDefault();
+ var block = $(this).data('collapseBlock');
+ $('#' + block).css('overflow', 'initial').css('height', 'initial');
+ $(this).unbind().remove();
+ });
+
+ $('.js-uncheck-all').click(function(e) {
+ e.preventDefault();
+ var selectId = $(this).data('uncheckSelect');
+ $('#' + selectId).selectpicker('deselectAll');
+ });
+
{literal}
$('#country-selector').change(function(e) {
$('#country-selector-form').submit();
@@ -308,7 +337,6 @@
});
});
- console.log(taxesRules);
$('#tax_list').val(JSON.stringify(taxesRules));
});
diff --git a/templates/admin/default/taxes-rules.html b/templates/admin/default/taxes-rules.html
index 8c2dfc074..312f2caa2 100644
--- a/templates/admin/default/taxes-rules.html
+++ b/templates/admin/default/taxes-rules.html
@@ -21,6 +21,72 @@
+
+
+
{intl l="In order to manges your shop taxes you can manage"} {intl l="taxes"} {intl l="and"} {intl l="tax rules"} .
+
{intl l="Taxes define the amount of money which is add to a bought product."}
+
+ {intl l="Example :"}
+
+ {intl l="French 19.6% VAT is a tax which add a 19.6% tax to the product price."}
+ {intl l="Ecotax is a tax wich add a defined amount (throug a product feature) to the product price."}
+
+
+
{intl l="Tax rules are combination of different taxes."}
+
+ {intl l="Example :"}
+
+ {intl l="French 19.6% VAT with ecotax is the applicance of the ecotax (on the product price) then the applicance of the 19.6% tax (on the product price + the ecotax amount)."}
+
+
+
{intl l="you can combine taxes in tax rules and chose if they are applied one after the other or at the same time : it allows to apply taxes on an already taxed price or not."}
+
+
+
+
+
+
+ {intl l="Taxes"}
+ {loop type="auth" name="can_create" roles="ADMIN" permissions="admin.taxes.create"}
+
+
+
+ {/loop}
+
+
+
+ {intl l="Name"}
+ {intl l="Description"}
+ {intl l="Actions"}
+
+
+
+
+ {loop type="tax" name="taxes" backend_context="1"}
+
+
+ {$TITLE}
+ {$DESCRIPTION}
+
+
+ {loop type="auth" name="can_change" roles="ADMIN" permissions="admin.configuration.taxes.change"}
+
+ {/loop}
+
+ {loop type="auth" name="can_change" roles="ADMIN" permissions="admin.configuration.taxes.change"}
+
+ {/loop}
+
+
+
+
+ {/loop}
+
+
+
+
+
+
@@ -34,25 +100,32 @@
- {intl l="Name"}
- {intl l="Description"}
- {intl l="Actions"}
+ {intl l="Name"}
+ {intl l="Description"}
+ {intl l="Default"}
+ {intl l="Actions"}
- {loop type="tax-rule" name="taxes-rules"}
+ {loop type="tax-rule" name="taxes-rules" backend_context="1"}
{$TITLE}
{$DESCRIPTION}
+
+ {if $IS_DEFAULT == 1}
+
+ {/if}
+
{loop type="auth" name="can_change" roles="ADMIN" permissions="admin.configuration.taxes-rules.change"}
+
{/loop}
- {loop type="auth" name="can_change" roles="ADMIN" permissions="admin.configuration.taxes-rules.change"}
+ {loop type="auth" name="can_change" roles="ADMIN" permissions="admin.configuration.taxes-rules.dele"}
{/loop}
@@ -73,8 +146,8 @@
-{* -- Add tax rule confirmation dialog ----------------------------------- *}
- {form name="thelia.admin.taxrule.add"}
+{* -- Add tax confirmation dialog ----------------------------------- *}
+ {form name="thelia.admin.tax.add"}
{if $form_error_message}
{$taxCreateError = true}
@@ -82,6 +155,119 @@
{$taxCreateError = false}
{/if}
+ {* Capture the dialog body, to pass it to the generic dialog *}
+ {capture "tax_create_dialog"}
+
+ {form_hidden_fields form=$form}
+
+ {form_field form=$form field='locale'}
+
+ {/form_field}
+
+ {form_field form=$form field='title'}
+
+ {intl l=$label} :
+
+
+ {/form_field}
+
+ {form_field form=$form field='description'}
+
+
+ {intl l=$label} :
+ {intl l="The detailed description."}
+
+
+
+
+ {/form_field}
+
+ {form_field form=$form field='type'}
+
+ {/form_field}
+
+ {form_tagged_fields form=$form tag='requirements'}
+
+
+ {intl l=$label}
+
+ {if $formType == 'choice'}
+
+ {foreach $choices as $choice}
+ value || $form_error && $value == $choice->value}selected="selected" {/if}>{$choice->label}
+ {/foreach}
+
+ {/if}
+ {if $formType == 'text'}
+
+ {/if}
+
+ {/form_tagged_fields}
+
+ {/capture}
+
+ {include
+ file = "includes/generic-create-dialog.html"
+
+ dialog_id = "tax_create_dialog"
+ dialog_title = {intl l="Create a new tax"}
+ dialog_body = {$smarty.capture.tax_create_dialog nofilter}
+
+ dialog_ok_label = {intl l="Create"}
+ dialog_cancel_label = {intl l="Cancel"}
+
+ form_action = {url path="/admin/configuration/taxes/add"}
+ form_enctype = {form_enctype form=$form}
+ form_error_message = $form_error_message
+ }
+
+ {/form}
+
+{* -- Delete tax confirmation dialog ----------------------------------- *}
+
+ {capture "tax_delete_dialog"}
+
+
+ {module_include location='tax_delete_form'}
+
+ {/capture}
+
+ {include
+ file = "includes/generic-confirm-dialog.html"
+
+ dialog_id = "tax_delete_dialog"
+ dialog_title = {intl l="Delete tax"}
+ dialog_message = {intl l="Do you really want to delete this tax ?"}
+
+form_action = {url path='/admin/configuration/taxes/delete'}
+form_content = {$smarty.capture.tax_delete_dialog nofilter}
+}
+
+{* -- Add tax rule confirmation dialog ----------------------------------- *}
+ {form name="thelia.admin.taxrule.add"}
+
+ {if $form_error_message}
+ {$taxRuleCreateError = true}
+ {else}
+ {$taxRuleCreateError = false}
+ {/if}
+
{* Capture the dialog body, to pass it to the generic dialog *}
{capture "tax_rule_create_dialog"}
@@ -154,15 +340,41 @@ form_content = {$smarty.capture.tax_rule_delete_dialog nofilter}
{block name="javascript-initialization"}
+ {javascripts file='assets/js/bootstrap-select/bootstrap-select.js'}
+
+ {/javascripts}
+
+ {javascripts file='assets/js/main.js'}
+
+ {/javascripts}
+
{/block}
\ No newline at end of file
diff --git a/templates/default/category.html b/templates/default/category.html
index 6ad99485c..8bbb1d10b 100644
--- a/templates/default/category.html
+++ b/templates/default/category.html
@@ -40,6 +40,4 @@
-
-
{/block}
diff --git a/templates/default/includes/menu.html b/templates/default/includes/menu.html
index 083c74ef2..476e3ecd0 100644
--- a/templates/default/includes/menu.html
+++ b/templates/default/includes/menu.html
@@ -3,25 +3,28 @@
- {assign "previousLevel" 0}
- {loop name="cat-parent" type="category-tree" category="0"}
+ {assign "previousLevel" 0}
+ {loop name="cat-parent" type="category-tree" category="0"}
- {for $foo=1 to $previousLevel-$LEVEL}
-
-
+ {for $foo=1 to $previousLevel-$LEVEL}
+
+
{/for}
{if $CHILD_COUNT > 0 }
- {$TITLE} ({$CHILD_COUNT})
-
+
+ {$TITLE} ({$CHILD_COUNT})
- {else}
-
- {$TITLE} (0)
- {/if}
- {assign "previousLevel" $LEVEL}
- {/loop}
+ {else}
+ {$TITLE} (0)
+ {/if}
+ {assign "previousLevel" $LEVEL}
+ {/loop}
+ {for $i=$previousLevel to 1 step -1}
+
+ {/for}
+
-
\ No newline at end of file
+