Changeset 28496 for trunk/admin/themes/default/template/cat_perm.tpl
- Timestamp:
- May 17, 2014, 5:33:37 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/themes/default/template/cat_perm.tpl
r25005 r28496 1 {combine_script id='jquery.chosen' load='footer' path='themes/default/js/plugins/chosen.jquery.min.js'} 2 {combine_css path="themes/default/js/plugins/chosen.css"} 1 {combine_script id='LocalStorageCache' load='footer' path='admin/themes/default/js/LocalStorageCache.js'} 3 2 4 {footer_script}{literal} 5 jQuery(document).ready(function() { 6 jQuery(".chzn-select").chosen(); 3 {combine_script id='jquery.selectize' load='footer' path='themes/default/js/plugins/selectize.min.js'} 4 {combine_css id='jquery.selectize' path="themes/default/js/plugins/selectize.default.css"} 7 5 8 function checkStatusOptions() { 9 if (jQuery("input[name=status]:checked").val() == "private") { 10 jQuery("#privateOptions, #applytoSubAction").show(); 11 } 12 else { 13 jQuery("#privateOptions, #applytoSubAction").hide(); 14 } 15 } 16 17 checkStatusOptions(); 18 jQuery("#selectStatus").change(function() { 19 checkStatusOptions(); 20 }); 21 22 jQuery("#indirectPermissionsDetailsShow").click(function(){ 23 jQuery("#indirectPermissionsDetailsShow").hide(); 24 jQuery("#indirectPermissionsDetailsHide").show(); 25 jQuery("#indirectPermissionsDetails").show(); 26 return false; 27 }); 28 29 jQuery("#indirectPermissionsDetailsHide").click(function(){ 30 jQuery("#indirectPermissionsDetailsShow").show(); 31 jQuery("#indirectPermissionsDetailsHide").hide(); 32 jQuery("#indirectPermissionsDetails").hide(); 33 return false; 6 {footer_script} 7 (function(){ 8 {* <!-- GROUPS --> *} 9 var groupsCache = new LocalStorageCache('groupsAdminList', 5*60, function(callback) { 10 jQuery.getJSON('{$ROOT_URL}ws.php?format=json&method=pwg.groups.getList&per_page=99999', function(data) { 11 callback(data.result.groups); 34 12 }); 35 13 }); 36 {/literal}{/footer_script} 14 15 jQuery('[data-selectize=groups]').selectize({ 16 valueField: 'id', 17 labelField: 'name', 18 searchField: ['name'], 19 plugins: ['remove_button'] 20 }); 21 22 groupsCache.get(function(groups) { 23 jQuery('[data-selectize=groups]').each(function() { 24 this.selectize.load(function(callback) { 25 callback(groups); 26 }); 27 28 jQuery.each(jQuery(this).data('value'), jQuery.proxy(function(i, id) { 29 this.selectize.addItem(id); 30 }, this)); 31 }); 32 }); 33 34 {* <!-- USERS --> *} 35 var usersCache = new LocalStorageCache('usersAdminList', 5*60, function(callback) { 36 var page = 0, 37 users = []; 38 39 (function load(page){ 40 jQuery.getJSON('{$ROOT_URL}ws.php?format=json&method=pwg.users.getList&display=username&per_page=99999&page='+ page, function(data) { 41 users = users.concat(data.result.users); 42 43 if (data.result.paging.count == data.result.paging.per_page) { 44 load(++page); 45 } 46 else { 47 callback(users); 48 } 49 }); 50 }(page)); 51 }); 52 53 jQuery('[data-selectize=users]').selectize({ 54 valueField: 'id', 55 labelField: 'username', 56 searchField: ['username'], 57 plugins: ['remove_button'] 58 }); 59 60 usersCache.get(function(users) { 61 jQuery('[data-selectize=users]').each(function() { 62 this.selectize.load(function(callback) { 63 callback(users); 64 }); 65 66 jQuery.each(jQuery(this).data('value'), jQuery.proxy(function(i, id) { 67 this.selectize.addItem(id); 68 }, this)); 69 }); 70 }); 71 }()); 72 {/footer_script} 37 73 38 74 <div class="titrePage"> … … 59 95 <strong>{'Permission granted for groups'|@translate}</strong> 60 96 <br> 61 <select data-placeholder="{'Select groups...'|@translate}" class="chzn-select" multiple style="width:700px;" name="groups[]"> 62 {html_options options=$groups selected=$groups_selected} 63 </select> 97 <select data-selectize="groups" data-value="{$groups_selected|@json_encode|escape:html}" 98 name="groups[]" multiple style="width:600px;" ></select> 64 99 {else} 65 100 {'There is no group in this gallery.'|@translate} <a href="admin.php?page=group_list" class="externalLink">{'Group management'|@translate}</a> … … 70 105 <strong>{'Permission granted for users'|@translate}</strong> 71 106 <br> 72 <select data-placeholder="{'Select users...'|@translate}" class="chzn-select" multiple style="width:700px;" name="users[]"> 73 {html_options options=$users selected=$users_selected} 74 </select> 107 <select data-selectize="users" data-value="{$users_selected|@json_encode|escape:html}" 108 name="users[]" multiple style="width:600px;" ></select> 75 109 </p> 76 110 77 {if isset($nb_users_granted_indirect) }111 {if isset($nb_users_granted_indirect) && $nb_users_granted_indirect>0} 78 112 <p> 79 113 {'%u users have automatic permission because they belong to a granted group.'|@translate:$nb_users_granted_indirect}
Note: See TracChangeset
for help on using the changeset viewer.