+ {$ID}
+
- i={$ID} {loop type="image" name="cat_image" source="category" source_id="$ID" limit="1" width="50" height="50" resize_mode="crop" backend_context="1"}
-
+ {loop type="image" name="cat_image" source="category" source_id="$ID" limit="1" width="50" height="50" resize_mode="crop" backend_context="1"}
+
{/loop}
-
- {$ID} p={$POSITION} {$TITLE}
+
+ {$TITLE}
{module_include location='category_list_row'}
- {loop type="auth" name="can_change" roles="ADMIN" permissions="admin.category.edit"}
+ {loop type="auth" name="can_change" roles="ADMIN" permissions="admin.categories.edit"}
@@ -111,24 +121,24 @@
{admin_position_block
- permission="admin.category.edit"
- path={url path='admin/catalog/category' category_id="{$ID}"}
+ permission="admin.categories.edit"
+ path={url path='admin/category/update-position' category_id=$ID}
url_parameter="category_id"
in_place_edit_class="categoryPositionChange"
- position="$POSITION"
- id="$ID"
+ position=$POSITION
+ id=$ID
}
-
+
- {loop type="auth" name="can_change" roles="ADMIN" permissions="admin.category.edit"}
-
+ {loop type="auth" name="can_change" roles="ADMIN" permissions="admin.categories.edit"}
+
{/loop}
- {loop type="auth" name="can_delete" roles="ADMIN" permissions="admin.category.delete"}
+ {loop type="auth" name="can_delete" roles="ADMIN" permissions="admin.categories.delete"}
{/loop}
@@ -143,7 +153,7 @@
- {loop type="auth" name="can_create" roles="ADMIN" permissions="admin.category.create"}
+ {loop type="auth" name="can_create" roles="ADMIN" permissions="admin.categories.create"}
{intl l="This category has no sub-categories. To create a new one, click the + button above."}
{/loop}
@@ -166,9 +176,10 @@
{* display parent category name *}
- {loop name="category_title" type="category" visible="*" id="{$current_category_id}"}
+ {loop name="category_title" type="category" visible="*" id=$current_category_id}
{intl l="Products in %cat" cat=$TITLE}
{/loop}
+
{elseloop rel="category_title"}
{intl l="Top level Products"}
{/elseloop}
@@ -183,15 +194,34 @@
{ifloop rel="product_list"}
+
+ {admin_sortable_header
+ current_order=$product_order
+ order='id'
+ reverse_order='id_reverse'
+ path={url path='/admin/product' category_id=$current_category_id}
+ label="{intl l='ID'}"
+ }
+
+
+ {admin_sortable_header
+ current_order=$product_order
+ order='ref'
+ reverse_order='ref_reverse'
+ path={url path='/admin/product' category_id=$current_category_id}
+ label="{intl l='Reference'}"
+ }
+
+
{admin_sortable_header
current_order=$product_order
order='alpha'
reverse_order='alpha_reverse'
- path={url path='/admin/catalog/product' id="{$current_category_id}"}
- label={intl l='Product title'}
+ path={url path='/admin/product' category_id=$current_category_id}
+ label="{intl l='Product title'}"
}
{module_include location='product_list_header'}
@@ -201,8 +231,8 @@
current_order=$product_order
order='visible'
reverse_order='visible_reverse'
- path={url path='/admin/catalog/product' id="{$current_category_id}"}
- label={intl l='Online'}
+ path={url path='/admin/product' category_id=$current_category_id}
+ label="{intl l='Online'}"
}
@@ -211,8 +241,8 @@
current_order=$product_order
order='manual'
reverse_order='manual_reverse'
- path={url path='/admin/catalog/product' id="{$current_category_id}"}
- label={intl l='Position'}
+ path={url path='/admin/product' category_id=$current_category_id}
+ label="{intl l='Position'}"
}
@@ -221,37 +251,58 @@
- {loop name="product_list" type="product" category="{$current_category_id}" order="manual"}
+ {loop name="product_list" type="product" category=$current_category_id order="manual"}
+ {$ID}
+
{loop type="image" name="cat_image" source="product" source_id="$ID" limit="1" width="50" height="50" resize_mode="crop" backend_context="1"}
-
+
{/loop}
- {$TITLE}
+ {$REF}
+
+ {$TITLE}
{module_include location='product_list_row'}
-
+ {loop type="auth" name="can_change" roles="ADMIN" permissions="admin.products.edit"}
+
+
+
+ {/loop}
+
+ {elseloop rel="can_change"}
+
+
+
+ {/elseloop}
{admin_position_block
permission="admin.product.edit"
- path={url path='admin/catalog/product' category_id="{$ID}"}
+ path={url path='admin/product' category_id=$ID}
url_parameter="product_id"
in_place_edit_class="productPositionChange"
- position="$POSITION"
- id="$ID"
+ position=$POSITION
+ id=$ID
}
-
-
+
+ {loop type="auth" name="can_change" roles="ADMIN" permissions="admin.product.edit"}
+
+ {/loop}
+
+ {loop type="auth" name="can_change" roles="ADMIN" permissions="admin.product.delete"}
+
+ {/loop}
+
{/loop}
@@ -274,8 +325,105 @@
-{include file="includes/add-category-dialog.html"}
-{include file="includes/delete-category-dialog.html"}
+ {* Adding a new Category *}
+
+
+
+
+
+
+
+ {form name="thelia.admin.category.creation"}
+
+ {/form}
+
+
+
+
+
+ {* Delete category confirmation dialog *}
+
+
+
+
+
+
+
+
+
{intl l="Do you really want to delete this category ?"}
+
+
+
+
+
+
+
+
{/block}
{block name="javascript-initialization"}
@@ -314,14 +462,25 @@ $(function() {
{* Set the proper category ID in the delete confirmation dialog *}
- $(document).on("click", ".category-delete", function () {
- $('#'+'delete-category-id').val($(this).data('id'));
+ $('a.category-delete').click(function(ev) {
+ $('#delete_category_id').val($(this).data('id'));
});
// Toggle category visibility
$(".categoryVisibleToggle").click(function() {
$.ajax({
- url : "{url path='admin/catalog/category'}",
+ url : "{url path='admin/categories/toggle-online'}",
+ data : {
+ category_id : $(this).data('id'),
+ action : 'visibilityToggle'
+ }
+ });
+ });
+
+ // Toggle product visibility
+ $(".productVisibleToggle").click(function() {
+ $.ajax({
+ url : "{url path='admin/products/toggle-online'}",
data : {
category_id : $(this).data('id'),
action : 'visibilityToggle'
@@ -338,15 +497,34 @@ $(function() {
inputclass : 'input-mini',
placement : 'left',
success : function(response, newValue) {
- // The URL template
- var url = "{url path='admin/catalog/category' action='changePosition' category_id='__ID__' position='__POS__'}";
+ // The URL template
+ var url = "{url path='/admin/categories/update-position' category_id='__ID__' position='__POS__'}";
- // Perform subtitutions
+ // Perform subtitutions
url = url.replace('__ID__', $(this).data('id'))
- .replace('__POS__', newValue);
+ .replace('__POS__', newValue);
- // Reload the page
- location.href = url;
+ // Reload the page
+ location.href = url;
+ }
+ });
+
+ $('.productPositionChange').editable({
+ type : 'text',
+ title : '{intl l="Enter new product position"}',
+ mode : 'popup',
+ inputclass : 'input-mini',
+ placement : 'left',
+ success : function(response, newValue) {
+ // The URL template
+ var url = "{url path='/admin/products/update-position' product_id='__ID__' position='__POS__'}";
+
+ // Perform subtitutions
+ url = url.replace('__ID__', $(this).data('id'))
+ .replace('__POS__', newValue);
+
+ // Reload the page
+ location.href = url;
}
});
diff --git a/templates/admin/default/edit_category.html b/templates/admin/default/category-edit.html
similarity index 99%
rename from templates/admin/default/edit_category.html
rename to templates/admin/default/category-edit.html
index 85e6d42bd..31c425157 100755
--- a/templates/admin/default/edit_category.html
+++ b/templates/admin/default/category-edit.html
@@ -7,9 +7,8 @@
{block name="main-content"}
-
- {include file="includes/category_breadcrumb.html"}
-
+
+ {include file="includes/categories-breadcrumb.html"}
{loop name="category_edit" type="category" visible="*" id="{$current_category_id}" backend_context="1" lang="$edit_language_id"}
diff --git a/templates/admin/default/currencies.html b/templates/admin/default/currencies.html
index 29bd582a2..83ca62ba3 100644
--- a/templates/admin/default/currencies.html
+++ b/templates/admin/default/currencies.html
@@ -122,7 +122,7 @@
{loop type="auth" name="can_change" roles="ADMIN" permissions="admin.configuration.currencies.change"}
- {$NAME}
+ {$NAME}
{/loop}
{elseloop rel="can_change"}
{$NAME}
diff --git a/templates/admin/default/includes/add-category-dialog.html b/templates/admin/default/includes/add-category-dialog.html
deleted file mode 100755
index 0e62994f7..000000000
--- a/templates/admin/default/includes/add-category-dialog.html
+++ /dev/null
@@ -1,71 +0,0 @@
-
-{* Adding a new Category *}
-
-
-
-
-
-
-
-
- {form name="thelia.admin.category.creation"}
-
- {/form}
-
-
-
-
-
\ No newline at end of file
diff --git a/templates/admin/default/includes/category_breadcrumb.html b/templates/admin/default/includes/category_breadcrumb.html
deleted file mode 100755
index bf14142b5..000000000
--- a/templates/admin/default/includes/category_breadcrumb.html
+++ /dev/null
@@ -1,13 +0,0 @@
-{* Breadcrumb for categories browsing and editing *}
-
-Home
-Catalog {ifloop rel="category_path"}
-
-{loop name="category_path" type="category-path" visible="*" category="{$current_category_id}"} {if $ID == $current_category_id}
-{if $action == 'edit'} {intl l='Editing %cat' cat="{$TITLE}"} {else} {$TITLE} {intl l="(edit)"} {/if}
-
-{else}
-{$TITLE}
-{/if} {/loop} {/ifloop} {elseloop rel="category_path"}
-
-{/elseloop}
diff --git a/templates/admin/default/includes/delete-category-dialog.html b/templates/admin/default/includes/delete-category-dialog.html
deleted file mode 100755
index 91cc8db66..000000000
--- a/templates/admin/default/includes/delete-category-dialog.html
+++ /dev/null
@@ -1,42 +0,0 @@
-
-{* Adding a new Category *}
-
-
-
-
-
- {form name="thelia.admin.category.deletion"}
-
- {/form}
-