diff options
Diffstat (limited to 'app/Template/subtask')
-rw-r--r-- | app/Template/subtask/menu.php | 21 | ||||
-rw-r--r-- | app/Template/subtask/show.php | 31 |
2 files changed, 31 insertions, 21 deletions
diff --git a/app/Template/subtask/menu.php b/app/Template/subtask/menu.php new file mode 100644 index 00000000..f14b09b2 --- /dev/null +++ b/app/Template/subtask/menu.php @@ -0,0 +1,21 @@ +<div class="dropdown"> + <a href="#" class="dropdown-menu dropdown-menu-link-icon"><i class="fa fa-cog fa-fw"></i><i class="fa fa-caret-down"></i></a> + <ul> + <?php if ($subtask['position'] != $first_position): ?> + <li> + <?= $this->url->link(t('Move Up'), 'subtask', 'movePosition', array('project_id' => $project['id'], 'task_id' => $subtask['task_id'], 'subtask_id' => $subtask['id'], 'direction' => 'up', 'redirect' => $redirect), true) ?> + </li> + <?php endif ?> + <?php if ($subtask['position'] != $last_position): ?> + <li> + <?= $this->url->link(t('Move Down'), 'subtask', 'movePosition', array('project_id' => $project['id'], 'task_id' => $subtask['task_id'], 'subtask_id' => $subtask['id'], 'direction' => 'down', 'redirect' => $redirect), true) ?> + </li> + <?php endif ?> + <li> + <?= $this->url->link(t('Edit'), 'subtask', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'subtask_id' => $subtask['id']), false, 'popover') ?> + </li> + <li> + <?= $this->url->link(t('Remove'), 'subtask', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'subtask_id' => $subtask['id']), false, 'popover') ?> + </li> + </ul> +</div> diff --git a/app/Template/subtask/show.php b/app/Template/subtask/show.php index 027e9495..cf56a1de 100644 --- a/app/Template/subtask/show.php +++ b/app/Template/subtask/show.php @@ -62,32 +62,21 @@ </td> <?php if ($editable): ?> <td> - <div class="dropdown"> - <a href="#" class="dropdown-menu dropdown-menu-link-icon"><i class="fa fa-cog fa-fw"></i><i class="fa fa-caret-down"></i></a> - <ul> - <?php if ($subtask['position'] != $first_position): ?> - <li> - <?= $this->url->link(t('Move Up'), 'subtask', 'movePosition', array('project_id' => $project['id'], 'task_id' => $subtask['task_id'], 'subtask_id' => $subtask['id'], 'direction' => 'up', 'redirect' => $redirect), true) ?> - </li> - <?php endif ?> - <?php if ($subtask['position'] != $last_position): ?> - <li> - <?= $this->url->link(t('Move Down'), 'subtask', 'movePosition', array('project_id' => $project['id'], 'task_id' => $subtask['task_id'], 'subtask_id' => $subtask['id'], 'direction' => 'down', 'redirect' => $redirect), true) ?> - </li> - <?php endif ?> - <li> - <?= $this->url->link(t('Edit'), 'subtask', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'subtask_id' => $subtask['id']), false, 'popover') ?> - </li> - <li> - <?= $this->url->link(t('Remove'), 'subtask', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'subtask_id' => $subtask['id']), false, 'popover') ?> - </li> - </ul> - </div> + <?= $this->render('subtask/menu', array( + 'project' => $project, + 'task' => $task, + 'subtask' => $subtask, + 'redirect' => $redirect, + 'first_position' => $first_position, + 'last_position' => $last_position, + )) ?> </td> <?php endif ?> </tr> <?php endforeach ?> </table> + <?php else: ?> + <p class="alert"><?= t('There is no subtask at the moment.') ?></p> <?php endif ?> <?php if ($editable && $this->user->hasProjectAccess('subtask', 'save', $task['project_id'])): ?> |