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

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

add dark selectize theme + "ternary" template modifier

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