From 5fe68d4d499a8496229763369b50d71c9fa16200 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 20 Feb 2016 18:11:08 -0500 Subject: Add drag and drop to change swimlane positions --- app/Template/swimlane/create.php | 37 +++++++++++ app/Template/swimlane/edit_default.php | 18 ++++++ app/Template/swimlane/index.php | 87 +++++++------------------ app/Template/swimlane/table.php | 113 +++++++++++++++++++++------------ 4 files changed, 148 insertions(+), 107 deletions(-) create mode 100644 app/Template/swimlane/create.php create mode 100644 app/Template/swimlane/edit_default.php (limited to 'app/Template') diff --git a/app/Template/swimlane/create.php b/app/Template/swimlane/create.php new file mode 100644 index 00000000..bb389555 --- /dev/null +++ b/app/Template/swimlane/create.php @@ -0,0 +1,37 @@ + +
+ + form->csrf() ?> + form->hidden('project_id', $values) ?> + + form->label(t('Name'), 'name') ?> + form->text('name', $values, $errors, array('autofocus', 'required', 'maxlength="50"')) ?> + + form->label(t('Description'), 'description') ?> + +
+
+ form->textarea('description', $values, $errors) ?> +
+
+
+
+
    +
  • + +
  • +
  • + +
  • +
+
+
url->doc(t('Write your text in Markdown'), 'syntax-guide') ?>
+ +
+ + + url->link(t('cancel'), 'Swimlane', 'index', array('project_id' => $project['id']), false, 'close-popover') ?> +
+
diff --git a/app/Template/swimlane/edit_default.php b/app/Template/swimlane/edit_default.php new file mode 100644 index 00000000..df25ec12 --- /dev/null +++ b/app/Template/swimlane/edit_default.php @@ -0,0 +1,18 @@ + +
+ form->csrf() ?> + form->hidden('id', $values) ?> + + form->label(t('Name'), 'default_swimlane') ?> + form->text('default_swimlane', $values, $errors, array('required', 'maxlength="50"')) ?> + + form->checkbox('show_default_swimlane', t('Show default swimlane'), 1, $values['show_default_swimlane'] == 1) ?> + +
+ + + url->link(t('cancel'), 'Swimlane', 'index', array('project_id' => $project['id']), false, 'close-popover') ?> +
+
diff --git a/app/Template/swimlane/index.php b/app/Template/swimlane/index.php index 90100a98..fad35306 100644 --- a/app/Template/swimlane/index.php +++ b/app/Template/swimlane/index.php @@ -1,71 +1,28 @@ -
- form->csrf() ?> - form->hidden('id', $default_swimlane) ?> - - form->label(t('Rename'), 'default_swimlane') ?> - form->text('default_swimlane', $default_swimlane, array(), array('required', 'maxlength="50"')) ?> - - - form->checkbox('show_default_swimlane', t('Show default swimlane'), 1, $default_swimlane['show_default_swimlane'] == 1) ?> - - form->hidden('show_default_swimlane', $default_swimlane) ?> - - -
- -
-
- - - -render('swimlane/table', array('swimlanes' => $active_swimlanes, 'project' => $project)) ?> + +

+ render('swimlane/table', array( + 'swimlanes' => $active_swimlanes, + 'project' => $project, + 'default_swimlane' => $default_swimlane['show_default_swimlane'] == 1 ? $default_swimlane : array() + )) ?> - - -render('swimlane/table', array('swimlanes' => $inactive_swimlanes, 'project' => $project, 'hide_position' => true)) ?> + +

+ render('swimlane/table', array( + 'swimlanes' => $inactive_swimlanes, + 'project' => $project, + 'default_swimlane' => $default_swimlane['show_default_swimlane'] == 0 ? $default_swimlane : array(), + 'disable_handler' => true + )) ?> - - -
- - form->csrf() ?> - form->hidden('project_id', $values) ?> - - form->label(t('Name'), 'name') ?> - form->text('name', $values, $errors, array('required', 'maxlength="50"')) ?> - - form->label(t('Description'), 'description') ?> - -
-
- form->textarea('description', $values, $errors) ?> -
-
-
-
-
    -
  • - -
  • -
  • - -
  • -
-
-
url->doc(t('Write your text in Markdown'), 'syntax-guide') ?>
- -
- -
-
diff --git a/app/Template/swimlane/table.php b/app/Template/swimlane/table.php index 60eea47b..1e6a86bc 100644 --- a/app/Template/swimlane/table.php +++ b/app/Template/swimlane/table.php @@ -1,47 +1,76 @@ - - - - - - - - - - - - - - - + + + + +
#e($swimlane['name']) ?> - + +
-- cgit v1.2.3