Use smarty template inheritance
[squasher.git] / templates / udmin.tpl
1 {extends file='layout.tpl'}
2
3
4 {block extra_head}
5 <script>
6    {literal}
7    function confirm_delete(formID) {
8     if (confirm("Are you sure you want to delete this user?")) {
9      document.getElementById(formID).submit();
10     }
11    }
12    {/literal}
13 </script>
14 {/block}
15
16
17 {block content}
18 {foreach item=user key=user_id from=$users}
19 <div class="white_border">
20         <form method='post' name='user_{$user.id|escape}' id='user_{$user.id|escape}'>
21         <input type='hidden' name='u[user_id]' id='user_id' value='{$user.id|escape}'>
22         <input type='hidden' name='type' id='type' value=''>
23         <input name='u[user_name]' id='user_name' value='{$user.name|escape}' readonly>
24          | {html_options name='u[user_level]' id='user_level' options=$user_levels selected=$user.level}
25          |
26                 {if $user.enabled}
27                 <a onClick="document.user_{$user.id}.type.value='disable';document.user_{$user.id}.submit();" style="cursor:pointer" >remove password</a>
28                 {else}
29                 <input name='u[user_pass]' id='user_pass'>
30                 {/if}
31          | <a onClick="document.user_{$user.id}.type.value='delete';confirm_delete('user_{$user.id}');" style="cursor:pointer" >delete</a>
32          | <a onClick="document.user_{$user.id}.type.value='update';document.user_{$user.id}.submit();" style="cursor:pointer" >update</a>
33         </form>
34 </div>
35 {/foreach}
36
37 <div class="white_border">
38         <form method='post' name='user_new' id='user_new'><input type='hidden' name='type' id='type' value=''>
39                 <input name='u[user_name]' value=''>
40                 | {html_options name='u[user_level]' options=$user_levels }
41                 | <input name='u[user_pass]'>
42                 | <a onClick="document.user_new.type.value='new';document.user_new.submit();" style="cursor:pointer" >add</a>
43         </form>
44 </div>
45 {/block}
46
47
48 {* vim: set syntax=smarty ts=4 sw=4 sts=4 sr noet: *}