Use the same task form layout everywhere

This commit is contained in:
Frederic Guillot
2016-06-24 17:57:26 -04:00
parent 18cb7ad0a4
commit 17213da5ce
18 changed files with 196 additions and 164 deletions

View File

@@ -47,6 +47,24 @@ class TaskHelper extends Base
return $html;
}
public function selectDescription(array $values, array $errors)
{
$html = $this->helper->form->label(t('Description'), 'description');
$html .= $this->helper->form->textarea(
'description',
$values,
$errors,
array(
'placeholder="'.t('Leave a description').'"',
'tabindex="2"',
'data-mention-search-url="'.$this->helper->url->href('UserAjaxController', 'mention', array('project_id' => $values['project_id'])).'"'
),
'markdown-editor'
);
return $html;
}
public function selectTags(array $project, array $tags = array())
{
$options = $this->tagModel->getAssignableList($project['id']);
@@ -68,6 +86,14 @@ class TaskHelper extends Base
return $html;
}
public function selectColor(array $values)
{
$colors = $this->colorModel->getList();
$html = $this->helper->form->label(t('Color'), 'color_id');
$html .= $this->helper->form->select('color_id', $colors, $values, array(), array(), 'color-picker');
return $html;
}
public function selectAssignee(array $users, array $values, array $errors = array(), array $attributes = array())
{
$attributes = array_merge(array('tabindex="3"'), $attributes);