source: extensions/community/admin_permissions.tpl @ 11217

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

on a select, Chrome doesn't trigger anything on click(), use change() instead

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