summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2014-09-11 16:27:10 +0200
committerFrédéric Guillot <fred@kanboard.net>2014-09-11 16:27:10 +0200
commitd9850ae66ac7c6545633b3cfa0fe1b811b27bc41 (patch)
treeed90170bcbdecd073bf99e841c1b297c2422aa14
parentaa23098995c700ad310a760a89f183a64c65aa79 (diff)
Add icon for subtasks on the board
-rw-r--r--app/Model/Task.php2
-rw-r--r--app/Templates/board_task.php17
-rw-r--r--assets/css/app.css14
3 files changed, 28 insertions, 5 deletions
diff --git a/app/Model/Task.php b/app/Model/Task.php
index 10d125d4..7245417a 100644
--- a/app/Model/Task.php
+++ b/app/Model/Task.php
@@ -195,6 +195,8 @@ class Task extends Base
->columns(
'(SELECT count(*) FROM comments WHERE task_id=tasks.id) AS nb_comments',
'(SELECT count(*) FROM task_has_files WHERE task_id=tasks.id) AS nb_files',
+ '(SELECT count(*) FROM task_has_subtasks WHERE task_id=tasks.id) AS nb_subtasks',
+ '(SELECT count(*) FROM task_has_subtasks WHERE task_id=tasks.id AND status=2) AS nb_completed_subtasks',
'tasks.id',
'tasks.title',
'tasks.description',
diff --git a/app/Templates/board_task.php b/app/Templates/board_task.php
index 20947a02..4f3546e2 100644
--- a/app/Templates/board_task.php
+++ b/app/Templates/board_task.php
@@ -56,7 +56,7 @@
<?php endif ?>
-<?php if (! empty($task['date_due']) || ! empty($task['nb_files']) || ! empty($task['nb_comments']) || ! empty($task['description'])): ?>
+<?php if (! empty($task['date_due']) || ! empty($task['nb_files']) || ! empty($task['nb_comments']) || ! empty($task['description']) || ! empty($task['nb_subtasks'])): ?>
<div class="task-board-footer">
<?php if (! empty($task['date_due'])): ?>
@@ -66,20 +66,27 @@
<?php endif ?>
<div class="task-board-icons">
+
+ <?php if (! empty($task['nb_subtasks'])): ?>
+ <span title="<?= t('Sub-Tasks') ?>"><?= $task['nb_completed_subtasks'].'/'.$task['nb_subtasks'] ?> <i class="fa fa-bars"></i></span>
+ <?php endif ?>
+
<?php if (! empty($task['nb_files'])): ?>
- <?= $task['nb_files'] ?> <i class="fa fa-paperclip" title="<?= t('Attachments') ?>"></i>
+ <span title="<?= t('Attachments') ?>"><?= $task['nb_files'] ?> <i class="fa fa-paperclip"></i></span>
<?php endif ?>
<?php if (! empty($task['nb_comments'])): ?>
- <?= $task['nb_comments'] ?> <i class="fa fa-comment-o" title="<?= p($task['nb_comments'], t('%d comment', $task['nb_comments']), t('%d comments', $task['nb_comments'])) ?>"></i>
+ <span title="<?= p($task['nb_comments'], t('%d comment', $task['nb_comments']), t('%d comments', $task['nb_comments'])) ?>"><?= $task['nb_comments'] ?> <i class="fa fa-comment-o"></i></span>
<?php endif ?>
<?php if (! empty($task['description'])): ?>
+ <span title="<?= t('Description') ?>">
<?php if (! isset($not_editable)): ?>
- <a class="task-description-popover" href="?controller=task&amp;action=description&amp;task_id=<?= $task['id'] ?>"><i class="fa fa-file-text-o" title="<?= t('Description') ?>" data-href="?controller=task&amp;action=description&amp;task_id=<?= $task['id'] ?>"></i></a>
+ <a class="task-description-popover" href="?controller=task&amp;action=description&amp;task_id=<?= $task['id'] ?>"><i class="fa fa-file-text-o" data-href="?controller=task&amp;action=description&amp;task_id=<?= $task['id'] ?>"></i></a>
<?php else: ?>
- <i class="fa fa-file-text-o" title="<?= t('Description') ?>"></i>
+ <i class="fa fa-file-text-o"></i>
<?php endif ?>
+ </span>
<?php endif ?>
</div>
</div>
diff --git a/assets/css/app.css b/assets/css/app.css
index a612a8f4..3f6e131f 100644
--- a/assets/css/app.css
+++ b/assets/css/app.css
@@ -693,6 +693,20 @@ a.task-board-nobody {
right: 5px;
}
+.task-board-icons a {
+ opacity: 0.5;
+}
+
+.task-board-icons span {
+ opacity: 0.5;
+ margin-left: 5px;
+}
+
+.task-board-icons a:hover,
+.task-board-icons span:hover {
+ opacity: 1.0;
+}
+
/* task score */
.task-score {
font-weight: bold;