From 178eda18872f99840937dc3d23629b5d7aa7cee0 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Tue, 29 Dec 2015 18:44:21 +0100 Subject: Add autocompletion in textarea for user mentions --- app/Template/comment/create.php | 13 ++++++++++++- app/Template/task_creation/form.php | 11 ++++++++++- app/Template/task_modification/edit_description.php | 12 +++++++++++- app/Template/task_modification/edit_task.php | 11 ++++++++++- 4 files changed, 43 insertions(+), 4 deletions(-) (limited to 'app/Template') diff --git a/app/Template/comment/create.php b/app/Template/comment/create.php index 8bcbe0f7..e9a6404d 100644 --- a/app/Template/comment/create.php +++ b/app/Template/comment/create.php @@ -17,7 +17,18 @@
- form->textarea('comment', $values, $errors, array(! isset($skip_cancel) ? 'autofocus' : '', 'required', 'placeholder="'.t('Leave a comment').'"'), 'comment-textarea') ?> + form->textarea( + 'comment', + $values, + $errors, + array( + ! isset($skip_cancel) ? 'autofocus' : '', + 'required', + 'placeholder="'.t('Leave a comment').'"', + 'data-mention-search-url="'.$this->url->href('UserHelper', 'mention', array('project_id' => $task['project_id'])).'"', + ), + 'comment-textarea' + ) ?>
diff --git a/app/Template/task_creation/form.php b/app/Template/task_creation/form.php index 325ca1c8..c9f367a0 100644 --- a/app/Template/task_creation/form.php +++ b/app/Template/task_creation/form.php @@ -22,7 +22,16 @@
- form->textarea('description', $values, $errors, array('placeholder="'.t('Leave a description').'"', 'tabindex="2"')) ?> + form->textarea( + 'description', + $values, + $errors, + array( + 'placeholder="'.t('Leave a description').'"', + 'tabindex="2"', + 'data-mention-search-url="'.$this->url->href('UserHelper', 'mention', array('project_id' => $values['project_id'])).'"' + ) + ) ?>
diff --git a/app/Template/task_modification/edit_description.php b/app/Template/task_modification/edit_description.php index 4cae939c..c38e885d 100644 --- a/app/Template/task_modification/edit_description.php +++ b/app/Template/task_modification/edit_description.php @@ -17,7 +17,17 @@
- form->textarea('description', $values, $errors, array('autofocus', 'placeholder="'.t('Leave a description').'"'), 'task-show-description-textarea') ?> + form->textarea( + 'description', + $values, + $errors, + array( + 'autofocus', + 'placeholder="'.t('Leave a description').'"', + 'data-mention-search-url="'.$this->url->href('UserHelper', 'mention', array('project_id' => $task['project_id'])).'"' + ), + 'task-show-description-textarea' + ) ?>
diff --git a/app/Template/task_modification/edit_task.php b/app/Template/task_modification/edit_task.php index f4d7449a..6fdb77b5 100644 --- a/app/Template/task_modification/edit_task.php +++ b/app/Template/task_modification/edit_task.php @@ -13,7 +13,16 @@ form->label(t('Description'), 'description') ?>
- form->textarea('description', $values, $errors, array('placeholder="'.t('Leave a description').'"', 'tabindex="2"')) ?> + form->textarea( + 'description', + $values, + $errors, + array( + 'placeholder="'.t('Leave a description').'"', + 'tabindex="2"', + 'data-mention-search-url="'.$this->url->href('UserHelper', 'mention', array('project_id' => $task['project_id'])).'"' + ) + ) ?>
-- cgit v1.2.3