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

@@ -0,0 +1,18 @@
<div class="page-header">
<h2><?= t('Swimlane modification for the project "%s"', $project['name']) ?></h2>
</div>
<form method="post" action="<?= Helper\u('swimlane', 'update', array('project_id' => $project['id'], 'swimlane_id' => $values['id'])) ?>" autocomplete="off">
<?= Helper\form_csrf() ?>
<?= Helper\form_hidden('id', $values) ?>
<?= Helper\form_hidden('project_id', $values) ?>
<?= Helper\form_label(t('Name'), 'name') ?>
<?= Helper\form_text('name', $values, $errors, array('autofocus required')) ?>
<div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
</div>
</form>

View File

@@ -0,0 +1,47 @@
<?php if (! empty($active_swimlanes)): ?>
<div class="page-header">
<h2><?= t('Active swimlanes') ?></h2>
</div>
<?= Helper\template('swimlane/table', array('swimlanes' => $active_swimlanes, 'project' => $project)) ?>
<?php endif ?>
<div class="page-header">
<h2><?= t('Add a new swimlane') ?></h2>
</div>
<form method="post" action="<?= Helper\u('swimlane', 'save', array('project_id' => $project['id'])) ?>" autocomplete="off">
<?= Helper\form_csrf() ?>
<?= Helper\form_hidden('project_id', $values) ?>
<?= Helper\form_label(t('Name'), 'name') ?>
<?= Helper\form_text('name', $values, $errors, array('autofocus required')) ?>
<div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
</div>
</form>
<div class="page-header">
<h2><?= t('Change default swimlane') ?></h2>
</div>
<form method="post" action="<?= Helper\u('swimlane', 'change', array('project_id' => $project['id'])) ?>" autocomplete="off">
<?= Helper\form_csrf() ?>
<?= Helper\form_hidden('id', $default_swimlane) ?>
<?= Helper\form_label(t('Rename'), 'default_swimlane') ?>
<?= Helper\form_text('default_swimlane', $default_swimlane, array(), array('autofocus required')) ?><br/>
<?= Helper\form_checkbox('show_default_swimlane', t('Show default swimlane'), 1, isset($default_swimlane['show_default_swimlane']) && $default_swimlane['show_default_swimlane'] == 1) ?>
<div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
</div>
</form>
<?php if (! empty($inactive_swimlanes)): ?>
<div class="page-header">
<h2><?= t('Inactive swimlanes') ?></h2>
</div>
<?= Helper\template('swimlane/table', array('swimlanes' => $inactive_swimlanes, 'project' => $project, 'hide_position' => true)) ?>
<?php endif ?>

View File

@@ -0,0 +1,17 @@
<section id="main">
<div class="page-header">
<h2><?= t('Remove a swimlane') ?></h2>
</div>
<div class="confirm">
<p class="alert alert-info">
<?= t('Do you really want to remove this swimlane: "%s"?', $swimlane['name']) ?>
</p>
<div class="form-actions">
<?= Helper\a(t('Yes'), 'swimlane', 'remove', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id']), true, 'btn btn-red') ?>
<?= t('or') ?>
<?= Helper\a(t('cancel'), 'swimlane', 'index', array('project_id' => $project['id'])) ?>
</div>
</div>
</section>

View File

@@ -0,0 +1,44 @@
<table>
<tr>
<?php if (! isset($hide_position)): ?>
<th><?= t('Position') ?></th>
<?php endif ?>
<th class="column-70"><?= t('Name') ?></th>
<th><?= t('Actions') ?></th>
</tr>
<?php foreach ($swimlanes as $swimlane): ?>
<tr>
<?php if (! isset($hide_position)): ?>
<td>#<?= $swimlane['position'] ?></td>
<?php endif ?>
<td><?= Helper\escape($swimlane['name']) ?></td>
<td>
<ul>
<?php if ($swimlane['position'] != 0 && $swimlane['position'] != 1): ?>
<li>
<?= Helper\a(t('Move Up'), 'swimlane', 'moveup', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id']), true) ?>
</li>
<?php endif ?>
<?php if ($swimlane['position'] != 0 && $swimlane['position'] != count($swimlanes)): ?>
<li>
<?= Helper\a(t('Move Down'), 'swimlane', 'movedown', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id']), true) ?>
</li>
<?php endif ?>
<li>
<?= Helper\a(t('Rename'), 'swimlane', 'edit', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id'])) ?>
</li>
<li>
<?php if ($swimlane['is_active']): ?>
<?= Helper\a(t('Disable'), 'swimlane', 'disable', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id']), true) ?>
<?php else: ?>
<?= Helper\a(t('Enable'), 'swimlane', 'enable', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id']), true) ?>
<?php endif ?>
</li>
<li>
<?= Helper\a(t('Remove'), 'swimlane', 'confirm', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id'])) ?>
</li>
</ul>
</td>
</tr>
<?php endforeach ?>
</table>