minor form styling, adding check all/uncheck all buttons, fixing url entities in forms

This commit is contained in:
Pepijn Over 2014-07-31 14:37:27 +02:00
parent c589424bce
commit ca7fdf1ec5
21 changed files with 292 additions and 177 deletions

View File

@ -58,6 +58,8 @@ $sm_lang = array(
'a_minute_ago' => 'преди минута',
'seconds_ago' => 'преди %d секунди',
'a_second_ago' => 'преди секунда',
'check_all' => 'Check all',
'uncheck_all' => 'Uncheck all',
),
'menu' => array(
'config' => 'Настройки',
@ -82,8 +84,10 @@ $sm_lang = array(
'mobile' => 'Мобилен телефон',
'email' => 'Имейл',
'pushover' => 'Pushover',
'pushover_description' => 'Pushover is a service that makes it easy to get real-time notifications. See <a href="https://pushover.net/">their website</a> for more info.',
'pushover_key' => 'Pushover Key',
'pushover_device' => 'Pushover Device',
'pushover_device_description' => 'Device name to send the message to. Leave empty to send it to all devices.',
'delete_title' => 'Изтриване на потребител',
'delete_message' => 'Сигурни ли сте, че искате да изтриете потребител \'%1\'?',
'deleted' => 'Потребителят е изтрит успешно.',

View File

@ -58,6 +58,8 @@ $sm_lang = array(
'a_minute_ago' => 'omkring et minut siden',
'seconds_ago' => '%d sekunder siden',
'a_second_ago' => 'et sekund siden',
'check_all' => 'Check all',
'uncheck_all' => 'Uncheck all',
),
'menu' => array(
'config' => 'Indstillinger',
@ -82,8 +84,10 @@ $sm_lang = array(
'mobile' => 'Mobil',
'email' => 'Email',
'pushover' => 'Pushover',
'pushover_description' => 'Pushover is a service that makes it easy to get real-time notifications. See <a href="https://pushover.net/">their website</a> for more info.',
'pushover_key' => 'Pushover Key',
'pushover_device' => 'Pushover Device',
'pushover_device_description' => 'Device name to send the message to. Leave empty to send it to all devices.',
'delete_title' => 'Slet bruger',
'delete_message' => 'Er du sikker på du vil slette bruger \'%1\'?',
'deleted' => 'Bruger slettet.',

View File

@ -58,6 +58,8 @@ $sm_lang = array(
'a_minute_ago' => 'about a minute ago',
'seconds_ago' => '%d seconds ago',
'a_second_ago' => 'a second ago',
'check_all' => 'Check all',
'uncheck_all' => 'Uncheck all',
),
'menu' => array(
'config' => 'Einstellungen',
@ -82,8 +84,10 @@ $sm_lang = array(
'mobile' => 'Mobil',
'email' => 'Email',
'pushover' => 'Pushover',
'pushover_description' => 'Pushover is a service that makes it easy to get real-time notifications. See <a href="https://pushover.net/">their website</a> for more info.',
'pushover_key' => 'Pushover Key',
'pushover_device' => 'Pushover Device',
'pushover_device_description' => 'Device name to send the message to. Leave empty to send it to all devices.',
'delete_title' => 'Delete User',
'delete_message' => 'Are you sure you want to delete user \'%1\'?',
'deleted' => 'User deleted.',

View File

@ -58,6 +58,8 @@ $sm_lang = array(
'a_minute_ago' => 'about a minute ago',
'seconds_ago' => '%d seconds ago',
'a_second_ago' => 'a second ago',
'check_all' => 'Check all',
'uncheck_all' => 'Uncheck all',
),
'menu' => array(
'config' => 'Config',
@ -82,8 +84,10 @@ $sm_lang = array(
'mobile' => 'Mobile',
'email' => 'Email',
'pushover' => 'Pushover',
'pushover_description' => 'Pushover is a service that makes it easy to get real-time notifications. See <a href="https://pushover.net/">their website</a> for more info.',
'pushover_key' => 'Pushover Key',
'pushover_device' => 'Pushover Device',
'pushover_device_description' => 'Device name to send the message to. Leave empty to send it to all devices.',
'delete_title' => 'Delete User',
'delete_message' => 'Are you sure you want to delete user \'%1\'?',
'deleted' => 'User deleted.',

View File

@ -58,6 +58,8 @@ $sm_lang = array(
'a_minute_ago' => 'about a minute ago',
'seconds_ago' => '%d seconds ago',
'a_second_ago' => 'a second ago',
'check_all' => 'Check all',
'uncheck_all' => 'Uncheck all',
),
'menu' => array(
'config' => 'Configurar',
@ -82,8 +84,10 @@ $sm_lang = array(
'mobile' => 'Mobil',
'email' => 'Email',
'pushover' => 'Pushover',
'pushover_description' => 'Pushover is a service that makes it easy to get real-time notifications. See <a href="https://pushover.net/">their website</a> for more info.',
'pushover_key' => 'Pushover Key',
'pushover_device' => 'Pushover Device',
'pushover_device_description' => 'Device name to send the message to. Leave empty to send it to all devices.',
'delete_title' => 'Delete User',
'delete_message' => 'Are you sure you want to delete user \'%1\'?',
'deleted' => 'User deleted.',

View File

@ -58,6 +58,8 @@ $sm_lang = array(
'a_minute_ago' => 'Il y a une minute',
'seconds_ago' => 'Il y a %d secondes',
'a_second_ago' => 'Il y a une seconde',
'check_all' => 'Check all',
'uncheck_all' => 'Uncheck all',
),
'menu' => array(
'config' => 'Configuration',
@ -82,8 +84,10 @@ $sm_lang = array(
'mobile' => 'Téléphone',
'email' => 'Email',
'pushover' => 'Pushover',
'pushover_description' => 'Pushover is a service that makes it easy to get real-time notifications. See <a href="https://pushover.net/">their website</a> for more info.',
'pushover_key' => 'Pushover Key',
'pushover_device' => 'Pushover Device',
'pushover_device_description' => 'Device name to send the message to. Leave empty to send it to all devices.',
'delete_title' => 'Supprimer un utilisateur',
'delete_message' => 'Êtes-vous sûr de vouloir supprimer l\'utilisateur \'%1\' ?',
'deleted' => 'Utilisateur supprimé.',

View File

@ -58,6 +58,8 @@ $sm_lang = array(
'a_minute_ago' => 'about a minute ago',
'seconds_ago' => '%d seconds ago',
'a_second_ago' => 'a second ago',
'check_all' => 'Check all',
'uncheck_all' => 'Uncheck all',
),
'menu' => array(
'config' => 'Configurazione',
@ -82,8 +84,10 @@ $sm_lang = array(
'mobile' => 'Cellulare',
'email' => 'Email',
'pushover' => 'Pushover',
'pushover_description' => 'Pushover is a service that makes it easy to get real-time notifications. See <a href="https://pushover.net/">their website</a> for more info.',
'pushover_key' => 'Pushover Key',
'pushover_device' => 'Pushover Device',
'pushover_device_description' => 'Device name to send the message to. Leave empty to send it to all devices.',
'delete_title' => 'Delete User',
'delete_message' => 'Are you sure you want to delete user \'%1\'?',
'deleted' => 'User deleted.',

View File

@ -58,6 +58,8 @@ $sm_lang = array(
'a_minute_ago' => 'about a minute ago',
'seconds_ago' => '%d seconds ago',
'a_second_ago' => 'a second ago',
'check_all' => 'Check all',
'uncheck_all' => 'Uncheck all',
),
'menu' => array(
'config' => '설정',
@ -82,8 +84,10 @@ $sm_lang = array(
'mobile' => '휴대폰',
'email' => 'Email',
'pushover' => 'Pushover',
'pushover_description' => 'Pushover is a service that makes it easy to get real-time notifications. See <a href="https://pushover.net/">their website</a> for more info.',
'pushover_key' => 'Pushover Key',
'pushover_device' => 'Pushover Device',
'pushover_device_description' => 'Device name to send the message to. Leave empty to send it to all devices.',
'delete_title' => 'Delete User',
'delete_message' => 'Are you sure you want to delete user \'%1\'?',
'deleted' => 'User deleted.',

View File

@ -58,6 +58,8 @@ $sm_lang = array(
'a_minute_ago' => 'een minuut geleden',
'seconds_ago' => '%d seconden geleden',
'a_second_ago' => 'een seconde geleden',
'check_all' => 'Check all',
'uncheck_all' => 'Uncheck all',
),
'menu' => array(
'config' => 'Config',
@ -82,8 +84,10 @@ $sm_lang = array(
'mobile' => 'Mobiel',
'email' => 'Email',
'pushover' => 'Pushover',
'pushover_description' => 'Pushover is a service that makes it easy to get real-time notifications. See <a href="https://pushover.net/">their website</a> for more info.',
'pushover_key' => 'Pushover Key',
'pushover_device' => 'Pushover Device',
'pushover_device_description' => 'Device name to send the message to. Leave empty to send it to all devices.',
'delete_title' => 'Delete User',
'delete_message' => 'Are you sure you want to delete user \'%1\'?',
'deleted' => 'User deleted.',

View File

@ -58,6 +58,8 @@ $sm_lang = array(
'a_minute_ago' => 'cerca de um minuto atrás',
'seconds_ago' => '%d segundos atrás',
'a_second_ago' => 'um segundo atrás',
'check_all' => 'Check all',
'uncheck_all' => 'Uncheck all',
),
'menu' => array(
'config' => 'Configuração',
@ -82,8 +84,10 @@ $sm_lang = array(
'mobile' => 'Celular',
'email' => 'Email',
'pushover' => 'Pushover',
'pushover_description' => 'Pushover is a service that makes it easy to get real-time notifications. See <a href="https://pushover.net/">their website</a> for more info.',
'pushover_key' => 'Pushover Key',
'pushover_device' => 'Pushover Device',
'pushover_device_description' => 'Device name to send the message to. Leave empty to send it to all devices.',
'delete_title' => 'Delete User',
'delete_message' => 'Are you sure you want to delete user \'%1\'?',
'deleted' => 'User deleted.',

View File

@ -58,6 +58,8 @@ $sm_lang = array(
'a_minute_ago' => 'минуту назад',
'seconds_ago' => '%d секунд назад',
'a_second_ago' => 'секунду назад',
'check_all' => 'Check all',
'uncheck_all' => 'Uncheck all',
),
'menu' => array(
'config' => 'Параметры',
@ -82,8 +84,10 @@ $sm_lang = array(
'mobile' => 'Телефон',
'email' => 'Email',
'pushover' => 'Pushover',
'pushover_description' => 'Pushover is a service that makes it easy to get real-time notifications. See <a href="https://pushover.net/">their website</a> for more info.',
'pushover_key' => 'Pushover Key',
'pushover_device' => 'Pushover Device',
'pushover_device_description' => 'Device name to send the message to. Leave empty to send it to all devices.',
'delete_title' => 'Удалить пользователя',
'delete_message' => 'Вы точно хотите удалить пользователя \'%1\'?',
'deleted' => 'Пользователь удален.',

View File

@ -58,6 +58,8 @@ $sm_lang = array(
'a_minute_ago' => '1分钟前',
'seconds_ago' => '%d 秒前',
'a_second_ago' => '刚刚',
'check_all' => 'Check all',
'uncheck_all' => 'Uncheck all',
),
'menu' => array(
'config' => '设置',
@ -82,8 +84,10 @@ $sm_lang = array(
'mobile' => '手机',
'email' => '邮件',
'pushover' => 'Pushover',
'pushover_description' => 'Pushover is a service that makes it easy to get real-time notifications. See <a href="https://pushover.net/">their website</a> for more info.',
'pushover_key' => 'Pushover Key',
'pushover_device' => 'Pushover Device',
'pushover_device_description' => 'Device name to send the message to. Leave empty to send it to all devices.',
'delete_title' => 'Delete User',
'delete_message' => 'Are you sure you want to delete user \'%1\'?',
'deleted' => 'User deleted.',

View File

@ -103,11 +103,6 @@ abstract class AbstractServerController extends AbstractController {
$server['email'] = psm_get_lang('system', $server['email']);
$server['sms'] = psm_get_lang('system', $server['sms']);
$server['pushover'] = psm_get_lang('system', $server['pushover']);
$server['url_view'] = psm_build_url(array(
'mod' => 'server',
'action' => 'view',
'id' => $server['server_id'],
));
if($server['status'] == 'on' && $server['warning_threshold_counter'] > 0) {
$server['status'] = 'warning';
@ -117,6 +112,15 @@ abstract class AbstractServerController extends AbstractController {
$server['type'] = psm_get_lang('servers', 'type_' . $server['type']);
$server['timeout'] = ($server['timeout'] > 0) ? $server['timeout'] : PSM_CURL_TIMEOUT;
$url_actions = array('delete', 'edit', 'view');
foreach($url_actions as $action) {
$server['url_' . $action] = psm_build_url(array(
'mod' => 'server',
'action' => $action,
'id' => $server['server_id'],
));
}
return $server;
}
}

View File

@ -355,9 +355,12 @@ class ServerController extends AbstractServerController {
if($this->user->getUserLevel() == PSM_USER_ADMIN) {
$tpl_id_actions = 'server_view_admin_actions';
$this->tpl->newTemplate($tpl_id_actions, 'server/view.tpl.html');
$tpl_data['html_actions'] = $this->tpl->getTemplate($tpl_id_actions);
// template magic: push the actions html to the front of the server array
// so the template handler will add it first. that way the other server vars
// will also be replaced in the html_actions template itself
$tpl_data = array('html_actions' => $this->tpl->getTemplate($tpl_id_actions)) + $tpl_data;
$tpl_data['url_edit'] = psm_build_url(array('mod' => 'server', 'action' => 'edit', 'id' => $this->server_id, 'back_to' => 'view'));
$tpl_data['url_delete'] = psm_build_url(array('mod' => 'server', 'action' => 'delete', 'id' => $this->server_id));
$tpl_data['server_name'] = $server['label'];
$modal = new \psm\Util\Module\Modal($this->tpl, 'delete', \psm\Util\Module\Modal::MODAL_TYPE_DANGER);
@ -432,6 +435,8 @@ class ServerController extends AbstractServerController {
'label_yes' => psm_get_lang('system', 'yes'),
'label_no' => psm_get_lang('system', 'no'),
'label_add_new' => psm_get_lang('system', 'add_new'),
'label_check_all' => psm_get_lang('system', 'check_all'),
'label_uncheck_all' => psm_get_lang('system', 'uncheck_all'),
)
);

View File

@ -132,8 +132,11 @@ class ProfileController extends AbstractController {
'label_password_repeat' => psm_get_lang('users', 'password_repeat'),
'label_level' => psm_get_lang('users', 'level'),
'label_mobile' => psm_get_lang('users', 'mobile'),
'label_pushover' => psm_get_lang('users', 'pushover'),
'label_pushover_description' => psm_get_lang('users', 'pushover_description'),
'label_pushover_key' => psm_get_lang('users', 'pushover_key'),
'label_pushover_device' => psm_get_lang('users', 'pushover_device'),
'label_pushover_device_description' => psm_get_lang('users', 'pushover_device_description'),
'label_email' => psm_get_lang('users', 'email'),
'label_save' => psm_get_lang('system', 'save'),
)

View File

@ -111,6 +111,17 @@ class UserController extends AbstractController {
$user['emp_servers'] .= $servers_labels[$server_id] . '<br/>';
}
$user['emp_servers'] = substr($user['emp_servers'], 0, -5);
$user['url_delete'] = psm_build_url(array(
'mod' => 'user',
'action' => 'delete',
'id' => $user['user_id'],
));
$user['url_edit'] = psm_build_url(array(
'mod' => 'user',
'action' => 'edit',
'id' => $user['user_id'],
));
}
$this->tpl->addTemplateDataRepeat($this->getTemplateId(), 'users', $users);
}
@ -166,6 +177,11 @@ class UserController extends AbstractController {
'titlemode' => $title,
'placeholder_password' => $placeholder_password,
'edit_user_id' => $user_id,
'url_save' => psm_build_url(array(
'mod' => 'user',
'action' => 'save',
'id' => $user_id,
)),
);
foreach($fields_prefill as $field) {
if(isset($edit_user->$field)) {
@ -301,8 +317,10 @@ class UserController extends AbstractController {
'label_level_description' => psm_get_lang('users', 'level_description'),
'label_mobile' => psm_get_lang('users', 'mobile'),
'label_pushover' => psm_get_lang('users', 'pushover'),
'label_pushover_description' => psm_get_lang('users', 'pushover_description'),
'label_pushover_key' => psm_get_lang('users', 'pushover_key'),
'label_pushover_device' => psm_get_lang('users', 'pushover_device'),
'label_pushover_device_description' => psm_get_lang('users', 'pushover_device_description'),
'label_email' => psm_get_lang('users', 'email'),
'label_servers' => psm_get_lang('menu', 'server'),
'label_action' => psm_get_lang('system', 'action'),
@ -311,6 +329,8 @@ class UserController extends AbstractController {
'label_edit' => psm_get_lang('system', 'edit'),
'label_delete' => psm_get_lang('system', 'delete'),
'label_add_new' => psm_get_lang('system', 'add_new'),
'label_check_all' => psm_get_lang('system', 'check_all'),
'label_uncheck_all' => psm_get_lang('system', 'uncheck_all'),
'icon_level_10' => 'icon-admin',
'icon_level_20' => 'icon-user',
)

View File

@ -27,7 +27,7 @@
<td class="tight hidden-phone"><div class="table-cell-title"><i class="{active_icon}" title="{active_title}"></i> <i class="{email_icon}" title="{label_email}"></i> <i class="{sms_icon}" title="{label_sms}"></i> <i class="{pushover_icon}" title="Pushover"></i></div></td>
<td class="tight hidden-phone">
<div class="table-cell-title">
<a class="btn btn-small" href="index.php?mod=server&amp;action=view&amp;id={server_id}"><i class="icon-chart"></i></a>
<a class="btn btn-small" href="{url_view}"><i class="icon-chart"></i></a>
{html_actions}
</div>
</td>
@ -38,7 +38,7 @@
<a class="title" href="{url_view}">{label}</a>
</div>
<div class="table-cell tight">
&nbsp;<a class="btn btn-small" href="index.php?mod=server&amp;action=view&amp;id={server_id}"><i class="icon-chart"></i></a>
&nbsp;<a class="btn btn-small" href="{url_view}"><i class="icon-chart"></i></a>
{html_actions}
</div>
</div>
@ -63,10 +63,10 @@
<!--%%tpl_server_list-->
<!--%tpl_server_list_admin_actions-->
<a class="btn btn-small" href="index.php?mod=server&amp;action=edit&amp;id={server_id}" title="{label_edit}">
<a class="btn btn-small" href="{url_edit}" title="{label_edit}">
<i class="icon-pencil"></i>
</a>
<a class="btn btn-small btn-danger show-modal" href="index.php?mod=server&action=delete&id={server_id}" title="{label_delete}" data-modal-id="delete" data-modal-param="{label}">
<a class="btn btn-small btn-danger show-modal" href="{url_delete}" title="{label_delete}" data-modal-id="delete" data-modal-param="{label}">
<i class="icon-remove icon-white"></i>
</a>
<!--%%tpl_server_list_admin_actions-->
@ -75,106 +75,110 @@
<form class="form-horizontal well" action="{url_save}" method="post">
<fieldset>
<legend>{titlemode}</legend>
<div class="control-group">
<label class="control-label" for="label">{label_label}</label>
<div class="controls">
<input type="text" id="label" name="label" value="{edit_value_label}" maxlength="255" />
<div class="row-fluid">
<div class="span6">
<div class="control-group">
<label class="control-label" for="label">{label_label}</label>
<div class="controls">
<input type="text" id="label" name="label" value="{edit_value_label}" maxlength="255" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="ip">{label_domain}</label>
<div class="controls">
<input type="text" id="ip" name="ip" value="{edit_value_ip}" maxlength="100" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="type">{label_type}</label>
<div class="controls">
<select id="type" name="type">
<option value="service" {edit_type_selected_service}>{label_service}</option>
<option value="website" {edit_type_selected_website}>{label_website}</option>
</select>
</div>
</div>
<div class="control-group">
<label class="control-label" for="port">{label_port}</label>
<div class="controls">
<input class="input-mini" type="text" id="port" name="port" value="{edit_value_port}" maxlength="5" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="pattern">{label_pattern}</label>
<div class="controls">
<input type="text" id="pattern" name="pattern" value="{edit_value_pattern}" maxlength="255" data-toggle="tooltip" title="{label_pattern_description}" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="warning_threshold">{label_warning_threshold}</label>
<div class="controls">
<input class="input-mini" type="text" id="warning_threshold" name="warning_threshold" value="{edit_value_warning_threshold}" maxlength="5" data-toggle="tooltip" title="{label_warning_threshold_description}" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="timeout">{label_timeout}</label>
<div class="controls">
<input class="input-mini" type="text" id="timeout" name="timeout" value="{edit_value_timeout}" placeholder="{default_value_timeout}" maxlength="10" data-toggle="tooltip" title="{label_timeout_description}" /> s
</div>
</div>
<div class="control-group">
<label class="control-label" for="active">{label_monitoring}</label>
<div class="controls">
<select id="active" name="active">
<option value="yes" {edit_active_selected_yes}>{label_yes}</option>
<option value="no" {edit_active_selected_no}>{label_no}</option>
</select>
</div>
</div>
<div class="control-group">
<label class="control-label" for="email">{label_send_email}</label>
<div class="controls">
<select id="email" name="email">
<option value="yes" {edit_email_selected_yes}>{label_yes}</option>
<option value="no" {edit_email_selected_no}>{label_no}</option>
</select>
</div>
</div>
<div class="control-group">
<label class="control-label" for="sms">{label_send_sms}</label>
<div class="controls">
<select id="sms" name="sms">
<option value="yes" {edit_sms_selected_yes}>{label_yes}</option>
<option value="no" {edit_sms_selected_no}>{label_no}</option>
</select>
</div>
</div>
<div class="control-group">
<label class="control-label" for="pushover">{label_pushover}</label>
<div class="controls">
<select id="pushover" name="pushover">
<option value="yes" {edit_pushover_selected_yes}>{label_yes}</option>
<option value="no" {edit_pushover_selected_no}>{label_no}</option>
</select>
</div>
</div>
</div>
<div class="span6">
<div class="control-group">
<label class="control-label">{label_users}</label>
<div class="controls">
<!--%tpl_repeat_users-->
<label class="checkbox"><input type="checkbox" name="user_id[]" value="{user_id}" {edit_checked}> {name}</label>
<!--%%tpl_repeat_users-->
{users}
<p><button class="btn btn-small" onclick="psm_onClickCheckboxIDCToggleAll('user_id[]', true);return false;">{label_check_all}</button>
<button class="btn btn-small" onclick="psm_onClickCheckboxIDCToggleAll('user_id[]', false);return false;">{label_uncheck_all}</button></p>
</div>
</div>
</div>
</div>
<div class="control-group">
<label class="control-label" for="ip">{label_domain}</label>
<div class="controls">
<input type="text" id="ip" name="ip" value="{edit_value_ip}" maxlength="100" />
<div class="row-fluid">
<div class="form-actions">
<button class="btn btn-success" type="submit">{label_save}</button>
<a class="btn" href="{url_go_back}" >{label_go_back}</a>
</div>
</div>
<div class="control-group">
<label class="control-label" for="type">{label_type}</label>
<div class="controls">
<select id="type" name="type">
<option value="service" {edit_type_selected_service}>{label_service}</option>
<option value="website" {edit_type_selected_website}>{label_website}</option>
</select>
</div>
</div>
<div class="control-group">
<label class="control-label" for="port">{label_port}</label>
<div class="controls">
<input class="input-mini" type="text" id="port" name="port" value="{edit_value_port}" maxlength="5" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="pattern">{label_pattern}</label>
<div class="controls">
<input type="text" id="pattern" name="pattern" value="{edit_value_pattern}" maxlength="255" data-toggle="tooltip" title="{label_pattern_description}" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="active">{label_monitoring}</label>
<div class="controls">
<select id="active" name="active">
<option value="yes" {edit_active_selected_yes}>{label_yes}</option>
<option value="no" {edit_active_selected_no}>{label_no}</option>
</select>
</div>
</div>
<div class="control-group">
<label class="control-label" for="email">{label_send_email}</label>
<div class="controls">
<select id="email" name="email">
<option value="yes" {edit_email_selected_yes}>{label_yes}</option>
<option value="no" {edit_email_selected_no}>{label_no}</option>
</select>
</div>
</div>
<div class="control-group">
<label class="control-label" for="sms">{label_send_sms}</label>
<div class="controls">
<select id="sms" name="sms">
<option value="yes" {edit_sms_selected_yes}>{label_yes}</option>
<option value="no" {edit_sms_selected_no}>{label_no}</option>
</select>
</div>
</div>
<div class="control-group">
<label class="control-label" for="pushover">{label_pushover}</label>
<div class="controls">
<select id="pushover" name="pushover">
<option value="yes" {edit_pushover_selected_yes}>{label_yes}</option>
<option value="no" {edit_pushover_selected_no}>{label_no}</option>
</select>
</div>
</div>
<div class="control-group">
<label class="control-label" for="warning_threshold">{label_warning_threshold}</label>
<div class="controls">
<input class="input-mini" type="text" id="warning_threshold" name="warning_threshold" value="{edit_value_warning_threshold}" maxlength="5" data-toggle="tooltip" title="{label_warning_threshold_description}" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="timeout">{label_timeout}</label>
<div class="controls">
<input class="input-mini" type="text" id="timeout" name="timeout" value="{edit_value_timeout}" placeholder="{default_value_timeout}" maxlength="10" data-toggle="tooltip" title="{label_timeout_description}" /> s
</div>
</div>
<div class="control-group">
<label class="control-label" for="users[]">{label_users}</label>
<div class="controls">
<!--%tpl_repeat_users-->
<label class="checkbox">
<input id="user{user_id}"
type="checkbox"
name='user_id[]'
value='{user_id}' {edit_checked} >
{name}
</label>
<!--%%tpl_repeat_users-->
{users}
</div>
</div>
<div class="form-actions">
<button class="btn btn-success" type="submit">{label_save}</button>
<a class="btn" href="{url_go_back}" >{label_go_back}</a>
</div>
</fieldset>
</form>
<!--%%tpl_server_update-->

View File

@ -1,61 +1,74 @@
<!--%tpl_user_profile-->
<form class="form-horizontal well" action="{form_action}" method="post">
<fieldset>
<div class="control-group">
<label class="control-label" for="user_name">{label_user_name}</label>
<div class="controls">
<input type="text" id="user_name" name="user_name" value="{user_name}" maxlength="64" required autofocus=>
<fieldset>
<div class="row-fluid">
<div class="span6">
<div class="control-group">
<label class="control-label" for="user_name">{label_user_name}</label>
<div class="controls">
<input type="text" id="user_name" name="user_name" value="{user_name}" maxlength="64" required autofocus=>
</div>
</div>
<div class="control-group">
<label class="control-label" for="name">{label_name}</label>
<div class="controls">
<input type="text" id="name" name="name" value="{name}" maxlength="255" required>
</div>
</div>
<div class="control-group">
<label class="control-label" for="level">{label_level}</label>
<div class="controls"><input type="text" value="{level}" disabled="disabled" /></div>
</div>
<div class="control-group">
<label class="control-label" for="password">{label_password}</label>
<div class="controls">
<input type="password" id="password" name="password" maxlength="255" placeholder="{placeholder_password}" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="password_repeat">{label_password_repeat}</label>
<div class="controls">
<input type="password" id="password_repeat" name="password_repeat" maxlength="255" placeholder="{placeholder_password}" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="email">{label_email}</label>
<div class="controls">
<input type="text" id="email" name="email" value="{email}" maxlength="255" required>
</div>
</div>
<div class="control-group">
<label class="control-label" for="email">{label_mobile}</label>
<div class="controls">
<input type="text" id="mobile" name="mobile" value="{mobile}" maxlength="15" />
</div>
</div>
</div>
<div class="control-group">
<label class="control-label" for="name">{label_name}</label>
<div class="controls">
<input type="text" id="name" name="name" value="{name}" maxlength="255" required>
</div>
</div>
<div class="control-group">
<label class="control-label" for="level">{label_level}</label>
<div class="controls"><input type="text" value="{level}" disabled="disabled" /></div>
</div>
<div class="control-group">
<label class="control-label" for="password">{label_password}</label>
<div class="controls">
<input type="password" id="password" name="password" maxlength="255" placeholder="{placeholder_password}" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="password_repeat">{label_password_repeat}</label>
<div class="controls">
<input type="password" id="password_repeat" name="password_repeat" maxlength="255" placeholder="{placeholder_password}" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="email">{label_email}</label>
<div class="controls">
<input type="text" id="email" name="email" value="{email}" maxlength="255" required>
</div>
</div>
<div class="control-group">
<label class="control-label" for="mobile">{label_pushover_key}</label>
<div class="controls">
<input type="text" id="pushover_key" name="pushover_key" value="{pushover_key}" maxlength="255" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="mobile">{label_pushover_device}</label>
<div class="controls">
<input type="text" id="pushover_device" name="pushover_device" value="{pushover_device}" maxlength="255" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="email">{label_email}</label>
<div class="controls">
<input type="text" id="mobile" name="mobile" value="{mobile}" maxlength="15" />
<div class="span6">
<div class="control-group">
<label class="control-label">{label_pushover}</label>
<div class="controls">{label_pushover_description} </div>
</div>
<div class="control-group">
<label class="control-label" for="mobile">{label_pushover_key}</label>
<div class="controls">
<input type="text" id="pushover_key" name="pushover_key" value="{pushover_key}" maxlength="255" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="mobile">{label_pushover_device}</label>
<div class="controls">
<input type="text" id="pushover_device" name="pushover_device" value="{pushover_device}" maxlength="255" />
<p class="help-block">{label_pushover_device_description}</p>
</div>
</div>
</div>
</div>
<div class="row-fluid">
<div class="form-actions">
<button class="btn btn-success" type="submit">{label_save}</button>
</div>
</div>
</fieldset>
</form>
<!--%%tpl_user_profile-->

View File

@ -25,10 +25,10 @@
</div>
<div class="table-cell tight">
<div class="visible-phone">
<a class="btn btn-small" href="index.php?mod=user&amp;action=edit&amp;id={user_id}" title="{label_edit}">
<a class="btn btn-small" href="{url_edit}" title="{label_edit}">
<i class="icon-pencil"></i>
</a>
<a class="btn btn-small btn-danger show-modal" href="index.php?mod=user&action=delete&id={user_id}" title="{label_delete}" data-modal-id="delete" data-modal-param="{user_name}">
<a class="btn btn-small btn-danger show-modal" href="{url_delete}" title="{label_delete}" data-modal-id="delete" data-modal-param="{user_name}">
<i class="icon-remove icon-white"></i>
</a>
</div>
@ -48,10 +48,10 @@
<td class="hidden-phone tight"><div class="table-cell-title">{mobile}</div></td>
<td class="hidden-phone"><div class="table-cell-title">{emp_servers}</div></td>
<td class="hidden-phone tight">
<a class="btn btn-small" href="index.php?mod=user&amp;action=edit&amp;id={user_id}" title="{label_edit}">
<a class="btn btn-small" href="{url_edit}" title="{label_edit}">
<i class="icon-pencil"></i>
</a>
<a class="btn btn-small btn-danger show-modal" href="index.php?mod=user&action=delete&id={user_id}" title="{label_delete}" data-modal-id="delete" data-modal-param="{user_name}">
<a class="btn btn-small btn-danger show-modal" href="{url_delete}" title="{label_delete}" data-modal-id="delete" data-modal-param="{user_name}">
<i class="icon-remove icon-white"></i>
</a>
</td>
@ -63,9 +63,11 @@
<!--%%tpl_user_list-->
<!--%tpl_user_update-->
<form class="form-horizontal well" action="index.php?mod=user&amp;action=save&amp;id={edit_user_id}" method="post">
<fieldset>
<legend>{titlemode}</legend>
<form class="form-horizontal well" action="{url_save}" method="post">
<fieldset>
<legend>{titlemode}</legend>
<div class="row-fluid">
<div class="span6">
<div class="control-group">
<label class="control-label" for="user_name">{label_user_name}</label>
<div class="controls">
@ -87,9 +89,7 @@
<!--%%tpl_repeat_levels-->
{levels}
</select>
<p class="help-block">
{label_level_description}
</p>
<p class="help-block">{label_level_description}</p>
</div>
</div>
<div class="control-group">
@ -117,36 +117,43 @@
</div>
</div>
<div class="control-group">
<label class="control-label" for="pushover_key">{label_pushover_key}</label>
<label class="control-label">{label_pushover}</label>
<div class="controls">{label_pushover_description} </div>
</div>
<div class="control-group">
<label class="control-label" for="mobile">{label_pushover_key}</label>
<div class="controls">
<input type="text" id="pushover_key" name="pushover_key" value="{edit_value_pushover_key}" maxlength="255" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="pushover_device">{label_pushover_device}</label>
<label class="control-label" for="mobile">{label_pushover_device}</label>
<div class="controls">
<input type="text" id="pushover_device" name="pushover_device" value="{edit_value_pushover_device}" maxlength="255" />
<p class="help-block">{label_pushover_device_description}</p>
</div>
</div>
</div>
<div class="span6">
<div class="control-group">
<label class="control-label" for="servers[]">{label_servers}</label>
<label class="control-label">{label_servers}</label>
<div class="controls">
<!--%tpl_repeat_servers-->
<label class="checkbox">
<input id="server{server_id}"
type="checkbox"
name='server_id[]'
value='{server_id}' {edit_checked} >
{label}
</label>
<label class="checkbox"><input type="checkbox" name="server_id[]" value="{server_id}" {edit_checked}> {label}</label>
<!--%%tpl_repeat_servers-->
{servers}
<p><button class="btn btn-small" onclick="psm_onClickCheckboxIDCToggleAll('server_id[]', true);return false;">{label_check_all}</button>
<button class="btn btn-small" onclick="psm_onClickCheckboxIDCToggleAll('server_id[]', false);return false;">{label_uncheck_all}</button></p>
</div>
</div>
</div>
</div>
<div class="row-fluid">
<div class="form-actions">
<button class="btn btn-success" type="submit">{label_save}</button>
<button class="btn" onclick="history.back();return false;" >{label_go_back}</button>
</div>
</div>
</fieldset>
</form>
<!--%%tpl_user_update-->

View File

@ -417,6 +417,7 @@ div.tabbable ul.nav-tabs li{
}
legend{
border-color: -moz-use-text-color -moz-use-text-color #CCCCCC;
margin-bottom: 10px;
}
.form-actions {
background-color: transparent;

View File

@ -28,7 +28,7 @@ $().ready(function() {
}
return false;
});
$('.modalOKButton').click(function(e) {
var $this = $(this);
var $origin = $this.data('modal-origin');
@ -110,4 +110,14 @@ function psm_flash_message(message) {
flashmessage.slideDown();
}
}
}
/**
* This function toggles all grouped checkboxes by name
*/
function psm_onClickCheckboxIDCToggleAll(name, value) {
var $visible = $('input[name="'+name+'"]:visible');
var value = (typeof value === 'undefined') ? !$visible.first().is(':checked') : value;
$visible.prop('checked', value);
}