From f3deb6492a74f1ffa9e3391274e0ab7947a04016 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sun, 26 Feb 2017 19:30:02 -0500 Subject: Add toggle button to show/hide subtasks in task list view --- app/Template/task_list/header.php | 6 ++++++ app/Template/task_list/listing.php | 13 ++++++++++--- app/Template/task_list/task_subtasks.php | 22 ++++++++++++++++++++++ 3 files changed, 38 insertions(+), 3 deletions(-) create mode 100644 app/Template/task_list/task_subtasks.php (limited to 'app/Template/task_list') diff --git a/app/Template/task_list/header.php b/app/Template/task_list/header.php index fb05dbdc..6501a919 100644 --- a/app/Template/task_list/header.php +++ b/app/Template/task_list/header.php @@ -7,6 +7,12 @@
+ user->hasSubtaskListActivated()): ?> + url->icon('tasks', t('Hide subtasks'), 'TaskListController', 'show', array('project_id' => $project['id'], 'hide_subtasks' => 1)) ?> + + url->icon('tasks', t('Show subtasks'), 'TaskListController', 'show', array('project_id' => $project['id'], 'show_subtasks' => 1)) ?> + + render('task_list/sort_menu', array('paginator' => $paginator)) ?>
\ No newline at end of file diff --git a/app/Template/task_list/listing.php b/app/Template/task_list/listing.php index 171c148d..b3c66aa6 100644 --- a/app/Template/task_list/listing.php +++ b/app/Template/task_list/listing.php @@ -5,7 +5,11 @@

isEmpty()): ?>
- render('task_list/header', array('paginator' => $paginator)) ?> + render('task_list/header', array( + 'paginator' => $paginator, + 'project' => $project, + )) ?> + getCollection() as $task): ?>
render('task_list/task_title', array( @@ -21,8 +25,11 @@ )) ?> render('task_list/task_icons', array( - 'project' => $project, - 'task' => $task, + 'task' => $task, + )) ?> + + render('task_list/task_subtasks', array( + 'task' => $task, )) ?>
diff --git a/app/Template/task_list/task_subtasks.php b/app/Template/task_list/task_subtasks.php new file mode 100644 index 00000000..716d6df2 --- /dev/null +++ b/app/Template/task_list/task_subtasks.php @@ -0,0 +1,22 @@ + +
+ +
+ + subtask->renderToggleStatus($task, $subtask) ?> + + + + text->e($subtask['name'] ?: $subtask['username']) ?> + + + + render('subtask/timer', array( + 'task' => $task, + 'subtask' => $subtask, + )) ?> + +
+ +
+ -- cgit v1.2.3