Refactoring/rewrite of modal boxes handling
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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 ?>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user