summaryrefslogtreecommitdiff
path: root/app/Template/swimlane
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2017-01-02 17:01:27 -0500
committerFrederic Guillot <fred@kanboard.net>2017-01-02 17:01:27 -0500
commit3833c12ccce59bcc49c4cfa892401973558f604d (patch)
treeb67b0e10cdc3d42e5626f728206138a444a40ed0 /app/Template/swimlane
parentd49ce63e51f596ad3bf0d02b689aea673cf544f8 (diff)
Refactoring/rewrite of modal boxes handling
Diffstat (limited to 'app/Template/swimlane')
-rw-r--r--app/Template/swimlane/create.php8
-rw-r--r--app/Template/swimlane/edit.php8
-rw-r--r--app/Template/swimlane/edit_default.php8
-rw-r--r--app/Template/swimlane/index.php3
-rw-r--r--app/Template/swimlane/remove.php28
-rw-r--r--app/Template/swimlane/table.php9
6 files changed, 23 insertions, 41 deletions
diff --git a/app/Template/swimlane/create.php b/app/Template/swimlane/create.php
index 207b526c..7d05e731 100644
--- a/app/Template/swimlane/create.php
+++ b/app/Template/swimlane/create.php
@@ -1,7 +1,7 @@
<div class="page-header">
<h2><?= t('Add a new swimlane') ?></h2>
</div>
-<form class="popover-form" method="post" action="<?= $this->url->href('SwimlaneController', 'save', array('project_id' => $project['id'])) ?>" autocomplete="off">
+<form method="post" action="<?= $this->url->href('SwimlaneController', 'save', array('project_id' => $project['id'])) ?>" autocomplete="off">
<?= $this->form->csrf() ?>
<?= $this->form->hidden('project_id', $values) ?>
@@ -12,9 +12,5 @@
<?= $this->form->label(t('Description'), 'description') ?>
<?= $this->form->textEditor('description', $values, $errors, array('tabindex' => 2)) ?>
- <div class="form-actions">
- <button type="submit" class="btn btn-blue" tabindex="3"><?= t('Save') ?></button>
- <?= t('or') ?>
- <?= $this->url->link(t('cancel'), 'SwimlaneController', 'index', array('project_id' => $project['id']), false, 'close-popover') ?>
- </div>
+ <?= $this->modal->submitButtons() ?>
</form>
diff --git a/app/Template/swimlane/edit.php b/app/Template/swimlane/edit.php
index d225b345..c1c41196 100644
--- a/app/Template/swimlane/edit.php
+++ b/app/Template/swimlane/edit.php
@@ -2,7 +2,7 @@
<h2><?= t('Swimlane modification for the project "%s"', $project['name']) ?></h2>
</div>
-<form class="popover-form" method="post" action="<?= $this->url->href('SwimlaneController', 'update', array('project_id' => $project['id'], 'swimlane_id' => $values['id'])) ?>" autocomplete="off">
+<form method="post" action="<?= $this->url->href('SwimlaneController', 'update', array('project_id' => $project['id'], 'swimlane_id' => $values['id'])) ?>" autocomplete="off">
<?= $this->form->csrf() ?>
@@ -15,9 +15,5 @@
<?= $this->form->label(t('Description'), 'description') ?>
<?= $this->form->textEditor('description', $values, $errors, array('tabindex' => 2)) ?>
- <div class="form-actions">
- <button type="submit" class="btn btn-blue" tabindex="3"><?= t('Save') ?></button>
- <?= t('or') ?>
- <?= $this->url->link(t('cancel'), 'SwimlaneController', 'index', array('project_id' => $project['id']), false, 'close-popover') ?>
- </div>
+ <?= $this->modal->submitButtons() ?>
</form>
diff --git a/app/Template/swimlane/edit_default.php b/app/Template/swimlane/edit_default.php
index 8a0c0a15..a2c3ee73 100644
--- a/app/Template/swimlane/edit_default.php
+++ b/app/Template/swimlane/edit_default.php
@@ -1,7 +1,7 @@
<div class="page-header">
<h2><?= t('Change default swimlane') ?></h2>
</div>
-<form class="popover-form" method="post" action="<?= $this->url->href('SwimlaneController', 'updateDefault', array('project_id' => $project['id'])) ?>" autocomplete="off">
+<form method="post" action="<?= $this->url->href('SwimlaneController', 'updateDefault', array('project_id' => $project['id'])) ?>" autocomplete="off">
<?= $this->form->csrf() ?>
<?= $this->form->hidden('id', $values) ?>
@@ -10,9 +10,5 @@
<?= $this->form->checkbox('show_default_swimlane', t('Show default swimlane'), 1, $values['show_default_swimlane'] == 1) ?>
- <div class="form-actions">
- <button type="submit" class="btn btn-blue"><?= t('Save') ?></button>
- <?= t('or') ?>
- <?= $this->url->link(t('cancel'), 'SwimlaneController', 'index', array('project_id' => $project['id']), false, 'close-popover') ?>
- </div>
+ <?= $this->modal->submitButtons() ?>
</form>
diff --git a/app/Template/swimlane/index.php b/app/Template/swimlane/index.php
index 4f78a405..e05b9088 100644
--- a/app/Template/swimlane/index.php
+++ b/app/Template/swimlane/index.php
@@ -2,8 +2,7 @@
<h2><?= t('Swimlanes') ?></h2>
<ul>
<li>
- <i class="fa fa-plus fa-fw"></i>
- <?= $this->url->link(t('Add a new swimlane'), 'SwimlaneController', 'create', array('project_id' => $project['id']), false, 'popover') ?>
+ <?= $this->modal->medium('plus', t('Add a new swimlane'), 'SwimlaneController', 'create', array('project_id' => $project['id'])) ?>
</li>
</ul>
</div>
diff --git a/app/Template/swimlane/remove.php b/app/Template/swimlane/remove.php
index f16b778c..02d1e322 100644
--- a/app/Template/swimlane/remove.php
+++ b/app/Template/swimlane/remove.php
@@ -1,17 +1,15 @@
-<section id="main">
- <div class="page-header">
- <h2><?= t('Remove a swimlane') ?></h2>
- </div>
+<div class="page-header">
+ <h2><?= t('Remove a swimlane') ?></h2>
+</div>
- <div class="confirm">
- <p class="alert alert-info">
- <?= t('Do you really want to remove this swimlane: "%s"?', $swimlane['name']) ?>
- </p>
+<div class="confirm">
+ <p class="alert alert-info">
+ <?= t('Do you really want to remove this swimlane: "%s"?', $swimlane['name']) ?>
+ </p>
- <div class="form-actions">
- <?= $this->url->link(t('Yes'), 'SwimlaneController', 'remove', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id']), true, 'btn btn-red') ?>
- <?= t('or') ?>
- <?= $this->url->link(t('cancel'), 'SwimlaneController', 'index', array('project_id' => $project['id']), false, 'close-popover') ?>
- </div>
- </div>
-</section>
+ <?= $this->modal->confirmButtons(
+ 'SwimlaneController',
+ 'remove',
+ array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id'])
+ ) ?>
+</div>
diff --git a/app/Template/swimlane/table.php b/app/Template/swimlane/table.php
index 81daed01..4c9390e0 100644
--- a/app/Template/swimlane/table.php
+++ b/app/Template/swimlane/table.php
@@ -20,8 +20,7 @@
<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>
<li>
- <i class="fa fa-pencil-square-o fa-fw" aria-hidden="true"></i>
- <?= $this->url->link(t('Edit'), 'SwimlaneController', 'editDefault', array('project_id' => $project['id']), false, 'popover') ?>
+ <?= $this->modal->medium('edit', t('Edit'), 'SwimlaneController', 'editDefault', array('project_id' => $project['id'])) ?>
</li>
<li>
<?php if ($default_swimlane['show_default_swimlane'] == 1): ?>
@@ -58,8 +57,7 @@
<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>
<li>
- <i class="fa fa-pencil-square-o fa-fw" aria-hidden="true"></i>
- <?= $this->url->link(t('Edit'), 'SwimlaneController', 'edit', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id']), false, 'popover') ?>
+ <?= $this->modal->medium('edit', t('Edit'), 'SwimlaneController', 'edit', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id'])) ?>
</li>
<li>
<?php if ($swimlane['is_active']): ?>
@@ -71,8 +69,7 @@
<?php endif ?>
</li>
<li>
- <i class="fa fa-trash-o fa-fw" aria-hidden="true"></i>
- <?= $this->url->link(t('Remove'), 'SwimlaneController', 'confirm', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id']), false, 'popover') ?>
+ <?= $this->modal->confirm('trash-o', t('Remove'), 'SwimlaneController', 'confirm', array('project_id' => $project['id'], 'swimlane_id' => $swimlane['id'])) ?>
</li>
</ul>
</div>