summaryrefslogtreecommitdiff
path: root/app/Templates
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2014-10-07 19:21:26 -0400
committerFrédéric Guillot <fred@kanboard.net>2014-10-07 19:21:26 -0400
commitf63984af1a1098f9d3925b5d5f1d0b98fdcf05e2 (patch)
treef72296b39352dd7a690987f43e250088550cac88 /app/Templates
parentf7fa47fa35cde502317fbc92ca90278541cd628a (diff)
Allow quickly creating and changing state of subtask (pull-request #312)
Diffstat (limited to 'app/Templates')
-rw-r--r--app/Templates/subtask_show.php32
1 files changed, 28 insertions, 4 deletions
diff --git a/app/Templates/subtask_show.php b/app/Templates/subtask_show.php
index ffabbff4..112262bd 100644
--- a/app/Templates/subtask_show.php
+++ b/app/Templates/subtask_show.php
@@ -26,7 +26,22 @@
<?php foreach ($subtasks as $subtask): ?>
<tr>
<td><?= Helper\escape($subtask['title']) ?></td>
- <td><?= Helper\escape($subtask['status_name']) ?></td>
+ <td>
+ <?php if (!isset($not_editable)): ?>
+ <a href="<?= Helper\u('subtask', 'toggleStatus', array('task_id' => $task['id'], 'subtask_id' => $subtask['id'])) ?>">
+ <?php endif ?>
+ <?php if ($subtask['status'] == 0): ?>
+ <i class="fa fa-square-o fa-fw"></i><i class="fa">&nbsp;<?= Helper\escape($subtask['status_name']) ?></i>
+ <?php elseif ($subtask['status'] == 1): ?>
+ <i class="fa fa-gears fa-fw"></i><i class="fa">&nbsp;<?= Helper\escape($subtask['status_name']) ?></i>
+ <?php else: ?>
+ <i class="fa fa-check-square-o fa-fw"></i><i class="fa">&nbsp;<?= Helper\escape($subtask['status_name']) ?></i>
+ <?php endif ?>
+ <?php if (! isset($not_editable)): ?>
+ </a>
+ <?php endif ?>
+ </td>
+
<td>
<?php if (! empty($subtask['username'])): ?>
<?= Helper\escape($subtask['name'] ?: $subtask['username']) ?>
@@ -43,9 +58,9 @@
</td>
<?php if (! isset($not_editable)): ?>
<td>
- <a href="?controller=subtask&amp;action=edit&amp;task_id=<?= $task['id'] ?>&amp;subtask_id=<?= $subtask['id'] ?>"><?= t('Edit') ?></a>
+ <?= Helper\a(t('Edit'), 'subtask', 'edit', array('task_id' => $task['id'], 'subtask_id' => $subtask['id'])) ?>
<?= t('or') ?>
- <a href="?controller=subtask&amp;action=confirm&amp;task_id=<?= $task['id'] ?>&amp;subtask_id=<?= $subtask['id'] ?>"><?= t('Remove') ?></a>
+ <?= Helper\a(t('Remove'), 'subtask', 'confirm', array('task_id' => $task['id'], 'subtask_id' => $subtask['id'])) ?>
</td>
<?php endif ?>
</tr>
@@ -57,6 +72,15 @@
<?php endforeach ?>
</table>
+ <?php if (! isset($not_editable)): ?>
+ <form method="post" action="<?= Helper\u('subtask', 'save', array('task_id' => $task['id'])) ?>" autocomplete="off">
+ <?= Helper\form_csrf() ?>
+ <?= Helper\form_hidden('task_id', array('task_id' => $task['id'])) ?>
+ <?= Helper\form_text('title', array(), array(), array('required', 'placeholder="'.t('Type here to create a new sub-task').'"')) ?>
+ <input type="submit" value="<?= t('Add') ?>" class="btn btn-blue"/>
+ </form>
+ <?php endif ?>
+
<div class="subtasks-time-tracking">
<h4><?= t('Time tracking') ?></h4>
<ul>
@@ -67,4 +91,4 @@
</div>
</div>
-<?php endif ?> \ No newline at end of file
+<?php endif ?>