summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2017-01-08 22:54:05 -0500
committerFrederic Guillot <fred@kanboard.net>2017-01-08 22:54:05 -0500
commitd459bec035acaa8a03de6de1b33cb1048361d8d0 (patch)
treec1c2f2189f25d75b8d6ed62a43883c9a73e0a280
parente766397be06de75e16833705b4942b3306d364f3 (diff)
Display at least the title when there is no custom filters
-rw-r--r--app/Template/custom_filter/index.php86
1 files changed, 44 insertions, 42 deletions
diff --git a/app/Template/custom_filter/index.php b/app/Template/custom_filter/index.php
index d8d1c8e0..9475c278 100644
--- a/app/Template/custom_filter/index.php
+++ b/app/Template/custom_filter/index.php
@@ -1,4 +1,3 @@
-<?php if (! empty($custom_filters)): ?>
<div class="page-header">
<h2><?= t('Custom filters') ?></h2>
<ul>
@@ -7,47 +6,50 @@
</li>
</ul>
</div>
-<table class="table-striped table-scrolling">
- <tr>
- <th class="column-15"><?= t('Name') ?></th>
- <th class="column-30"><?= t('Filter') ?></th>
- <th class="column-10"><?= t('Shared') ?></th>
- <th class="column-15"><?= t('Append/Replace') ?></th>
- <th class="column-25"><?= t('Owner') ?></th>
- <th class="column-5"><?= t('Actions') ?></th>
- </tr>
-<?php foreach ($custom_filters as $filter): ?>
- <tr>
- <td><?= $this->text->e($filter['name']) ?></td>
- <td><?= $this->text->e($filter['filter']) ?></td>
- <td>
- <?php if ($filter['is_shared'] == 1): ?>
- <?= t('Yes') ?>
- <?php else: ?>
- <?= t('No') ?>
- <?php endif ?>
- </td>
- <td>
- <?php if ($filter['append'] == 1): ?>
- <?= t('Append') ?>
- <?php else: ?>
- <?= t('Replace') ?>
- <?php endif ?>
- </td>
- <td><?= $this->text->e($filter['owner_name'] ?: $filter['owner_username']) ?></td>
- <td>
- <?php if ($filter['user_id'] == $this->user->getId() || $this->user->hasProjectAccess('CustomFilterController', 'edit', $project['id'])): ?>
- <div class="dropdown">
- <a href="#" class="dropdown-menu dropdown-menu-link-icon"><i class="fa fa-cog fa-fw"></i><i class="fa fa-caret-down"></i></a>
- <ul>
- <li><?= $this->modal->medium('edit', t('Edit'), 'CustomFilterController', 'edit', array('project_id' => $filter['project_id'], 'filter_id' => $filter['id'])) ?></li>
- <li><?= $this->modal->confirm('trash-o', t('Remove'), 'CustomFilterController', 'confirm', array('project_id' => $filter['project_id'], 'filter_id' => $filter['id'])) ?></li>
- </ul>
- </div>
+<?php if (! empty($custom_filters)): ?>
+ <table class="table-striped table-scrolling">
+ <tr>
+ <th class="column-15"><?= t('Name') ?></th>
+ <th class="column-30"><?= t('Filter') ?></th>
+ <th class="column-10"><?= t('Shared') ?></th>
+ <th class="column-15"><?= t('Append/Replace') ?></th>
+ <th class="column-25"><?= t('Owner') ?></th>
+ <th class="column-5"><?= t('Actions') ?></th>
+ </tr>
+ <?php foreach ($custom_filters as $filter): ?>
+ <tr>
+ <td><?= $this->text->e($filter['name']) ?></td>
+ <td><?= $this->text->e($filter['filter']) ?></td>
+ <td>
+ <?php if ($filter['is_shared'] == 1): ?>
+ <?= t('Yes') ?>
+ <?php else: ?>
+ <?= t('No') ?>
+ <?php endif ?>
+ </td>
+ <td>
+ <?php if ($filter['append'] == 1): ?>
+ <?= t('Append') ?>
+ <?php else: ?>
+ <?= t('Replace') ?>
<?php endif ?>
- </td>
- </tr>
-<?php endforeach ?>
-</table>
+ </td>
+ <td><?= $this->text->e($filter['owner_name'] ?: $filter['owner_username']) ?></td>
+ <td>
+ <?php if ($filter['user_id'] == $this->user->getId() || $this->user->hasProjectAccess('CustomFilterController', 'edit', $project['id'])): ?>
+ <div class="dropdown">
+ <a href="#" class="dropdown-menu dropdown-menu-link-icon"><i class="fa fa-cog fa-fw"></i><i class="fa fa-caret-down"></i></a>
+ <ul>
+ <li><?= $this->modal->medium('edit', t('Edit'), 'CustomFilterController', 'edit', array('project_id' => $filter['project_id'], 'filter_id' => $filter['id'])) ?></li>
+ <li><?= $this->modal->confirm('trash-o', t('Remove'), 'CustomFilterController', 'confirm', array('project_id' => $filter['project_id'], 'filter_id' => $filter['id'])) ?></li>
+ </ul>
+ </div>
+ <?php endif ?>
+ </td>
+ </tr>
+ <?php endforeach ?>
+ </table>
+<?php else: ?>
+ <p class="alert"><?= t('There is no custom filter.') ?></p>
<?php endif ?>