Add swimlanes

This commit is contained in:
Frédéric Guillot
2014-12-26 17:43:13 -05:00
parent 2b27d986b3
commit cf821e117c
54 changed files with 2180 additions and 256 deletions

View File

@@ -16,7 +16,7 @@
</tr>
<?php foreach ($columns as $column): ?>
<tr>
<td><?= Helper\form_label(++$i, 'title['.$column['id'].']', array('title="column_id='.$column['id'].'"')) ?></td>
<td><?= Helper\form_label('#'.++$i, 'title['.$column['id'].']', array('title="column_id='.$column['id'].'"')) ?></td>
<td><?= Helper\form_text('title['.$column['id'].']', $values, $errors, array('required')) ?></td>
<td><?= Helper\form_number('task_limit['.$column['id'].']', $values, $errors, array('placeholder="'.t('limit').'"')) ?></td>
<td>

View File

@@ -6,16 +6,12 @@
'project' => $project,
)) ?>
<?php if (empty($board)): ?>
<p class="alert alert-error"><?= t('There is no column in your project!') ?></p>
<?php else: ?>
<?= Helper\template('board/show', array(
'project' => $project,
'board' => $board,
'categories' => $categories,
'board_private_refresh_interval' => $board_private_refresh_interval,
'board_highlight_period' => $board_highlight_period,
)) ?>
<?php endif ?>
<?= Helper\template('board/show', array(
'project' => $project,
'swimlanes' => $swimlanes,
'categories' => $categories,
'board_private_refresh_interval' => $board_private_refresh_interval,
'board_highlight_period' => $board_highlight_period,
)) ?>
</section>

View File

@@ -1,39 +1,12 @@
<section id="main" class="public-board">
<?php if (empty($columns)): ?>
<p class="alert alert-error"><?= t('There is no column in your project!') ?></p>
<?php else: ?>
<table id="board">
<tr>
<?php $column_with = round(100 / count($columns), 2); ?>
<?php foreach ($columns as $column): ?>
<th width="<?= $column_with ?>%">
<?= Helper\escape($column['title']) ?>
<?php if ($column['task_limit']): ?>
<span title="<?= t('Task limit') ?>" class="task-limit">(<?= Helper\escape(count($column['tasks']).'/'.$column['task_limit']) ?>)</span>
<?php endif ?>
</th>
<?php endforeach ?>
</tr>
<tr>
<?php foreach ($columns as $column): ?>
<td class="column <?= $column['task_limit'] && count($column['tasks']) > $column['task_limit'] ? 'task-limit-warning' : '' ?>">
<?php foreach ($column['tasks'] as $task): ?>
<div class="task-board task-<?= $task['color_id'] ?>">
<?= Helper\template('board/task', array(
'task' => $task,
'categories' => $categories,
'not_editable' => true,
'project' => $project
)) ?>
</div>
<?php endforeach ?>
</td>
<?php endforeach ?>
</tr>
</table>
<?php endif ?>
<?= Helper\template('board/show', array(
'project' => $project,
'swimlanes' => $swimlanes,
'categories' => $categories,
'board_private_refresh_interval' => $board_private_refresh_interval,
'board_highlight_period' => $board_highlight_period,
'not_editable' => true,
)) ?>
</section>

View File

@@ -1,51 +1,28 @@
<table id="board"
data-project-id="<?= $project['id'] ?>"
data-check-interval="<?= $board_private_refresh_interval ?>"
data-save-url="<?= Helper\u('board', 'save', array('project_id' => $project['id'])) ?>"
data-check-url="<?= Helper\u('board', 'check', array('project_id' => $project['id'], 'timestamp' => time())) ?>"
>
<tr>
<?php $column_with = round(100 / count($board), 2); ?>
<?php foreach ($board as $column): ?>
<th width="<?= $column_with ?>%">
<div class="board-add-icon">
<?= Helper\a('+', 'task', 'create', array('project_id' => $column['project_id'], 'column_id' => $column['id']), false, 'task-creation-popover', t('Add a new task')) ?>
</div>
<?= Helper\escape($column['title']) ?>
<?php if ($column['task_limit']): ?>
<span title="<?= t('Task limit') ?>" class="task-limit">
(<span id="task-number-column-<?= $column['id'] ?>"><?= count($column['tasks']) ?></span>/<?= Helper\escape($column['task_limit']) ?>)
</span>
<?php else: ?>
<span title="<?= t('Task count') ?>" class="task-count">
(<span id="task-number-column-<?= $column['id'] ?>"><?= count($column['tasks']) ?></span>)
</span>
<?php endif ?>
</th>
<?php endforeach ?>
</tr>
<tr>
<?php foreach ($board as $column): ?>
<td
id="column-<?= $column['id'] ?>"
class="column <?= $column['task_limit'] && count($column['tasks']) > $column['task_limit'] ? 'task-limit-warning' : '' ?>"
data-column-id="<?= $column['id'] ?>"
data-task-limit="<?= $column['task_limit'] ?>"
>
<?php foreach ($column['tasks'] as $task): ?>
<div class="task-board draggable-item task-<?= $task['color_id'] ?> <?= $task['date_modification'] > time() - $board_highlight_period ? 'task-board-recent' : '' ?>"
data-task-id="<?= $task['id'] ?>"
data-owner-id="<?= $task['owner_id'] ?>"
data-category-id="<?= $task['category_id'] ?>"
data-due-date="<?= $task['date_due'] ?>"
data-task-url="<?= Helper\u('task', 'show', array('task_id' => $task['id'])) ?>"
title="<?= t('View this task') ?>">
<?= Helper\template('board/task', array('task' => $task, 'categories' => $categories)) ?>
<?php if (isset($not_editable)): ?>
<table id="board">
<?php else: ?>
<table id="board"
data-project-id="<?= $project['id'] ?>"
data-check-interval="<?= $board_private_refresh_interval ?>"
data-save-url="<?= Helper\u('board', 'save', array('project_id' => $project['id'])) ?>"
data-check-url="<?= Helper\u('board', 'check', array('project_id' => $project['id'], 'timestamp' => time())) ?>"
>
<?php endif ?>
</div>
<?php endforeach ?>
</td>
<?php endforeach ?>
</tr>
<?php foreach ($swimlanes as $swimlane): ?>
<?php if (empty($swimlane['columns'])): ?>
<p class="alert alert-error"><?= t('There is no column in your project!') ?></p>
<?php break ?>
<?php else: ?>
<?= Helper\template('board/swimlane', array(
'project' => $project,
'swimlane' => $swimlane,
'board_highlight_period' => $board_highlight_period,
'categories' => $categories,
'hide_swimlane' => count($swimlanes) === 1,
'not_editable' => isset($not_editable),
)) ?>
<?php endif ?>
<?php endforeach ?>
</table>

View File

@@ -0,0 +1,59 @@
<tr>
<?php if (! $hide_swimlane): ?>
<td width="10%"></td>
<?php endif ?>
<?php foreach ($swimlane['columns'] as $column): ?>
<th>
<?php if (! $not_editable): ?>
<div class="board-add-icon">
<?= Helper\a('+', 'task', 'create', array('project_id' => $column['project_id'], 'column_id' => $column['id'], 'swimlane_id' => $swimlane['id']), false, 'task-creation-popover', t('Add a new task')) ?>
</div>
<?php endif ?>
<?= Helper\escape($column['title']) ?>
<?php if ($column['task_limit']): ?>
<span title="<?= t('Task limit') ?>" class="task-limit">
(<span id="task-number-column-<?= $column['id'] ?>"><?= $column['nb_tasks'] ?></span>/<?= Helper\escape($column['task_limit']) ?>)
</span>
<?php else: ?>
<span title="<?= t('Task count') ?>" class="task-count">
(<span id="task-number-column-<?= $column['id'] ?>"><?= $column['nb_tasks'] ?></span>)
</span>
<?php endif ?>
</th>
<?php endforeach ?>
</tr>
<tr>
<?php if (! $hide_swimlane): ?>
<th class="board-swimlane-title">
<?= Helper\escape($swimlane['name']) ?>
</th>
<?php endif ?>
<?php foreach ($swimlane['columns'] as $column): ?>
<?php if ($not_editable): ?>
<td>
<?php else: ?>
<td
id="column-<?= $column['id'] ?>"
class="column <?= $column['task_limit'] && count($column['tasks']) > $column['task_limit'] ? 'task-limit-warning' : '' ?>"
data-column-id="<?= $column['id'] ?>"
data-swimlane-id="<?= $swimlane['id'] ?>"
data-task-limit="<?= $column['task_limit'] ?>">
<?php endif ?>
<?php foreach ($column['tasks'] as $task): ?>
<?= Helper\template('board/task', array(
'project' => $project,
'task' => $task,
'categories' => $categories,
'board_highlight_period' => $board_highlight_period,
'not_editable' => $not_editable,
)) ?>
<?php endforeach ?>
</td>
<?php endforeach ?>
</tr>

View File

@@ -1,4 +1,8 @@
<?php if (isset($not_editable)): ?>
<?php if ($not_editable): ?>
<div class="task-board task-<?= $task['color_id'] ?> <?= $task['date_modification'] > time() - $board_highlight_period ? 'task-board-recent' : '' ?>">
<?= Helper\a('#'.$task['id'], 'task', 'readonly', array('task_id' => $task['id'], 'token' => $project['token'])) ?>
@@ -28,6 +32,14 @@
<?php else: ?>
<div class="task-board draggable-item task-<?= $task['color_id'] ?> <?= $task['date_modification'] > time() - $board_highlight_period ? 'task-board-recent' : '' ?>"
data-task-id="<?= $task['id'] ?>"
data-owner-id="<?= $task['owner_id'] ?>"
data-category-id="<?= $task['category_id'] ?>"
data-due-date="<?= $task['date_due'] ?>"
data-task-url="<?= Helper\u('task', 'show', array('task_id' => $task['id'])) ?>"
title="<?= t('View this task') ?>">
<?= Helper\a('#'.$task['id'], 'task', 'edit', array('task_id' => $task['id']), false, 'task-edit-popover', t('Edit this task')) ?>
<?php if ($task['reference']): ?>
@@ -114,3 +126,5 @@
</div>
</div>
<?php endif ?>
</div>