From 63a5bbafea58ffcf7b018d8e36569543c7dbe953 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 19 Mar 2016 14:36:16 -0400 Subject: Show avatar on the cards --- app/Model/TaskFinder.php | 1 + app/Template/board/task_footer.php | 24 ++++++++++++++++++++++-- app/Template/board/task_menu.php | 2 +- app/Template/board/task_private.php | 20 +------------------- app/Template/board/task_public.php | 12 +----------- 5 files changed, 26 insertions(+), 33 deletions(-) (limited to 'app') diff --git a/app/Model/TaskFinder.php b/app/Model/TaskFinder.php index 0492a9bf..d67372cc 100644 --- a/app/Model/TaskFinder.php +++ b/app/Model/TaskFinder.php @@ -127,6 +127,7 @@ class TaskFinder extends Base 'tasks.time_spent', User::TABLE.'.username AS assignee_username', User::TABLE.'.name AS assignee_name', + User::TABLE.'.email AS assignee_email', Category::TABLE.'.name AS category_name', Category::TABLE.'.description AS category_description', Column::TABLE.'.title AS column_name', diff --git a/app/Template/board/task_footer.php b/app/Template/board/task_footer.php index cb1f1b0d..f5614f1d 100644 --- a/app/Template/board/task_footer.php +++ b/app/Template/board/task_footer.php @@ -18,6 +18,26 @@ + +
+ user->hasProjectAccess('taskmodification', 'edit', $task['project_id'])): ?> +
+ +
+ + avatar->small( + $task['owner_id'], + $task['assignee_username'], + $task['assignee_name'], + $task['assignee_email'], + 'avatar-inline' + ) ?> +
+
+ +
@@ -59,8 +79,6 @@ - - hook->render('template:board:task:footer', array('task' => $task)) ?> text->e($task['score']) ?> @@ -78,3 +96,5 @@ task->formatPriority($project, $task) ?>
+ +hook->render('template:board:task:footer', array('task' => $task)) ?> diff --git a/app/Template/board/task_menu.php b/app/Template/board/task_menu.php index ce9b7fa2..c0d97cda 100644 --- a/app/Template/board/task_menu.php +++ b/app/Template/board/task_menu.php @@ -1,5 +1,5 @@ - +
  •  url->link(t('Change assignee'), 'BoardPopover', 'changeAssignee', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
  •  url->link(t('Change category'), 'BoardPopover', 'changeCategory', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
  • diff --git a/app/Template/board/task_private.php b/app/Template/board/task_private.php index 234480cb..a066ad1e 100644 --- a/app/Template/board/task_private.php +++ b/app/Template/board/task_private.php @@ -44,24 +44,6 @@ - - - user->hasProjectAccess('taskmodification', 'edit', $task['project_id'])): ?> - url->link( - $task['assignee_name'] ?: $task['assignee_username'], - 'BoardPopover', - 'changeAssignee', - array('task_id' => $task['id'], 'project_id' => $task['project_id']), - false, - 'popover', - t('Change assignee') - ) ?> - - text->e($task['assignee_name'] ?: $task['assignee_username']) ?> - - - -
    dt->age($task['date_creation']) ?> @@ -76,7 +58,7 @@
    url->link($this->text->e($task['title']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?>
    - + hook->render('template:board:private:task:after-title', array('task' => $task)) ?> render('board/task_footer', array( diff --git a/app/Template/board/task_public.php b/app/Template/board/task_public.php index 15806613..c62cce1a 100644 --- a/app/Template/board/task_public.php +++ b/app/Template/board/task_public.php @@ -8,22 +8,12 @@ -  -  - - - - - - - - - hook->render('template:board:public:task:before-title', array('task' => $task)) ?>
    url->link($this->text->e($task['title']), 'task', 'readonly', array('task_id' => $task['id'], 'token' => $project['token'])) ?>
    - + hook->render('template:board:public:task:after-title', array('task' => $task)) ?> render('board/task_footer', array( -- cgit v1.2.3