Add custom filters (refactoring of pull-request #1312)

This commit is contained in:
Frederic Guillot
2015-10-02 21:58:00 -04:00
parent 370361330a
commit 264b552603
17 changed files with 596 additions and 3 deletions

View File

@@ -2,6 +2,10 @@
<i class="fa fa-dashboard fa-fw"></i>&nbsp;
<?= $this->url->link(t('Activity'), 'activity', 'project', array('project_id' => $project['id'])) ?>
</li>
<li>
<i class="fa fa-filter fa-fw"></i>&nbsp;
<?= $this->url->link(t('Custom filters'), 'customfilter', 'index', array('project_id' => $project['id'])) ?>
</li>
<?php if ($project['is_public']): ?>
<li>

View File

@@ -86,5 +86,16 @@
</ul>
</div>
<?php endif ?>
<?php if (isset($custom_filters_list) && ! empty($custom_filters_list)): ?>
<div class="dropdown filters">
<i class="fa fa-caret-down"></i> <a href="#" class="dropdown-menu"><?= t('My filters') ?></a>
<ul>
<?php foreach ($custom_filters_list as $filter): ?>
<li><a href="#" class="filter-helper" data-filter='<?= $this->e($filter['filter']) ?>'><?= $this->e($filter['name']) ?></a></li>
<?php endforeach ?>
</ul>
</div>
<?php endif ?>
</div>
</div>

View File

@@ -4,6 +4,9 @@
<li <?= $this->app->getRouterAction() === 'show' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Summary'), 'project', 'show', array('project_id' => $project['id'])) ?>
</li>
<li <?= $this->app->getRouterController() === 'customfilter' && $this->app->getRouterAction() === 'index' ? 'class="active"' : '' ?>>
<?= $this->url->link(t('Custom filters'), 'customfilter', 'index', array('project_id' => $project['id'])) ?>
</li>
<?php if ($this->user->isProjectManagementAllowed($project['id'])): ?>
<li <?= $this->app->getRouterController() === 'project' && $this->app->getRouterAction() === 'share' ? 'class="active"' : '' ?>>