+ | {$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,39 +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}
@@ -276,8 +325,82 @@
-{include file="includes/add-category-dialog.html"}
-{include file="includes/delete-category-dialog.html"}
+ {* Adding a new Category *}
+
+
+ {form name="thelia.admin.category.creation"}
+
+ {* Capture the dialog body, to pass it to the generic dialog *}
+ {capture "category_creation_dialog"}
+
+ {form_hidden_fields form=$form}
+
+ {form_field form=$form field='success_url'}
+ {* on success, redirect to the edition page, _ID_ is replaced with the created object ID, see controller *}
+
+ {/form_field}
+
+ {form_field form=$form field='parent'}
+
+ {/form_field}
+
+ {form_field form=$form field='title'}
+
+ {/form_field}
+ {/capture}
+
+ {include
+ file = "includes/generic-create-dialog.html"
+
+ dialog_id = "add_category_dialog"
+ dialog_title = {intl l="Create a new category"}
+ dialog_body = {$smarty.capture.category_creation_dialog nofilter}
+
+ dialog_ok_label = {intl l="Create this category"}
+ dialog_cancel_label = {intl l="Cancel"}
+
+ form_action = {url path='/admin/categories/create'}
+ form_enctype = {form_enctype form=$form}
+ form_error_message = $form_error_message
+ }
+ {/form}
+
+ {* Delete category confirmation dialog *}
+
+ {capture "category_delete_dialog"}
+
+
+ {/capture}
+
+ {include
+ file = "includes/generic-confirm-dialog.html"
+
+ dialog_id = "delete_category_dialog"
+ dialog_title = {intl l="Delete a category"}
+ dialog_message = {intl l="Do you really want to delete this category, and all its contents ?"}
+
+ form_action = {url path='/admin/categories/delete'}
+ form_content = {$smarty.capture.category_delete_dialog nofilter}
+ }
{/block}
{block name="javascript-initialization"}
@@ -290,68 +413,100 @@
{/javascripts}
-
+ {* Inline editing of object position using bootstrap-editable *}
+
+ $('.categoryPositionChange').editable({
+ type : 'text',
+ title : '{intl l="Enter new category position"}',
+ mode : 'popup',
+ inputclass : 'input-mini',
+ placement : 'left',
+ success : function(response, newValue) {
+ // The URL template
+ var url = "{url path='/admin/categories/update-position' category_id='__ID__' position='__POS__'}";
+
+ // Perform subtitutions
+ url = url.replace('__ID__', $(this).data('id'))
+ .replace('__POS__', newValue);
+
+ // 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;
+ }
+ });
+
+})
+
{/block}
\ No newline at end of file
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..13327ca3d 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/catalog-breadcrumb.html"}
{loop name="category_edit" type="category" visible="*" id="{$current_category_id}" backend_context="1" lang="$edit_language_id"}
@@ -27,6 +26,7 @@
|