Show avatar on the cards
This commit is contained in:
@@ -127,6 +127,7 @@ class TaskFinder extends Base
|
|||||||
'tasks.time_spent',
|
'tasks.time_spent',
|
||||||
User::TABLE.'.username AS assignee_username',
|
User::TABLE.'.username AS assignee_username',
|
||||||
User::TABLE.'.name AS assignee_name',
|
User::TABLE.'.name AS assignee_name',
|
||||||
|
User::TABLE.'.email AS assignee_email',
|
||||||
Category::TABLE.'.name AS category_name',
|
Category::TABLE.'.name AS category_name',
|
||||||
Category::TABLE.'.description AS category_description',
|
Category::TABLE.'.description AS category_description',
|
||||||
Column::TABLE.'.title AS column_name',
|
Column::TABLE.'.title AS column_name',
|
||||||
|
|||||||
@@ -18,6 +18,26 @@
|
|||||||
</div>
|
</div>
|
||||||
<?php endif ?>
|
<?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">
|
<div class="task-board-icons">
|
||||||
<?php if (! empty($task['date_due'])): ?>
|
<?php if (! empty($task['date_due'])): ?>
|
||||||
<span class="task-board-date <?= time() > $task['date_due'] ? 'task-board-date-overdue' : '' ?>">
|
<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>
|
<i class="fa fa-file-text-o"></i>
|
||||||
</span>
|
</span>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|
||||||
<?= $this->hook->render('template:board:task:footer', array('task' => $task)) ?>
|
|
||||||
|
|
||||||
<?php if ($task['score']): ?>
|
<?php if ($task['score']): ?>
|
||||||
<span class="task-score"><?= $this->text->e($task['score']) ?></span>
|
<span class="task-score"><?= $this->text->e($task['score']) ?></span>
|
||||||
@@ -78,3 +96,5 @@
|
|||||||
|
|
||||||
<?= $this->task->formatPriority($project, $task) ?>
|
<?= $this->task->formatPriority($project, $task) ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<?= $this->hook->render('template:board:task:footer', array('task' => $task)) ?>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<span class="dropdown">
|
<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>
|
<ul>
|
||||||
<li><i class="fa fa-user fa-fw"></i> <?= $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-user fa-fw"></i> <?= $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> <?= $this->url->link(t('Change category'), 'BoardPopover', 'changeCategory', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?></li>
|
<li><i class="fa fa-tag fa-fw"></i> <?= $this->url->link(t('Change category'), 'BoardPopover', 'changeCategory', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?></li>
|
||||||
|
|||||||
@@ -44,24 +44,6 @@
|
|||||||
</span>
|
</span>
|
||||||
<?php endif ?>
|
<?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): ?>
|
<?php if ($task['is_active'] == 1): ?>
|
||||||
<div class="task-board-days">
|
<div class="task-board-days">
|
||||||
<span title="<?= t('Task age in days')?>" class="task-days-age"><?= $this->dt->age($task['date_creation']) ?></span>
|
<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">
|
<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')) ?>
|
<?= $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>
|
</div>
|
||||||
|
|
||||||
<?= $this->hook->render('template:board:private:task:after-title', array('task' => $task)) ?>
|
<?= $this->hook->render('template:board:private:task:after-title', array('task' => $task)) ?>
|
||||||
|
|
||||||
<?= $this->render('board/task_footer', array(
|
<?= $this->render('board/task_footer', array(
|
||||||
|
|||||||
@@ -8,22 +8,12 @@
|
|||||||
</span>
|
</span>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|
||||||
-
|
|
||||||
|
|
||||||
<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)) ?>
|
<?= $this->hook->render('template:board:public:task:before-title', array('task' => $task)) ?>
|
||||||
|
|
||||||
<div class="task-board-title">
|
<div class="task-board-title">
|
||||||
<?= $this->url->link($this->text->e($task['title']), 'task', 'readonly', array('task_id' => $task['id'], 'token' => $project['token'])) ?>
|
<?= $this->url->link($this->text->e($task['title']), 'task', 'readonly', array('task_id' => $task['id'], 'token' => $project['token'])) ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?= $this->hook->render('template:board:public:task:after-title', array('task' => $task)) ?>
|
<?= $this->hook->render('template:board:public:task:after-title', array('task' => $task)) ?>
|
||||||
|
|
||||||
<?= $this->render('board/task_footer', array(
|
<?= $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
@@ -31,7 +31,7 @@
|
|||||||
.avatar-20 .avatar-letter {
|
.avatar-20 .avatar-letter {
|
||||||
line-height: 20px;
|
line-height: 20px;
|
||||||
width: 20px;
|
width: 20px;
|
||||||
font-size: 11px;
|
font-size: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.avatar-letter {
|
.avatar-letter {
|
||||||
|
|||||||
@@ -55,17 +55,8 @@ a.task-board-collapsed-title {
|
|||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
.task-board-user {
|
.task-board-change-assignee {
|
||||||
font-size: 0.8em;
|
cursor: pointer;
|
||||||
}
|
|
||||||
|
|
||||||
.task-board-current-user a {
|
|
||||||
text-decoration: underline;
|
|
||||||
}
|
|
||||||
|
|
||||||
.task-board-current-user a:focus,
|
|
||||||
.task-board-current-user a:hover {
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
a.task-board-nobody {
|
a.task-board-nobody {
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -148,8 +148,13 @@ Board.prototype.changeTaskState = function(taskId) {
|
|||||||
Board.prototype.listen = function() {
|
Board.prototype.listen = function() {
|
||||||
var self = this;
|
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) {
|
$(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");
|
window.location = $(this).data("task-url");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user