Category visibility toggle implementation

This commit is contained in:
franck
2013-08-08 10:12:14 +02:00
parent 64031a1883
commit efa3eb2767
6 changed files with 111 additions and 34 deletions

View File

@@ -57,7 +57,13 @@
{module_include location='category_list_row'}
<td>
<input type="checkbox" data-id="{$ID}" class="displayToggle" {if $VISIBLE == 1}checked="checked"{/if}>
{loop type="auth" name="can_change" context="admin" roles="ADMIN" permissions="admin.category.edit"}
<input type="checkbox" data-id="{$ID}" class="categoryVisibleToggle" {if $VISIBLE == 1}checked="checked"{/if}>
{/loop}
{elseloop rel="can_change"}
<input type="checkbox" class="disabled" disabled="disabled" {if $VISIBLE == 1}checked="checked"{/if}>
{/elseloop}
</td>
<td>
@@ -222,6 +228,17 @@ $(function() {
$('#'+'delete-category-id').val($(this).data('id'));
});
// Toggle category visibility
$(".categoryVisibleToggle").click(function() {
$.ajax({
url : "{url path='admin/catalog/category'}",
data : {
id : $(this).data('id'),
action : 'visibilityToggle'
}
});
});
})
</script>

View File

@@ -88,7 +88,7 @@
{loop name="menu-auth-order" type="auth" context="admin" roles="ADMIN" permissions="admin.orders.view"}
<li class="dropdown {if $admin_current_location == 'customer'}active{/if}" id="orders_menu" data-toggle="dropdown">
<a href="#">{intl l="Orders"}<span class="caret"></span></a>
<a href="#">{intl l="Orders"} <span class="caret"></span></a>
<ul class="dropdown-menu config_menu" role="menu">