Display an error message when there is no column for a project

This commit is contained in:
Frédéric Guillot
2014-02-23 20:34:55 -05:00
parent 2298594455
commit 50051e776f
5 changed files with 92 additions and 73 deletions

View File

@@ -426,6 +426,10 @@ nav .active a {
text-align: right; text-align: right;
} }
.public-board {
margin-top: 5px;
}
#board th a { #board th a {
text-decoration: none; text-decoration: none;
font-size: 150%; font-size: 150%;

View File

@@ -180,4 +180,5 @@ return array(
'%d closed tasks' => '%d tâches terminées', '%d closed tasks' => '%d tâches terminées',
'no task for this project' => 'aucune tâche pour ce projet', 'no task for this project' => 'aucune tâche pour ce projet',
'Public link' => 'Accès public', 'Public link' => 'Accès public',
'There is no column in your project!' => 'Il n\'y a aucune colonne dans votre projet !',
); );

View File

@@ -180,4 +180,8 @@ return array(
'%d closed tasks' => '%d zamkniętych zadań', '%d closed tasks' => '%d zamkniętych zadań',
'no task for this project' => 'brak zadań dla tego projektu', 'no task for this project' => 'brak zadań dla tego projektu',
'Public link' => 'Link publiczny', 'Public link' => 'Link publiczny',
/* Missing translations:
'There is no column in your project!' => '',
*/
); );

View File

@@ -21,44 +21,50 @@
</ul> </ul>
</div> </div>
<table id="board" data-project-id="<?= $current_project_id ?>"> <?php if (empty($columns)): ?>
<tr> <p class="alert alert-error"><?= t('There is no column in your project!') ?></p>
<?php $column_with = round(100 / count($columns), 2); ?> <?php else: ?>
<?php foreach ($columns as $column): ?>
<th width="<?= $column_with ?>%">
<a href="?controller=task&amp;action=create&amp;project_id=<?= $column['project_id'] ?>&amp;column_id=<?= $column['id'] ?>" title="<?= t('Add a new task') ?>">+</a>
<?= Helper\escape($column['title']) ?>
</th>
<?php endforeach ?>
</tr>
<tr>
<?php foreach ($columns as $column): ?>
<td id="column-<?= $column['id'] ?>" class="column" data-column-id="<?= $column['id'] ?>" dropzone="copy">
<?php foreach ($column['tasks'] as $task): ?>
<div class="draggable-item" draggable="true">
<div class="task task-<?= $task['color_id'] ?>" data-task-id="<?= $task['id'] ?>">
<a href="?controller=task&amp;action=show&amp;task_id=<?= $task['id'] ?>" title="<?= t('View this task') ?>">#<?= $task['id'] ?></a> - <table id="board" data-project-id="<?= $current_project_id ?>">
<tr>
<span class="task-user"> <?php $column_with = round(100 / count($columns), 2); ?>
<?php if (! empty($task['owner_id'])): ?> <?php foreach ($columns as $column): ?>
<?= t('Assigned to %s', $task['username']) ?> <th width="<?= $column_with ?>%">
<?php else: ?> <a href="?controller=task&amp;action=create&amp;project_id=<?= $column['project_id'] ?>&amp;column_id=<?= $column['id'] ?>" title="<?= t('Add a new task') ?>">+</a>
<span class="task-nobody"><?= t('No body assigned') ?></span> <?= Helper\escape($column['title']) ?>
<?php endif ?> </th>
</span>
<div class="task-title">
<?= Helper\escape($task['title']) ?>
</div>
</div>
</div>
<?php endforeach ?> <?php endforeach ?>
</td> </tr>
<?php endforeach ?> <tr>
</tr> <?php foreach ($columns as $column): ?>
</table> <td id="column-<?= $column['id'] ?>" class="column" data-column-id="<?= $column['id'] ?>" dropzone="copy">
<?php foreach ($column['tasks'] as $task): ?>
<div class="draggable-item" draggable="true">
<div class="task task-<?= $task['color_id'] ?>" data-task-id="<?= $task['id'] ?>">
<a href="?controller=task&amp;action=show&amp;task_id=<?= $task['id'] ?>" title="<?= t('View this task') ?>">#<?= $task['id'] ?></a> -
<span class="task-user">
<?php if (! empty($task['owner_id'])): ?>
<?= t('Assigned to %s', $task['username']) ?>
<?php else: ?>
<span class="task-nobody"><?= t('No body assigned') ?></span>
<?php endif ?>
</span>
<div class="task-title">
<?= Helper\escape($task['title']) ?>
</div>
</div>
</div>
<?php endforeach ?>
</td>
<?php endforeach ?>
</tr>
</table>
<?php endif ?>
</section> </section>

View File

@@ -1,41 +1,45 @@
<section id="main"> <section id="main" class="public-board">
<table id="board"> <?php if (empty($columns)): ?>
<tr> <p class="alert alert-error"><?= t('There is no column in your project!') ?></p>
<?php $column_with = round(100 / count($columns), 2); ?> <?php else: ?>
<?php foreach ($columns as $column): ?> <table id="board">
<th width="<?= $column_with ?>%"> <tr>
<?= Helper\escape($column['title']) ?> <?php $column_with = round(100 / count($columns), 2); ?>
</th> <?php foreach ($columns as $column): ?>
<?php endforeach ?> <th width="<?= $column_with ?>%">
</tr> <?= Helper\escape($column['title']) ?>
<tr> </th>
<?php foreach ($columns as $column): ?>
<td class="column">
<?php foreach ($column['tasks'] as $task): ?>
<div class="draggable-item">
<div class="task task-<?= $task['color_id'] ?>">
#<?= $task['id'] ?> -
<span class="task-user">
<?php if (! empty($task['owner_id'])): ?>
<?= t('Assigned to %s', $task['username']) ?>
<?php else: ?>
<span class="task-nobody"><?= t('No body assigned') ?></span>
<?php endif ?>
</span>
<div class="task-title">
<?= Helper\escape($task['title']) ?>
</div>
</div>
</div>
<?php endforeach ?> <?php endforeach ?>
</td> </tr>
<?php endforeach ?> <tr>
</tr> <?php foreach ($columns as $column): ?>
</table> <td class="column">
<?php foreach ($column['tasks'] as $task): ?>
<div class="draggable-item">
<div class="task task-<?= $task['color_id'] ?>">
#<?= $task['id'] ?> -
<span class="task-user">
<?php if (! empty($task['owner_id'])): ?>
<?= t('Assigned to %s', $task['username']) ?>
<?php else: ?>
<span class="task-nobody"><?= t('No body assigned') ?></span>
<?php endif ?>
</span>
<div class="task-title">
<?= Helper\escape($task['title']) ?>
</div>
</div>
</div>
<?php endforeach ?>
</td>
<?php endforeach ?>
</tr>
</table>
<?php endif ?>
</section> </section>