summaryrefslogtreecommitdiff
path: root/app/Template
diff options
context:
space:
mode:
authorJulian Maurice <julian.maurice@biblibre.com>2018-08-09 21:35:11 +0200
committerJulian Maurice <julian.maurice@biblibre.com>2018-08-11 10:15:13 +0200
commit9d4cd31e1aae02e9980932c67036fdfe574e3432 (patch)
tree6fca71d93aaed9032a0d771a0b8111d79fdc99b6 /app/Template
parentae3ade0908bae350488260ee5d878a2ffbff605a (diff)
Allow to associate tags to colors
The color is then used as background in the board, list and task details views
Diffstat (limited to 'app/Template')
-rw-r--r--app/Template/board/task_footer.php2
-rw-r--r--app/Template/project_tag/create.php3
-rw-r--r--app/Template/project_tag/edit.php3
-rw-r--r--app/Template/tag/create.php3
-rw-r--r--app/Template/tag/edit.php3
-rw-r--r--app/Template/task/details.php2
-rw-r--r--app/Template/task_list/task_details.php2
7 files changed, 15 insertions, 3 deletions
diff --git a/app/Template/board/task_footer.php b/app/Template/board/task_footer.php
index cdb75a1f..08af52a2 100644
--- a/app/Template/board/task_footer.php
+++ b/app/Template/board/task_footer.php
@@ -25,7 +25,7 @@
<div class="task-tags">
<ul>
<?php foreach ($task['tags'] as $tag): ?>
- <li><?= $this->text->e($tag['name']) ?></li>
+ <li class="task-tag <?= $tag['color_id'] ? "color-{$tag['color_id']}" : '' ?>"><?= $this->text->e($tag['name']) ?></li>
<?php endforeach ?>
</ul>
</div>
diff --git a/app/Template/project_tag/create.php b/app/Template/project_tag/create.php
index d665aa76..61b6e670 100644
--- a/app/Template/project_tag/create.php
+++ b/app/Template/project_tag/create.php
@@ -7,5 +7,8 @@
<?= $this->form->label(t('Name'), 'name') ?>
<?= $this->form->text('name', $values, $errors, array('autofocus', 'required', 'maxlength="191"')) ?>
+ <?= $this->form->label(t('Color'), 'color_id') ?>
+ <?= $this->form->select('color_id', array('' => t('No color')) + $colors, $values, $errors, array(), 'color-picker') ?>
+
<?= $this->modal->submitButtons() ?>
</form>
diff --git a/app/Template/project_tag/edit.php b/app/Template/project_tag/edit.php
index 39b08326..0fab036b 100644
--- a/app/Template/project_tag/edit.php
+++ b/app/Template/project_tag/edit.php
@@ -7,5 +7,8 @@
<?= $this->form->label(t('Name'), 'name') ?>
<?= $this->form->text('name', $values, $errors, array('autofocus', 'required', 'maxlength="191"')) ?>
+ <?= $this->form->label(t('Color'), 'color_id') ?>
+ <?= $this->form->select('color_id', array('' => t('No color')) + $colors, $values, $errors, array(), 'color-picker') ?>
+
<?= $this->modal->submitButtons() ?>
</form>
diff --git a/app/Template/tag/create.php b/app/Template/tag/create.php
index c376eb28..f080f8d8 100644
--- a/app/Template/tag/create.php
+++ b/app/Template/tag/create.php
@@ -8,5 +8,8 @@
<?= $this->form->label(t('Name'), 'name') ?>
<?= $this->form->text('name', $values, $errors, array('autofocus', 'required', 'maxlength="191"')) ?>
+ <?= $this->form->label(t('Color'), 'color_id') ?>
+ <?= $this->form->select('color_id', array('' => t('No color')) + $colors, $values, $errors, array(), 'color-picker') ?>
+
<?= $this->modal->submitButtons() ?>
</form>
diff --git a/app/Template/tag/edit.php b/app/Template/tag/edit.php
index a0e54843..93ce0c94 100644
--- a/app/Template/tag/edit.php
+++ b/app/Template/tag/edit.php
@@ -9,5 +9,8 @@
<?= $this->form->label(t('Name'), 'name') ?>
<?= $this->form->text('name', $values, $errors, array('autofocus', 'required', 'maxlength="191"')) ?>
+ <?= $this->form->label(t('Color'), 'color_id') ?>
+ <?= $this->form->select('color_id', array('' => t('No color')) + $colors, $values, $errors, array(), 'color-picker') ?>
+
<?= $this->modal->submitButtons() ?>
</form>
diff --git a/app/Template/task/details.php b/app/Template/task/details.php
index 2712d49b..f3c6d896 100644
--- a/app/Template/task/details.php
+++ b/app/Template/task/details.php
@@ -156,7 +156,7 @@
<div class="task-tags">
<ul>
<?php foreach ($tags as $tag): ?>
- <li><?= $this->text->e($tag) ?></li>
+ <li class="task-tag <?= $tag['color_id'] ? "color-{$tag['color_id']}" : '' ?>"><?= $this->text->e($tag['name']) ?></li>
<?php endforeach ?>
</ul>
</div>
diff --git a/app/Template/task_list/task_details.php b/app/Template/task_list/task_details.php
index 9afd9f55..03e1d3eb 100644
--- a/app/Template/task_list/task_details.php
+++ b/app/Template/task_list/task_details.php
@@ -25,7 +25,7 @@
<?php endif ?>
<?php foreach ($task['tags'] as $tag): ?>
- <span class="table-list-category task-list-tag">
+ <span class="table-list-category task-list-tag <?= $tag['color_id'] ? "color-{$tag['color_id']}" : '' ?>">
<?= $this->text->e($tag['name']) ?>
</span>
<?php endforeach ?>