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/tag | |
parent | d49ce63e51f596ad3bf0d02b689aea673cf544f8 (diff) |
Refactoring/rewrite of modal boxes handling
Diffstat (limited to 'app/Template/tag')
-rw-r--r-- | app/Template/tag/create.php | 8 | ||||
-rw-r--r-- | app/Template/tag/edit.php | 8 | ||||
-rw-r--r-- | app/Template/tag/index.php | 9 | ||||
-rw-r--r-- | app/Template/tag/remove.php | 10 |
4 files changed, 12 insertions, 23 deletions
diff --git a/app/Template/tag/create.php b/app/Template/tag/create.php index 9b32bc46..752a63e5 100644 --- a/app/Template/tag/create.php +++ b/app/Template/tag/create.php @@ -1,16 +1,12 @@ <div class="page-header"> <h2><?= t('Add new tag') ?></h2> </div> -<form method="post" class="popover-form" action="<?= $this->url->href('TagController', 'save') ?>" autocomplete="off"> +<form method="post" action="<?= $this->url->href('TagController', 'save') ?>" autocomplete="off"> <?= $this->form->csrf() ?> <?= $this->form->hidden('project_id', $values) ?> <?= $this->form->label(t('Name'), 'name') ?> <?= $this->form->text('name', $values, $errors, array('autofocus', 'required', 'maxlength="255"')) ?> - <div class="form-actions"> - <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> - <?= t('or') ?> - <?= $this->url->link(t('cancel'), 'TagController', 'index', array(), false, 'close-popover') ?> - </div> + <?= $this->modal->submitButtons() ?> </form> diff --git a/app/Template/tag/edit.php b/app/Template/tag/edit.php index f751ff49..adef3568 100644 --- a/app/Template/tag/edit.php +++ b/app/Template/tag/edit.php @@ -1,7 +1,7 @@ <div class="page-header"> <h2><?= t('Edit a tag') ?></h2> </div> -<form method="post" class="popover-form" action="<?= $this->url->href('TagController', 'update', array('tag_id' => $tag['id'])) ?>" autocomplete="off"> +<form method="post" action="<?= $this->url->href('TagController', 'update', array('tag_id' => $tag['id'])) ?>" autocomplete="off"> <?= $this->form->csrf() ?> <?= $this->form->hidden('id', $values) ?> <?= $this->form->hidden('project_id', $values) ?> @@ -9,9 +9,5 @@ <?= $this->form->label(t('Name'), 'name') ?> <?= $this->form->text('name', $values, $errors, array('autofocus', 'required', 'maxlength="255"')) ?> - <div class="form-actions"> - <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> - <?= t('or') ?> - <?= $this->url->link(t('cancel'), 'TagController', 'index', array(), false, 'close-popover') ?> - </div> + <?= $this->modal->submitButtons() ?> </form> diff --git a/app/Template/tag/index.php b/app/Template/tag/index.php index 8e0c9a06..834e8e7c 100644 --- a/app/Template/tag/index.php +++ b/app/Template/tag/index.php @@ -2,8 +2,7 @@ <h2><?= t('Global tags') ?></h2> <ul> <li> - <i class="fa fa-plus" aria-hidden="true"></i> - <?= $this->url->link(t('Add new tag'), 'TagController', 'create', array(), false, 'popover') ?> + <?= $this->modal->medium('plus', t('Add new tag'), 'TagController', 'create') ?> </li> </ul> </div> @@ -20,10 +19,8 @@ <tr> <td><?= $this->text->e($tag['name']) ?></td> <td> - <i class="fa fa-times" aria-hidden="true"></i> - <?= $this->url->link(t('Remove'), 'TagController', 'confirm', array('tag_id' => $tag['id']), false, 'popover') ?> - <i class="fa fa-pencil-square-o" aria-hidden="true"></i> - <?= $this->url->link(t('Edit'), 'TagController', 'edit', array('tag_id' => $tag['id']), false, 'popover') ?> + <?= $this->modal->medium('edit', t('Edit'), 'TagController', 'edit', array('tag_id' => $tag['id'])) ?> + <?= $this->modal->confirm('trash-o', t('Remove'), 'TagController', 'confirm', array('tag_id' => $tag['id'])) ?> </td> </tr> <?php endforeach ?> diff --git a/app/Template/tag/remove.php b/app/Template/tag/remove.php index 46ea3f99..47ba8d3d 100644 --- a/app/Template/tag/remove.php +++ b/app/Template/tag/remove.php @@ -7,9 +7,9 @@ <?= t('Do you really want to remove this tag: "%s"?', $tag['name']) ?> </p> - <div class="form-actions"> - <?= $this->url->link(t('Yes'), 'TagController', 'remove', array('tag_id' => $tag['id']), true, 'btn btn-red popover-link') ?> - <?= t('or') ?> - <?= $this->url->link(t('cancel'), 'TagController', 'index', array(), false, 'close-popover') ?> - </div> + <?= $this->modal->confirmButtons( + 'TagController', + 'remove', + array('tag_id' => $tag['id']) + ) ?> </div> |