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

View File

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