source: trunk/admin/themes/default/template/cat_perm.tpl @ 28555

Last change on this file since 28555 was 28555, checked in by mistic100, 10 years ago

feature 3077 : fix addAlbum process when creating the first ever album, improve data API

  • Property svn:eol-style set to LF
File size: 6.1 KB
Line 
1{combine_script id='LocalStorageCache' load='footer' path='admin/themes/default/js/LocalStorageCache.js'}
2
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"}
5
6{footer_script}
7(function(){
8{* <!-- GROUPS --> *}
9var groupsCache = new GroupsCache({
10  serverKey: '{$CACHE_KEYS.groups}',
11  serverId: '{$CACHE_KEYS._hash}',
12  rootUrl: '{$ROOT_URL}'
13});
14
15groupsCache.selectize(jQuery('[data-selectize=groups]'));
16
17{* <!-- USERS --> *}
18var usersCache = new UsersCache({
19  serverKey: '{$CACHE_KEYS.users}',
20  serverId: '{$CACHE_KEYS._hash}',
21  rootUrl: '{$ROOT_URL}'
22});
23
24usersCache.selectize(jQuery('[data-selectize=users]'));
25
26{* <!-- TOGGLES --> *}
27function checkStatusOptions() {
28  if (jQuery("input[name=status]:checked").val() == "private") {
29    jQuery("#privateOptions, #applytoSubAction").show();
30  }
31  else {
32    jQuery("#privateOptions, #applytoSubAction").hide();
33  }
34}
35
36checkStatusOptions();
37jQuery("#selectStatus").change(function() {
38  checkStatusOptions();
39});
40
41{if isset($nb_users_granted_indirect) && $nb_users_granted_indirect>0}
42  jQuery(".toggle-indirectPermissions").click(function(e){
43    jQuery(".toggle-indirectPermissions").toggle();
44    jQuery("#indirectPermissionsDetails").toggle();
45    e.preventDefault();
46  });
47{/if}
48}());
49{/footer_script}
50
51<div class="titrePage">
52  <h2><span style="letter-spacing:0">{$CATEGORIES_NAV}</span> &#8250; {'Edit album'|@translate} {$TABSHEET_TITLE}</h2>
53</div>
54
55<form action="{$F_ACTION}" method="post" id="categoryPermissions">
56
57<fieldset>
58  <legend>{'Access type'|@translate}</legend>
59
60  <p id="selectStatus">
61    <label><input type="radio" name="status" value="public" {if not $private}checked="checked"{/if}> <strong>{'public'|@translate}</strong> : <em>{'any visitor can see this album'|@translate}</em></label>
62    <br>
63    <label><input type="radio" name="status" value="private" {if $private}checked="checked"{/if}> <strong>{'private'|@translate}</strong> : <em>{'visitors need to login and have the appropriate permissions to see this album'|@translate}</em></label>
64  </p>
65</fieldset>
66
67<fieldset id="privateOptions">
68  <legend>{'Groups and users'|@translate}</legend>
69
70  <p>
71{if count($groups) > 0}
72    <strong>{'Permission granted for groups'|@translate}</strong>
73    <br>
74    <select data-selectize="groups" data-value="{$groups_selected|@json_encode|escape:html}"
75      placeholder="{'Type in a search term'|translate}"
76      name="groups[]" multiple style="width:600px;"></select>
77{else}
78    {'There is no group in this gallery.'|@translate} <a href="admin.php?page=group_list" class="externalLink">{'Group management'|@translate}</a>
79{/if}
80  </p>
81
82  <p>
83    <strong>{'Permission granted for users'|@translate}</strong>
84    <br>
85    <select data-selectize="users" data-value="{$users_selected|@json_encode|escape:html}"
86      placeholder="{'Type in a search term'|translate}"
87      name="users[]" multiple style="width:600px;"></select>
88  </p>
89
90{if isset($nb_users_granted_indirect) && $nb_users_granted_indirect>0}
91  <p>
92    {'%u users have automatic permission because they belong to a granted group.'|@translate:$nb_users_granted_indirect}
93    <a href="#" class="toggle-indirectPermissions" style="display:none">{'hide details'|@translate}</a>
94    <a href="#" class="toggle-indirectPermissions">{'show details'|@translate}</a>
95
96    <ul id="indirectPermissionsDetails" style="display:none">
97  {foreach from=$user_granted_indirect_groups item=group_details}
98      <li><strong>{$group_details.group_name}</strong> : {$group_details.group_users}</li>
99  {/foreach}
100    </ul>
101  </p>
102{/if}
103
104{*
105  <h4>{'Groups'|@translate}</h4>
106
107  <fieldset>
108    <legend>{'Permission granted'|@translate}</legend>
109    <ul>
110      {foreach from=$group_granted_ids item=id}
111      <li><label><input type="checkbox" name="deny_groups[]" value="{$id}"> {$all_groups[$id]}</label></li>
112      {/foreach}
113    </ul>
114    <input class="submit" type="submit" name="deny_groups_submit" value="{'Deny selected groups'|@translate}">
115  </fieldset>
116
117  <fieldset>
118    <legend>{'Permission denied'|@translate}</legend>
119    <ul>
120      {foreach from=$group_denied_ids item=id}
121      <li><label><input type="checkbox" name="grant_groups[]" value="{$id}"> {$all_groups[$id]}</label></li>
122      {/foreach}
123    </ul>
124    <input class="submit" type="submit" name="grant_groups_submit" value="{'Grant selected groups'|@translate}">
125    <label><input type="checkbox" name="apply_on_sub">{'Apply to sub-albums'|@translate}</label>
126  </fieldset>
127
128  <h4>{'Users'|@translate}</h4>
129
130  <fieldset>
131    <legend>{'Permission granted'|@translate}</legend>
132    <ul>
133      {foreach from=$user_granted_direct_ids item=id}
134      <li><label><input type="checkbox" name="deny_users[]" value="{$id}"> {$all_users[$id]}</label></li>
135      {/foreach}
136    </ul>
137    <input class="submit" type="submit" name="deny_users_submit" value="{'Deny selected users'|@translate}">
138  </fieldset>
139
140  <fieldset>
141    <legend>{'Permission granted thanks to a group'|@translate}</legend>
142    {if isset($user_granted_indirects) }
143    <ul>
144      {foreach from=$user_granted_indirects item=user_group}
145      <li>{$user_group.USER} ({$user_group.GROUP})</li>
146      {/foreach}
147    </ul>
148    {/if}
149  </fieldset>
150
151  <fieldset>
152    <legend>{'Permission denied'|@translate}</legend>
153    <ul>
154      {foreach from=$user_denied_ids item=id}
155      <li><label><input type="checkbox" name="grant_users[]" value="{$id}"> {$all_users[$id]}</label></li>
156      {/foreach}
157    </ul>
158    <input class="submit" type="submit" name="grant_users_submit" value="{'Grant selected users'|@translate}">
159    <label><input type="checkbox" name="apply_on_sub">{'Apply to sub-albums'|@translate}</label>
160  </fieldset>
161*}
162</fieldset>
163
164  <p style="margin:12px;text-align:left;">
165    <input class="submit" type="submit" value="{'Save Settings'|@translate}" name="submit">
166    <label id="applytoSubAction" style="display:none;">
167      <input type="checkbox" name="apply_on_sub" {if $INHERIT}checked="checked"{/if}>
168      {'Apply to sub-albums'|@translate}
169    </label>
170  </p>
171
172<input type="hidden" name="pwg_token" value="{$PWG_TOKEN}">
173</form>
Note: See TracBrowser for help on using the repository browser.