source: extensions/community/admin_permissions.tpl @ 9672

Last change on this file since 9672 was 9510, checked in by plg, 14 years ago

edit a permission

File size: 5.3 KB
RevLine 
[9372]1{literal}
2<style>
3form fieldset p {text-align:left;margin:0 0 1.5em 0;line-height:20px;}
[9510]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}
[9372]8</style>
9{/literal}
10
11{footer_script}{literal}
12$(document).ready(function() {
13  $("select[name=who]").click(function () {
14    $("[name^=who_]").hide();
15    $("[name=who_"+$(this).attr("value")+"]").show();
16  });
17
[9500]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
[9372]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
[9510]62{if not isset($edit)}
[9372]63<a id="displayForm" href="#">{'Add a permission'|@translate}</a>
[9510]64{/if}
[9372]65
[9510]66<form method="post" name="add_permission" action="{$F_ADD_ACTION}" class="properties" {if not isset($edit)}style="display:none"{/if}>
[9372]67  <fieldset>
[9510]68    <legend>{if isset($edit)}{'Edit a permission'|@translate}{else}{'Add a permission'|@translate}{/if}</legend>
[9372]69
70    <p>
71      <strong>{'Who?'|@translate}</strong>
72      <br>
73      <select name="who">
[9510]74{html_options options=$who_options selected=$who_options_selected}
[9372]75      </select>
76
[9510]77      <select name="who_user" {if not isset($user_options_selected)}style="display:none"{/if}>
[9372]78{html_options options=$user_options selected=$user_options_selected}
79      </select>
80
[9510]81      <select name="who_group" {if not isset($group_options_selected)}style="display:none"{/if}>
[9372]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">
[9510]90        <option value="0" {if not isset($category_options_selected)}selected="selected"{/if}>{'The whole gallery'|@translate}</option>
[9372]91        <option disabled="disabled">------------</option>
92        {html_options options=$category_options selected=$category_options_selected}
93      </select>
94      <br>
[9510]95      <label><input type="checkbox" name="recursive" {if $recursive}checked="checked"{/if}> {'Apply to sub-albums'|@translate}</label>
[9500]96      <br>
[9510]97      <label><input type="checkbox" name="create_subcategories" {if $create_subcategories}checked="checked"{/if}> {'ability to create sub-albums'|@translate}</label>
[9372]98    </p>
99
100    <p>
101      <strong>{'Which level of trust?'|@translate}</strong>
[9510]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>
[9372]104    </p>
[9510]105
106    {if isset($edit)}
107      <input type="hidden" name="edit" value="{$edit}">
108    {/if}
[9372]109   
110    <p style="margin:0;">
[9510]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>
[9372]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}
[9510]126  <tr class="{if $smarty.foreach.permission_loop.index is odd}row1{else}row2{/if}{if $permission.HIGHLIGHT} rowSelected{/if}">
[9372]127    <td>{$permission.WHO}</td>
128    <td>{$permission.WHERE}</td>
129    <td>
130      <span title="{$permission.TRUST_TOOLTIP}">{$permission.TRUST}</span>
[9500]131    {if $permission.RECURSIVE}
132, <span title="{$permission.RECURSIVE_TOOLTIP}">{'sub-albums'|@translate}</span>
133    {/if}
[9372]134    {if $permission.CREATE_SUBCATEGORIES}
135, {'sub-albums creation'|@translate}
136    {/if}
137    </td>
[9510]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>
[9372]142      <a href="{$permission.U_DELETE}" onclick="return confirm( document.getElementById('btn_delete').title + '\n\n' + '{'Are you sure?'|@translate|@escape:'javascript'}');">
[9510]143        <img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/delete.png" id="btn_delete" alt="{'delete'|@translate}" title="{'Delete permission'|@translate}" />
[9372]144      </a>
145    </td>
146  </tr>
147  {/foreach}
148{/if}
149</table>
Note: See TracBrowser for help on using the repository browser.