summaryrefslogtreecommitdiff
path: root/app/Templates
diff options
context:
space:
mode:
Diffstat (limited to 'app/Templates')
-rw-r--r--app/Templates/board_public.php49
-rw-r--r--app/Templates/board_show.php53
-rw-r--r--app/Templates/board_task.php76
-rw-r--r--app/Templates/project_search.php64
-rw-r--r--app/Templates/project_tasks.php56
-rw-r--r--app/Templates/task_table.php54
6 files changed, 136 insertions, 216 deletions
diff --git a/app/Templates/board_public.php b/app/Templates/board_public.php
index 0808079e..f90dc01b 100644
--- a/app/Templates/board_public.php
+++ b/app/Templates/board_public.php
@@ -19,54 +19,9 @@
<?php foreach ($columns as $column): ?>
<td class="column <?= $column['task_limit'] && count($column['tasks']) > $column['task_limit'] ? 'task-limit-warning' : '' ?>">
<?php foreach ($column['tasks'] as $task): ?>
- <div class="task task-<?= $task['color_id'] ?>">
+ <div class="task-board 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('Nobody assigned') ?></span>
- <?php endif ?>
- </span>
-
- <?php if ($task['score']): ?>
- <span class="task-score"><?= Helper\escape($task['score']) ?></span>
- <?php endif ?>
-
- <div class="task-title">
- <?= Helper\escape($task['title']) ?>
- </div>
-
- <?php if ($task['category_id']): ?>
- <div class="task-category-container">
- <span class="task-category">
- <?= Helper\in_list($task['category_id'], $categories) ?>
- </span>
- </div>
- <?php endif ?>
-
- <?php if (! empty($task['date_due']) || ! empty($task['nb_comments']) || ! empty($task['description'])): ?>
- <div class="task-footer">
-
- <?php if (! empty($task['date_due'])): ?>
- <div class="task-date">
- <?= dt('%B %e, %G', $task['date_due']) ?>
- </div>
- <?php endif ?>
-
- <div class="task-icons">
- <?php if (! empty($task['nb_comments'])): ?>
- <?= $task['nb_comments'] ?> <i class="fa fa-comment-o" title="<?= p($task['nb_comments'], t('%d comment', $task['nb_comments']), t('%d comments', $task['nb_comments'])) ?>"></i>
- <?php endif ?>
-
- <?php if (! empty($task['description'])): ?>
- <i class="fa fa-file-text-o" title="<?= t('Description') ?>"></i>
- <?php endif ?>
- </div>
- </div>
- <?php endif ?>
+ <?= Helper\template('board_task', array('task' => $task, 'categories' => $categories, 'not_editable' => true)) ?>
</div>
<?php endforeach ?>
diff --git a/app/Templates/board_show.php b/app/Templates/board_show.php
index 78f9dd50..e5cd9ceb 100644
--- a/app/Templates/board_show.php
+++ b/app/Templates/board_show.php
@@ -26,63 +26,14 @@
data-task-limit="<?= $column['task_limit'] ?>"
>
<?php foreach ($column['tasks'] as $task): ?>
- <div class="task draggable-item task-<?= $task['color_id'] ?>"
+ <div class="task-board draggable-item task-<?= $task['color_id'] ?>"
data-task-id="<?= $task['id'] ?>"
data-owner-id="<?= $task['owner_id'] ?>"
data-category-id="<?= $task['category_id'] ?>"
data-due-date="<?= $task['date_due'] ?>"
title="<?= t('View this task') ?>">
- <a href="?controller=task&amp;action=edit&amp;task_id=<?= $task['id'] ?>" title="<?= t('Edit this task') ?>">#<?= $task['id'] ?></a> -
-
- <span class="task-user">
- <?php if (! empty($task['owner_id'])): ?>
- <a href="?controller=board&amp;action=assign&amp;task_id=<?= $task['id'] ?>" title="<?= t('Change assignee') ?>"><?= t('Assigned to %s', $task['username']) ?></a>
- <?php else: ?>
- <a href="?controller=board&amp;action=assign&amp;task_id=<?= $task['id'] ?>" title="<?= t('Change assignee') ?>" class="task-nobody"><?= t('Nobody assigned') ?></a>
- <?php endif ?>
- </span>
-
- <?php if ($task['score']): ?>
- <span class="task-score"><?= Helper\escape($task['score']) ?></span>
- <?php endif ?>
-
- <div class="task-title">
- <a href="?controller=task&amp;action=show&amp;task_id=<?= $task['id'] ?>" title="<?= t('View this task') ?>"><?= Helper\escape($task['title']) ?></a>
- </div>
-
- <?php if ($task['category_id']): ?>
- <div class="task-category-container">
- <span class="task-category">
- <?= Helper\in_list($task['category_id'], $categories) ?>
- </span>
- </div>
- <?php endif ?>
-
- <?php if (! empty($task['date_due']) || ! empty($task['nb_files']) || ! empty($task['nb_comments']) || ! empty($task['description'])): ?>
- <div class="task-footer">
-
- <?php if (! empty($task['date_due'])): ?>
- <div class="task-date">
- <?= dt('%B %e, %G', $task['date_due']) ?>
- </div>
- <?php endif ?>
-
- <div class="task-icons">
- <?php if (! empty($task['nb_files'])): ?>
- <?= $task['nb_files'] ?> <i class="fa fa-paperclip"></i>
- <?php endif ?>
-
- <?php if (! empty($task['nb_comments'])): ?>
- <?= $task['nb_comments'] ?> <i class="fa fa-comment-o" title="<?= p($task['nb_comments'], t('%d comment', $task['nb_comments']), t('%d comments', $task['nb_comments'])) ?>"></i>
- <?php endif ?>
-
- <?php if (! empty($task['description'])): ?>
- <i class="fa fa-file-text-o" title="<?= t('Description') ?>"></i>
- <?php endif ?>
- </div>
- </div>
- <?php endif ?>
+ <?= Helper\template('board_task', array('task' => $task, 'categories' => $categories)) ?>
</div>
<?php endforeach ?>
diff --git a/app/Templates/board_task.php b/app/Templates/board_task.php
new file mode 100644
index 00000000..fa745ac1
--- /dev/null
+++ b/app/Templates/board_task.php
@@ -0,0 +1,76 @@
+<?php if (isset($not_editable)): ?>
+
+ #<?= $task['id'] ?> -
+
+ <span class="task-board-user">
+ <?php if (! empty($task['owner_id'])): ?>
+ <?= t('Assigned to %s', $task['username']) ?>
+ <?php else: ?>
+ <span class="task-board-nobody"><?= t('Nobody assigned') ?></span>
+ <?php endif ?>
+ </span>
+
+ <?php if ($task['score']): ?>
+ <span class="task-score"><?= Helper\escape($task['score']) ?></span>
+ <?php endif ?>
+
+ <div class="task-board-title">
+ <?= Helper\escape($task['title']) ?>
+ </div>
+
+<?php else: ?>
+
+ <a href="?controller=task&amp;action=edit&amp;task_id=<?= $task['id'] ?>" title="<?= t('Edit this task') ?>">#<?= $task['id'] ?></a> -
+
+ <span class="task-board-user">
+ <?php if (! empty($task['owner_id'])): ?>
+ <a href="?controller=board&amp;action=assign&amp;task_id=<?= $task['id'] ?>" title="<?= t('Change assignee') ?>"><?= t('Assigned to %s', $task['username']) ?></a>
+ <?php else: ?>
+ <a href="?controller=board&amp;action=assign&amp;task_id=<?= $task['id'] ?>" title="<?= t('Change assignee') ?>" class="task-board-nobody"><?= t('Nobody assigned') ?></a>
+ <?php endif ?>
+ </span>
+
+ <?php if ($task['score']): ?>
+ <span class="task-score"><?= Helper\escape($task['score']) ?></span>
+ <?php endif ?>
+
+ <div class="task-board-title">
+ <a href="?controller=task&amp;action=show&amp;task_id=<?= $task['id'] ?>" title="<?= t('View this task') ?>"><?= Helper\escape($task['title']) ?></a>
+ </div>
+
+<?php endif ?>
+
+
+<?php if ($task['category_id']): ?>
+<div class="task-board-category-container">
+ <span class="task-board-category">
+ <?= Helper\in_list($task['category_id'], $categories) ?>
+ </span>
+</div>
+<?php endif ?>
+
+
+<?php if (! empty($task['date_due']) || ! empty($task['nb_files']) || ! empty($task['nb_comments']) || ! empty($task['description'])): ?>
+<div class="task-board-footer">
+
+ <?php if (! empty($task['date_due'])): ?>
+ <div class="task-board-date">
+ <?= dt('%B %e, %G', $task['date_due']) ?>
+ </div>
+ <?php endif ?>
+
+ <div class="task-board-icons">
+ <?php if (! empty($task['nb_files'])): ?>
+ <?= $task['nb_files'] ?> <i class="fa fa-paperclip" title="<?= t('Attachments') ?>"></i>
+ <?php endif ?>
+
+ <?php if (! empty($task['nb_comments'])): ?>
+ <?= $task['nb_comments'] ?> <i class="fa fa-comment-o" title="<?= p($task['nb_comments'], t('%d comment', $task['nb_comments']), t('%d comments', $task['nb_comments'])) ?>"></i>
+ <?php endif ?>
+
+ <?php if (! empty($task['description'])): ?>
+ <i class="fa fa-file-text-o" title="<?= t('Description') ?>"></i>
+ <?php endif ?>
+ </div>
+</div>
+<?php endif ?> \ No newline at end of file
diff --git a/app/Templates/project_search.php b/app/Templates/project_search.php
index 3594fd09..7826ba63 100644
--- a/app/Templates/project_search.php
+++ b/app/Templates/project_search.php
@@ -24,69 +24,7 @@
<?php if (empty($tasks) && ! empty($values['search'])): ?>
<p class="alert"><?= t('Nothing found.') ?></p>
<?php elseif (! empty($tasks)): ?>
- <table>
- <tr>
- <th><?= t('Id') ?></th>
- <th><?= t('Column') ?></th>
- <th><?= t('Category') ?></th>
- <th><?= t('Title') ?></th>
- <th><?= t('Assignee') ?></th>
- <th><?= t('Due date') ?></th>
- <th><?= t('Date created') ?></th>
- <th><?= t('Date completed') ?></th>
- <th><?= t('Status') ?></th>
- </tr>
- <?php foreach ($tasks as $task): ?>
- <tr>
- <td class="task task-<?= $task['color_id'] ?>">
- <a href="?controller=task&amp;action=show&amp;task_id=<?= $task['id'] ?>" title="<?= t('View this task') ?>"><?= Helper\escape($task['id']) ?></a>
- </td>
- <td>
- <?= Helper\in_list($task['column_id'], $columns) ?>
- </td>
- <td>
- <?= Helper\in_list($task['category_id'], $categories, '') ?>
- </td>
- <td>
- <a href="?controller=task&amp;action=show&amp;task_id=<?= $task['id'] ?>" title="<?= t('View this task') ?>"><?= Helper\escape($task['title']) ?></a>
- <div class="task-table-icons">
- <?php if (! empty($task['nb_comments'])): ?>
- <?= $task['nb_comments'] ?> <i class="fa fa-comment-o" title="<?= p($task['nb_comments'], t('%d comment', $task['nb_comments']), t('%d comments', $task['nb_comments'])) ?>"></i>
- <?php endif ?>
-
- <?php if (! empty($task['description'])): ?>
- <i class="fa fa-file-text-o" title="<?= t('Description') ?>"></i>
- <?php endif ?>
- </div>
- </td>
- <td>
- <?php if ($task['username']): ?>
- <?= Helper\escape($task['username']) ?>
- <?php else: ?>
- <?= t('Unassigned') ?>
- <?php endif ?>
- </td>
- <td>
- <?= dt('%B %e, %G', $task['date_due']) ?>
- </td>
- <td>
- <?= dt('%B %e, %G at %k:%M %p', $task['date_creation']) ?>
- </td>
- <td>
- <?php if ($task['date_completed']): ?>
- <?= dt('%B %e, %G at %k:%M %p', $task['date_completed']) ?>
- <?php endif ?>
- </td>
- <td>
- <?php if ($task['is_active'] == \Model\Task::STATUS_OPEN): ?>
- <?= t('Open') ?>
- <?php else: ?>
- <?= t('Closed') ?>
- <?php endif ?>
- </td>
- </tr>
- <?php endforeach ?>
- </table>
+ <?= Helper\template('task_table', array('tasks' => $tasks, 'categories' => $categories, 'columns' => $columns)) ?>
<?php endif ?>
</section>
diff --git a/app/Templates/project_tasks.php b/app/Templates/project_tasks.php
index 9f4263b8..a820be13 100644
--- a/app/Templates/project_tasks.php
+++ b/app/Templates/project_tasks.php
@@ -11,61 +11,7 @@
<?php if (empty($tasks)): ?>
<p class="alert"><?= t('No task') ?></p>
<?php else: ?>
- <table>
- <tr>
- <th><?= t('Id') ?></th>
- <th><?= t('Column') ?></th>
- <th><?= t('Category') ?></th>
- <th><?= t('Title') ?></th>
- <th><?= t('Assignee') ?></th>
- <th><?= t('Due date') ?></th>
- <th><?= t('Date created') ?></th>
- <th><?= t('Date completed') ?></th>
- </tr>
- <?php foreach ($tasks as $task): ?>
- <tr>
- <td class="task task-<?= $task['color_id'] ?>">
- <a href="?controller=task&amp;action=show&amp;task_id=<?= $task['id'] ?>" title="<?= t('View this task') ?>"><?= Helper\escape($task['id']) ?></a>
- </td>
- <td>
- <?= Helper\in_list($task['column_id'], $columns) ?>
- </td>
- <td>
- <?= Helper\in_list($task['category_id'], $categories, '') ?>
- </td>
- <td>
- <a href="?controller=task&amp;action=show&amp;task_id=<?= $task['id'] ?>" title="<?= t('View this task') ?>"><?= Helper\escape($task['title']) ?></a>
- <div class="task-table-icons">
- <?php if (! empty($task['nb_comments'])): ?>
- <?= $task['nb_comments'] ?> <i class="fa fa-comment-o" title="<?= p($task['nb_comments'], t('%d comment', $task['nb_comments']), t('%d comments', $task['nb_comments'])) ?>"></i>
- <?php endif ?>
-
- <?php if (! empty($task['description'])): ?>
- <i class="fa fa-file-text-o" title="<?= t('Description') ?>"></i>
- <?php endif ?>
- </div>
- </td>
- <td>
- <?php if ($task['username']): ?>
- <?= Helper\escape($task['username']) ?>
- <?php else: ?>
- <?= t('Unassigned') ?>
- <?php endif ?>
- </td>
- <td>
- <?= dt('%B %e, %G', $task['date_due']) ?>
- </td>
- <td>
- <?= dt('%B %e, %G at %k:%M %p', $task['date_creation']) ?>
- </td>
- <td>
- <?php if ($task['date_completed']): ?>
- <?= dt('%B %e, %G at %k:%M %p', $task['date_completed']) ?>
- <?php endif ?>
- </td>
- </tr>
- <?php endforeach ?>
- </table>
+ <?= Helper\template('task_table', array('tasks' => $tasks, 'categories' => $categories, 'columns' => $columns)) ?>
<?php endif ?>
</section>
</section> \ No newline at end of file
diff --git a/app/Templates/task_table.php b/app/Templates/task_table.php
new file mode 100644
index 00000000..10f79d29
--- /dev/null
+++ b/app/Templates/task_table.php
@@ -0,0 +1,54 @@
+<table>
+ <tr>
+ <th><?= t('Id') ?></th>
+ <th><?= t('Column') ?></th>
+ <th><?= t('Category') ?></th>
+ <th><?= t('Title') ?></th>
+ <th><?= t('Assignee') ?></th>
+ <th><?= t('Due date') ?></th>
+ <th><?= t('Date created') ?></th>
+ <th><?= t('Date completed') ?></th>
+ <th><?= t('Status') ?></th>
+ </tr>
+ <?php foreach ($tasks as $task): ?>
+ <tr>
+ <td class="task-table task-<?= $task['color_id'] ?>">
+ <a href="?controller=task&amp;action=show&amp;task_id=<?= $task['id'] ?>" title="<?= t('View this task') ?>"><?= Helper\escape($task['id']) ?></a>
+ </td>
+ <td>
+ <?= Helper\in_list($task['column_id'], $columns) ?>
+ </td>
+ <td>
+ <?= Helper\in_list($task['category_id'], $categories, '') ?>
+ </td>
+ <td>
+ <a href="?controller=task&amp;action=show&amp;task_id=<?= $task['id'] ?>" title="<?= t('View this task') ?>"><?= Helper\escape($task['title']) ?></a>
+ </td>
+ <td>
+ <?php if ($task['username']): ?>
+ <?= Helper\escape($task['username']) ?>
+ <?php else: ?>
+ <?= t('Unassigned') ?>
+ <?php endif ?>
+ </td>
+ <td>
+ <?= dt('%B %e, %G', $task['date_due']) ?>
+ </td>
+ <td>
+ <?= dt('%B %e, %G at %k:%M %p', $task['date_creation']) ?>
+ </td>
+ <td>
+ <?php if ($task['date_completed']): ?>
+ <?= dt('%B %e, %G at %k:%M %p', $task['date_completed']) ?>
+ <?php endif ?>
+ </td>
+ <td>
+ <?php if ($task['is_active'] == \Model\Task::STATUS_OPEN): ?>
+ <?= t('Open') ?>
+ <?php else: ?>
+ <?= t('Closed') ?>
+ <?php endif ?>
+ </td>
+ </tr>
+ <?php endforeach ?>
+</table> \ No newline at end of file