From 31f3de9646e4e54db431be6a6751e931be43d995 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Wed, 1 Jul 2015 18:28:32 -0400 Subject: Add global search section --- app/Template/app/layout.php | 29 ++++++++++++++++---- app/Template/app/projects.php | 2 +- app/Template/app/subtasks.php | 2 +- app/Template/app/tasks.php | 2 +- app/Template/search/index.php | 26 ++++++++++++++++++ app/Template/search/results.php | 60 +++++++++++++++++++++++++++++++++++++++++ 6 files changed, 113 insertions(+), 8 deletions(-) create mode 100644 app/Template/search/index.php create mode 100644 app/Template/search/results.php (limited to 'app/Template') diff --git a/app/Template/app/layout.php b/app/Template/app/layout.php index d2d63f25..4a307a19 100644 --- a/app/Template/app/layout.php +++ b/app/Template/app/layout.php @@ -2,13 +2,32 @@ diff --git a/app/Template/app/projects.php b/app/Template/app/projects.php index 22e0cc47..61839cee 100644 --- a/app/Template/app/projects.php +++ b/app/Template/app/projects.php @@ -4,7 +4,7 @@ isEmpty()): ?>

- +
diff --git a/app/Template/app/subtasks.php b/app/Template/app/subtasks.php index 67f2d04f..ad7402bd 100644 --- a/app/Template/app/subtasks.php +++ b/app/Template/app/subtasks.php @@ -4,7 +4,7 @@ isEmpty()): ?>

-
order('Id', 'id') ?> order(t('Project'), 'name') ?>
+
diff --git a/app/Template/app/tasks.php b/app/Template/app/tasks.php index 8e7fe74a..3712750b 100644 --- a/app/Template/app/tasks.php +++ b/app/Template/app/tasks.php @@ -4,7 +4,7 @@ isEmpty()): ?>

-
order('Id', 'tasks.id') ?> order(t('Project'), 'project_name') ?>
+
diff --git a/app/Template/search/index.php b/app/Template/search/index.php new file mode 100644 index 00000000..058f428d --- /dev/null +++ b/app/Template/search/index.php @@ -0,0 +1,26 @@ +
+ + +
+ form->hidden('controller', $values) ?> + form->hidden('action', $values) ?> + form->text('search', $values, array(), array('autofocus', 'required', 'placeholder="'.t('Search').'"'), 'form-input-large') ?> + + + + isEmpty()): ?> +

+ isEmpty()): ?> + render('search/results', array( + 'paginator' => $paginator, + )) ?> + + +
\ No newline at end of file diff --git a/app/Template/search/results.php b/app/Template/search/results.php new file mode 100644 index 00000000..1d8cc6e2 --- /dev/null +++ b/app/Template/search/results.php @@ -0,0 +1,60 @@ +
order('Id', 'tasks.id') ?> order(t('Project'), 'project_name') ?>
+ + + + + + + + + + + + + getCollection() as $task): ?> + + + + + + + + + + + + + +
order(t('Project'), 'tasks.project_id') ?>order(t('Id'), 'tasks.id') ?>order(t('Column'), 'tasks.column_id') ?>order(t('Category'), 'tasks.category_id') ?>order(t('Title'), 'tasks.title') ?>order(t('Assignee'), 'users.username') ?>order(t('Due date'), 'tasks.date_due') ?>order(t('Date created'), 'tasks.date_creation') ?>order(t('Date completed'), 'tasks.date_completed') ?>order(t('Status'), 'tasks.is_active') ?>
+ url->link($this->e($task['project_name']), 'board', 'show', array('project_id' => $task['project_id'])) ?> + + url->link('#'.$this->e($task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?> + + e($task['column_name']) ?> + + e($task['category_name']) ?> + + url->link($this->e($task['title']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?> + + + e($task['assignee_name'] ?: $task['assignee_username']) ?> + + + + + + + + + + + + + + + + + +
+ + -- cgit v1.2.3