diff options
author | Frederic Guillot <fred@kanboard.net> | 2017-11-02 15:41:58 -0700 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2017-11-02 15:41:58 -0700 |
commit | 648dc6bcfbdd44947ec58e2f3662c1cc3844d782 (patch) | |
tree | d122630decf0bf4a7a199798835481592424a3b0 /app/Helper | |
parent | 44ae87ac0e9bb37ca6d2b305d410758ff71b42c6 (diff) |
Add predefined templates for task descriptions
Diffstat (limited to 'app/Helper')
-rw-r--r-- | app/Helper/TaskHelper.php | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/app/Helper/TaskHelper.php b/app/Helper/TaskHelper.php index b105eaec..43347a6d 100644 --- a/app/Helper/TaskHelper.php +++ b/app/Helper/TaskHelper.php @@ -61,6 +61,30 @@ class TaskHelper extends Base return $this->helper->form->textEditor('description', $values, $errors, array('tabindex' => 2)); } + public function renderDescriptionTemplateDropdown($projectId) + { + $templates = $this->predefinedTaskDescriptionModel->getAll($projectId); + + if (! empty($templates)) { + $html = '<div class="dropdown">'; + $html .= '<a href="#" class="dropdown-menu dropdown-menu-link-icon"><i class="fa fa-floppy-o fa-fw" aria-hidden="true"></i>'.t('Description Templates').' <i class="fa fa-caret-down" aria-hidden="true"></i></a>'; + $html .= '<ul>'; + + foreach ($templates as $template) { + $html .= '<li>'; + $html .= '<a href="#" data-template-target="textarea[name=description]" data-template="'.$this->helper->text->e($template['description']).'" class="js-template">'; + $html .= $this->helper->text->e($template['title']); + $html .= '</a>'; + $html .= '</li>'; + } + + $html .= '</ul></div>'; + return $html; + } + + return ''; + } + public function renderTagField(array $project, array $tags = array()) { $options = $this->tagModel->getAssignableList($project['id']); |