summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-02-14 16:11:55 -0500
committerFrederic Guillot <fred@kanboard.net>2016-02-14 16:11:55 -0500
commit07e3f51edb76f1c20c7c7f222b356cd0a26fca42 (patch)
tree288f076e1800b01e9ac080ab84518dffe31d5820 /app
parent30fefe4fa9ab3f04f8344f00556f4f2f2c5ec563 (diff)
Move project header templates to folder project_header
Diffstat (limited to 'app')
-rw-r--r--app/Controller/Listing.php3
-rw-r--r--app/Template/board/view_private.php2
-rw-r--r--app/Template/calendar/show.php2
-rw-r--r--app/Template/gantt/project.php2
-rw-r--r--app/Template/listing/show.php5
-rw-r--r--app/Template/project/filters.php106
-rw-r--r--app/Template/project_header/dropdown.php34
-rw-r--r--app/Template/project_header/header.php14
-rw-r--r--app/Template/project_header/search.php45
-rw-r--r--app/Template/project_header/views.php20
10 files changed, 123 insertions, 110 deletions
diff --git a/app/Controller/Listing.php b/app/Controller/Listing.php
index c7d3d9a8..c784dd50 100644
--- a/app/Controller/Listing.php
+++ b/app/Controller/Listing.php
@@ -32,6 +32,9 @@ class Listing extends Base
$this->response->html($this->helper->layout->app('listing/show', $params + array(
'paginator' => $paginator,
+ 'categories_list' => $this->category->getList($params['project']['id'], false),
+ 'users_list' => $this->projectUserRole->getAssignableUsersList($params['project']['id'], false),
+ 'custom_filters_list' => $this->customFilter->getAll($params['project']['id'], $this->userSession->getId()),
)));
}
}
diff --git a/app/Template/board/view_private.php b/app/Template/board/view_private.php
index 63d261f6..b5e38c66 100644
--- a/app/Template/board/view_private.php
+++ b/app/Template/board/view_private.php
@@ -1,6 +1,6 @@
<section id="main">
- <?= $this->render('project/filters', array(
+ <?= $this->render('project_header/header', array(
'project' => $project,
'filters' => $filters,
'categories_list' => $categories_list,
diff --git a/app/Template/calendar/show.php b/app/Template/calendar/show.php
index d74e945e..7085b51e 100644
--- a/app/Template/calendar/show.php
+++ b/app/Template/calendar/show.php
@@ -1,5 +1,5 @@
<section id="main">
- <?= $this->render('project/filters', array(
+ <?= $this->render('project_header/header', array(
'project' => $project,
'filters' => $filters,
)) ?>
diff --git a/app/Template/gantt/project.php b/app/Template/gantt/project.php
index 1face3b8..fe193c2b 100644
--- a/app/Template/gantt/project.php
+++ b/app/Template/gantt/project.php
@@ -1,5 +1,5 @@
<section id="main">
- <?= $this->render('project/filters', array(
+ <?= $this->render('project_header/header', array(
'project' => $project,
'filters' => $filters,
'users_list' => $users_list,
diff --git a/app/Template/listing/show.php b/app/Template/listing/show.php
index e7aa5947..9a5992e3 100644
--- a/app/Template/listing/show.php
+++ b/app/Template/listing/show.php
@@ -1,7 +1,10 @@
<section id="main">
- <?= $this->render('project/filters', array(
+ <?= $this->render('project_header/header', array(
'project' => $project,
'filters' => $filters,
+ 'custom_filters_list' => $custom_filters_list,
+ 'users_list' => $users_list,
+ 'categories_list' => $categories_list,
)) ?>
<?php if ($paginator->isEmpty()): ?>
diff --git a/app/Template/project/filters.php b/app/Template/project/filters.php
deleted file mode 100644
index 78794e1c..00000000
--- a/app/Template/project/filters.php
+++ /dev/null
@@ -1,106 +0,0 @@
-<div class="page-header">
- <?= $this->hook->render('template:project:header:before', array('project' => $project)) ?>
-
- <div class="dropdown">
- <i class="fa fa-caret-down"></i> <a href="#" class="dropdown-menu"><?= t('Actions') ?></a>
- <ul>
- <?php if (isset($is_board)): ?>
- <li>
- <span class="filter-display-mode" <?= $this->board->isCollapsed($project['id']) ? '' : 'style="display: none;"' ?>>
- <i class="fa fa-expand fa-fw"></i>
- <?= $this->url->link(t('Expand tasks'), 'board', 'expand', array('project_id' => $project['id']), false, 'board-display-mode', t('Keyboard shortcut: "%s"', 's')) ?>
- </span>
- <span class="filter-display-mode" <?= $this->board->isCollapsed($project['id']) ? 'style="display: none;"' : '' ?>>
- <i class="fa fa-compress fa-fw"></i>
- <?= $this->url->link(t('Collapse tasks'), 'board', 'collapse', array('project_id' => $project['id']), false, 'board-display-mode', t('Keyboard shortcut: "%s"', 's')) ?>
- </span>
- </li>
- <li>
- <span class="filter-compact">
- <i class="fa fa-th fa-fw"></i> <a href="#" class="filter-toggle-scrolling" title="<?= t('Keyboard shortcut: "%s"', 'c') ?>"><?= t('Compact view') ?></a>
- </span>
- <span class="filter-wide" style="display: none">
- <i class="fa fa-arrows-h fa-fw"></i> <a href="#" class="filter-toggle-scrolling" title="<?= t('Keyboard shortcut: "%s"', 'c') ?>"><?= t('Horizontal scrolling') ?></a>
- </span>
- </li>
- <li>
- <span class="filter-max-height" style="display: none">
- <i class="fa fa-arrows-v fa-fw"></i> <a href="#" class="filter-toggle-height"><?= t('Set maximum column height') ?></a>
- </span>
- <span class="filter-min-height">
- <i class="fa fa-arrows-v fa-fw"></i> <a href="#" class="filter-toggle-height"><?= t('Remove maximum column height') ?></a>
- </span>
- </li>
- <?php endif ?>
- <?= $this->render('project/dropdown', array('project' => $project)) ?>
- </ul>
- </div>
- <ul class="views">
- <li <?= $filters['controller'] === 'board' ? 'class="active"' : '' ?>>
- <i class="fa fa-th fa-fw"></i>
- <?= $this->url->link(t('Board'), 'board', 'show', array('project_id' => $project['id'], 'search' => $filters['search']), false, 'view-board', t('Keyboard shortcut: "%s"', 'v b')) ?>
- </li>
- <li <?= $filters['controller'] === 'calendar' ? 'class="active"' : '' ?>>
- <i class="fa fa-calendar fa-fw"></i>
- <?= $this->url->link(t('Calendar'), 'calendar', 'show', array('project_id' => $project['id'], 'search' => $filters['search']), false, 'view-calendar', t('Keyboard shortcut: "%s"', 'v c')) ?>
- </li>
- <li <?= $filters['controller'] === 'listing' ? 'class="active"' : '' ?>>
- <i class="fa fa-list fa-fw"></i>
- <?= $this->url->link(t('List'), 'listing', 'show', array('project_id' => $project['id'], 'search' => $filters['search']), false, 'view-listing', t('Keyboard shortcut: "%s"', 'v l')) ?>
- </li>
- <?php if ($this->user->hasProjectAccess('gantt', 'project', $project['id'])): ?>
- <li <?= $filters['controller'] === 'gantt' ? 'class="active"' : '' ?>>
- <i class="fa fa-sliders fa-fw"></i>
- <?= $this->url->link(t('Gantt'), 'gantt', 'project', array('project_id' => $project['id'], 'search' => $filters['search']), false, 'view-gantt', t('Keyboard shortcut: "%s"', 'v g')) ?>
- </li>
- <?php endif ?>
- </ul>
- <form method="get" action="<?= $this->url->dir() ?>" class="search">
- <?= $this->form->hidden('controller', $filters) ?>
- <?= $this->form->hidden('action', $filters) ?>
- <?= $this->form->hidden('project_id', $filters) ?>
- <?= $this->form->text('search', $filters, array(), array('placeholder="'.t('Filter').'"'), 'form-input-large') ?>
- </form>
-
- <div class="filter-dropdowns">
-
- <?= $this->render('app/filters_helper', array('reset' => 'status:open', 'project' => $project)) ?>
-
- <?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-<?php if ($filter['append']): ?><?= 'append-' ?><?php endif ?>filter='<?= $this->e($filter['filter']) ?>'><?= $this->e($filter['name']) ?></a></li>
- <?php endforeach ?>
- </ul>
- </div>
- <?php endif ?>
-
- <?php if (isset($users_list)): ?>
- <div class="dropdown filters">
- <i class="fa fa-caret-down"></i> <a href="#" class="dropdown-menu"><?= t('Users') ?></a>
- <ul>
- <li><a href="#" class="filter-helper" data-append-filter="assignee:nobody"><?= t('Not assigned') ?></a></li>
- <?php foreach ($users_list as $user): ?>
- <li><a href="#" class="filter-helper" data-append-filter='assignee:"<?= $this->e($user) ?>"'><?= $this->e($user) ?></a></li>
- <?php endforeach ?>
- </ul>
- </div>
- <?php endif ?>
-
- <?php if (isset($categories_list) && ! empty($categories_list)): ?>
- <div class="dropdown filters">
- <i class="fa fa-caret-down"></i> <a href="#" class="dropdown-menu"><?= t('Categories') ?></a>
- <ul>
- <li><a href="#" class="filter-helper" data-append-filter="category:none"><?= t('No category') ?></a></li>
- <?php foreach ($categories_list as $category): ?>
- <li><a href="#" class="filter-helper" data-append-filter='category:"<?= $this->e($category) ?>"'><?= $this->e($category) ?></a></li>
- <?php endforeach ?>
- </ul>
- </div>
- <?php endif ?>
- </div>
-
- <?= $this->hook->render('template:project:header:after', array('project' => $project)) ?>
-</div> \ No newline at end of file
diff --git a/app/Template/project_header/dropdown.php b/app/Template/project_header/dropdown.php
new file mode 100644
index 00000000..bbc033bf
--- /dev/null
+++ b/app/Template/project_header/dropdown.php
@@ -0,0 +1,34 @@
+<div class="dropdown">
+ <i class="fa fa-caret-down"></i> <a href="#" class="dropdown-menu"><?= t('Actions') ?></a>
+ <ul>
+ <?php if ($is_board): ?>
+ <li>
+ <span class="filter-display-mode" <?= $this->board->isCollapsed($project['id']) ? '' : 'style="display: none;"' ?>>
+ <i class="fa fa-expand fa-fw"></i>
+ <?= $this->url->link(t('Expand tasks'), 'board', 'expand', array('project_id' => $project['id']), false, 'board-display-mode', t('Keyboard shortcut: "%s"', 's')) ?>
+ </span>
+ <span class="filter-display-mode" <?= $this->board->isCollapsed($project['id']) ? 'style="display: none;"' : '' ?>>
+ <i class="fa fa-compress fa-fw"></i>
+ <?= $this->url->link(t('Collapse tasks'), 'board', 'collapse', array('project_id' => $project['id']), false, 'board-display-mode', t('Keyboard shortcut: "%s"', 's')) ?>
+ </span>
+ </li>
+ <li>
+ <span class="filter-compact">
+ <i class="fa fa-th fa-fw"></i> <a href="#" class="filter-toggle-scrolling" title="<?= t('Keyboard shortcut: "%s"', 'c') ?>"><?= t('Compact view') ?></a>
+ </span>
+ <span class="filter-wide" style="display: none">
+ <i class="fa fa-arrows-h fa-fw"></i> <a href="#" class="filter-toggle-scrolling" title="<?= t('Keyboard shortcut: "%s"', 'c') ?>"><?= t('Horizontal scrolling') ?></a>
+ </span>
+ </li>
+ <li>
+ <span class="filter-max-height" style="display: none">
+ <i class="fa fa-arrows-v fa-fw"></i> <a href="#" class="filter-toggle-height"><?= t('Set maximum column height') ?></a>
+ </span>
+ <span class="filter-min-height">
+ <i class="fa fa-arrows-v fa-fw"></i> <a href="#" class="filter-toggle-height"><?= t('Remove maximum column height') ?></a>
+ </span>
+ </li>
+ <?php endif ?>
+ <?= $this->render('project/dropdown', array('project' => $project)) ?>
+ </ul>
+</div> \ No newline at end of file
diff --git a/app/Template/project_header/header.php b/app/Template/project_header/header.php
new file mode 100644
index 00000000..eca9b327
--- /dev/null
+++ b/app/Template/project_header/header.php
@@ -0,0 +1,14 @@
+<div class="page-header">
+ <?= $this->hook->render('template:project:header:before', array('project' => $project)) ?>
+ <?= $this->render('project_header/dropdown', array('project' => $project, 'is_board' => isset($is_board))) ?>
+ <?= $this->render('project_header/views', array('project' => $project, 'filters' => $filters)) ?>
+ <?= $this->render('project_header/search', array(
+ 'project' => $project,
+ 'filters' => $filters,
+ 'custom_filters_list' => isset($custom_filters_list) ? $custom_filters_list : array(),
+ 'users_list' => isset($users_list) ? $users_list : array(),
+ 'categories_list' => isset($categories_list) ? $categories_list : array(),
+ )) ?>
+
+ <?= $this->hook->render('template:project:header:after', array('project' => $project)) ?>
+</div> \ No newline at end of file
diff --git a/app/Template/project_header/search.php b/app/Template/project_header/search.php
new file mode 100644
index 00000000..032e3343
--- /dev/null
+++ b/app/Template/project_header/search.php
@@ -0,0 +1,45 @@
+<form method="get" action="<?= $this->url->dir() ?>" class="search">
+ <?= $this->form->hidden('controller', $filters) ?>
+ <?= $this->form->hidden('action', $filters) ?>
+ <?= $this->form->hidden('project_id', $filters) ?>
+ <?= $this->form->text('search', $filters, array(), array('placeholder="'.t('Filter').'"'), 'form-input-large') ?>
+</form>
+
+<div class="filter-dropdowns">
+ <?= $this->render('app/filters_helper', array('reset' => 'status:open', 'project' => $project)) ?>
+
+ <?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-<?php if ($filter['append']): ?><?= 'append-' ?><?php endif ?>filter='<?= $this->e($filter['filter']) ?>'><?= $this->e($filter['name']) ?></a></li>
+ <?php endforeach ?>
+ </ul>
+ </div>
+ <?php endif ?>
+
+ <?php if (isset($users_list)): ?>
+ <div class="dropdown filters">
+ <i class="fa fa-caret-down"></i> <a href="#" class="dropdown-menu"><?= t('Users') ?></a>
+ <ul>
+ <li><a href="#" class="filter-helper" data-append-filter="assignee:nobody"><?= t('Not assigned') ?></a></li>
+ <?php foreach ($users_list as $user): ?>
+ <li><a href="#" class="filter-helper" data-append-filter='assignee:"<?= $this->e($user) ?>"'><?= $this->e($user) ?></a></li>
+ <?php endforeach ?>
+ </ul>
+ </div>
+ <?php endif ?>
+
+ <?php if (isset($categories_list) && ! empty($categories_list)): ?>
+ <div class="dropdown filters">
+ <i class="fa fa-caret-down"></i> <a href="#" class="dropdown-menu"><?= t('Categories') ?></a>
+ <ul>
+ <li><a href="#" class="filter-helper" data-append-filter="category:none"><?= t('No category') ?></a></li>
+ <?php foreach ($categories_list as $category): ?>
+ <li><a href="#" class="filter-helper" data-append-filter='category:"<?= $this->e($category) ?>"'><?= $this->e($category) ?></a></li>
+ <?php endforeach ?>
+ </ul>
+ </div>
+ <?php endif ?>
+</div>
diff --git a/app/Template/project_header/views.php b/app/Template/project_header/views.php
new file mode 100644
index 00000000..1219a213
--- /dev/null
+++ b/app/Template/project_header/views.php
@@ -0,0 +1,20 @@
+<ul class="views">
+ <li <?= $filters['controller'] === 'board' ? 'class="active"' : '' ?>>
+ <i class="fa fa-th fa-fw"></i>
+ <?= $this->url->link(t('Board'), 'board', 'show', array('project_id' => $project['id'], 'search' => $filters['search']), false, 'view-board', t('Keyboard shortcut: "%s"', 'v b')) ?>
+ </li>
+ <li <?= $filters['controller'] === 'calendar' ? 'class="active"' : '' ?>>
+ <i class="fa fa-calendar fa-fw"></i>
+ <?= $this->url->link(t('Calendar'), 'calendar', 'show', array('project_id' => $project['id'], 'search' => $filters['search']), false, 'view-calendar', t('Keyboard shortcut: "%s"', 'v c')) ?>
+ </li>
+ <li <?= $filters['controller'] === 'listing' ? 'class="active"' : '' ?>>
+ <i class="fa fa-list fa-fw"></i>
+ <?= $this->url->link(t('List'), 'listing', 'show', array('project_id' => $project['id'], 'search' => $filters['search']), false, 'view-listing', t('Keyboard shortcut: "%s"', 'v l')) ?>
+ </li>
+ <?php if ($this->user->hasProjectAccess('gantt', 'project', $project['id'])): ?>
+ <li <?= $filters['controller'] === 'gantt' ? 'class="active"' : '' ?>>
+ <i class="fa fa-sliders fa-fw"></i>
+ <?= $this->url->link(t('Gantt'), 'gantt', 'project', array('project_id' => $project['id'], 'search' => $filters['search']), false, 'view-gantt', t('Keyboard shortcut: "%s"', 'v g')) ?>
+ </li>
+ <?php endif ?>
+</ul> \ No newline at end of file