bouffeatulm/tpl/default/edit_users.html

95 lines
6.6 KiB
HTML
Raw Normal View History

{include="header"}
{if condition="$view == 'list_users'"}
2014-08-31 14:27:57 +02:00
<h2>{$i18n['users_list']}</h2>
<p class="center">{$i18n['you_can_also']} <a href="?do=add_user">{$i18n['add_user']}</a>.</p>
2013-08-30 20:07:52 +02:00
<table id="edit_users">
<tr>
2014-08-31 14:27:57 +02:00
<th>{$i18n['id']}</th>
<th>{$i18n['login']}</th>
<th>{$i18n['display_name']}</th>
<th>{$i18n['email_address']}</th>
<th>{$i18n['is_admin']}{$i18n['before_double_ponctuation']}?</th>
<th>{$i18n['edit']}</th>
<th>{$i18n['delete']}</th>
</tr>
{loop="users"}
<tr>
<td>{$value->getId()}</td>
<td>{$value->getLogin()}</td>
<td>{$value->getDisplayName()}</td>
<td>{$value->getEmail()}</td>
<td>{$value->getAdmin() ? "Yes" : "No"}</td>
2014-08-31 14:27:57 +02:00
<td><a href="index.php?do=edit_users&user_id={$value->getId()}">{$i18n['edit']}</a></td>
<td>{if condition="$value->getId() != $current_user->getId()"}<a href="index.php?do=delete_user&amp;user_id={$value->getId()}&amp;token={$token}">{$i18n['delete']}</a>{/if}</td>
</tr>
{/loop}
</table>
{elseif condition="$view == 'edit_user'"}
2014-08-31 14:27:57 +02:00
<h2>{$user_id != -1 ? $i18n['edit'] : $i18n['add']} {$i18n['a_user']}</h2>
2013-08-25 23:06:47 +02:00
<form method="post" action="index.php?do={$user_id != -1 ? 'edit_users' : 'add_user'}" id="edit_user_form">
<p>
2014-08-31 14:27:57 +02:00
<label for="login" class="label-block">{$i18n['login']}{$i18n['before_double_ponctuation']}: </label><input type="text" name="login" id="login" {if condition="$login_post != ''"} value="{$login_post}" {else} {$user_id != -1 ? 'value="'.$user_data->getLogin().'"' : ''} {/if}/>
</p>
<p>
2014-08-31 14:27:57 +02:00
<label for="display_name" class="label-block">{$i18n['display_name']} ({$i18n['optionnal']}){$i18n['before_double_ponctuation']}: </label><input type="text" name="display_name" id="display_name" {if condition="$display_name_post != ''"} value="{$display_name_post}" {else} {$user_id != -1 ? 'value="'.$user_data->getDisplayName().'"' : ''} {/if}/>
</p>
<p>
2014-08-31 14:27:57 +02:00
<label for="email" class="label-block">{$i18n['email_address']} ({$i18n['optionnal']}){$i18n['before_double_ponctuation']}: </label><input type="text" name="email" id="email" {if condition="$email_post != ''"} value="{$email_post}" {else} {$user_id != -1 ? 'value="'.$user_data->getEmail().'"' : ''} {/if}/>
</p>
<p>
2014-08-31 14:27:57 +02:00
<label for="notifications" class="label-block">{$i18n['notifications_for']} </label>
<select name="notifications" id="notifications">
2014-08-31 14:27:57 +02:00
<option value="1" {if condition="$user_id != -1 && $user_data->getNotifications() == 1"}selected="selected"{/if}>{$i18n['nothing']}.</option>
<option value="2" {if condition="$user_id != -1 && $user_data->getNotifications() == 2"}selected="selected"{/if}>{$i18n['notif_global_paybacks']}.</option>
<option value="3" {if condition="$user_id != -1 && $user_data->getNotifications() == 3"}selected="selected"{/if}>{$i18n['notif_everything']}.</option>
</select>
</p>
<p>
2014-08-31 14:27:57 +02:00
<label for="password" class="label-block">{$i18n['password']}{$i18n['before_double_ponctuation']}: </label><input type="password" name="password" id="password"/> <a href="" onclick="toggle_password('password'); return false;"><img src="img/toggleVisible.png" alt="Toggle visible"/></a>
{if condition="$user_id != -1"}
2014-08-31 14:27:57 +02:00
<br/><em>{$i18n['note']}{$i18n['before_double_ponctuation']}:</em> {$i18n['note_dont_edit_passwords']}
{/if}
</p>
<p id="edit_user_admin_rights">
2014-08-31 14:27:57 +02:00
{$i18n['give_admin_rights']}{$i18n['before_double_ponctuation']}?<br/>
<input type="radio" id="admin_yes" value="1" name="admin" {if condition="$admin_post == 1 || ($admin_post == -1 && $user_id != -1 && $user_data->getAdmin())"} checked{/if}/><label for="admin_yes">{$i18n['yes']}</label><br/>
<input type="radio" id="admin_no" value="0" name="admin" {if condition="$admin_post == 0 || ($admin_post == -1 && ($user_id == -1 || !$user_data->getAdmin()))"} checked{/if}/><label for="admin_no">{$i18n['no']}</label>
</p>
<p class="center">
2014-08-31 14:27:57 +02:00
<input type="submit" value="{$user_id != -1 ? $i18n['edit'] : $i18n['add']}"/>
{if condition="$user_id != -1"}<input type="hidden" name="user_id" value="{$user_id}"/>{/if}
<input type="hidden" name="token" value="{$token}"/>
</p>
</form>
{if condition="$user_id != -1"}
2014-08-31 14:27:57 +02:00
<h2>{$i18n['personal_token_user']}</h2>
<p>{$i18n['personal_token_user_is']}{$i18n['before_double_ponctuation']}: {$user_data->getJsonToken()}.<br/>{$i18n['compromised_token']} <a href="index.php?do=new_token&user_id={$user_data->getId()}&amp;token={$token}">{$i18n['generate_new_one']}</a>.</p>
{/if}
{elseif condition="$view == 'password'"}
2014-08-31 14:27:57 +02:00
<h2>{$i18n['edit_password']}</h2>
<form method="post" action="index.php?do=password" id="edit_password_form">
2014-08-31 14:27:57 +02:00
<p><label for="password" class="label-block">{$i18n['new_password']}{$i18n['before_double_ponctuation']}: </label><input type="password" id="password" name="password"/> <a href="" onclick="toggle_password('password'); return false;"><img src="img/toggleVisible.png" alt="{$i18n['toggle_visible']}"/></a></p>
<p><label for="password_confirm" class="label-block">{$i18n['confirm_new_password']}{$i18n['before_double_ponctuation']}: </label><input type="password" id="password_confirm" name="password_confirm"/> <a href="" onclick="toggle_password('password_confirm'); return false;"><img src="img/toggleVisible.png" alt="{$i18n['toggle_visible']}"/></a></p>
<p>
2014-08-31 14:27:57 +02:00
<label for="email" class="label-block">{$i18n['email_address']}{$i18n['before_double_ponctuation']}: </label><input type="text" name="email" id="email" value="{$current_user->getEmail()}"/>
</p>
<p>
2014-08-31 14:27:57 +02:00
<label for="notifications" class="label-block">{$i18n['notifications_for']} </label>
<select name="notifications" id="notifications">
2014-08-31 14:27:57 +02:00
<option value="1" {if condition="$current_user->getNotifications() == 1"}selected="selected"{/if}>{$i18n['nothing']}.</option>
<option value="2" {if condition="$current_user->getNotifications() == 2"}selected="selected"{/if}>{$i18n['notif_global_paybacks']}.</option>
<option value="3" {if condition="$current_user->getNotifications() == 3"}selected="selected"{/if}>{$i18n['notif_everything']}.</option>
</select>
</p>
2014-08-31 14:27:57 +02:00
<p><em>{$i18n['note']}{$i18n['before_double_ponctuation']}:</em> {$i18n['note_dont_edit_passwords']}</p>
<p class="center"><input type="submit" value="{$i18n['update']}"/><input type="hidden" name="token" value="{$token}"</p>
</form>
2014-08-31 14:27:57 +02:00
<h2>{$i18n['personal_token_title']}</h2>
<p>{$i18n['personal_token_is']}{$i18n['before_double_ponctuation']}: {$json_token}.<br/>{$i18n['compromised_token']} <a href="index.php?do=new_token&amp;token={$token}">{$i18n['generate_new_one']}</a>.</p>
{/if}
{include="footer"}