summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-03-19 14:36:16 -0400
committerFrederic Guillot <fred@kanboard.net>2016-03-19 14:36:16 -0400
commit63a5bbafea58ffcf7b018d8e36569543c7dbe953 (patch)
treebabd78cb695b5630a7075fdd6d51968eebcac9e6 /app
parent2e320ceeadf5e134352a9bb83efff93964a40f81 (diff)
Show avatar on the cards
Diffstat (limited to 'app')
-rw-r--r--app/Model/TaskFinder.php1
-rw-r--r--app/Template/board/task_footer.php24
-rw-r--r--app/Template/board/task_menu.php2
-rw-r--r--app/Template/board/task_private.php20
-rw-r--r--app/Template/board/task_public.php12
5 files changed, 26 insertions, 33 deletions
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 @@
</div>
<?php endif ?>
+<?php if (! empty($task['owner_id'])): ?>
+<div class="task-board-avatars">
+ <?php if ($this->user->hasProjectAccess('taskmodification', 'edit', $task['project_id'])): ?>
+ <div
+ class="task-board-assignee task-board-change-assignee"
+ data-url="<?= $this->url->href('BoardPopover', 'changeAssignee', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>">
+ <?php else: ?>
+ <div class="task-board-assignee">
+ <?php endif ?>
+ <?= $this->avatar->small(
+ $task['owner_id'],
+ $task['assignee_username'],
+ $task['assignee_name'],
+ $task['assignee_email'],
+ 'avatar-inline'
+ ) ?>
+ </div>
+</div>
+<?php endif ?>
+
<div class="task-board-icons">
<?php if (! empty($task['date_due'])): ?>
<span class="task-board-date <?= time() > $task['date_due'] ? 'task-board-date-overdue' : '' ?>">
@@ -59,8 +79,6 @@
<i class="fa fa-file-text-o"></i>
</span>
<?php endif ?>
-
- <?= $this->hook->render('template:board:task:footer', array('task' => $task)) ?>
<?php if ($task['score']): ?>
<span class="task-score"><?= $this->text->e($task['score']) ?></span>
@@ -78,3 +96,5 @@
<?= $this->task->formatPriority($project, $task) ?>
</div>
+
+<?= $this->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 @@
<span class="dropdown">
- <a href="#" class="dropdown-menu"><?= '#'.$task['id'] ?></a>
+ <a href="#" class="dropdown-menu"><?= '#'.$task['id'] ?> <i class="fa fa-caret-down"></i></a>
<ul>
<li><i class="fa fa-user fa-fw"></i>&nbsp;<?= $this->url->link(t('Change assignee'), 'BoardPopover', 'changeAssignee', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?></li>
<li><i class="fa fa-tag fa-fw"></i>&nbsp;<?= $this->url->link(t('Change category'), 'BoardPopover', 'changeCategory', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?></li>
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 @@
</span>
<?php endif ?>
- <?php if (! empty($task['owner_id'])): ?>
- <span class="task-board-user <?= $this->user->isCurrentUser($task['owner_id']) ? 'task-board-current-user' : '' ?>">
- <?php if ($this->user->hasProjectAccess('taskmodification', 'edit', $task['project_id'])): ?>
- <?= $this->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')
- ) ?>
- <?php else: ?>
- <?= $this->text->e($task['assignee_name'] ?: $task['assignee_username']) ?>
- <?php endif ?>
- </span>
- <?php endif ?>
-
<?php if ($task['is_active'] == 1): ?>
<div class="task-board-days">
<span title="<?= t('Task age in days')?>" class="task-days-age"><?= $this->dt->age($task['date_creation']) ?></span>
@@ -76,7 +58,7 @@
<div class="task-board-title">
<?= $this->url->link($this->text->e($task['title']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?>
</div>
-
+
<?= $this->hook->render('template:board:private:task:after-title', array('task' => $task)) ?>
<?= $this->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 @@
</span>
<?php endif ?>
- &nbsp;-&nbsp;
-
- <span class="task-board-user">
- <?php if (! empty($task['owner_id'])): ?>
- <?= t('Assigned to %s', $task['assignee_name'] ?: $task['assignee_username']) ?>
- <?php else: ?>
- <span class="task-board-nobody"><?= t('Nobody assigned') ?></span>
- <?php endif ?>
- </span>
-
<?= $this->hook->render('template:board:public:task:before-title', array('task' => $task)) ?>
<div class="task-board-title">
<?= $this->url->link($this->text->e($task['title']), 'task', 'readonly', array('task_id' => $task['id'], 'token' => $project['token'])) ?>
</div>
-
+
<?= $this->hook->render('template:board:public:task:after-title', array('task' => $task)) ?>
<?= $this->render('board/task_footer', array(