From bb8b4c0e36afc05ff5b0cb3ac6465351a696b001 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sun, 5 Jul 2015 16:07:21 -0400 Subject: Add task analytics --- app/Template/board/task_private.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/Template/board/task_private.php') diff --git a/app/Template/board/task_private.php b/app/Template/board/task_private.php index 87121f2c..3f4010ea 100644 --- a/app/Template/board/task_private.php +++ b/app/Template/board/task_private.php @@ -43,8 +43,8 @@
- datetime->age($task['date_creation']) ?> - datetime->age($task['date_moved']) ?> + dt->age($task['date_creation']) ?> + dt->age($task['date_moved']) ?>
-- cgit v1.2.3 From 2f8beda6af9a3f360379ed689c2eb81833e23039 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Tue, 7 Jul 2015 20:19:57 -0400 Subject: Move board collapse/expand mode to server side to avoid board flickering --- app/Controller/Board.php | 24 ++++++++++ app/Helper/Board.php | 24 ++++++++++ app/Model/UserSession.php | 24 ++++++++++ app/Template/board/task_private.php | 88 +++++++++++++++++++------------------ app/Template/layout.php | 2 +- app/Template/project/filters.php | 13 +++--- assets/js/app.js | 15 +++---- assets/js/src/board.js | 73 +----------------------------- 8 files changed, 133 insertions(+), 130 deletions(-) create mode 100644 app/Helper/Board.php (limited to 'app/Template/board/task_private.php') diff --git a/app/Controller/Board.php b/app/Controller/Board.php index caaa38ef..ac80a192 100644 --- a/app/Controller/Board.php +++ b/app/Controller/Board.php @@ -310,4 +310,28 @@ class Board extends Base 'recurrence_basedate_list' => $this->task->getRecurrenceBasedateList(), ))); } + + /** + * Enable collapsed mode + * + * @access public + */ + public function collapse() + { + $project_id = $this->request->getIntegerParam('project_id'); + $this->userSession->setBoardDisplayMode($project_id, true); + $this->response->redirect($this->helper->url->to('board', 'show', array('project_id' => $project_id))); + } + + /** + * Enable expanded mode + * + * @access public + */ + public function expand() + { + $project_id = $this->request->getIntegerParam('project_id'); + $this->userSession->setBoardDisplayMode($project_id, false); + $this->response->redirect($this->helper->url->to('board', 'show', array('project_id' => $project_id))); + } } diff --git a/app/Helper/Board.php b/app/Helper/Board.php new file mode 100644 index 00000000..452a3b70 --- /dev/null +++ b/app/Helper/Board.php @@ -0,0 +1,24 @@ +userSession->isBoardCollapsed($project_id); + } +} diff --git a/app/Model/UserSession.php b/app/Model/UserSession.php index 6de4a182..44a9c2a2 100644 --- a/app/Model/UserSession.php +++ b/app/Model/UserSession.php @@ -118,4 +118,28 @@ class UserSession extends Base { $_SESSION['filters'][$project_id] = $filters; } + + /** + * Is board collapsed or expanded + * + * @access public + * @param integer $project_id + * @return boolean + */ + public function isBoardCollapsed($project_id) + { + return ! empty($_SESSION['board_collapsed'][$project_id]) ? $_SESSION['board_collapsed'][$project_id] : false; + } + + /** + * Set board display mode + * + * @access public + * @param integer $project_id + * @param boolean $collapsed + */ + public function setBoardDisplayMode($project_id, $collapsed) + { + $_SESSION['board_collapsed'][$project_id] = $collapsed; + } } diff --git a/app/Template/board/task_private.php b/app/Template/board/task_private.php index 3f4010ea..7eaff580 100644 --- a/app/Template/board/task_private.php +++ b/app/Template/board/task_private.php @@ -10,53 +10,55 @@ render('board/task_menu', array('task' => $task)) ?> - + board->isCollapsed($project['id'])): ?> +
+ + + e($this->user->getInitials($task['assignee_name'] ?: $task['assignee_username'])) ?> + - + + url->link($this->e($task['title']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'task-board-collapsed-title') ?> + +
+ +
-
+ + + () + + - - - () - - + + url->link( + (! empty($task['owner_id']) ? ($task['assignee_name'] ?: $task['assignee_username']) : t('Nobody assigned')), + 'board', + 'changeAssignee', + array('task_id' => $task['id'], 'project_id' => $task['project_id']), + false, + 'task-board-popover', + t('Change assignee') + ) ?> + - - url->link( - (! empty($task['owner_id']) ? ($task['assignee_name'] ?: $task['assignee_username']) : t('Nobody assigned')), - 'board', - 'changeAssignee', - array('task_id' => $task['id'], 'project_id' => $task['project_id']), - false, - 'task-board-popover', - t('Change assignee') - ) ?> - + +
+ dt->age($task['date_creation']) ?> + dt->age($task['date_moved']) ?> +
+ +
+ - -
- dt->age($task['date_creation']) ?> - dt->age($task['date_moved']) ?> -
- -
- +
+ url->link($this->e($task['title']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?> +
-
- url->link($this->e($task['title']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?> + render('board/task_footer', array( + 'task' => $task, + 'not_editable' => $not_editable, + )) ?>
- - render('board/task_footer', array( - 'task' => $task, - 'not_editable' => $not_editable, - )) ?> -
+
diff --git a/app/Template/layout.php b/app/Template/layout.php index d804d3d5..a9f1cbc3 100644 --- a/app/Template/layout.php +++ b/app/Template/layout.php @@ -48,7 +48,7 @@