Improve tabindex for project settings forms
This commit is contained in:
parent
de1b9416d2
commit
de2501f070
|
|
@ -131,16 +131,34 @@ class FormHelper extends Base
|
|||
* Display a checkbox field
|
||||
*
|
||||
* @access public
|
||||
* @param string $name Field name
|
||||
* @param string $label Form label
|
||||
* @param string $value Form value
|
||||
* @param boolean $checked Field selected or not
|
||||
* @param string $class CSS class
|
||||
* @param string $name Field name
|
||||
* @param string $label Form label
|
||||
* @param string $value Form value
|
||||
* @param boolean $checked Field selected or not
|
||||
* @param string $class CSS class
|
||||
* @param array $attributes
|
||||
* @return string
|
||||
*/
|
||||
public function checkbox($name, $label, $value, $checked = false, $class = '')
|
||||
public function checkbox($name, $label, $value, $checked = false, $class = '', array $attributes = array())
|
||||
{
|
||||
return '<label><input type="checkbox" name="'.$name.'" class="'.$class.'" value="'.$this->helper->text->e($value).'" '.($checked ? 'checked="checked"' : '').'> '.$this->helper->text->e($label).'</label>';
|
||||
$htmlAttributes = '';
|
||||
|
||||
if ($checked) {
|
||||
$attributes['checked'] = 'checked';
|
||||
}
|
||||
|
||||
foreach ($attributes as $attribute => $value) {
|
||||
$htmlAttributes .= sprintf('%s="%s"', $attribute, $this->helper->text->e($value));
|
||||
}
|
||||
|
||||
return sprintf(
|
||||
'<label><input type="checkbox" name="%s" class="%s" value="%s" %s> %s</label>',
|
||||
$name,
|
||||
$class,
|
||||
$this->helper->text->e($value),
|
||||
$htmlAttributes,
|
||||
$this->helper->text->e($label)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -10,10 +10,10 @@
|
|||
<?= $this->form->hidden('project_id', $values) ?>
|
||||
|
||||
<?= $this->form->label(t('Category Name'), 'name') ?>
|
||||
<?= $this->form->text('name', $values, $errors, array('autofocus', 'required', 'maxlength="50"')) ?>
|
||||
<?= $this->form->text('name', $values, $errors, array('autofocus', 'required', 'maxlength="50"', 'tabindex="1"')) ?>
|
||||
|
||||
<?= $this->form->label(t('Description'), 'description') ?>
|
||||
<?= $this->form->textEditor('description', $values, $errors) ?>
|
||||
<?= $this->form->textEditor('description', $values, $errors, array('tabindex' => 2)) ?>
|
||||
|
||||
<div class="form-actions">
|
||||
<button type="submit" class="btn btn-blue"><?= t('Save') ?></button>
|
||||
|
|
|
|||
|
|
@ -15,9 +15,11 @@
|
|||
<a href="#" class="dropdown-menu dropdown-menu-link-icon"><i class="fa fa-cog fa-fw"></i><i class="fa fa-caret-down"></i></a>
|
||||
<ul>
|
||||
<li>
|
||||
<i class="fa fa-pencil-square-o fa-fw" aria-hidden="true"></i>
|
||||
<?= $this->url->link(t('Edit'), 'CategoryController', 'edit', array('project_id' => $project['id'], 'category_id' => $category_id), false, 'popover') ?>
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-trash-o fa-fw" aria-hidden="true"></i>
|
||||
<?= $this->url->link(t('Remove'), 'CategoryController', 'confirm', array('project_id' => $project['id'], 'category_id' => $category_id), false, 'popover') ?>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
|
|||
|
|
@ -8,18 +8,18 @@
|
|||
<?= $this->form->hidden('project_id', $values) ?>
|
||||
|
||||
<?= $this->form->label(t('Title'), 'title') ?>
|
||||
<?= $this->form->text('title', $values, $errors, array('autofocus', 'required', 'maxlength="50"')) ?>
|
||||
<?= $this->form->text('title', $values, $errors, array('autofocus', 'required', 'maxlength="50"', 'tabindex="1"')) ?>
|
||||
|
||||
<?= $this->form->label(t('Task limit'), 'task_limit') ?>
|
||||
<?= $this->form->number('task_limit', $values, $errors) ?>
|
||||
<?= $this->form->number('task_limit', $values, $errors, array('tabindex="2"')) ?>
|
||||
|
||||
<?= $this->form->checkbox('hide_in_dashboard', t('Hide tasks in this column in the dashboard'), 1) ?>
|
||||
<?= $this->form->checkbox('hide_in_dashboard', t('Hide tasks in this column in the dashboard'), 1, false, '', array('tabindex' => 3)) ?>
|
||||
|
||||
<?= $this->form->label(t('Description'), 'description') ?>
|
||||
<?= $this->form->textEditor('description', $values, $errors) ?>
|
||||
<?= $this->form->textEditor('description', $values, $errors, array('tabindex' => 4)) ?>
|
||||
|
||||
<div class="form-actions">
|
||||
<button type="submit" class="btn btn-blue"><?= t('Save') ?></button>
|
||||
<button type="submit" class="btn btn-blue" tabindex="5"><?= t('Save') ?></button>
|
||||
<?= t('or') ?>
|
||||
<?= $this->url->link(t('cancel'), 'column', 'index', array('project_id' => $project['id']), false, 'close-popover') ?>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -7,13 +7,13 @@
|
|||
<?= $this->form->hidden('project_id', $values) ?>
|
||||
|
||||
<?= $this->form->label(t('Name'), 'name') ?>
|
||||
<?= $this->form->text('name', $values, $errors, array('autofocus', 'required', 'maxlength="50"')) ?>
|
||||
<?= $this->form->text('name', $values, $errors, array('autofocus', 'required', 'maxlength="50"', 'tabindex="1"')) ?>
|
||||
|
||||
<?= $this->form->label(t('Description'), 'description') ?>
|
||||
<?= $this->form->textEditor('description', $values, $errors) ?>
|
||||
<?= $this->form->textEditor('description', $values, $errors, array('tabindex' => 2)) ?>
|
||||
|
||||
<div class="form-actions">
|
||||
<button type="submit" class="btn btn-blue"><?= t('Save') ?></button>
|
||||
<button type="submit" class="btn btn-blue" tabindex="3"><?= t('Save') ?></button>
|
||||
<?= t('or') ?>
|
||||
<?= $this->url->link(t('cancel'), 'SwimlaneController', 'index', array('project_id' => $project['id']), false, 'close-popover') ?>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -10,13 +10,13 @@
|
|||
<?= $this->form->hidden('project_id', $values) ?>
|
||||
|
||||
<?= $this->form->label(t('Name'), 'name') ?>
|
||||
<?= $this->form->text('name', $values, $errors, array('autofocus', 'required', 'maxlength="50"')) ?>
|
||||
<?= $this->form->text('name', $values, $errors, array('autofocus', 'required', 'maxlength="50"', 'tabindex="1"')) ?>
|
||||
|
||||
<?= $this->form->label(t('Description'), 'description') ?>
|
||||
<?= $this->form->textEditor('description', $values, $errors) ?>
|
||||
<?= $this->form->textEditor('description', $values, $errors, array('tabindex' => 2)) ?>
|
||||
|
||||
<div class="form-actions">
|
||||
<button type="submit" class="btn btn-blue"><?= t('Save') ?></button>
|
||||
<button type="submit" class="btn btn-blue" tabindex="3"><?= t('Save') ?></button>
|
||||
<?= t('or') ?>
|
||||
<?= $this->url->link(t('cancel'), 'SwimlaneController', 'index', array('project_id' => $project['id']), false, 'close-popover') ?>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
<?= $this->form->hidden('id', $values) ?>
|
||||
|
||||
<?= $this->form->label(t('Name'), 'default_swimlane') ?>
|
||||
<?= $this->form->text('default_swimlane', $values, $errors, array('required', 'maxlength="50"')) ?>
|
||||
<?= $this->form->text('default_swimlane', $values, $errors, array('autofocus', 'required', 'maxlength="50"')) ?>
|
||||
|
||||
<?= $this->form->checkbox('show_default_swimlane', t('Show default swimlane'), 1, $values['show_default_swimlane'] == 1) ?>
|
||||
|
||||
|
|
|
|||
|
|
@ -20,12 +20,15 @@
|
|||
<a href="#" class="dropdown-menu dropdown-menu-link-icon"><i class="fa fa-cog fa-fw"></i><i class="fa fa-caret-down"></i></a>
|
||||
<ul>
|
||||
<li>
|
||||
<i class="fa fa-pencil-square-o fa-fw" aria-hidden="true"></i>
|
||||
<?= $this->url->link(t('Edit'), 'SwimlaneController', 'editDefault', array('project_id' => $project['id']), false, 'popover') ?>
|
||||
</li>
|
||||
<li>
|
||||
<?php if ($default_swimlane['show_default_swimlane'] == 1): ?>
|
||||
<i class="fa fa-toggle-off fa-fw" aria-hidden="true"></i>
|
||||
<?= $this->url->link(t('Disable'), 'SwimlaneController', 'disableDefault', array('project_id' => $project['id']), true) ?>
|
||||
<?php else: ?>
|
||||
<i class="fa fa-toggle-on fa-fw" aria-hidden="true"></i>
|
||||
<?= $this->url->link(t('Enable'), 'SwimlaneController', 'enableDefault', array('project_id' => $project['id']), true) ?>
|
||||
<?php endif ?>
|
||||
</li>
|
||||
|
|
@ -55,16 +58,20 @@
|
|||
<a href="#" class="dropdown-menu dropdown-menu-link-icon"><i class="fa fa-cog fa-fw"></i><i class="fa fa-caret-down"></i></a>
|
||||
<ul>
|
||||
<li>
|
||||
<i class="fa fa-pencil-square-o fa-fw" aria-hidden="true"></i>
|
||||
<?= $this->url->link(t('Edit'), 'SwimlaneController', 'edit', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id']), false, 'popover') ?>
|
||||
</li>
|
||||
<li>
|
||||
<?php if ($swimlane['is_active']): ?>
|
||||
<i class="fa fa-toggle-off fa-fw" aria-hidden="true"></i>
|
||||
<?= $this->url->link(t('Disable'), 'SwimlaneController', 'disable', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id']), true) ?>
|
||||
<?php else: ?>
|
||||
<i class="fa fa-toggle-on fa-fw" aria-hidden="true"></i>
|
||||
<?= $this->url->link(t('Enable'), 'SwimlaneController', 'enable', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id']), true) ?>
|
||||
<?php endif ?>
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-trash-o fa-fw" aria-hidden="true"></i>
|
||||
<?= $this->url->link(t('Remove'), 'SwimlaneController', 'confirm', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id']), false, 'popover') ?>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
|
|||
Loading…
Reference in New Issue