diff --git a/admin/skins/default/skeleton/users.html b/admin/skins/default/skeleton/users.html index c2802e6b..00ad7954 100755 --- a/admin/skins/default/skeleton/users.html +++ b/admin/skins/default/skeleton/users.html @@ -99,12 +99,9 @@

Users Manager ({{subSection}})

- @@ -119,13 +116,13 @@

Users Manager ({{subSection}})

{% for user in results %} +
+ +
+
-
- +
+
+
#
-
- -
-
{{user.id}} @@ -203,46 +200,30 @@

Users Manager ({{subSection}})

}); $('.bulk-check-main').on('click', function() { - if ($(this).attr('check') == 'selected') { - var mode = 'unselected'; - $('.bulk-check-sub').removeClass('selected').addClass('unselected').attr('check', 'unselected'); - $(this).removeClass('selected').addClass('unselected').attr('check', 'unselected'); - } else { - var mode = 'selected'; - $('.bulk-check-sub').removeClass('unselected').addClass('selected').attr('check', 'selected'); - $(this).removeClass('unselected').addClass('selected').attr('check', 'selected'); - } - - $('.bulk-check-sub').each(function(i, obj) { - if (mode == 'selected') { - if ($(obj).hasClass('selected')) { - $(obj).trigger('click'); - } - } else { - if ($(obj).hasClass('unselected')) { - $(obj).trigger('click'); - } - } + var mainMode = (this.checked ? "check" : "uncheck"); + $('input[type=checkbox]').each(function () { + var subMode = (this.checked ? "check" : "uncheck"); + if (mainMode != subMode) { + $(this).trigger('click'); + } }); - }); + }); - $('.bulk-actions').on('click', function(e) { - e.preventDefault(); - var action = $(this).attr('action'); - $('#bulk-action').val(action); + $('.bulk-actions').on('click', function(e) { + e.preventDefault(); + $('#bulk-action').val($(this).attr('action')); - var allkeys = ''; - $('.selected').each(function(i, obj) { - // bulk-keys - var currentKey = $(obj).attr('videokey'); - if (currentKey != null) { - allkeys += currentKey + ','; + var allkeys = ''; + $('input[type=checkbox]').each(function () { + var checked = (this.checked ? true : false); + if (this.checked) { + allkeys += $(this).attr('videokey') + ','; } }); $('#bulk-keys').val(allkeys); $('#bulk-actions').submit(); - }); + }); }); diff --git a/admin/skins/default/skeleton/videos.html b/admin/skins/default/skeleton/videos.html index d69a4014..f0b6808c 100755 --- a/admin/skins/default/skeleton/videos.html +++ b/admin/skins/default/skeleton/videos.html @@ -123,12 +123,9 @@

Videos Manager ({{subSection}})

- @@ -143,12 +140,12 @@

Videos Manager ({{subSection}})

{% for video in results %}
-
- +
+
+
#
-
- -
+
+ +
{{video.id}} @@ -244,40 +241,24 @@

Videos Manager ({{subSection}})

}); $('.bulk-check-main').on('click', function() { - if ($(this).attr('check') == 'selected') { - var mode = 'unselected'; - $('.bulk-check-sub').removeClass('selected').addClass('unselected').attr('check', 'unselected'); - $(this).removeClass('selected').addClass('unselected').attr('check', 'unselected'); - } else { - var mode = 'selected'; - $('.bulk-check-sub').removeClass('unselected').addClass('selected').attr('check', 'selected'); - $(this).removeClass('unselected').addClass('selected').attr('check', 'selected'); - } - - $('.bulk-check-sub').each(function(i, obj) { - if (mode == 'selected') { - if ($(obj).hasClass('selected')) { - $(obj).trigger('click'); - } - } else { - if ($(obj).hasClass('unselected')) { - $(obj).trigger('click'); - } - } + var mainMode = (this.checked ? "check" : "uncheck"); + $('input[type=checkbox]').each(function () { + var subMode = (this.checked ? "check" : "uncheck"); + if (mainMode != subMode) { + $(this).trigger('click'); + } }); - }); + }); $('.bulk-actions').on('click', function(e) { e.preventDefault(); - var action = $(this).attr('action'); - $('#bulk-action').val(action); + $('#bulk-action').val($(this).attr('action')); var allkeys = ''; - $('.selected').each(function(i, obj) { - // bulk-keys - var currentKey = $(obj).attr('videokey'); - if (currentKey != null) { - allkeys += currentKey + ','; + $('input[type=checkbox]').each(function () { + var checked = (this.checked ? true : false); + if (this.checked) { + allkeys += $(this).attr('videokey') + ','; } });