-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding color filter + Compatibility with Calendar and Wiki theme
- Loading branch information
JB
committed
Oct 28, 2019
1 parent
fc2a04c
commit 4c8ec53
Showing
11 changed files
with
175 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<?php | ||
|
||
namespace Kanboard\Plugin\Greenwing; | ||
|
||
use Kanboard\Core\Base; | ||
|
||
/** | ||
* Project Header Helper | ||
* | ||
* @package helper | ||
* @author Frederic Guillot | ||
*/ | ||
class MyProjectHeaderHelper extends Base | ||
{ | ||
/** | ||
* Get current search query | ||
* | ||
* @access public | ||
* @param array $project | ||
* @return string | ||
*/ | ||
public function getSearchQuery(array $project) | ||
{ | ||
$search = $this->request->getStringParam('search', $this->userSession->getFilters($project['id'])); | ||
$this->userSession->setFilters($project['id'], $search); | ||
return urldecode($search); | ||
} | ||
|
||
/** | ||
* Render project header (views switcher and search box) | ||
* | ||
* @access public | ||
* @param array $project | ||
* @param string $controller | ||
* @param string $action | ||
* @param bool $boardView | ||
* @param string $plugin | ||
* @return string | ||
*/ | ||
public function render(array $project, $controller, $action, $boardView = false, $plugin = '') | ||
{ | ||
$filters = array( | ||
'controller' => $controller, | ||
'action' => $action, | ||
'project_id' => $project['id'], | ||
'search' => $this->getSearchQuery($project), | ||
'plugin' => $plugin, | ||
); | ||
|
||
return $this->template->render('project_header/header', array( | ||
'project' => $project, | ||
'filters' => $filters, | ||
'categories_list' => $this->categoryModel->getList($project['id'], false), | ||
'colors_list' => $this->colorModel->getList(false, true), | ||
'users_list' => $this->projectUserRoleModel->getAssignableUsersList($project['id'], false), | ||
'custom_filters_list' => $this->customFilterModel->getAll($project['id'], $this->userSession->getId()), | ||
'board_view' => $boardView, | ||
)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<div class="filter-box"> | ||
<form method="get" action="<?= $this->url->dir() ?>" class="search"> | ||
<?= $this->form->hidden('controller', $filters) ?> | ||
<?= $this->form->hidden('action', $filters) ?> | ||
<?= $this->form->hidden('plugin', $filters) ?> | ||
<?= $this->form->hidden('project_id', $filters) ?> | ||
|
||
<div class="input-addon"> | ||
<?= $this->form->text('search', $filters, array(), array('placeholder="'.t('Filter').'"'), 'input-addon-field') ?> | ||
<div class="input-addon-item"> | ||
<?= $this->render('app/filters_helper', array('reset' => 'status:open', 'project' => $project)) ?> | ||
</div> | ||
|
||
<?php if (isset($custom_filters_list) && ! empty($custom_filters_list)): ?> | ||
<div class="input-addon-item"> | ||
<div class="dropdown"> | ||
<a href="#" class="dropdown-menu dropdown-menu-link-icon" title="<?= t('Custom filters') ?>"><i class="fa fa-bookmark fa-fw"></i><i class="fa fa-caret-down"></i></a> | ||
<ul> | ||
<?php foreach ($custom_filters_list as $filter): ?> | ||
<li><a href="#" class="filter-helper" data-<?php if ($filter['append']): ?><?= 'append-' ?><?php endif ?>filter='<?= $this->text->e($filter['filter']) ?>'><?= $this->text->e($filter['name']) ?></a></li> | ||
<?php endforeach ?> | ||
</ul> | ||
</div> | ||
</div> | ||
<?php endif ?> | ||
|
||
<?php if (isset($users_list)): ?> | ||
<div class="input-addon-item"> | ||
<div class="dropdown"> | ||
<a href="#" class="dropdown-menu dropdown-menu-link-icon" title="<?= t('User filters') ?>"><i class="fa fa-users fa-fw"></i> <i class="fa fa-caret-down"></i></a> | ||
<ul> | ||
<li><a href="#" class="filter-helper" data-unique-filter="assignee:nobody"><?= t('Not assigned') ?></a></li> | ||
<?php foreach ($users_list as $user): ?> | ||
<li><a href="#" class="filter-helper" data-unique-filter='assignee:"<?= $this->text->e($user) ?>"'><?= $this->text->e($user) ?></a></li> | ||
<?php endforeach ?> | ||
</ul> | ||
</div> | ||
</div> | ||
<?php endif ?> | ||
|
||
<?php if (isset($categories_list) && ! empty($categories_list)): ?> | ||
<div class="input-addon-item"> | ||
<div class="dropdown"> | ||
<a href="#" class="dropdown-menu dropdown-menu-link-icon" title="<?= t('Category filters') ?>"><i class="fa fa-tags fa-fw"></i><i class="fa fa-caret-down"></i></a> | ||
<ul> | ||
<li><a href="#" class="filter-helper" data-unique-filter="category:none"><?= t('No category') ?></a></li> | ||
<?php foreach ($categories_list as $category): ?> | ||
<li><a href="#" class="filter-helper" data-unique-filter='category:"<?= $this->text->e($category) ?>"'><?= $this->text->e($category) ?></a></li> | ||
<?php endforeach ?> | ||
</ul> | ||
</div> | ||
</div> | ||
<?php endif ?> | ||
|
||
<div class="input-addon-item"> | ||
<div class="dropdown"> | ||
<a href="#" class="dropdown-menu dropdown-menu-link-icon" title="<?= t('Category filters') ?>"><i class="fa fa-paint-brush fa-fw"></i><i class="fa fa-caret-down"></i></a> | ||
<ul> | ||
<?php foreach ($colors_list as $color): ?> | ||
<li> | ||
<div class="color-picker-square color-<?= str_replace(' ', '_', strtolower($color)) ?>"></div> | ||
<a href="#" class="filter-helper" data-unique-filter='color:"<?= $this->text->e($color) ?>"'><?= $this->text->e($color) ?></a> | ||
</li> | ||
<?php endforeach ?> | ||
</ul> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
</form> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<section id="main"> | ||
|
||
<?= $this->myProjectHeaderHelper->render($project, 'BoardViewController', 'show', true) ?> | ||
|
||
<?= $this->render('board/table_container', array( | ||
'project' => $project, | ||
'swimlanes' => $swimlanes, | ||
'board_private_refresh_interval' => $board_private_refresh_interval, | ||
'board_highlight_period' => $board_highlight_period, | ||
)) ?> | ||
|
||
</section> |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"main.css": "main-f1edf4f1ce.css" | ||
"main.css": "main-e6cea98ce5.css" | ||
} |