From 20b60bc628a7c28cb7780e06073df68a821adc19 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot <fred@kanboard.net> Date: Wed, 26 Nov 2014 21:04:46 -0500 Subject: Move subtask templates to a subfolder --- app/Template/subtask/create.php | 27 +++++++++++++++++ app/Template/subtask/edit.php | 32 ++++++++++++++++++++ app/Template/subtask/remove.php | 17 +++++++++++ app/Template/subtask/show.php | 65 +++++++++++++++++++++++++++++++++++++++++ app/Template/subtask_create.php | 27 ----------------- app/Template/subtask_edit.php | 32 -------------------- app/Template/subtask_remove.php | 16 ---------- app/Template/subtask_show.php | 65 ----------------------------------------- app/Template/task_show.php | 2 +- 9 files changed, 142 insertions(+), 141 deletions(-) create mode 100644 app/Template/subtask/create.php create mode 100644 app/Template/subtask/edit.php create mode 100644 app/Template/subtask/remove.php create mode 100644 app/Template/subtask/show.php delete mode 100644 app/Template/subtask_create.php delete mode 100644 app/Template/subtask_edit.php delete mode 100644 app/Template/subtask_remove.php delete mode 100644 app/Template/subtask_show.php (limited to 'app/Template') diff --git a/app/Template/subtask/create.php b/app/Template/subtask/create.php new file mode 100644 index 00000000..40a6da3d --- /dev/null +++ b/app/Template/subtask/create.php @@ -0,0 +1,27 @@ +<div class="page-header"> + <h2><?= t('Add a sub-task') ?></h2> +</div> + +<form method="post" action="<?= Helper\u('subtask', 'save', array('task_id' => $task['id'])) ?>" autocomplete="off"> + + <?= Helper\form_csrf() ?> + + <?= Helper\form_hidden('task_id', $values) ?> + + <?= Helper\form_label(t('Title'), 'title') ?> + <?= Helper\form_text('title', $values, $errors, array('required autofocus')) ?><br/> + + <?= Helper\form_label(t('Assignee'), 'user_id') ?> + <?= Helper\form_select('user_id', $users_list, $values, $errors) ?><br/> + + <?= Helper\form_label(t('Original estimate'), 'time_estimated') ?> + <?= Helper\form_numeric('time_estimated', $values, $errors) ?> <?= t('hours') ?><br/> + + <?= Helper\form_checkbox('another_subtask', t('Create another sub-task'), 1, isset($values['another_subtask']) && $values['another_subtask'] == 1) ?> + + <div class="form-actions"> + <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> + <?= t('or') ?> + <?= Helper\a(t('cancel'), 'task', 'show', array('task_id' => $task['id'])) ?> + </div> +</form> diff --git a/app/Template/subtask/edit.php b/app/Template/subtask/edit.php new file mode 100644 index 00000000..88ea6175 --- /dev/null +++ b/app/Template/subtask/edit.php @@ -0,0 +1,32 @@ +<div class="page-header"> + <h2><?= t('Edit a sub-task') ?></h2> +</div> + +<form method="post" action="<?= Helper\u('subtask', 'update', array('task_id' => $task['id'], 'subtask_id' => $subtask['id'])) ?>" autocomplete="off"> + + <?= Helper\form_csrf() ?> + + <?= Helper\form_hidden('id', $values) ?> + <?= Helper\form_hidden('task_id', $values) ?> + + <?= Helper\form_label(t('Title'), 'title') ?> + <?= Helper\form_text('title', $values, $errors, array('required autofocus')) ?><br/> + + <?= Helper\form_label(t('Status'), 'status') ?> + <?= Helper\form_select('status', $status_list, $values, $errors) ?><br/> + + <?= Helper\form_label(t('Assignee'), 'user_id') ?> + <?= Helper\form_select('user_id', $users_list, $values, $errors) ?><br/> + + <?= Helper\form_label(t('Original estimate'), 'time_estimated') ?> + <?= Helper\form_numeric('time_estimated', $values, $errors) ?> <?= t('hours') ?><br/> + + <?= Helper\form_label(t('Time spent'), 'time_spent') ?> + <?= Helper\form_numeric('time_spent', $values, $errors) ?> <?= t('hours') ?><br/> + + <div class="form-actions"> + <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> + <?= t('or') ?> + <?= Helper\a(t('cancel'), 'task', 'show', array('task_id' => $task['id'])) ?> + </div> +</form> diff --git a/app/Template/subtask/remove.php b/app/Template/subtask/remove.php new file mode 100644 index 00000000..74245a7a --- /dev/null +++ b/app/Template/subtask/remove.php @@ -0,0 +1,17 @@ +<div class="page-header"> + <h2><?= t('Remove a sub-task') ?></h2> +</div> + +<div class="confirm"> + <p class="alert alert-info"> + <?= t('Do you really want to remove this sub-task?') ?> + </p> + + <p><strong><?= Helper\escape($subtask['title']) ?></strong></p> + + <div class="form-actions"> + <?= Helper\a(t('Yes'), 'subtask', 'remove', array('task_id' => $task['id'], 'subtask_id' => $subtask['id']), true, 'btn btn-red') ?> + <?= t('or') ?> + <?= Helper\a(t('cancel'), 'task', 'show', array('task_id' => $task['id'])) ?> + </div> +</div> \ No newline at end of file diff --git a/app/Template/subtask/show.php b/app/Template/subtask/show.php new file mode 100644 index 00000000..686b160e --- /dev/null +++ b/app/Template/subtask/show.php @@ -0,0 +1,65 @@ +<?php if (! empty($subtasks)): ?> +<div id="subtasks" class="task-show-section"> + + <div class="page-header"> + <h2><?= t('Sub-Tasks') ?></h2> + </div> + + <table class="subtasks-table"> + <tr> + <th width="40%"><?= t('Title') ?></th> + <th><?= t('Status') ?></th> + <th><?= t('Assignee') ?></th> + <th><?= t('Time tracking') ?></th> + <?php if (! isset($not_editable)): ?> + <th><?= t('Actions') ?></th> + <?php endif ?> + </tr> + <?php foreach ($subtasks as $subtask): ?> + <tr> + <td><?= Helper\escape($subtask['title']) ?></td> + <td> + <?= Helper\template('subtask/icons', array('subtask' => $subtask)) ?> + + <?php if (! isset($not_editable)): ?> + <?= Helper\a(Helper\escape($subtask['status_name']), 'subtask', 'toggleStatus', array('task_id' => $task['id'], 'subtask_id' => $subtask['id'])) ?> + <?php else: ?> + <?= Helper\escape($subtask['status_name']) ?> + <?php endif ?> + </td> + <td> + <?php if (! empty($subtask['username'])): ?> + <?= Helper\escape($subtask['name'] ?: $subtask['username']) ?> + <?php endif ?> + </td> + <td> + <?php if (! empty($subtask['time_spent'])): ?> + <strong><?= Helper\escape($subtask['time_spent']).'h' ?></strong> <?= t('spent') ?> + <?php endif ?> + + <?php if (! empty($subtask['time_estimated'])): ?> + <strong><?= Helper\escape($subtask['time_estimated']).'h' ?></strong> <?= t('estimated') ?> + <?php endif ?> + </td> + <?php if (! isset($not_editable)): ?> + <td> + <?= Helper\a(t('Edit'), 'subtask', 'edit', array('task_id' => $task['id'], 'subtask_id' => $subtask['id'])) ?> + <?= t('or') ?> + <?= Helper\a(t('Remove'), 'subtask', 'confirm', array('task_id' => $task['id'], 'subtask_id' => $subtask['id'])) ?> + </td> + <?php endif ?> + </tr> + <?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> +<?php endif ?> diff --git a/app/Template/subtask_create.php b/app/Template/subtask_create.php deleted file mode 100644 index c8ee556b..00000000 --- a/app/Template/subtask_create.php +++ /dev/null @@ -1,27 +0,0 @@ -<div class="page-header"> - <h2><?= t('Add a sub-task') ?></h2> -</div> - -<form method="post" action="?controller=subtask&action=save&task_id=<?= $task['id'] ?>" autocomplete="off"> - - <?= Helper\form_csrf() ?> - - <?= Helper\form_hidden('task_id', $values) ?> - - <?= Helper\form_label(t('Title'), 'title') ?> - <?= Helper\form_text('title', $values, $errors, array('required autofocus')) ?><br/> - - <?= Helper\form_label(t('Assignee'), 'user_id') ?> - <?= Helper\form_select('user_id', $users_list, $values, $errors) ?><br/> - - <?= Helper\form_label(t('Original estimate'), 'time_estimated') ?> - <?= Helper\form_numeric('time_estimated', $values, $errors) ?> <?= t('hours') ?><br/> - - <?= Helper\form_checkbox('another_subtask', t('Create another sub-task'), 1, isset($values['another_subtask']) && $values['another_subtask'] == 1) ?> - - <div class="form-actions"> - <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> - <?= t('or') ?> - <a href="?controller=task&action=show&task_id=<?= $task['id'] ?>"><?= t('cancel') ?></a> - </div> -</form> diff --git a/app/Template/subtask_edit.php b/app/Template/subtask_edit.php deleted file mode 100644 index 91690d0a..00000000 --- a/app/Template/subtask_edit.php +++ /dev/null @@ -1,32 +0,0 @@ -<div class="page-header"> - <h2><?= t('Edit a sub-task') ?></h2> -</div> - -<form method="post" action="?controller=subtask&action=update&task_id=<?= $task['id'] ?>&subtask_id=<?= $subtask['id'] ?>" autocomplete="off"> - - <?= Helper\form_csrf() ?> - - <?= Helper\form_hidden('id', $values) ?> - <?= Helper\form_hidden('task_id', $values) ?> - - <?= Helper\form_label(t('Title'), 'title') ?> - <?= Helper\form_text('title', $values, $errors, array('required autofocus')) ?><br/> - - <?= Helper\form_label(t('Status'), 'status') ?> - <?= Helper\form_select('status', $status_list, $values, $errors) ?><br/> - - <?= Helper\form_label(t('Assignee'), 'user_id') ?> - <?= Helper\form_select('user_id', $users_list, $values, $errors) ?><br/> - - <?= Helper\form_label(t('Original estimate'), 'time_estimated') ?> - <?= Helper\form_numeric('time_estimated', $values, $errors) ?> <?= t('hours') ?><br/> - - <?= Helper\form_label(t('Time spent'), 'time_spent') ?> - <?= Helper\form_numeric('time_spent', $values, $errors) ?> <?= t('hours') ?><br/> - - <div class="form-actions"> - <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> - <?= t('or') ?> - <a href="?controller=task&action=show&task_id=<?= $task['id'] ?>"><?= t('cancel') ?></a> - </div> -</form> diff --git a/app/Template/subtask_remove.php b/app/Template/subtask_remove.php deleted file mode 100644 index 12c99cf1..00000000 --- a/app/Template/subtask_remove.php +++ /dev/null @@ -1,16 +0,0 @@ -<div class="page-header"> - <h2><?= t('Remove a sub-task') ?></h2> -</div> - -<div class="confirm"> - <p class="alert alert-info"> - <?= t('Do you really want to remove this sub-task?') ?> - </p> - - <p><strong><?= Helper\escape($subtask['title']) ?></strong></p> - - <div class="form-actions"> - <a href="?controller=subtask&action=remove&task_id=<?= $task['id'] ?>&subtask_id=<?= $subtask['id'].Helper\param_csrf() ?>" class="btn btn-red"><?= t('Yes') ?></a> - <?= t('or') ?> <a href="?controller=task&action=show&task_id=<?= $task['id'] ?>#subtasks"><?= t('cancel') ?></a> - </div> -</div> \ No newline at end of file diff --git a/app/Template/subtask_show.php b/app/Template/subtask_show.php deleted file mode 100644 index 686b160e..00000000 --- a/app/Template/subtask_show.php +++ /dev/null @@ -1,65 +0,0 @@ -<?php if (! empty($subtasks)): ?> -<div id="subtasks" class="task-show-section"> - - <div class="page-header"> - <h2><?= t('Sub-Tasks') ?></h2> - </div> - - <table class="subtasks-table"> - <tr> - <th width="40%"><?= t('Title') ?></th> - <th><?= t('Status') ?></th> - <th><?= t('Assignee') ?></th> - <th><?= t('Time tracking') ?></th> - <?php if (! isset($not_editable)): ?> - <th><?= t('Actions') ?></th> - <?php endif ?> - </tr> - <?php foreach ($subtasks as $subtask): ?> - <tr> - <td><?= Helper\escape($subtask['title']) ?></td> - <td> - <?= Helper\template('subtask/icons', array('subtask' => $subtask)) ?> - - <?php if (! isset($not_editable)): ?> - <?= Helper\a(Helper\escape($subtask['status_name']), 'subtask', 'toggleStatus', array('task_id' => $task['id'], 'subtask_id' => $subtask['id'])) ?> - <?php else: ?> - <?= Helper\escape($subtask['status_name']) ?> - <?php endif ?> - </td> - <td> - <?php if (! empty($subtask['username'])): ?> - <?= Helper\escape($subtask['name'] ?: $subtask['username']) ?> - <?php endif ?> - </td> - <td> - <?php if (! empty($subtask['time_spent'])): ?> - <strong><?= Helper\escape($subtask['time_spent']).'h' ?></strong> <?= t('spent') ?> - <?php endif ?> - - <?php if (! empty($subtask['time_estimated'])): ?> - <strong><?= Helper\escape($subtask['time_estimated']).'h' ?></strong> <?= t('estimated') ?> - <?php endif ?> - </td> - <?php if (! isset($not_editable)): ?> - <td> - <?= Helper\a(t('Edit'), 'subtask', 'edit', array('task_id' => $task['id'], 'subtask_id' => $subtask['id'])) ?> - <?= t('or') ?> - <?= Helper\a(t('Remove'), 'subtask', 'confirm', array('task_id' => $task['id'], 'subtask_id' => $subtask['id'])) ?> - </td> - <?php endif ?> - </tr> - <?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> -<?php endif ?> diff --git a/app/Template/task_show.php b/app/Template/task_show.php index a4b49cef..d1264d2e 100644 --- a/app/Template/task_show.php +++ b/app/Template/task_show.php @@ -1,7 +1,7 @@ <?= Helper\template('task_details', array('task' => $task, 'project' => $project)) ?> <?= Helper\template('task_time', array('values' => $values, 'date_format' => $date_format, 'date_formats' => $date_formats)) ?> <?= Helper\template('task_show_description', array('task' => $task)) ?> -<?= Helper\template('subtask_show', array('task' => $task, 'subtasks' => $subtasks)) ?> +<?= Helper\template('subtask/show', array('task' => $task, 'subtasks' => $subtasks)) ?> <?= Helper\template('task_timesheet', array('timesheet' => $timesheet)) ?> <?= Helper\template('file/show', array('task' => $task, 'files' => $files)) ?> <?= Helper\template('task_comments', array('task' => $task, 'comments' => $comments, 'project' => $project)) ?> \ No newline at end of file -- cgit v1.2.3