From 8bf054a480ecc2d31b857cb27bd6256f1efdd74c Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 11 Feb 2017 17:22:10 -0500 Subject: Open comments in board view with a modal dialog instead of tooltip --- app/Template/board/task_footer.php | 11 +++++++++-- app/Template/board/task_private.php | 4 ++-- app/Template/board/tooltip_comments.php | 9 --------- app/Template/comment/show.php | 13 ++++++------ app/Template/comment_list/create.php | 8 ++++++++ app/Template/comment_list/show.php | 27 +++++++++++++++++++++++++ app/Template/comments/create.php | 11 ----------- app/Template/comments/show.php | 35 --------------------------------- app/Template/task/public.php | 2 +- app/Template/task/show.php | 2 +- app/Template/task_comments/create.php | 8 ++++++++ app/Template/task_comments/show.php | 31 +++++++++++++++++++++++++++++ 12 files changed, 93 insertions(+), 68 deletions(-) delete mode 100644 app/Template/board/tooltip_comments.php create mode 100644 app/Template/comment_list/create.php create mode 100644 app/Template/comment_list/show.php delete mode 100644 app/Template/comments/create.php delete mode 100644 app/Template/comments/show.php create mode 100644 app/Template/task_comments/create.php create mode 100644 app/Template/task_comments/show.php (limited to 'app/Template') diff --git a/app/Template/board/task_footer.php b/app/Template/board/task_footer.php index 23f4e32e..4e561f14 100644 --- a/app/Template/board/task_footer.php +++ b/app/Template/board/task_footer.php @@ -95,8 +95,15 @@   - -   + 0): ?> + modal->medium( + 'comments-o', + $task['nb_comments'], + 'CommentListController', + 'show', + array('task_id' => $task['id'], 'project_id' => $task['project_id']), + $task['nb_comments'] == 1 ? t('%d comment', $task['nb_comments']) : t('%d comments', $task['nb_comments']) + ) ?> diff --git a/app/Template/board/task_private.php b/app/Template/board/task_private.php index 3201d4e2..1be64fcf 100644 --- a/app/Template/board/task_private.php +++ b/app/Template/board/task_private.php @@ -28,7 +28,7 @@ text->e($this->user->getInitials($task['assignee_name'] ?: $task['assignee_username'])) ?> - - url->link($this->text->e($task['title']), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-collapsed-title tooltip', $this->text->e($task['title'])) ?> + text->e($task['title']) ?>
@@ -50,7 +50,7 @@ hook->render('template:board:private:task:before-title', array('task' => $task)) ?>
- url->link($this->text->e($task['title']), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?> + text->e($task['title']) ?>
hook->render('template:board:private:task:after-title', array('task' => $task)) ?> diff --git a/app/Template/board/tooltip_comments.php b/app/Template/board/tooltip_comments.php deleted file mode 100644 index a1071848..00000000 --- a/app/Template/board/tooltip_comments.php +++ /dev/null @@ -1,9 +0,0 @@ -
- - render('comment/show', array( - 'comment' => $comment, - 'task' => $task, - 'hide_actions' => true, - )) ?> - -
diff --git a/app/Template/comment/show.php b/app/Template/comment/show.php index f8d9607e..d8470c24 100644 --- a/app/Template/comment/show.php +++ b/app/Template/comment/show.php @@ -9,13 +9,6 @@ dt->datetime($comment['date_creation']) ?> dt->datetime($comment['date_modification']) ?> - -
- -
-
- text->markdown($comment['comment'], isset($is_public) && $is_public) ?> -
@@ -36,4 +29,10 @@ + +
+
+ text->markdown($comment['comment'], isset($is_public) && $is_public) ?> +
+
diff --git a/app/Template/comment_list/create.php b/app/Template/comment_list/create.php new file mode 100644 index 00000000..a1bae5eb --- /dev/null +++ b/app/Template/comment_list/create.php @@ -0,0 +1,8 @@ + +
+ form->csrf() ?> + form->textEditor('comment', array(), array(), array('required' => true)) ?> + modal->submitButtons() ?> +
diff --git a/app/Template/comment_list/show.php b/app/Template/comment_list/show.php new file mode 100644 index 00000000..6e362560 --- /dev/null +++ b/app/Template/comment_list/show.php @@ -0,0 +1,27 @@ + +
+ + render('comment/show', array( + 'comment' => $comment, + 'task' => $task, + 'project' => $project, + 'editable' => $editable, + 'is_public' => isset($is_public) && $is_public, + )) ?> + + + + render('comment_list/create', array( + 'task' => $task, + )) ?> + +
diff --git a/app/Template/comments/create.php b/app/Template/comments/create.php deleted file mode 100644 index 06173575..00000000 --- a/app/Template/comments/create.php +++ /dev/null @@ -1,11 +0,0 @@ -
- form->csrf() ?> - form->hidden('task_id', $values) ?> - form->hidden('user_id', $values) ?> - - form->textEditor('comment', $values, $errors, array('required' => true)) ?> - -
- -
-
diff --git a/app/Template/comments/show.php b/app/Template/comments/show.php deleted file mode 100644 index 3edf7076..00000000 --- a/app/Template/comments/show.php +++ /dev/null @@ -1,35 +0,0 @@ -
-
-

-
-
- -
- - url->icon('sort', t('change sorting'), 'CommentController', 'toggleSorting', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> - -
- - - render('comment/show', array( - 'comment' => $comment, - 'task' => $task, - 'project' => $project, - 'editable' => $editable, - 'is_public' => isset($is_public) && $is_public, - )) ?> - - - - render('comments/create', array( - 'values' => array( - 'user_id' => $this->user->getId(), - 'task_id' => $task['id'], - 'project_id' => $task['project_id'], - ), - 'errors' => array(), - 'task' => $task, - )) ?> - -
-
diff --git a/app/Template/task/public.php b/app/Template/task/public.php index b8405ff7..eb3b9f1d 100644 --- a/app/Template/task/public.php +++ b/app/Template/task/public.php @@ -26,7 +26,7 @@ 'is_public' => true, )) ?> - render('comments/show', array( + render('task_comments/show', array( 'task' => $task, 'comments' => $comments, 'project' => $project, diff --git a/app/Template/task/show.php b/app/Template/task/show.php index a5c2d5a7..565f0632 100644 --- a/app/Template/task/show.php +++ b/app/Template/task/show.php @@ -54,7 +54,7 @@ hook->render('template:task:show:before-comments', array('task' => $task, 'project' => $project)) ?> - render('comments/show', array( + render('task_comments/show', array( 'task' => $task, 'comments' => $comments, 'project' => $project, diff --git a/app/Template/task_comments/create.php b/app/Template/task_comments/create.php new file mode 100644 index 00000000..05b05120 --- /dev/null +++ b/app/Template/task_comments/create.php @@ -0,0 +1,8 @@ +
+ form->csrf() ?> + form->hidden('task_id', $values) ?> + form->hidden('user_id', $values) ?> + + form->textEditor('comment', $values, $errors, array('required' => true)) ?> + modal->submitButtons() ?> +
diff --git a/app/Template/task_comments/show.php b/app/Template/task_comments/show.php new file mode 100644 index 00000000..18200bc8 --- /dev/null +++ b/app/Template/task_comments/show.php @@ -0,0 +1,31 @@ +
+
+

+
+
+ +
+ + url->icon('sort', t('change sorting'), 'CommentController', 'toggleSorting', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + +
+ + + render('comment/show', array( + 'comment' => $comment, + 'task' => $task, + 'project' => $project, + 'editable' => $editable, + 'is_public' => isset($is_public) && $is_public, + )) ?> + + + + render('task_comments/create', array( + 'values' => array(), + 'errors' => array(), + 'task' => $task, + )) ?> + +
+
-- cgit v1.2.3