diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-10-06 21:51:10 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-10-06 21:51:10 -0400 |
commit | f3f438a3ffed5f8594ead5d8cff60ee1c8a4673f (patch) | |
tree | 2fd70f70d48032719f4a23f148e36e1ce1a4e5dd /app | |
parent | 28a4c86f7af4e7ed33ca19424c47e7b0ce054536 (diff) |
Repeat column headers for each swimlane
Diffstat (limited to 'app')
-rw-r--r-- | app/Template/board/table_column.php | 23 | ||||
-rw-r--r-- | app/Template/board/table_container.php | 56 | ||||
-rw-r--r-- | app/Template/board/table_tasks.php | 2 |
3 files changed, 47 insertions, 34 deletions
diff --git a/app/Template/board/table_column.php b/app/Template/board/table_column.php index da8db52d..2a6b496a 100644 --- a/app/Template/board/table_column.php +++ b/app/Template/board/table_column.php @@ -1,13 +1,12 @@ <!-- column titles --> -<?php ?> -<tr> +<tr class="board-swimlane-columns-<?= $swimlane['id'] ?>"> <?php foreach ($swimlane['columns'] as $column): ?> <th class="board-column-header board-column-header-<?= $column['id'] ?>" data-column-id="<?= $column['id'] ?>"> <!-- column in collapsed mode --> <div class="board-column-collapsed"> <span title="<?= t('Task count') ?>" class="board-column-header-task-count" title="<?= t('Show this column') ?>"> - <span id="task-number-column-<?= $column['id'] ?>"><?= $column['nb_column_tasks'] ?></span> + <span id="task-number-column-<?= $column['id'] ?>"><?= $column['nb_tasks'] ?></span> </span> </div> @@ -19,6 +18,12 @@ </div> <?php endif ?> + <?php if ($swimlane['nb_swimlanes'] > 1 && ! empty($column['nb_column_tasks'])): ?> + <span title="<?= t('Total number of tasks in this column across all swimlanes') ?>" class="board-column-header-task-count"> + (<span><?= $column['nb_column_tasks'] ?></span>) + </span> + <?php endif ?> + <span class="board-column-title" data-column-id="<?= $column['id'] ?>" title="<?= t('Hide this column') ?>"> <?= $this->e($column['title']) ?> </span> @@ -31,17 +36,17 @@ <?php if (! empty($column['score'])): ?> <span class="pull-right" title="<?= t('Score') ?>"> - <?= $column['total_score'] ?> + <?= $column['score'] ?> </span> <?php endif ?> - <span title="<?= t('Total number of tasks in this column across all swimlanes') ?>" class="board-column-header-task-count"> - (<span id="task-number-column-<?= $column['id'] ?>"><?= $column['nb_column_tasks'] ?></span>) - </span> - <?php if ($column['task_limit']): ?> <span title="<?= t('Task limit') ?>"> - (<span id="task-number-column-<?= $column['id'] ?>"><?= $this->e($column['task_limit']) ?></span>) + (<span id="task-number-column-<?= $column['id'] ?>"><?= $column['nb_tasks'] ?></span>/<?= $this->e($column['task_limit']) ?>) + </span> + <?php else: ?> + <span title="<?= t('Task count') ?>" class="board-column-header-task-count"> + (<span id="task-number-column-<?= $column['id'] ?>"><?= $column['nb_tasks'] ?></span>) </span> <?php endif ?> </div> diff --git a/app/Template/board/table_container.php b/app/Template/board/table_container.php index 83587c44..b2d475ac 100644 --- a/app/Template/board/table_container.php +++ b/app/Template/board/table_container.php @@ -1,33 +1,40 @@ <div id="board-container"> - <?php if (isset($not_editable)): ?> - <table id="board" class="board-project-<?= $project['id'] ?>"> + <?php if (empty($swimlanes) || empty($swimlanes[0]['nb_columns'])): ?> + <p class="alert alert-error"><?= t('There is no column in your project!') ?></p> <?php else: ?> - <table id="board" - class="board-project-<?= $project['id'] ?>" - data-project-id="<?= $project['id'] ?>" - data-check-interval="<?= $board_private_refresh_interval ?>" - data-save-url="<?= $this->url->href('board', 'save', array('project_id' => $project['id'])) ?>" - data-reload-url="<?= $this->url->href('board', 'reload', array('project_id' => $project['id'])) ?>" - data-check-url="<?= $this->url->href('board', 'check', array('project_id' => $project['id'], 'timestamp' => time())) ?>" - data-task-creation-url="<?= $this->url->href('taskcreation', 'create', array('project_id' => $project['id'])) ?>" - > - <?php endif ?> - <?php foreach ($swimlanes as $index => $swimlane): ?> - <?php if (empty($swimlane['columns'])): ?> - <p class="alert alert-error"><?= t('There is no column in your project!') ?></p> - <?php break ?> + <?php if (isset($not_editable)): ?> + <table id="board" class="board-project-<?= $project['id'] ?>"> <?php else: ?> - <?php if ($index === 0): ?> + <table id="board" + class="board-project-<?= $project['id'] ?>" + data-project-id="<?= $project['id'] ?>" + data-check-interval="<?= $board_private_refresh_interval ?>" + data-save-url="<?= $this->url->href('board', 'save', array('project_id' => $project['id'])) ?>" + data-reload-url="<?= $this->url->href('board', 'reload', array('project_id' => $project['id'])) ?>" + data-check-url="<?= $this->url->href('board', 'check', array('project_id' => $project['id'], 'timestamp' => time())) ?>" + data-task-creation-url="<?= $this->url->href('taskcreation', 'create', array('project_id' => $project['id'])) ?>" + > + <?php endif ?> + + <?php foreach ($swimlanes as $index => $swimlane): ?> + <?php if (! ($swimlane['nb_tasks'] === 0 && isset($not_editable))): ?> + + <!-- Note: Do not show swimlane row on the top otherwise we can't collapse columns --> + <?php if ($index > 0 && $swimlane['nb_swimlanes'] > 1): ?> + <?= $this->render('board/table_swimlane', array( + 'project' => $project, + 'swimlane' => $swimlane, + 'not_editable' => isset($not_editable), + )) ?> + <?php endif ?> + <?= $this->render('board/table_column', array( 'swimlane' => $swimlane, 'not_editable' => isset($not_editable), )) ?> - <?php endif ?> - <?php if (! ($swimlane['nb_tasks'] === 0 && isset($not_editable))): ?> - - <?php if ($swimlane['nb_swimlanes'] > 1): ?> + <?php if ($index === 0 && $swimlane['nb_swimlanes'] > 1): ?> <?= $this->render('board/table_swimlane', array( 'project' => $project, 'swimlane' => $swimlane, @@ -43,8 +50,9 @@ )) ?> <?php endif ?> + <?php endforeach ?> - <?php endif ?> - <?php endforeach ?> - </table> + </table> + + <?php endif ?> </div>
\ No newline at end of file diff --git a/app/Template/board/table_tasks.php b/app/Template/board/table_tasks.php index edb4d323..f10d48e4 100644 --- a/app/Template/board/table_tasks.php +++ b/app/Template/board/table_tasks.php @@ -1,5 +1,5 @@ <!-- task row --> -<tr class="board-swimlane swimlane-row-<?= $swimlane['id'] ?>"> +<tr class="board-swimlane board-swimlane-tasks-<?= $swimlane['id'] ?>"> <?php foreach ($swimlane['columns'] as $column): ?> <td class=" board-column-<?= $column['id'] ?> |