summaryrefslogtreecommitdiff
path: root/app/Template/category
diff options
context:
space:
mode:
Diffstat (limited to 'app/Template/category')
-rw-r--r--app/Template/category/edit.php38
-rw-r--r--app/Template/category/index.php42
-rw-r--r--app/Template/category/remove.php17
3 files changed, 97 insertions, 0 deletions
diff --git a/app/Template/category/edit.php b/app/Template/category/edit.php
new file mode 100644
index 00000000..7d40fe65
--- /dev/null
+++ b/app/Template/category/edit.php
@@ -0,0 +1,38 @@
+<div class="page-header">
+ <h2><?= t('Category modification for the project "%s"', $project['name']) ?></h2>
+</div>
+
+<form method="post" action="<?= $this->url->href('category', 'update', array('project_id' => $project['id'], 'category_id' => $values['id'])) ?>" autocomplete="off">
+
+ <?= $this->form->csrf() ?>
+
+ <?= $this->form->hidden('id', $values) ?>
+ <?= $this->form->hidden('project_id', $values) ?>
+
+ <?= $this->form->label(t('Category Name'), 'name') ?>
+ <?= $this->form->text('name', $values, $errors, array('autofocus', 'required', 'maxlength="50"')) ?>
+
+ <?= $this->form->label(t('Description'), 'description') ?>
+
+ <div class="form-tabs">
+ <div class="write-area">
+ <?= $this->form->textarea('description', $values, $errors) ?>
+ </div>
+ <div class="preview-area">
+ <div class="markdown"></div>
+ </div>
+ <ul class="form-tabs-nav">
+ <li class="form-tab form-tab-selected">
+ <i class="fa fa-pencil-square-o fa-fw"></i><a id="markdown-write" href="#"><?= t('Write') ?></a>
+ </li>
+ <li class="form-tab">
+ <a id="markdown-preview" href="#"><i class="fa fa-eye fa-fw"></i><?= t('Preview') ?></a>
+ </li>
+ </ul>
+ </div>
+ <div class="form-help"><a href="http://kanboard.net/documentation/syntax-guide" target="_blank" rel="noreferrer"><?= t('Write your text in Markdown') ?></a></div>
+
+ <div class="form-actions">
+ <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
+ </div>
+</form> \ No newline at end of file
diff --git a/app/Template/category/index.php b/app/Template/category/index.php
new file mode 100644
index 00000000..dba537d0
--- /dev/null
+++ b/app/Template/category/index.php
@@ -0,0 +1,42 @@
+<?php if (! empty($categories)): ?>
+<div class="page-header">
+ <h2><?= t('Categories') ?></h2>
+</div>
+<table>
+ <tr>
+ <th><?= t('Category Name') ?></th>
+ <th><?= t('Actions') ?></th>
+ </tr>
+ <?php foreach ($categories as $category_id => $category_name): ?>
+ <tr>
+ <td><?= $this->e($category_name) ?></td>
+ <td>
+ <ul>
+ <li>
+ <?= $this->url->link(t('Edit'), 'category', 'edit', array('project_id' => $project['id'], 'category_id' => $category_id)) ?>
+ </li>
+ <li>
+ <?= $this->url->link(t('Remove'), 'category', 'confirm', array('project_id' => $project['id'], 'category_id' => $category_id)) ?>
+ </li>
+ </ul>
+ </td>
+ </tr>
+ <?php endforeach ?>
+</table>
+<?php endif ?>
+
+<div class="page-header">
+ <h2><?= t('Add a new category') ?></h2>
+</div>
+<form method="post" action="<?= $this->url->href('category', 'save', array('project_id' => $project['id'])) ?>" autocomplete="off">
+
+ <?= $this->form->csrf() ?>
+ <?= $this->form->hidden('project_id', $values) ?>
+
+ <?= $this->form->label(t('Category Name'), 'name') ?>
+ <?= $this->form->text('name', $values, $errors, array('autofocus', 'required', 'maxlength="50"')) ?>
+
+ <div class="form-actions">
+ <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
+ </div>
+</form> \ No newline at end of file
diff --git a/app/Template/category/remove.php b/app/Template/category/remove.php
new file mode 100644
index 00000000..ce589785
--- /dev/null
+++ b/app/Template/category/remove.php
@@ -0,0 +1,17 @@
+<section id="main">
+ <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="form-actions">
+ <?= $this->url->link(t('Yes'), 'category', 'remove', array('project_id' => $project['id'], 'category_id' => $category['id']), true, 'btn btn-red') ?>
+ <?= t('or') ?>
+ <?= $this->url->link(t('cancel'), 'category', 'index', array('project_id' => $project['id'])) ?>
+ </div>
+ </div>
+</section> \ No newline at end of file