From 854457baf0043b51ce9c30f36a6fecaed97cb04d Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Fri, 18 Mar 2016 21:00:14 -0400 Subject: Improve task summary sections --- app/Template/comment/create.php | 10 ++-- app/Template/comments/create.php | 36 ++++++++++++ app/Template/comments/show.php | 31 ++++++++++ app/Template/subtask/show.php | 44 ++++---------- app/Template/subtask/table.php | 2 - app/Template/task/comments.php | 35 ----------- app/Template/task/description.php | 21 +++---- app/Template/task/details.php | 7 +++ app/Template/task/public.php | 8 +-- app/Template/task/show.php | 20 +++---- app/Template/task/sidebar.php | 20 +++---- app/Template/task_external_link/show.php | 72 ++++------------------- app/Template/task_external_link/table.php | 42 +++++++++++++ app/Template/task_file/files.php | 47 +++++++++++++++ app/Template/task_file/images.php | 34 +++++++++++ app/Template/task_file/show.php | 97 +++---------------------------- app/Template/tasklink/show.php | 55 +++++------------- app/Template/tasklink/table.php | 4 +- 18 files changed, 273 insertions(+), 312 deletions(-) create mode 100644 app/Template/comments/create.php create mode 100644 app/Template/comments/show.php delete mode 100644 app/Template/task/comments.php create mode 100644 app/Template/task_external_link/table.php create mode 100644 app/Template/task_file/files.php create mode 100644 app/Template/task_file/images.php (limited to 'app/Template') diff --git a/app/Template/comment/create.php b/app/Template/comment/create.php index 574eec9f..58b4abdf 100644 --- a/app/Template/comment/create.php +++ b/app/Template/comment/create.php @@ -1,7 +1,7 @@ -
+ form->csrf() ?> form->hidden('task_id', $values) ?> form->hidden('user_id', $values) ?> @@ -21,7 +21,7 @@ $values, $errors, array( - ! isset($skip_cancel) ? 'autofocus' : '', + 'autofocus', 'required', 'placeholder="'.t('Leave a comment').'"', 'data-mention-search-url="'.$this->url->href('UserHelper', 'mention', array('project_id' => $task['project_id'])).'"', @@ -38,9 +38,7 @@
- - - url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'close-popover') ?> - + + url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'close-popover') ?>
diff --git a/app/Template/comments/create.php b/app/Template/comments/create.php new file mode 100644 index 00000000..87d69491 --- /dev/null +++ b/app/Template/comments/create.php @@ -0,0 +1,36 @@ +
+ form->csrf() ?> + form->hidden('task_id', $values) ?> + form->hidden('user_id', $values) ?> + +
+
    +
  • + +
  • +
  • + +
  • +
+
+ form->textarea( + 'comment', + $values, + $errors, + array( + '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/comments/show.php b/app/Template/comments/show.php new file mode 100644 index 00000000..ccc1d9cc --- /dev/null +++ b/app/Template/comments/show.php @@ -0,0 +1,31 @@ +
+
+

+
+
+
+ + url->link(t('change sorting'), 'comment', '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'], + ), + 'errors' => array(), + 'task' => $task, + )) ?> + +
+
\ No newline at end of file diff --git a/app/Template/subtask/show.php b/app/Template/subtask/show.php index 0e94a305..fe436d51 100644 --- a/app/Template/subtask/show.php +++ b/app/Template/subtask/show.php @@ -1,32 +1,12 @@ - -
-

text->e($task['title']) ?>

-
- - - - -
- - render('subtask/table', array('subtasks' => $subtasks, 'task' => $task, 'editable' => $editable)) ?> - - user->hasProjectAccess('subtask', 'save', $task['project_id'])): ?> -
- form->csrf() ?> - form->hidden('task_id', array('task_id' => $task['id'])) ?> - form->text('title', array(), array(), array('required', 'placeholder="'.t('Type here to create a new sub-task').'"')) ?> - form->numeric('time_estimated', array(), array(), array('placeholder="'.t('Original estimate').'"')) ?> - form->select('user_id', $users_list, array(), array(), array('placeholder="'.t('Assignee').'"')) ?> - -
- - -
+
+
+

+
+
+ render('subtask/table', array( + 'subtasks' => $subtasks, + 'task' => $task, + 'editable' => $editable + )) ?> +
+
diff --git a/app/Template/subtask/table.php b/app/Template/subtask/table.php index 0af02dcf..40510a2f 100644 --- a/app/Template/subtask/table.php +++ b/app/Template/subtask/table.php @@ -66,6 +66,4 @@ - -

diff --git a/app/Template/task/comments.php b/app/Template/task/comments.php deleted file mode 100644 index c22e39ec..00000000 --- a/app/Template/task/comments.php +++ /dev/null @@ -1,35 +0,0 @@ - -
- - - - render('comment/show', array( - 'comment' => $comment, - 'task' => $task, - 'project' => $project, - 'editable' => $editable, - 'is_public' => isset($is_public) && $is_public, - )) ?> - - - - render('comment/create', array( - 'skip_cancel' => true, - 'values' => array( - 'user_id' => $this->user->getId(), - 'task_id' => $task['id'], - ), - 'errors' => array(), - 'task' => $task, - )) ?> - -
- \ No newline at end of file diff --git a/app/Template/task/description.php b/app/Template/task/description.php index b84e9f42..9ffe8589 100644 --- a/app/Template/task/description.php +++ b/app/Template/task/description.php @@ -1,16 +1,9 @@ - -
- - -
+
+
+

+
+
+
text->markdown( $task['description'], @@ -36,4 +29,4 @@
- \ No newline at end of file +
\ No newline at end of file diff --git a/app/Template/task/details.php b/app/Template/task/details.php index 61f6c848..a7c4ad01 100644 --- a/app/Template/task/details.php +++ b/app/Template/task/details.php @@ -32,6 +32,13 @@ url->link(t('Public link'), 'task', 'readonly', array('task_id' => $task['id'], 'token' => $project['token']), false, '', '', true) ?> + +
  • + + url->link(t('Back to the board'), 'board', 'readonly', array('token' => $project['token'])) ?> +
  • + +
  • diff --git a/app/Template/task/public.php b/app/Template/task/public.php index 0052214a..723882c3 100644 --- a/app/Template/task/public.php +++ b/app/Template/task/public.php @@ -1,9 +1,6 @@
    - render('task/details', array('task' => $task, 'project' => $project, 'editable' => false)) ?> -

    url->link(t('Back to the board'), 'board', 'readonly', array('token' => $project['token'])) ?>

    - render('task/description', array( 'task' => $task, 'project' => $project, @@ -24,12 +21,11 @@ 'is_public' => true, )) ?> - render('task/comments', array( + render('comments/show', array( 'task' => $task, 'comments' => $comments, 'project' => $project, 'editable' => false, 'is_public' => true, )) ?> - -
    \ No newline at end of file + diff --git a/app/Template/task/show.php b/app/Template/task/show.php index 5dc27ca1..98221bcf 100644 --- a/app/Template/task/show.php +++ b/app/Template/task/show.php @@ -7,11 +7,9 @@ )) ?> hook->render('template:task:show:before-description', array('task' => $task, 'project' => $project)) ?> - render('task/description', array('task' => $task)) ?> hook->render('template:task:show:before-subtasks', array('task' => $task, 'project' => $project)) ?> - render('subtask/show', array( 'task' => $task, 'subtasks' => $subtasks, @@ -20,23 +18,24 @@ 'editable' => true, )) ?> -hook->render('template:task:show:before-tasklinks', array('task' => $task, 'project' => $project)) ?> - +hook->render('template:task:show:before-internal-links', array('task' => $task, 'project' => $project)) ?> render('tasklink/show', array( 'task' => $task, - 'links' => $links, + 'links' => $internal_links, 'project' => $project, 'link_label_list' => $link_label_list, 'editable' => true, 'is_public' => false, )) ?> -hook->render('template:task:show:before-timetracking', array('task' => $task, 'project' => $project)) ?> - -render('task/time_tracking_summary', array('task' => $task)) ?> +hook->render('template:task:show:before-external-links', array('task' => $task, 'project' => $project)) ?> +render('task_external_link/show', array( + 'task' => $task, + 'links' => $external_links, + 'project' => $project, +)) ?> hook->render('template:task:show:before-attachements', array('task' => $task, 'project' => $project)) ?> - render('task_file/show', array( 'task' => $task, 'files' => $files, @@ -44,8 +43,7 @@ )) ?> hook->render('template:task:show:before-comments', array('task' => $task, 'project' => $project)) ?> - -render('task/comments', array( +render('comments/show', array( 'task' => $task, 'comments' => $comments, 'project' => $project, diff --git a/app/Template/task/sidebar.php b/app/Template/task/sidebar.php index e9af71a5..955b17c4 100644 --- a/app/Template/task/sidebar.php +++ b/app/Template/task/sidebar.php @@ -23,18 +23,6 @@ url->link(t('Time tracking'), 'task', 'timetracking', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> -
  • app->checkMenuSelection('subtask', 'show') ?>> - - url->link(t('Sub-tasks'), 'subtask', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> -
  • -
  • app->checkMenuSelection('tasklink', 'show') ?>> - - url->link(t('Internal links'), 'tasklink', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> -
  • -
  • app->checkMenuSelection('TaskExternalLink', 'show') ?>> - - url->link(t('External links'), 'TaskExternalLink', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> -