Use same layout as task listing for task search
This commit is contained in:
@@ -9,6 +9,7 @@ Improvements:
|
|||||||
|
|
||||||
* Render QR code for TwoFactor authentication without Google Chart API
|
* Render QR code for TwoFactor authentication without Google Chart API
|
||||||
* Add toggle button to show/hide subtasks in task list view
|
* Add toggle button to show/hide subtasks in task list view
|
||||||
|
* Use same layout as task listing for task search
|
||||||
* Display tags in task list view
|
* Display tags in task list view
|
||||||
* Make user actions available from contextual menu
|
* Make user actions available from contextual menu
|
||||||
* Change users and groups list layout
|
* Change users and groups list layout
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
namespace Kanboard\Controller;
|
namespace Kanboard\Controller;
|
||||||
|
|
||||||
use Kanboard\Filter\TaskProjectsFilter;
|
use Kanboard\Filter\TaskProjectsFilter;
|
||||||
|
use Kanboard\Model\TaskModel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Search Controller
|
* Search Controller
|
||||||
@@ -21,11 +22,12 @@ class SearchController extends BaseController
|
|||||||
$paginator = $this->paginator
|
$paginator = $this->paginator
|
||||||
->setUrl('SearchController', 'index', array('search' => $search))
|
->setUrl('SearchController', 'index', array('search' => $search))
|
||||||
->setMax(30)
|
->setMax(30)
|
||||||
->setOrder('tasks.id')
|
->setOrder(TaskModel::TABLE.'.id')
|
||||||
->setDirection('DESC');
|
->setDirection('DESC');
|
||||||
|
|
||||||
if ($search !== '' && ! empty($projects)) {
|
if ($search !== '' && ! empty($projects)) {
|
||||||
$paginator
|
$paginator
|
||||||
|
->setFormatter($this->taskListFormatter)
|
||||||
->setQuery($this->taskLexer
|
->setQuery($this->taskLexer
|
||||||
->build($search)
|
->build($search)
|
||||||
->withFilter(new TaskProjectsFilter(array_keys($projects)))
|
->withFilter(new TaskProjectsFilter(array_keys($projects)))
|
||||||
|
|||||||
@@ -1,45 +1,40 @@
|
|||||||
<section id="main">
|
<div class="page-header">
|
||||||
<div class="page-header">
|
<ul>
|
||||||
<ul>
|
<li>
|
||||||
<li>
|
<?= $this->url->icon('search', t('Search tasks'), 'SearchController', 'index') ?>
|
||||||
<?= $this->url->icon('search', t('Search tasks'), 'SearchController', 'index') ?>
|
</li>
|
||||||
</li>
|
</ul>
|
||||||
</ul>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="filter-box">
|
<div class="filter-box margin-bottom">
|
||||||
<form method="get" action="<?= $this->url->dir() ?>" class="search">
|
<form method="get" action="<?= $this->url->dir() ?>" class="search">
|
||||||
<?= $this->form->hidden('controller', $values) ?>
|
<?= $this->form->hidden('controller', $values) ?>
|
||||||
<?= $this->form->hidden('action', $values) ?>
|
<?= $this->form->hidden('action', $values) ?>
|
||||||
|
|
||||||
<div class="input-addon">
|
<div class="input-addon">
|
||||||
<?= $this->form->text('search', $values, array(), array(empty($values['search']) ? 'autofocus' : '', 'placeholder="'.t('Search').'"'), 'input-addon-field') ?>
|
<?= $this->form->text('search', $values, array(), array(empty($values['search']) ? 'autofocus' : '', 'placeholder="'.t('Search').'"'), 'input-addon-field') ?>
|
||||||
<div class="input-addon-item">
|
<div class="input-addon-item">
|
||||||
<?= $this->render('app/filters_helper') ?>
|
<?= $this->render('app/filters_helper') ?>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php if (empty($values['search'])): ?>
|
||||||
|
<div class="panel">
|
||||||
|
<h3><?= t('Advanced search') ?></h3>
|
||||||
|
<p><?= t('Example of query: ') ?><strong>project:"My project" creator:me</strong></p>
|
||||||
|
<ul>
|
||||||
|
<li><?= t('Search by project: ') ?><strong>project:"My project"</strong></li>
|
||||||
|
<li><?= t('Search by creator: ') ?><strong>creator:admin</strong></li>
|
||||||
|
<li><?= t('Search by creation date: ') ?><strong>created:today</strong></li>
|
||||||
|
<li><?= t('Search by task status: ') ?><strong>status:open</strong></li>
|
||||||
|
<li><?= t('Search by task title: ') ?><strong>title:"My task"</strong></li>
|
||||||
|
</ul>
|
||||||
|
<p><i class="fa fa-external-link fa-fw"></i><?= $this->url->doc(t('View advanced search syntax'), 'search') ?></p>
|
||||||
</div>
|
</div>
|
||||||
|
<?php elseif (! empty($values['search']) && $nb_events === 0): ?>
|
||||||
<?php if (empty($values['search'])): ?>
|
<p class="alert"><?= t('Nothing found.') ?></p>
|
||||||
<div class="panel">
|
<?php else: ?>
|
||||||
<h3><?= t('Advanced search') ?></h3>
|
<?= $this->render('event/events', array('events' => $events)) ?>
|
||||||
<p><?= t('Example of query: ') ?><strong>project:"My project" creator:me</strong></p>
|
<?php endif ?>
|
||||||
<ul>
|
|
||||||
<li><?= t('Search by project: ') ?><strong>project:"My project"</strong></li>
|
|
||||||
<li><?= t('Search by creator: ') ?><strong>creator:admin</strong></li>
|
|
||||||
<li><?= t('Search by creation date: ') ?><strong>created:today</strong></li>
|
|
||||||
<li><?= t('Search by task status: ') ?><strong>status:open</strong></li>
|
|
||||||
<li><?= t('Search by task title: ') ?><strong>title:"My task"</strong></li>
|
|
||||||
</ul>
|
|
||||||
<p><i class="fa fa-external-link fa-fw"></i><?= $this->url->doc(t('View advanced search syntax'), 'search') ?></p>
|
|
||||||
</div>
|
|
||||||
<?php elseif (! empty($values['search']) && $nb_events === 0): ?>
|
|
||||||
<p class="alert"><?= t('Nothing found.') ?></p>
|
|
||||||
<?php else: ?>
|
|
||||||
<div class="margin-top">
|
|
||||||
<?= $this->render('event/events', array('events' => $events)) ?>
|
|
||||||
</div>
|
|
||||||
<?php endif ?>
|
|
||||||
|
|
||||||
</section>
|
|
||||||
|
|||||||
@@ -1,47 +1,44 @@
|
|||||||
<section id="main">
|
<div class="page-header">
|
||||||
<div class="page-header">
|
<ul>
|
||||||
<ul>
|
<li>
|
||||||
<li>
|
<?= $this->url->icon('search', t('Activity stream search'), 'SearchController', 'activity') ?>
|
||||||
<?= $this->url->icon('search', t('Activity stream search'), 'SearchController', 'activity') ?>
|
</li>
|
||||||
</li>
|
</ul>
|
||||||
</ul>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="filter-box">
|
<div class="filter-box margin-bottom">
|
||||||
<form method="get" action="<?= $this->url->dir() ?>" class="search">
|
<form method="get" action="<?= $this->url->dir() ?>" class="search">
|
||||||
<?= $this->form->hidden('controller', $values) ?>
|
<?= $this->form->hidden('controller', $values) ?>
|
||||||
<?= $this->form->hidden('action', $values) ?>
|
<?= $this->form->hidden('action', $values) ?>
|
||||||
|
|
||||||
<div class="input-addon">
|
<div class="input-addon">
|
||||||
<?= $this->form->text('search', $values, array(), array(empty($values['search']) ? 'autofocus' : '', 'placeholder="'.t('Search').'"'), 'input-addon-field') ?>
|
<?= $this->form->text('search', $values, array(), array(empty($values['search']) ? 'autofocus' : '', 'placeholder="'.t('Search').'"'), 'input-addon-field') ?>
|
||||||
<div class="input-addon-item">
|
<div class="input-addon-item">
|
||||||
<?= $this->render('app/filters_helper') ?>
|
<?= $this->render('app/filters_helper') ?>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<?php if (empty($values['search'])): ?>
|
|
||||||
<div class="panel">
|
|
||||||
<h3><?= t('Advanced search') ?></h3>
|
|
||||||
<p><?= t('Example of query: ') ?><strong>project:"My project" assignee:me due:tomorrow</strong></p>
|
|
||||||
<ul>
|
|
||||||
<li><?= t('Search by project: ') ?><strong>project:"My project"</strong></li>
|
|
||||||
<li><?= t('Search by column: ') ?><strong>column:"Work in progress"</strong></li>
|
|
||||||
<li><?= t('Search by assignee: ') ?><strong>assignee:nobody</strong></li>
|
|
||||||
<li><?= t('Search by color: ') ?><strong>color:Blue</strong></li>
|
|
||||||
<li><?= t('Search by category: ') ?><strong>category:"Feature Request"</strong></li>
|
|
||||||
<li><?= t('Search by description: ') ?><strong>description:"Something to find"</strong></li>
|
|
||||||
<li><?= t('Search by due date: ') ?><strong>due:2015-07-01</strong></li>
|
|
||||||
</ul>
|
|
||||||
<p><i class="fa fa-external-link fa-fw"></i><?= $this->url->doc(t('View advanced search syntax'), 'search') ?></p>
|
|
||||||
</div>
|
</div>
|
||||||
<?php elseif (! empty($values['search']) && $paginator->isEmpty()): ?>
|
</form>
|
||||||
<p class="alert"><?= t('Nothing found.') ?></p>
|
</div>
|
||||||
<?php elseif (! $paginator->isEmpty()): ?>
|
|
||||||
<?= $this->render('search/results', array(
|
|
||||||
'paginator' => $paginator,
|
|
||||||
)) ?>
|
|
||||||
<?php endif ?>
|
|
||||||
|
|
||||||
</section>
|
<?php if (empty($values['search'])): ?>
|
||||||
|
<div class="panel">
|
||||||
|
<h3><?= t('Advanced search') ?></h3>
|
||||||
|
<p><?= t('Example of query: ') ?><strong>project:"My project" assignee:me due:tomorrow</strong></p>
|
||||||
|
<ul>
|
||||||
|
<li><?= t('Search by project: ') ?><strong>project:"My project"</strong></li>
|
||||||
|
<li><?= t('Search by column: ') ?><strong>column:"Work in progress"</strong></li>
|
||||||
|
<li><?= t('Search by assignee: ') ?><strong>assignee:nobody</strong></li>
|
||||||
|
<li><?= t('Search by color: ') ?><strong>color:Blue</strong></li>
|
||||||
|
<li><?= t('Search by category: ') ?><strong>category:"Feature Request"</strong></li>
|
||||||
|
<li><?= t('Search by description: ') ?><strong>description:"Something to find"</strong></li>
|
||||||
|
<li><?= t('Search by due date: ') ?><strong>due:2015-07-01</strong></li>
|
||||||
|
</ul>
|
||||||
|
<p><i class="fa fa-external-link fa-fw"></i><?= $this->url->doc(t('View advanced search syntax'), 'search') ?></p>
|
||||||
|
</div>
|
||||||
|
<?php elseif (! empty($values['search']) && $paginator->isEmpty()): ?>
|
||||||
|
<p class="alert"><?= t('Nothing found.') ?></p>
|
||||||
|
<?php elseif (! $paginator->isEmpty()): ?>
|
||||||
|
<?= $this->render('search/results', array(
|
||||||
|
'paginator' => $paginator,
|
||||||
|
)) ?>
|
||||||
|
<?php endif ?>
|
||||||
|
|||||||
@@ -1,58 +1,31 @@
|
|||||||
<table class="table-small table-scrolling margin-top">
|
<div class="table-list">
|
||||||
<tr>
|
<?= $this->render('task_list/header', array(
|
||||||
<th class="column-5"><?= $paginator->order(t('Id'), 'tasks.id') ?></th>
|
'paginator' => $paginator,
|
||||||
<th class="column-8"><?= $paginator->order(t('Project'), 'tasks.project_id') ?></th>
|
)) ?>
|
||||||
<th class="column-10"><?= $paginator->order(t('Swimlane'), 'tasks.swimlane_id') ?></th>
|
|
||||||
<th class="column-10"><?= $paginator->order(t('Column'), 'tasks.column_id') ?></th>
|
|
||||||
<th class="column-10"><?= $paginator->order(t('Category'), 'tasks.category_id') ?></th>
|
|
||||||
<th><?= $paginator->order(t('Title'), 'tasks.title') ?></th>
|
|
||||||
<th class="column-10"><?= $paginator->order(t('Assignee'), 'users.username') ?></th>
|
|
||||||
<th class="column-10"><?= $paginator->order(t('Due date'), 'tasks.date_due') ?></th>
|
|
||||||
<th class="column-5"><?= $paginator->order(t('Status'), 'tasks.is_active') ?></th>
|
|
||||||
</tr>
|
|
||||||
<?php foreach ($paginator->getCollection() as $task): ?>
|
|
||||||
<tr>
|
|
||||||
<td class="color-<?= $task['color_id'] ?>">
|
|
||||||
<?php if ($this->user->hasProjectAccess('TaskModificationController', 'edit', $task['project_id'])): ?>
|
|
||||||
<?= $this->render('task/dropdown', array('task' => $task)) ?>
|
|
||||||
<?php else: ?>
|
|
||||||
#<?= $task['id'] ?>
|
|
||||||
<?php endif ?>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<?= $this->url->link($this->text->e($task['project_name']), 'BoardViewController', 'show', array('project_id' => $task['project_id'])) ?>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<?= $this->text->e($task['swimlane_name']) ?>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<?= $this->text->e($task['column_name']) ?>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<?= $this->text->e($task['category_name']) ?>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<?= $this->url->link($this->text->e($task['title']), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<?php if ($task['assignee_username']): ?>
|
|
||||||
<?= $this->text->e($task['assignee_name'] ?: $task['assignee_username']) ?>
|
|
||||||
<?php else: ?>
|
|
||||||
<?= t('Unassigned') ?>
|
|
||||||
<?php endif ?>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<?= $this->dt->date($task['date_due']) ?>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<?php if ($task['is_active'] == \Kanboard\Model\TaskModel::STATUS_OPEN): ?>
|
|
||||||
<?= t('Open') ?>
|
|
||||||
<?php else: ?>
|
|
||||||
<?= t('Closed') ?>
|
|
||||||
<?php endif ?>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<?php endforeach ?>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<?= $paginator ?>
|
<?php foreach ($paginator->getCollection() as $task): ?>
|
||||||
|
<div class="table-list-row color-<?= $task['color_id'] ?>">
|
||||||
|
<?= $this->render('task_list/task_title', array(
|
||||||
|
'task' => $task,
|
||||||
|
)) ?>
|
||||||
|
|
||||||
|
<?= $this->render('task_list/task_details', array(
|
||||||
|
'task' => $task,
|
||||||
|
)) ?>
|
||||||
|
|
||||||
|
<?= $this->render('task_list/task_avatars', array(
|
||||||
|
'task' => $task,
|
||||||
|
)) ?>
|
||||||
|
|
||||||
|
<?= $this->render('task_list/task_icons', array(
|
||||||
|
'task' => $task,
|
||||||
|
)) ?>
|
||||||
|
|
||||||
|
<?= $this->render('task_list/task_subtasks', array(
|
||||||
|
'task' => $task,
|
||||||
|
)) ?>
|
||||||
|
</div>
|
||||||
|
<?php endforeach ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?= $paginator ?>
|
||||||
@@ -7,10 +7,12 @@
|
|||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="table-list-header-menu">
|
<div class="table-list-header-menu">
|
||||||
<?php if ($this->user->hasSubtaskListActivated()): ?>
|
<?php if (isset($project)): ?>
|
||||||
<?= $this->url->icon('tasks', t('Hide subtasks'), 'TaskListController', 'show', array('project_id' => $project['id'], 'hide_subtasks' => 1)) ?>
|
<?php if ($this->user->hasSubtaskListActivated()): ?>
|
||||||
<?php else: ?>
|
<?= $this->url->icon('tasks', t('Hide subtasks'), 'TaskListController', 'show', array('project_id' => $project['id'], 'hide_subtasks' => 1)) ?>
|
||||||
<?= $this->url->icon('tasks', t('Show subtasks'), 'TaskListController', 'show', array('project_id' => $project['id'], 'show_subtasks' => 1)) ?>
|
<?php else: ?>
|
||||||
|
<?= $this->url->icon('tasks', t('Show subtasks'), 'TaskListController', 'show', array('project_id' => $project['id'], 'show_subtasks' => 1)) ?>
|
||||||
|
<?php endif ?>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|
||||||
<?= $this->render('task_list/sort_menu', array('paginator' => $paginator)) ?>
|
<?= $this->render('task_list/sort_menu', array('paginator' => $paginator)) ?>
|
||||||
|
|||||||
Reference in New Issue
Block a user