Improve settings pages layout

This commit is contained in:
Frederic Guillot 2017-01-08 21:42:08 -05:00
parent d01b2271d3
commit 36de36dad9
9 changed files with 88 additions and 80 deletions

View File

@ -16,6 +16,7 @@ Improvements:
* Improve accordion component
* Improve currencies pages navigation
* Improve link labels pages navigation
* Improve settings pages layout
* Offer the possibility to define version compatibility from plugins
Version 1.0.36 (Dec 30, 2016)

View File

@ -167,13 +167,14 @@ class CustomFilterController extends BaseController
if ($valid) {
if ($this->customFilterModel->update($values)) {
$this->flash->success(t('Your custom filter have been updated successfully.'));
return $this->response->redirect($this->helper->url->to('CustomFilterController', 'index', array('project_id' => $project['id'])));
$this->response->redirect($this->helper->url->to('CustomFilterController', 'index', array('project_id' => $project['id'])), true);
return;
} else {
$this->flash->failure(t('Unable to update custom filter.'));
}
}
return $this->edit($values, $errors);
$this->edit($values, $errors);
}
private function checkPermission(array $project, array $filter)

View File

@ -1,7 +1,7 @@
<div class="page-header">
<h2><?= t('API') ?></h2>
</div>
<section class="panel">
<div class="panel">
<ul>
<li>
<?= t('API token:') ?>
@ -9,10 +9,10 @@
</li>
<li>
<?= t('API endpoint:') ?>
<input type="text" class="auto-select" readonly="readonly" value="<?= $this->url->base().'jsonrpc.php' ?>">
</li>
<li>
<?= $this->url->link(t('Reset token'), 'ConfigController', 'token', array('type' => 'api'), true) ?>
<strong><?= $this->url->base().'jsonrpc.php' ?></strong>
</li>
</ul>
</section>
</div>
<?= $this->url->link(t('Reset token'), 'ConfigController', 'token', array('type' => 'api'), true, 'btn btn-red') ?>

View File

@ -2,33 +2,38 @@
<h2><?= t('Application settings') ?></h2>
</div>
<form method="post" action="<?= $this->url->href('ConfigController', 'save', array('redirect' => 'application')) ?>" autocomplete="off">
<?= $this->form->csrf() ?>
<?= $this->form->label(t('Application URL'), 'application_url') ?>
<?= $this->form->text('application_url', $values, $errors, array('placeholder="http://example.kanboard.net/"')) ?>
<p class="form-help"><?= t('Example: http://example.kanboard.net/ (used to generate absolute URLs)') ?></p>
<fieldset>
<?= $this->form->label(t('Application URL'), 'application_url') ?>
<?= $this->form->text('application_url', $values, $errors, array('placeholder="http://example.kanboard.net/"')) ?>
<p class="form-help"><?= t('Example: http://example.kanboard.net/ (used to generate absolute URLs)') ?></p>
<?= $this->form->label(t('Language'), 'application_language') ?>
<?= $this->form->select('application_language', $languages, $values, $errors) ?>
<?= $this->form->label(t('Language'), 'application_language') ?>
<?= $this->form->select('application_language', $languages, $values, $errors) ?>
<?= $this->form->label(t('Timezone'), 'application_timezone') ?>
<?= $this->form->select('application_timezone', $timezones, $values, $errors) ?>
<?= $this->form->checkbox('password_reset', t('Enable "Forget Password"'), 1, $values['password_reset'] == 1) ?>
</fieldset>
<?= $this->form->label(t('Date format'), 'application_date_format') ?>
<?= $this->form->select('application_date_format', $date_formats, $values, $errors) ?>
<p class="form-help"><?= t('ISO format is always accepted, example: "%s" and "%s"', date('Y-m-d'), date('Y_m_d')) ?></p>
<fieldset>
<?= $this->form->label(t('Timezone'), 'application_timezone') ?>
<?= $this->form->select('application_timezone', $timezones, $values, $errors) ?>
<?= $this->form->label(t('Date and time format'), 'application_datetime_format') ?>
<?= $this->form->select('application_datetime_format', $datetime_formats, $values, $errors) ?>
<?= $this->form->label(t('Date format'), 'application_date_format') ?>
<?= $this->form->select('application_date_format', $date_formats, $values, $errors) ?>
<p class="form-help"><?= t('ISO format is always accepted, example: "%s" and "%s"', date('Y-m-d'), date('Y_m_d')) ?></p>
<?= $this->form->label(t('Time format'), 'application_time_format') ?>
<?= $this->form->select('application_time_format', $time_formats, $values, $errors) ?>
<?= $this->form->label(t('Date and time format'), 'application_datetime_format') ?>
<?= $this->form->select('application_datetime_format', $datetime_formats, $values, $errors) ?>
<?= $this->form->checkbox('password_reset', t('Enable "Forget Password"'), 1, $values['password_reset'] == 1) ?>
<?= $this->form->label(t('Time format'), 'application_time_format') ?>
<?= $this->form->select('application_time_format', $time_formats, $values, $errors) ?>
</fieldset>
<?= $this->form->label(t('Custom Stylesheet'), 'application_stylesheet') ?>
<?= $this->form->textarea('application_stylesheet', $values, $errors) ?>
<fieldset>
<?= $this->form->label(t('Custom Stylesheet'), 'application_stylesheet') ?>
<?= $this->form->textarea('application_stylesheet', $values, $errors) ?>
</fieldset>
<?= $this->hook->render('template:config:application', array('values' => $values, 'errors' => $errors)) ?>

View File

@ -2,20 +2,21 @@
<h2><?= t('Board settings') ?></h2>
</div>
<form method="post" action="<?= $this->url->href('ConfigController', 'save', array('redirect' => 'board')) ?>" autocomplete="off">
<?= $this->form->csrf() ?>
<?= $this->form->label(t('Task highlight period'), 'board_highlight_period') ?>
<?= $this->form->number('board_highlight_period', $values, $errors) ?>
<p class="form-help"><?= t('Period (in second) to consider a task was modified recently (0 to disable, 2 days by default)') ?></p>
<fieldset>
<?= $this->form->label(t('Task highlight period'), 'board_highlight_period') ?>
<?= $this->form->number('board_highlight_period', $values, $errors) ?>
<p class="form-help"><?= t('Period (in second) to consider a task was modified recently (0 to disable, 2 days by default)') ?></p>
<?= $this->form->label(t('Refresh interval for public board'), 'board_public_refresh_interval') ?>
<?= $this->form->number('board_public_refresh_interval', $values, $errors) ?>
<p class="form-help"><?= t('Frequency in second (60 seconds by default)') ?></p>
<?= $this->form->label(t('Refresh interval for public board'), 'board_public_refresh_interval') ?>
<?= $this->form->number('board_public_refresh_interval', $values, $errors) ?>
<p class="form-help"><?= t('Frequency in second (60 seconds by default)') ?></p>
<?= $this->form->label(t('Refresh interval for private board'), 'board_private_refresh_interval') ?>
<?= $this->form->number('board_private_refresh_interval', $values, $errors) ?>
<p class="form-help"><?= t('Frequency in second (0 to disable this feature, 10 seconds by default)') ?></p>
<?= $this->form->label(t('Refresh interval for private board'), 'board_private_refresh_interval') ?>
<?= $this->form->number('board_private_refresh_interval', $values, $errors) ?>
<p class="form-help"><?= t('Frequency in second (0 to disable this feature, 10 seconds by default)') ?></p>
</fieldset>
<div class="form-actions">
<button type="submit" class="btn btn-blue"><?= t('Save') ?></button>

View File

@ -1,34 +1,36 @@
<div class="page-header">
<h2><?= t('Calendar settings') ?></h2>
</div>
<section>
<form method="post" action="<?= $this->url->href('ConfigController', 'save', array('redirect' => 'calendar')) ?>" autocomplete="off">
<?= $this->form->csrf() ?>
<div class="panel">
<h3><?= t('Project calendar view') ?></h3>
<fieldset>
<legend><?= t('Project calendar view') ?></legend>
<?= $this->form->radios('calendar_project_tasks', array(
'date_creation' => t('Show tasks based on the creation date'),
'date_started' => t('Show tasks based on the start date'),
), $values) ?>
</div>
),
$values
) ?>
</fieldset>
<div class="panel">
<h3><?= t('User calendar view') ?></h3>
<fieldset>
<legend><?= t('User calendar view') ?></legend>
<?= $this->form->radios('calendar_user_tasks', array(
'date_creation' => t('Show tasks based on the creation date'),
'date_started' => t('Show tasks based on the start date'),
), $values) ?>
</div>
),
$values
) ?>
</fieldset>
<div class="panel">
<h3><?= t('Subtasks time tracking') ?></h3>
<fieldset>
<legend><?= t('Subtasks time tracking') ?></legend>
<?= $this->form->checkbox('calendar_user_subtasks_time_tracking', t('Show subtasks based on the time tracking'), 1, $values['calendar_user_subtasks_time_tracking'] == 1) ?>
</div>
</fieldset>
<div class="form-actions">
<button type="submit" class="btn btn-blue"><?= t('Save') ?></button>
</div>
</form>
</section>

View File

@ -4,11 +4,14 @@
<form method="post" action="<?= $this->url->href('ConfigController', 'save', array('redirect' => 'email')) ?>" autocomplete="off">
<?= $this->form->csrf() ?>
<?= $this->form->label(t('Email sender address'), 'mail_sender_address') ?>
<?= $this->form->text('mail_sender_address', $values, $errors, array('placeholder="'.MAIL_FROM.'"')) ?>
<fieldset>
<legend><?= t('Outgoing Emails') ?></legend>
<?= $this->form->label(t('Email sender address'), 'mail_sender_address') ?>
<?= $this->form->text('mail_sender_address', $values, $errors, array('placeholder="'.MAIL_FROM.'"')) ?>
<?= $this->form->label(t('Email transport'), 'mail_transport') ?>
<?= $this->form->select('mail_transport', $mail_transports, $values, $errors) ?>
<?= $this->form->label(t('Email transport'), 'mail_transport') ?>
<?= $this->form->select('mail_transport', $mail_transports, $values, $errors) ?>
</fieldset>
<?= $this->hook->render('template:config:email', array('values' => $values, 'errors' => $errors)) ?>

View File

@ -2,24 +2,27 @@
<h2><?= t('Project settings') ?></h2>
</div>
<form method="post" action="<?= $this->url->href('ConfigController', 'save', array('redirect' => 'project')) ?>" autocomplete="off">
<?= $this->form->csrf() ?>
<?= $this->form->label(t('Default task color'), 'default_color') ?>
<?= $this->form->select('default_color', $colors, $values, $errors) ?>
<fieldset>
<?= $this->form->label(t('Default task color'), 'default_color') ?>
<?= $this->form->select('default_color', $colors, $values, $errors) ?>
<?= $this->form->label(t('Default columns for new projects (Comma-separated)'), 'board_columns') ?>
<?= $this->form->text('board_columns', $values, $errors) ?>
<p class="form-help"><?= t('Default values are "%s"', $default_columns) ?></p>
<?= $this->form->label(t('Default columns for new projects (Comma-separated)'), 'board_columns') ?>
<?= $this->form->text('board_columns', $values, $errors) ?>
<p class="form-help"><?= t('Default values are "%s"', $default_columns) ?></p>
<?= $this->form->label(t('Default categories for new projects (Comma-separated)'), 'project_categories') ?>
<?= $this->form->text('project_categories', $values, $errors) ?>
<p class="form-help"><?= t('Example: "Bug, Feature Request, Improvement"') ?></p>
<?= $this->form->label(t('Default categories for new projects (Comma-separated)'), 'project_categories') ?>
<?= $this->form->text('project_categories', $values, $errors) ?>
<p class="form-help"><?= t('Example: "Bug, Feature Request, Improvement"') ?></p>
</fieldset>
<?= $this->form->checkbox('disable_private_project', t('Disable private projects'), 1, isset($values['disable_private_project']) && $values['disable_private_project'] == 1) ?>
<?= $this->form->checkbox('subtask_restriction', t('Allow only one subtask in progress at the same time for a user'), 1, $values['subtask_restriction'] == 1) ?>
<?= $this->form->checkbox('subtask_time_tracking', t('Trigger automatically subtask time tracking'), 1, $values['subtask_time_tracking'] == 1) ?>
<?= $this->form->checkbox('cfd_include_closed_tasks', t('Include closed tasks in the cumulative flow diagram'), 1, $values['cfd_include_closed_tasks'] == 1) ?>
<fieldset>
<?= $this->form->checkbox('disable_private_project', t('Disable private projects'), 1, isset($values['disable_private_project']) && $values['disable_private_project'] == 1) ?>
<?= $this->form->checkbox('subtask_restriction', t('Allow only one subtask in progress at the same time for a user'), 1, $values['subtask_restriction'] == 1) ?>
<?= $this->form->checkbox('subtask_time_tracking', t('Trigger automatically subtask time tracking'), 1, $values['subtask_time_tracking'] == 1) ?>
<?= $this->form->checkbox('cfd_include_closed_tasks', t('Include closed tasks in the cumulative flow diagram'), 1, $values['cfd_include_closed_tasks'] == 1) ?>
</fieldset>
<div class="form-actions">
<button type="submit" class="btn btn-blue"><?= t('Save') ?></button>

View File

@ -1,9 +1,7 @@
<div class="page-header">
<h2><?= t('Webhook settings') ?></h2>
</div>
<section>
<form method="post" action="<?= $this->url->href('ConfigController', 'save', array('redirect' => 'webhook')) ?>" autocomplete="off">
<?= $this->form->csrf() ?>
<?= $this->form->label(t('Webhook URL'), 'webhook_url') ?>
@ -13,19 +11,13 @@
<button type="submit" class="btn btn-blue"><?= t('Save') ?></button>
</div>
</form>
</section>
<div class="page-header margin-top">
<h2><?= t('Webhook token') ?></h2>
</div>
<section class="panel">
<ul>
<li>
<?= t('Webhook token:') ?>
<strong><?= $this->text->e($values['webhook_token']) ?></strong>
</li>
<li>
<?= $this->url->link(t('Reset token'), 'ConfigController', 'token', array('type' => 'webhook'), true) ?>
</li>
</ul>
</section>
<div class="panel">
<?= t('Webhook token:') ?>
<strong><?= $this->text->e($values['webhook_token']) ?></strong>
</div>
<?= $this->url->link(t('Reset token'), 'ConfigController', 'token', array('type' => 'webhook'), true, 'btn btn-red') ?>