Fix position issues on column index template

This commit is contained in:
Frederic Guillot 2015-04-18 15:14:52 -04:00
parent 54449d48c4
commit 9317416223
1 changed files with 47 additions and 40 deletions

View File

@ -2,46 +2,53 @@
<h2><?= t('Edit the board for "%s"', $project['name']) ?></h2>
</div>
<h3><?= t('Change columns') ?></h3>
<table>
<tr>
<th><?= t('Column title') ?></th>
<th><?= t('Task limit') ?></th>
<th><?= t('Actions') ?></th>
</tr>
<?php foreach ($columns as $column): ?>
<tr>
<td class="column-60"><?= $this->e($column['title']) ?>
<?php if (! empty($column['description'])): ?>
<span class="column-tooltip" title='<?= $this->e($this->markdown($column['description'])) ?>'>
<i class="fa fa-info-circle"></i>
</span>
<?php endif ?>
</td>
<td class="column-10"><?= $this->e($column['task_limit']) ?></td>
<td class="column-30">
<ul>
<li>
<?= $this->a(t('Edit'), 'column', 'edit', array('project_id' => $project['id'], 'column_id' => $column['id'])) ?>
</li>
<?php if ($column['position'] != 1): ?>
<li>
<?= $this->a(t('Move Up'), 'column', 'move', array('project_id' => $project['id'], 'column_id' => $column['id'], 'direction' => 'up'), true) ?>
</li>
<?php endif ?>
<?php if ($column['position'] != count($columns)): ?>
<li>
<?= $this->a(t('Move Down'), 'column', 'move', array('project_id' => $project['id'], 'column_id' => $column['id'], 'direction' => 'down'), true) ?>
</li>
<?php endif ?>
<li>
<?= $this->a(t('Remove'), 'column', 'confirm', array('project_id' => $project['id'], 'column_id' => $column['id'])) ?>
</li>
</ul>
</td>
</tr>
<?php endforeach ?>
</table>
<?php if (! empty($columns)): ?>
<?php $first_position = $columns[0]['position']; ?>
<?php $last_position = $columns[count($columns) - 1]['position']; ?>
<h3><?= t('Change columns') ?></h3>
<table>
<tr>
<th><?= t('Column title') ?></th>
<th><?= t('Task limit') ?></th>
<th><?= t('Actions') ?></th>
</tr>
<?php foreach ($columns as $column): ?>
<tr>
<td class="column-60"><?= $this->e($column['title']) ?>
<?php if (! empty($column['description'])): ?>
<span class="column-tooltip" title='<?= $this->e($this->markdown($column['description'])) ?>'>
<i class="fa fa-info-circle"></i>
</span>
<?php endif ?>
</td>
<td class="column-10"><?= $this->e($column['task_limit']) ?></td>
<td class="column-30">
<ul>
<li>
<?= $this->a(t('Edit'), 'column', 'edit', array('project_id' => $project['id'], 'column_id' => $column['id'])) ?>
</li>
<?php if ($column['position'] != $first_position): ?>
<li>
<?= $this->a(t('Move Up'), 'column', 'move', array('project_id' => $project['id'], 'column_id' => $column['id'], 'direction' => 'up'), true) ?>
</li>
<?php endif ?>
<?php if ($column['position'] != $last_position): ?>
<li>
<?= $this->a(t('Move Down'), 'column', 'move', array('project_id' => $project['id'], 'column_id' => $column['id'], 'direction' => 'down'), true) ?>
</li>
<?php endif ?>
<li>
<?= $this->a(t('Remove'), 'column', 'confirm', array('project_id' => $project['id'], 'column_id' => $column['id'])) ?>
</li>
</ul>
</td>
</tr>
<?php endforeach ?>
</table>
<?php endif ?>
<h3><?= t('Add a new column') ?></h3>
<form method="post" action="<?= $this->u('column', 'create', array('project_id' => $project['id'])) ?>" autocomplete="off">