source: extensions/community/admin_permissions.tpl @ 9500

Last change on this file since 9500 was 9500, checked in by plg, 13 years ago

a permission may not automatically apply to sub-albums

in the upload form, the album list does not show private (and unreachable for
the user) albums and public albums that contains photos invisible to the user.

File size: 4.5 KB
Line 
1{literal}
2<style>
3form fieldset p {text-align:left;margin:0 0 1.5em 0;line-height:20px;}
4</style>
5{/literal}
6
7{footer_script}{literal}
8$(document).ready(function() {
9  $("select[name=who]").click(function () {
10    $("[name^=who_]").hide();
11    $("[name=who_"+$(this).attr("value")+"]").show();
12  });
13
14  function checkWhereOptions() {
15    var recursive = $("input[name=recursive]");
16    var create = $("input[name=create_subcategories]");
17
18    if ($("select[name=category] option:selected").val() == 0) {
19      $(recursive).attr("disabled", true);
20      $(recursive).attr('checked', true);
21    }
22    else {
23      $(recursive).removeAttr("disabled");
24    }
25
26    if (!$(recursive).is(':checked')) {
27      $(create).attr('checked', false);
28      $(create).attr("disabled", true);
29    }
30    else {
31      $(create).removeAttr("disabled");
32    }
33  }
34
35  checkWhereOptions();
36
37  $("select[name=category]").change(function() {
38    checkWhereOptions();
39  });
40
41  $("input[name=recursive]").change(function() {
42    checkWhereOptions();
43  });
44
45  $("#displayForm").click(function() {
46    $("[name=add_permission]").show();
47    $(this).hide();
48    return false;
49  });
50});
51{/literal}{/footer_script}
52
53
54<div class="titrePage">
55  <h2>{'Upload Permissions'|@translate} - {'Community'|@translate}</h2>
56</div>
57
58<a id="displayForm" href="#">{'Add a permission'|@translate}</a>
59
60<form method="post" name="add_permission" action="{$F_ADD_ACTION}" class="properties" style="display:none">
61  <fieldset>
62    <legend>{'Add a permission'|@translate}</legend>
63
64    <p>
65      <strong>{'Who?'|@translate}</strong>
66      <br>
67      <select name="who">
68        <option value="any_visitor">{'any visitor'|@translate}</option>
69        <option value="any_registered_user">{'any registered user'|@translate}</option>
70        <option value="user">{'a specific user'|@translate}</option>
71        <option value="group">{'a group'|@translate}</option>
72      </select>
73
74      <select name="who_user" style="display:none">
75{html_options options=$user_options selected=$user_options_selected}
76      </select>
77
78      <select name="who_group" style="display:none">
79{html_options options=$group_options selected=$group_options_selected}
80      </select>
81    </p>
82
83    <p>
84      <strong>{'Where?'|@translate}</strong>
85      <br>
86      <select class="categoryDropDown" name="category">
87        <option value="0">{'The whole gallery'|@translate}</option>
88        <option disabled="disabled">------------</option>
89        {html_options options=$category_options selected=$category_options_selected}
90      </select>
91      <br>
92      <label><input type="checkbox" name="recursive" checked="checked"> {'Apply to sub-albums'|@translate}</label>
93      <br>
94      <label><input type="checkbox" name="create_subcategories"> {'ability to create sub-albums'|@translate}</label>
95    </p>
96
97    <p>
98      <strong>{'Which level of trust?'|@translate}</strong>
99      <br><label><input type="radio" name="moderate" value="true" checked="checked"> <em>{'low trust'|@translate}</em> : {'uploaded photos must be validated by an administrator'|@translate}</label>
100      <br><label><input type="radio" name="moderate" value="false"> <em>{'high trust'|@translate}</em> : {'uploaded photos are directly displayed in the gallery'|@translate}</label>
101    </p>
102   
103    <p style="margin:0;">
104      <input class="submit" type="submit" name="submit_add" value="{'Add'|@translate}"/>
105    </p>
106  </fieldset>
107</form>
108
109<table class="table2" style="margin:15px auto;">
110  <tr class="throw">
111    <th>{'Who?'|@translate}</th>
112    <th>{'Where?'|@translate}</th>
113    <th>{'Options'|@translate}</th>
114    <th>{'Actions'|@translate}</th>
115  </tr>
116{if not empty($permissions)}
117  {foreach from=$permissions item=permission name=permission_loop}
118  <tr class="{if $smarty.foreach.permission_loop.index is odd}row1{else}row2{/if}">
119    <td>{$permission.WHO}</td>
120    <td>{$permission.WHERE}</td>
121    <td>
122      <span title="{$permission.TRUST_TOOLTIP}">{$permission.TRUST}</span>
123    {if $permission.RECURSIVE}
124, <span title="{$permission.RECURSIVE_TOOLTIP}">{'sub-albums'|@translate}</span>
125    {/if}
126    {if $permission.CREATE_SUBCATEGORIES}
127, {'sub-albums creation'|@translate}
128    {/if}
129    </td>
130    <td style="text-align:center;">
131      <a href="{$permission.U_DELETE}" onclick="return confirm( document.getElementById('btn_delete').title + '\n\n' + '{'Are you sure?'|@translate|@escape:'javascript'}');">
132        <img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/delete.png" class="button" style="border:none" id="btn_delete" alt="{'delete'|@translate}" title="{'delete'|@translate}" />
133      </a>
134    </td>
135  </tr>
136  {/foreach}
137{/if}
138</table>
Note: See TracBrowser for help on using the repository browser.