diff options
author | Frederic Guillot <fred@kanboard.net> | 2017-01-02 17:01:27 -0500 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2017-01-02 17:01:27 -0500 |
commit | 3833c12ccce59bcc49c4cfa892401973558f604d (patch) | |
tree | b67b0e10cdc3d42e5626f728206138a444a40ed0 /app/Template/category | |
parent | d49ce63e51f596ad3bf0d02b689aea673cf544f8 (diff) |
Refactoring/rewrite of modal boxes handling
Diffstat (limited to 'app/Template/category')
-rw-r--r-- | app/Template/category/edit.php | 9 | ||||
-rw-r--r-- | app/Template/category/index.php | 6 | ||||
-rw-r--r-- | app/Template/category/remove.php | 28 |
3 files changed, 17 insertions, 26 deletions
diff --git a/app/Template/category/edit.php b/app/Template/category/edit.php index d8ca313d..108826f3 100644 --- a/app/Template/category/edit.php +++ b/app/Template/category/edit.php @@ -2,8 +2,7 @@ <h2><?= t('Category modification for the project "%s"', $project['name']) ?></h2> </div> -<form class="popover-form" method="post" action="<?= $this->url->href('CategoryController', 'update', array('project_id' => $project['id'], 'category_id' => $values['id'])) ?>" autocomplete="off"> - +<form method="post" action="<?= $this->url->href('CategoryController', 'update', array('project_id' => $project['id'], 'category_id' => $values['id'])) ?>" autocomplete="off"> <?= $this->form->csrf() ?> <?= $this->form->hidden('id', $values) ?> @@ -15,9 +14,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"><?= t('Save') ?></button> - <?= t('or') ?> - <?= $this->url->link(t('cancel'), 'CategoryController', 'index', array('project_id' => $project['id']), false, 'close-popover') ?> - </div> + <?= $this->modal->submitButtons() ?> </form> diff --git a/app/Template/category/index.php b/app/Template/category/index.php index 336b79a2..e93138fd 100644 --- a/app/Template/category/index.php +++ b/app/Template/category/index.php @@ -15,12 +15,10 @@ <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'), 'CategoryController', 'edit', array('project_id' => $project['id'], 'category_id' => $category_id), false, 'popover') ?> + <?= $this->modal->medium('edit', t('Edit'), 'CategoryController', 'edit', array('project_id' => $project['id'], 'category_id' => $category_id)) ?> </li> <li> - <i class="fa fa-trash-o fa-fw" aria-hidden="true"></i> - <?= $this->url->link(t('Remove'), 'CategoryController', 'confirm', array('project_id' => $project['id'], 'category_id' => $category_id), false, 'popover') ?> + <?= $this->modal->confirm('trash-o', t('Remove'), 'CategoryController', 'confirm', array('project_id' => $project['id'], 'category_id' => $category_id)) ?> </li> </ul> </div> diff --git a/app/Template/category/remove.php b/app/Template/category/remove.php index e7b9c9b4..79e8a560 100644 --- a/app/Template/category/remove.php +++ b/app/Template/category/remove.php @@ -1,17 +1,15 @@ -<section id="main"> - <div class="page-header"> - <h2><?= t('Remove a category') ?></h2> - </div> +<div class="page-header"> + <h2><?= t('Remove a category') ?></h2> +</div> - <div class="confirm"> - <p class="alert alert-info"> - <?= t('Do you really want to remove this category: "%s"?', $category['name']) ?> - </p> +<div class="confirm"> + <p class="alert alert-info"> + <?= t('Do you really want to remove this category: "%s"?', $category['name']) ?> + </p> - <div class="form-actions"> - <?= $this->url->link(t('Yes'), 'CategoryController', 'remove', array('project_id' => $project['id'], 'category_id' => $category['id']), true, 'btn btn-red') ?> - <?= t('or') ?> - <?= $this->url->link(t('cancel'), 'CategoryController', 'index', array('project_id' => $project['id']), false, 'close-popover') ?> - </div> - </div> -</section> + <?= $this->modal->confirmButtons( + 'CategoryController', + 'remove', + array('project_id' => $project['id'], 'category_id' => $category['id']) + ) ?> +</div> |