diff options
Diffstat (limited to 'app/Template/link')
-rw-r--r-- | app/Template/link/create.php | 12 | ||||
-rw-r--r-- | app/Template/link/edit.php | 6 | ||||
-rw-r--r-- | app/Template/link/index.php | 33 | ||||
-rw-r--r-- | app/Template/link/remove.php | 10 | ||||
-rw-r--r-- | app/Template/link/show.php | 36 |
5 files changed, 45 insertions, 52 deletions
diff --git a/app/Template/link/create.php b/app/Template/link/create.php index 23990604..37610a3b 100644 --- a/app/Template/link/create.php +++ b/app/Template/link/create.php @@ -1,18 +1,12 @@ <div class="page-header"> - <h2><?= t('Add a new link') ?></h2> + <h2><?= t('Add link label') ?></h2> </div> <form action="<?= $this->url->href('LinkController', 'save') ?>" method="post" autocomplete="off"> - <?= $this->form->csrf() ?> - <?= $this->form->label(t('Label'), 'label') ?> - <?= $this->form->text('label', $values, $errors, array('required')) ?> - + <?= $this->form->text('label', $values, $errors, array('required', 'autofocus')) ?> <?= $this->form->label(t('Opposite label'), 'opposite_label') ?> <?= $this->form->text('opposite_label', $values, $errors) ?> - - <div class="form-actions"> - <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> - </div> + <?= $this->modal->submitButtons() ?> </form> diff --git a/app/Template/link/edit.php b/app/Template/link/edit.php index 0ad73275..4be56573 100644 --- a/app/Template/link/edit.php +++ b/app/Template/link/edit.php @@ -13,9 +13,5 @@ <?= $this->form->label(t('Opposite label'), 'opposite_id') ?> <?= $this->form->select('opposite_id', $labels, $values, $errors) ?> - <div class="form-actions"> - <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> - <?= t('or') ?> - <?= $this->url->link(t('cancel'), 'link', 'index') ?> - </div> + <?= $this->modal->submitButtons() ?> </form> diff --git a/app/Template/link/index.php b/app/Template/link/index.php deleted file mode 100644 index 7e32069a..00000000 --- a/app/Template/link/index.php +++ /dev/null @@ -1,33 +0,0 @@ -<div class="page-header"> - <h2><?= t('Link labels') ?></h2> -</div> -<?php if (! empty($links)): ?> -<table> - <tr> - <th class="column-70"><?= t('Link labels') ?></th> - <th><?= t('Actions') ?></th> - </tr> - <?php foreach ($links as $link): ?> - <tr> - <td> - <strong><?= t($link['label']) ?></strong> - - <?php if (! empty($link['opposite_label'])): ?> - | <?= t($link['opposite_label']) ?> - <?php endif ?> - </td> - <td> - <ul> - <?= $this->url->link(t('Edit'), 'LinkController', 'edit', array('link_id' => $link['id'])) ?> - <?= t('or') ?> - <?= $this->url->link(t('Remove'), 'LinkController', 'confirm', array('link_id' => $link['id'])) ?> - </ul> - </td> - </tr> - <?php endforeach ?> -</table> -<?php else: ?> - <?= t('There is no link.') ?> -<?php endif ?> - -<?= $this->render('link/create', array('values' => $values, 'errors' => $errors)) ?> diff --git a/app/Template/link/remove.php b/app/Template/link/remove.php index b7fbef5e..e5ea2466 100644 --- a/app/Template/link/remove.php +++ b/app/Template/link/remove.php @@ -7,9 +7,9 @@ <?= t('Do you really want to remove this link: "%s"?', $link['label']) ?> </p> - <div class="form-actions"> - <?= $this->url->link(t('Yes'), 'LinkController', 'remove', array('link_id' => $link['id']), true, 'btn btn-red') ?> - <?= t('or') ?> - <?= $this->url->link(t('cancel'), 'LinkController', 'index') ?> - </div> + <?= $this->modal->confirmButtons( + 'LinkController', + 'remove', + array('link_id' => $link['id']) + ) ?> </div> diff --git a/app/Template/link/show.php b/app/Template/link/show.php new file mode 100644 index 00000000..6aadd66b --- /dev/null +++ b/app/Template/link/show.php @@ -0,0 +1,36 @@ +<div class="page-header"> + <h2><?= t('Link labels') ?></h2> + <ul> + <li> + <?= $this->modal->medium('plus', t('Add link label'), 'LinkController', 'create') ?> + </li> + </ul> +</div> +<?php if (! empty($links)): ?> + <table class="table-striped table-scrolling"> + <tr> + <th class="column-70"><?= t('Link labels') ?></th> + <th><?= t('Actions') ?></th> + </tr> + <?php foreach ($links as $link): ?> + <tr> + <td> + <strong><?= t($link['label']) ?></strong> + + <?php if (! empty($link['opposite_label'])): ?> + | <?= t($link['opposite_label']) ?> + <?php endif ?> + </td> + <td> + <ul> + <?= $this->modal->medium('edit', t('Edit'), 'LinkController', 'edit', array('link_id' => $link['id'])) ?> + <?= t('or') ?> + <?= $this->modal->confirm('trash-o', t('Remove'), 'LinkController', 'confirm', array('link_id' => $link['id'])) ?> + </ul> + </td> + </tr> + <?php endforeach ?> + </table> +<?php else: ?> + <?= t('There is no link.') ?> +<?php endif ?> |