summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-02-01 11:05:07 -0500
committerFrederic Guillot <fred@kanboard.net>2015-02-01 11:05:07 -0500
commitbe4e90e319cf65b368bb866165abc8d1fd4e074f (patch)
treed7170a150abf37644654b2c35910dee54663eb7b /app
parent9a98013736f1acebbb62c5fce6a10c02e32b516f (diff)
Add collapsible swimlanes (merge and improve pull-request #565)
Diffstat (limited to 'app')
-rw-r--r--app/Model/Board.php2
-rw-r--r--app/Template/board/swimlane.php23
2 files changed, 20 insertions, 5 deletions
diff --git a/app/Model/Board.php b/app/Model/Board.php
index 8dd68a80..030f1efe 100644
--- a/app/Model/Board.php
+++ b/app/Model/Board.php
@@ -243,10 +243,12 @@ class Board extends Base
$swimlanes[$i]['columns'] = $columns;
$swimlanes[$i]['nb_columns'] = $nb_columns;
+ $swimlanes[$i]['nb_tasks'] = 0;
for ($j = 0; $j < $nb_columns; $j++) {
$swimlanes[$i]['columns'][$j]['tasks'] = $this->taskFinder->getTasksByColumnAndSwimlane($project_id, $columns[$j]['id'], $swimlanes[$i]['id']);
$swimlanes[$i]['columns'][$j]['nb_tasks'] = count($swimlanes[$i]['columns'][$j]['tasks']);
+ $swimlanes[$i]['nb_tasks'] += $swimlanes[$i]['columns'][$j]['nb_tasks'];
}
}
diff --git a/app/Template/board/swimlane.php b/app/Template/board/swimlane.php
index 5766141e..77bc4114 100644
--- a/app/Template/board/swimlane.php
+++ b/app/Template/board/swimlane.php
@@ -1,6 +1,20 @@
<tr>
<?php if (! $hide_swimlane): ?>
- <td width="10%"></td>
+ <th>
+
+ <?php if ($swimlane['nb_tasks'] > 0): ?>
+ <a href="#" class="board-swimlane-toggle" data-swimlane-id="<?= $swimlane['id'] ?>">
+ <i class="fa fa-minus-circle hide-icon-swimlane-<?= $swimlane['id'] ?>"></i>
+ <i class="fa fa-plus-circle show-icon-swimlane-<?= $swimlane['id'] ?>" style="display: none"></i>
+ </a>
+ <?php endif ?>
+
+ <?= $this->e($swimlane['name']) ?>
+
+ <span title="<?= t('Task count') ?>" class="task-count">
+ (<span><?= $swimlane['nb_tasks'] ?></span>)
+ </span>
+ </th>
<?php endif ?>
<?php foreach ($swimlane['columns'] as $column): ?>
@@ -25,11 +39,10 @@
</th>
<?php endforeach ?>
</tr>
-<tr>
+<tr class="swimlane-row-<?= $swimlane['id'] ?>">
+
<?php if (! $hide_swimlane): ?>
- <th class="board-swimlane-title">
- <?= $this->e($swimlane['name']) ?>
- </th>
+ <th></th>
<?php endif ?>
<?php foreach ($swimlane['columns'] as $column): ?>