Add colors to tag and category list

Add colors to:

- Global tag list
- Project tag list
- Project category list
This commit is contained in:
Timo
2019-11-22 04:36:19 +01:00
committed by Frédéric Guillot
parent 75682398c1
commit f0b53863fb
6 changed files with 10 additions and 1 deletions

View File

@@ -25,6 +25,7 @@ class CategoryController extends BaseController
$this->response->html($this->helper->layout->project('category/index', array( $this->response->html($this->helper->layout->project('category/index', array(
'categories' => $this->categoryModel->getAll($project['id']), 'categories' => $this->categoryModel->getAll($project['id']),
'project' => $project, 'project' => $project,
'colors' => $this->colorModel->getList(),
'title' => t('Categories'), 'title' => t('Categories'),
))); )));
} }

View File

@@ -17,6 +17,7 @@ class ProjectTagController extends BaseController
$this->response->html($this->helper->layout->project('project_tag/index', array( $this->response->html($this->helper->layout->project('project_tag/index', array(
'project' => $project, 'project' => $project,
'tags' => $this->tagModel->getAllByProject($project['id']), 'tags' => $this->tagModel->getAllByProject($project['id']),
'colors' => $this->colorModel->getList(),
'title' => t('Project tags management'), 'title' => t('Project tags management'),
))); )));
} }

View File

@@ -16,6 +16,7 @@ class TagController extends BaseController
{ {
$this->response->html($this->helper->layout->config('tag/index', array( $this->response->html($this->helper->layout->config('tag/index', array(
'tags' => $this->tagModel->getAllByProject(0), 'tags' => $this->tagModel->getAllByProject(0),
'colors' => $this->colorModel->getList(),
'title' => t('Settings').' > '.t('Global tags management'), 'title' => t('Settings').' > '.t('Global tags management'),
))); )));
} }

View File

@@ -12,6 +12,7 @@
<table class="table-striped"> <table class="table-striped">
<tr> <tr>
<th><?= t('Category Name') ?></th> <th><?= t('Category Name') ?></th>
<th><?= t('Color') ?></th>
</tr> </tr>
<?php foreach ($categories as $category): ?> <?php foreach ($categories as $category): ?>
<tr> <tr>
@@ -34,6 +35,7 @@
<?= $this->app->tooltipMarkdown($category['description']) ?> <?= $this->app->tooltipMarkdown($category['description']) ?>
<?php endif ?> <?php endif ?>
</td> </td>
<td><?= $this->text->e($colors[$category['color_id']] ?? '') ?></td>
</tr> </tr>
<?php endforeach ?> <?php endforeach ?>
</table> </table>

View File

@@ -13,6 +13,7 @@
<table class="table-striped table-scrolling"> <table class="table-striped table-scrolling">
<tr> <tr>
<th><?= t('Tag') ?></th> <th><?= t('Tag') ?></th>
<th><?= t('Color') ?></th>
</tr> </tr>
<?php foreach ($tags as $tag): ?> <?php foreach ($tags as $tag): ?>
<tr> <tr>
@@ -30,6 +31,7 @@
</div> </div>
<?= $this->text->e($tag['name']) ?> <?= $this->text->e($tag['name']) ?>
</td> </td>
<td><?= $this->text->e($colors[$tag['color_id']] ?? '') ?></td>
</tr> </tr>
<?php endforeach ?> <?php endforeach ?>
</table> </table>

View File

@@ -12,12 +12,14 @@
<?php else: ?> <?php else: ?>
<table class="table-striped table-scrolling"> <table class="table-striped table-scrolling">
<tr> <tr>
<th class="column-80"><?= t('Tag') ?></th> <th class="column-60"><?= t('Tag') ?></th>
<th class="column-20"><?= t('Color') ?></th>
<th><?= t('Action') ?></th> <th><?= t('Action') ?></th>
</tr> </tr>
<?php foreach ($tags as $tag): ?> <?php foreach ($tags as $tag): ?>
<tr> <tr>
<td><?= $this->text->e($tag['name']) ?></td> <td><?= $this->text->e($tag['name']) ?></td>
<td><?= $this->text->e($colors[$tag['color_id']] ?? '') ?></td>
<td> <td>
<?= $this->modal->medium('edit', t('Edit'), 'TagController', 'edit', array('tag_id' => $tag['id'])) ?> <?= $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'])) ?> <?= $this->modal->confirm('trash-o', t('Remove'), 'TagController', 'confirm', array('tag_id' => $tag['id'])) ?>