Show avatar on the cards

This commit is contained in:
Frederic Guillot 2016-03-19 14:36:16 -04:00
parent 2e320ceead
commit 63a5bbafea
11 changed files with 38 additions and 49 deletions

View File

@ -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',

View File

@ -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)) ?>

View File

@ -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>

View File

@ -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(

View File

@ -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(

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -31,7 +31,7 @@
.avatar-20 .avatar-letter {
line-height: 20px;
width: 20px;
font-size: 11px;
font-size: 10px;
}
.avatar-letter {

View File

@ -55,17 +55,8 @@ a.task-board-collapsed-title {
font-weight: normal;
}
.task-board-user {
font-size: 0.8em;
}
.task-board-current-user a {
text-decoration: underline;
}
.task-board-current-user a:focus,
.task-board-current-user a:hover {
text-decoration: none;
.task-board-change-assignee {
cursor: pointer;
}
a.task-board-nobody {

File diff suppressed because one or more lines are too long

View File

@ -148,8 +148,13 @@ Board.prototype.changeTaskState = function(taskId) {
Board.prototype.listen = function() {
var self = this;
$(document).on("click", ".task-board-change-assignee", function(e) {
e.preventDefault();
self.app.popover.open($(this).data('url'));
});
$(document).on("click", ".task-board", function(e) {
if (e.target.tagName != "A") {
if (e.target.tagName != "A" && e.target.tagName != "IMG") {
window.location = $(this).data("task-url");
}
});