From 346151e103431e8de12520b26daae10676b8faf5 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Wed, 3 Feb 2016 20:53:07 -0500 Subject: Add dropdown menu with inline popup for all task actions --- app/Template/comment/edit.php | 6 +- app/Template/comment/remove.php | 2 +- app/Template/comment/show.php | 4 +- app/Template/file/new.php | 4 +- app/Template/subtask/menu.php | 21 ++++++ app/Template/subtask/show.php | 31 +++------ app/Template/task/layout.php | 3 + app/Template/task/menu.php | 72 ++++++++++++++++++++ app/Template/task/remove.php | 2 +- app/Template/task/sidebar.php | 78 ++-------------------- app/Template/task_duplication/copy.php | 6 +- app/Template/task_duplication/duplicate.php | 2 +- app/Template/task_duplication/move.php | 6 +- app/Template/task_external_link/remove.php | 2 +- app/Template/task_external_link/show.php | 4 +- app/Template/task_modification/edit_recurrence.php | 47 ------------- app/Template/task_recurrence/edit.php | 47 +++++++++++++ 17 files changed, 177 insertions(+), 160 deletions(-) create mode 100644 app/Template/subtask/menu.php create mode 100644 app/Template/task/menu.php delete mode 100644 app/Template/task_modification/edit_recurrence.php create mode 100644 app/Template/task_recurrence/edit.php (limited to 'app/Template') diff --git a/app/Template/comment/edit.php b/app/Template/comment/edit.php index e01f3da4..6db952cc 100644 --- a/app/Template/comment/edit.php +++ b/app/Template/comment/edit.php @@ -2,7 +2,7 @@

-
+ form->csrf() ?> form->hidden('id', $values) ?> @@ -29,8 +29,8 @@
url->doc(t('Write your text in Markdown'), 'syntax-guide') ?>
- + - url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'close-popover') ?>
diff --git a/app/Template/comment/remove.php b/app/Template/comment/remove.php index afc3346f..1b5004f4 100644 --- a/app/Template/comment/remove.php +++ b/app/Template/comment/remove.php @@ -12,6 +12,6 @@
url->link(t('Yes'), 'comment', 'remove', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'comment_id' => $comment['id']), true, 'btn btn-red') ?> - url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'close-popover') ?>
\ No newline at end of file diff --git a/app/Template/comment/show.php b/app/Template/comment/show.php index 44457653..26b300e8 100644 --- a/app/Template/comment/show.php +++ b/app/Template/comment/show.php @@ -18,10 +18,10 @@
  • user->isAdmin() || $this->user->isCurrentUser($comment['user_id']))): ?>
  • - url->link(t('remove'), 'comment', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'comment_id' => $comment['id'])) ?> + url->link(t('remove'), 'comment', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'comment_id' => $comment['id']), false, 'popover') ?>
  • - url->link(t('edit'), 'comment', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'comment_id' => $comment['id'])) ?> + url->link(t('edit'), 'comment', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'comment_id' => $comment['id']), false, 'popover') ?>
  • diff --git a/app/Template/file/new.php b/app/Template/file/new.php index a1a59eae..1702638d 100644 --- a/app/Template/file/new.php +++ b/app/Template/file/new.php @@ -7,8 +7,8 @@
    text->bytes($max_size) : $max_size ?>
    - + - url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'close-popover') ?>
    \ No newline at end of file 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 @@ + 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 @@ - + render('subtask/menu', array( + 'project' => $project, + 'task' => $task, + 'subtask' => $subtask, + 'redirect' => $redirect, + 'first_position' => $first_position, + 'last_position' => $last_position, + )) ?> + +

    user->hasProjectAccess('subtask', 'save', $task['project_id'])): ?> diff --git a/app/Template/task/layout.php b/app/Template/task/layout.php index 070ae37d..9cbbfec9 100644 --- a/app/Template/task/layout.php +++ b/app/Template/task/layout.php @@ -1,6 +1,9 @@
    \ No newline at end of file diff --git a/app/Template/task/sidebar.php b/app/Template/task/sidebar.php index c184e095..c60a1810 100644 --- a/app/Template/task/sidebar.php +++ b/app/Template/task/sidebar.php @@ -1,5 +1,5 @@ diff --git a/app/Template/task_duplication/copy.php b/app/Template/task_duplication/copy.php index 415b8610..fe2c599a 100644 --- a/app/Template/task_duplication/copy.php +++ b/app/Template/task_duplication/copy.php @@ -6,7 +6,7 @@

    -
    + form->csrf() ?> form->hidden('id', $values) ?> @@ -39,9 +39,9 @@

    - + - url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'close-popover') ?>
    diff --git a/app/Template/task_duplication/duplicate.php b/app/Template/task_duplication/duplicate.php index 4b50d9ca..376f6b3b 100644 --- a/app/Template/task_duplication/duplicate.php +++ b/app/Template/task_duplication/duplicate.php @@ -10,6 +10,6 @@
    url->link(t('Yes'), 'taskduplication', 'duplicate', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'confirmation' => 'yes'), true, 'btn btn-red') ?> - url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'close-popover') ?>
    \ No newline at end of file diff --git a/app/Template/task_duplication/move.php b/app/Template/task_duplication/move.php index d8d1ba05..8ab81f5b 100644 --- a/app/Template/task_duplication/move.php +++ b/app/Template/task_duplication/move.php @@ -6,7 +6,7 @@

    -
    + form->csrf() ?> form->hidden('id', $values) ?> @@ -39,9 +39,9 @@

    - + - url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'close-popover') ?>
    diff --git a/app/Template/task_external_link/remove.php b/app/Template/task_external_link/remove.php index f55e751c..01535255 100644 --- a/app/Template/task_external_link/remove.php +++ b/app/Template/task_external_link/remove.php @@ -10,6 +10,6 @@
    url->link(t('Yes'), 'TaskExternalLink', 'remove', array('link_id' => $link['id'], 'task_id' => $task['id'], 'project_id' => $task['project_id']), true, 'btn btn-red') ?> - url->link(t('cancel'), 'TaskExternalLink', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + url->link(t('cancel'), 'TaskExternalLink', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'close-popover') ?>
    \ No newline at end of file diff --git a/app/Template/task_external_link/show.php b/app/Template/task_external_link/show.php index 7e8b1948..2dc3d1dd 100644 --- a/app/Template/task_external_link/show.php +++ b/app/Template/task_external_link/show.php @@ -38,8 +38,8 @@ diff --git a/app/Template/task_modification/edit_recurrence.php b/app/Template/task_modification/edit_recurrence.php deleted file mode 100644 index dc4faa7a..00000000 --- a/app/Template/task_modification/edit_recurrence.php +++ /dev/null @@ -1,47 +0,0 @@ - - - -
    - render('task/recurring_info', array( - 'task' => $task, - 'recurrence_trigger_list' => $recurrence_trigger_list, - 'recurrence_timeframe_list' => $recurrence_timeframe_list, - 'recurrence_basedate_list' => $recurrence_basedate_list, - )) ?> -
    - - - - -
    - - form->csrf() ?> - - form->hidden('id', $values) ?> - form->hidden('project_id', $values) ?> - - form->label(t('Generate recurrent task'), 'recurrence_status') ?> - form->select('recurrence_status', $recurrence_status_list, $values, $errors) ?> - - form->label(t('Trigger to generate recurrent task'), 'recurrence_trigger') ?> - form->select('recurrence_trigger', $recurrence_trigger_list, $values, $errors) ?> - - form->label(t('Factor to calculate new due date'), 'recurrence_factor') ?> - form->number('recurrence_factor', $values, $errors) ?> - - form->label(t('Timeframe to calculate new due date'), 'recurrence_timeframe') ?> - form->select('recurrence_timeframe', $recurrence_timeframe_list, $values, $errors) ?> - - form->label(t('Base date to calculate new due date'), 'recurrence_basedate') ?> - form->select('recurrence_basedate', $recurrence_basedate_list, $values, $errors) ?> - -
    - - - url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> -
    -
    - - \ No newline at end of file diff --git a/app/Template/task_recurrence/edit.php b/app/Template/task_recurrence/edit.php new file mode 100644 index 00000000..3c7f2318 --- /dev/null +++ b/app/Template/task_recurrence/edit.php @@ -0,0 +1,47 @@ + + + +
    + render('task/recurring_info', array( + 'task' => $task, + 'recurrence_trigger_list' => $recurrence_trigger_list, + 'recurrence_timeframe_list' => $recurrence_timeframe_list, + 'recurrence_basedate_list' => $recurrence_basedate_list, + )) ?> +
    + + + + +
    + + form->csrf() ?> + + form->hidden('id', $values) ?> + form->hidden('project_id', $values) ?> + + form->label(t('Generate recurrent task'), 'recurrence_status') ?> + form->select('recurrence_status', $recurrence_status_list, $values, $errors) ?> + + form->label(t('Trigger to generate recurrent task'), 'recurrence_trigger') ?> + form->select('recurrence_trigger', $recurrence_trigger_list, $values, $errors) ?> + + form->label(t('Factor to calculate new due date'), 'recurrence_factor') ?> + form->number('recurrence_factor', $values, $errors) ?> + + form->label(t('Timeframe to calculate new due date'), 'recurrence_timeframe') ?> + form->select('recurrence_timeframe', $recurrence_timeframe_list, $values, $errors) ?> + + form->label(t('Base date to calculate new due date'), 'recurrence_basedate') ?> + form->select('recurrence_basedate', $recurrence_basedate_list, $values, $errors) ?> + +
    + + + url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'close-popover') ?> +
    +
    + + \ No newline at end of file -- cgit v1.2.3