summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorFrédéric Guillot <contact@fredericguillot.com>2014-02-23 20:34:55 -0500
committerFrédéric Guillot <contact@fredericguillot.com>2014-02-23 20:34:55 -0500
commit50051e776f9183471570f2688d0a85f92b309a3c (patch)
tree128a58e224b712aee068453e7695b1911455ca42 /templates
parent229859445515b9f8e379a2037f177cbd277094d7 (diff)
Display an error message when there is no column for a project
Diffstat (limited to 'templates')
-rw-r--r--templates/board_index.php70
-rw-r--r--templates/board_public.php68
2 files changed, 74 insertions, 64 deletions
diff --git a/templates/board_index.php b/templates/board_index.php
index abd511b7..274e8227 100644
--- a/templates/board_index.php
+++ b/templates/board_index.php
@@ -21,44 +21,50 @@
</ul>
</div>
- <table id="board" data-project-id="<?= $current_project_id ?>">
- <tr>
- <?php $column_with = round(100 / count($columns), 2); ?>
- <?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'] ?>">
+ <?php if (empty($columns)): ?>
+ <p class="alert alert-error"><?= t('There is no column in your project!') ?></p>
+ <?php else: ?>
+
+ <table id="board" data-project-id="<?= $current_project_id ?>">
+ <tr>
+ <?php $column_with = round(100 / count($columns), 2); ?>
+ <?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> -
+ <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>
+ <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 class="task-title">
+ <?= Helper\escape($task['title']) ?>
+ </div>
+ </div>
</div>
- </div>
+ <?php endforeach ?>
+ </td>
<?php endforeach ?>
- </td>
- <?php endforeach ?>
- </tr>
- </table>
+ </tr>
+ </table>
+
+ <?php endif ?>
</section>
diff --git a/templates/board_public.php b/templates/board_public.php
index d01bae0f..ac9e80ae 100644
--- a/templates/board_public.php
+++ b/templates/board_public.php
@@ -1,41 +1,45 @@
-<section id="main">
+<section id="main" class="public-board">
- <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']) ?>
- </th>
- <?php endforeach ?>
- </tr>
- <tr>
- <?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'] ?>">
+ <?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']) ?>
+ </th>
+ <?php endforeach ?>
+ </tr>
+ <tr>
+ <?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'] ?> -
+ #<?= $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>
+ <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 class="task-title">
+ <?= Helper\escape($task['title']) ?>
+ </div>
+ </div>
</div>
- </div>
+ <?php endforeach ?>
+ </td>
<?php endforeach ?>
- </td>
- <?php endforeach ?>
- </tr>
- </table>
+ </tr>
+ </table>
+ <?php endif ?>
</section> \ No newline at end of file