summaryrefslogtreecommitdiff
path: root/app/Template
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-06-24 22:10:14 -0400
committerFrederic Guillot <fred@kanboard.net>2016-06-24 22:10:14 -0400
commitce367a24fca09bb1fa05da167f36db54712c8fa1 (patch)
tree204814ef3e71256ef77716d7f233ff194772c5a0 /app/Template
parentcead21691e449707e17dba4ef0be3f8ce0ee42f5 (diff)
Added tag modification from the user interface
Diffstat (limited to 'app/Template')
-rw-r--r--app/Template/config/sidebar.php3
-rw-r--r--app/Template/project/sidebar.php3
-rw-r--r--app/Template/project_tag/create.php16
-rw-r--r--app/Template/project_tag/edit.php17
-rw-r--r--app/Template/project_tag/index.php31
-rw-r--r--app/Template/project_tag/remove.php15
-rw-r--r--app/Template/tag/create.php16
-rw-r--r--app/Template/tag/edit.php17
-rw-r--r--app/Template/tag/index.php31
-rw-r--r--app/Template/tag/remove.php15
10 files changed, 164 insertions, 0 deletions
diff --git a/app/Template/config/sidebar.php b/app/Template/config/sidebar.php
index 29caa0ef..e304f0d0 100644
--- a/app/Template/config/sidebar.php
+++ b/app/Template/config/sidebar.php
@@ -19,6 +19,9 @@
<li <?= $this->app->checkMenuSelection('ConfigController', 'calendar') ?>>
<?= $this->url->link(t('Calendar settings'), 'ConfigController', 'calendar') ?>
</li>
+ <li <?= $this->app->checkMenuSelection('TagController', 'index') ?>>
+ <?= $this->url->link(t('Tags management'), 'TagController', 'index') ?>
+ </li>
<li <?= $this->app->checkMenuSelection('LinkController') ?>>
<?= $this->url->link(t('Link settings'), 'LinkController', 'index') ?>
</li>
diff --git a/app/Template/project/sidebar.php b/app/Template/project/sidebar.php
index 9bc0c9c4..d0f50596 100644
--- a/app/Template/project/sidebar.php
+++ b/app/Template/project/sidebar.php
@@ -32,6 +32,9 @@
<li <?= $this->app->checkMenuSelection('CategoryController') ?>>
<?= $this->url->link(t('Categories'), 'CategoryController', 'index', array('project_id' => $project['id'])) ?>
</li>
+ <li <?= $this->app->checkMenuSelection('ProjectTagController') ?>>
+ <?= $this->url->link(t('Tags'), 'ProjectTagController', 'index', array('project_id' => $project['id'])) ?>
+ </li>
<?php if ($project['is_private'] == 0): ?>
<li <?= $this->app->checkMenuSelection('ProjectPermissionController') ?>>
<?= $this->url->link(t('Permissions'), 'ProjectPermissionController', 'index', array('project_id' => $project['id'])) ?>
diff --git a/app/Template/project_tag/create.php b/app/Template/project_tag/create.php
new file mode 100644
index 00000000..bfd1084a
--- /dev/null
+++ b/app/Template/project_tag/create.php
@@ -0,0 +1,16 @@
+<div class="page-header">
+ <h2><?= t('Add new tag') ?></h2>
+</div>
+<form method="post" class="popover-form" action="<?= $this->url->href('ProjectTagController', 'save', array('project_id' => $project['id'])) ?>" 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'), 'ProjectTagController', 'index', array('project_id' => $project['id']), false, 'close-popover') ?>
+ </div>
+</form>
diff --git a/app/Template/project_tag/edit.php b/app/Template/project_tag/edit.php
new file mode 100644
index 00000000..9bf261bd
--- /dev/null
+++ b/app/Template/project_tag/edit.php
@@ -0,0 +1,17 @@
+<div class="page-header">
+ <h2><?= t('Edit a tag') ?></h2>
+</div>
+<form method="post" class="popover-form" action="<?= $this->url->href('ProjectTagController', 'update', array('tag_id' => $tag['id'], 'project_id' => $project['id'])) ?>" autocomplete="off">
+ <?= $this->form->csrf() ?>
+ <?= $this->form->hidden('id', $values) ?>
+ <?= $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'), 'ProjectTagController', 'index', array(), false, 'close-popover') ?>
+ </div>
+</form>
diff --git a/app/Template/project_tag/index.php b/app/Template/project_tag/index.php
new file mode 100644
index 00000000..8e8dd96c
--- /dev/null
+++ b/app/Template/project_tag/index.php
@@ -0,0 +1,31 @@
+<div class="page-header">
+ <h2><?= t('Project tags') ?></h2>
+ <ul>
+ <li>
+ <i class="fa fa-plus" aria-hidden="true"></i>
+ <?= $this->url->link(t('Add new tag'), 'ProjectTagController', 'create', array('project_id' => $project['id']), false, 'popover') ?>
+ </li>
+ </ul>
+</div>
+
+<?php if (empty($tags)): ?>
+ <p class="alert"><?= t('There is no specific tag for this project at the moment.') ?></p>
+<?php else: ?>
+ <table class="table-striped">
+ <tr>
+ <th class="column-80"><?= t('Tag') ?></th>
+ <th><?= t('Action') ?></th>
+ </tr>
+ <?php foreach ($tags as $tag): ?>
+ <tr>
+ <td><?= $this->text->e($tag['name']) ?></td>
+ <td>
+ <i class="fa fa-times" aria-hidden="true"></i>
+ <?= $this->url->link(t('Remove'), 'ProjectTagController', 'confirm', array('tag_id' => $tag['id'], 'project_id' => $project['id']), false, 'popover') ?>
+ <i class="fa fa-pencil-square-o" aria-hidden="true"></i>
+ <?= $this->url->link(t('Edit'), 'ProjectTagController', 'edit', array('tag_id' => $tag['id'], 'project_id' => $project['id']), false, 'popover') ?>
+ </td>
+ </tr>
+ <?php endforeach ?>
+ </table>
+<?php endif ?>
diff --git a/app/Template/project_tag/remove.php b/app/Template/project_tag/remove.php
new file mode 100644
index 00000000..f4aadab1
--- /dev/null
+++ b/app/Template/project_tag/remove.php
@@ -0,0 +1,15 @@
+<div class="page-header">
+ <h2><?= t('Remove a tag') ?></h2>
+</div>
+
+<div class="confirm">
+ <p class="alert alert-info">
+ <?= t('Do you really want to remove this tag: "%s"?', $tag['name']) ?>
+ </p>
+
+ <div class="form-actions">
+ <?= $this->url->link(t('Yes'), 'ProjectTagController', 'remove', array('tag_id' => $tag['id'], 'project_id' => $project['id']), true, 'btn btn-red popover-link') ?>
+ <?= t('or') ?>
+ <?= $this->url->link(t('cancel'), 'ProjectTagController', 'index', array('project_id' => $project['id']), false, 'close-popover') ?>
+ </div>
+</div>
diff --git a/app/Template/tag/create.php b/app/Template/tag/create.php
new file mode 100644
index 00000000..9b32bc46
--- /dev/null
+++ b/app/Template/tag/create.php
@@ -0,0 +1,16 @@
+<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">
+ <?= $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>
+</form>
diff --git a/app/Template/tag/edit.php b/app/Template/tag/edit.php
new file mode 100644
index 00000000..f751ff49
--- /dev/null
+++ b/app/Template/tag/edit.php
@@ -0,0 +1,17 @@
+<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">
+ <?= $this->form->csrf() ?>
+ <?= $this->form->hidden('id', $values) ?>
+ <?= $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>
+</form>
diff --git a/app/Template/tag/index.php b/app/Template/tag/index.php
new file mode 100644
index 00000000..2a495eb3
--- /dev/null
+++ b/app/Template/tag/index.php
@@ -0,0 +1,31 @@
+<div class="page-header">
+ <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') ?>
+ </li>
+ </ul>
+</div>
+
+<?php if (empty($tags)): ?>
+ <p class="alert"><?= t('There is no global tag at the moment.') ?></p>
+<?php else: ?>
+ <table class="table-striped">
+ <tr>
+ <th class="column-80"><?= t('Tag') ?></th>
+ <th><?= t('Action') ?></th>
+ </tr>
+ <?php foreach ($tags as $tag): ?>
+ <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') ?>
+ </td>
+ </tr>
+ <?php endforeach ?>
+ </table>
+<?php endif ?>
diff --git a/app/Template/tag/remove.php b/app/Template/tag/remove.php
new file mode 100644
index 00000000..46ea3f99
--- /dev/null
+++ b/app/Template/tag/remove.php
@@ -0,0 +1,15 @@
+<div class="page-header">
+ <h2><?= t('Remove a tag') ?></h2>
+</div>
+
+<div class="confirm">
+ <p class="alert alert-info">
+ <?= 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>
+</div>