Refactoring to implement new layout with filters: board/calendar/list views (work in progress)

This commit is contained in:
Frederic Guillot
2015-07-04 11:14:21 -04:00
parent a327f790ee
commit 554500aa49
52 changed files with 463 additions and 758 deletions

View File

@@ -12,9 +12,19 @@
</span>
</li>
<li>
<i class="fa fa-table fa-fw"></i>
<i class="fa fa-th fa-fw"></i>
<?= $this->url->link(t('Back to the board'), 'board', 'show', array('project_id' => $project['id'])) ?>
</li>
<li>
<i class="fa fa-calendar fa-fw"></i>
<?= $this->url->link(t('Back to the calendar'), 'calendar', 'show', array('project_id' => $project['id'])) ?>
</li>
<?php if ($this->user->isManager($project['id'])): ?>
<li>
<i class="fa fa-cog fa-fw"></i>
<?= $this->url->link(t('Project settings'), 'project', 'show', array('project_id' => $project['id'])) ?>
</li>
<?php endif ?>
<li>
<i class="fa fa-folder fa-fw"></i>
<?= $this->url->link(t('All projects'), 'project', 'index') ?>

View File

@@ -12,9 +12,19 @@
</span>
</li>
<li>
<i class="fa fa-table fa-fw"></i>
<i class="fa fa-th fa-fw"></i>
<?= $this->url->link(t('Back to the board'), 'board', 'show', array('project_id' => $project['id'])) ?>
</li>
<li>
<i class="fa fa-calendar fa-fw"></i>
<?= $this->url->link(t('Back to the calendar'), 'calendar', 'show', array('project_id' => $project['id'])) ?>
</li>
<?php if ($this->user->isManager($project['id'])): ?>
<li>
<i class="fa fa-cog fa-fw"></i>
<?= $this->url->link(t('Project settings'), 'project', 'show', array('project_id' => $project['id'])) ?>
</li>
<?php endif ?>
<li>
<i class="fa fa-folder fa-fw"></i>
<?= $this->url->link(t('All projects'), 'project', 'index') ?>

View File

@@ -1,6 +1,5 @@
<div id="user-calendar"
data-check-url="<?= $this->url->href('calendar', 'user') ?>"
data-user-id="<?= $user['id'] ?>"
<div id="calendar"
data-check-url="<?= $this->url->href('calendar', 'user', array('user_id' => $user['id'])) ?>"
data-save-url="<?= $this->url->href('calendar', 'save') ?>"
>
</div>

View File

@@ -1,7 +1,7 @@
<form method="get" action="?" autocomplete="off">
<?= $this->form->hidden('controller', array('controller' => 'search')) ?>
<?= $this->form->hidden('action', array('controller' => 'index')) ?>
<?= $this->form->text('search', array(), array(), array('required', 'placeholder="'.t('Search').'"'), 'form-input-large') ?>
<?= $this->form->text('search', array(), array(), array('placeholder="'.t('Search').'"'), 'form-input-large') ?>
<input type="submit" value="<?= t('Search') ?>" class="btn btn-blue"/>
</form>

View File

@@ -1,43 +0,0 @@
<div class="page-header">
<ul class="board-filters">
<li>
<span class="dropdown">
<span>
<i class="fa fa-caret-down"></i> <a href="#" class="dropdown-menu"><?= t('Actions') ?></a>
<ul>
<li>
<span class="filter-collapse">
<i class="fa fa-compress fa-fw"></i> <a href="#" class="filter-collapse-link"><?= t('Collapse tasks') ?></a>
</span>
<span class="filter-expand" style="display: none">
<i class="fa fa-expand fa-fw"></i> <a href="#" class="filter-expand-link"><?= t('Expand tasks') ?></a>
</span>
</li>
<li>
<span class="filter-compact">
<i class="fa fa-th fa-fw"></i> <a href="#" class="filter-toggle-scrolling"><?= 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"><?= t('Horizontal scrolling') ?></a>
</span>
</li>
<?= $this->render('project/dropdown', array('project' => $project)) ?>
</ul>
</span>
</span>
</li>
<li>
<?= $this->form->select('user_id', $users, array(), array(), array('data-placeholder="'.t('Filter by user').'"', 'data-notfound="'.t('No results match:').'"', 'tabindex=="-1"'), 'apply-filters chosen-select') ?>
</li>
<li>
<?= $this->form->select('category_id', $categories, array(), array(), array('data-placeholder="'.t('Filter by category').'"', 'data-notfound="'.t('No results match:').'"', 'tabindex=="-1"'), 'apply-filters chosen-select') ?>
</li>
<li>
<select id="more-filters" multiple data-placeholder="<?= t('More filters') ?>" data-notfound="<?= t('No results match:') ?>" class="apply-filters hide-mobile" tabindex="-1">
<option value=""></option>
<option value="filter-due-date"><?= t('Filter by due date') ?></option>
<option value="filter-recent"><?= t('Filter recently updated') ?></option>
</select>
</li>
</ul>
</div>

View File

@@ -1,12 +1,12 @@
<section id="main">
<?= $this->render('board/filters', array(
'categories' => $categories_listing,
'users' => $users,
<?= $this->render('project/filters', array(
'project' => $project,
'filters' => $filters,
'is_board' => true,
)) ?>
<?= $this->render('board/show', array(
<?= $this->render('board/table_container', array(
'project' => $project,
'swimlanes' => $swimlanes,
'board_private_refresh_interval' => $board_private_refresh_interval,

View File

@@ -1,6 +1,6 @@
<section id="main" class="public-board">
<?= $this->render('board/show', array(
<?= $this->render('board/table_container', array(
'project' => $project,
'swimlanes' => $swimlanes,
'board_private_refresh_interval' => $board_private_refresh_interval,

View File

@@ -17,7 +17,7 @@
<p class="alert alert-error"><?= t('There is no column in your project!') ?></p>
<?php break ?>
<?php else: ?>
<?= $this->render('board/swimlane', array(
<?= $this->render('board/table_swimlane', array(
'project' => $project,
'swimlane' => $swimlane,
'board_highlight_period' => $board_highlight_period,

View File

@@ -1,46 +1,13 @@
<section id="main">
<div class="page-header">
<ul>
<li>
<span class="dropdown">
<span>
<i class="fa fa-caret-down"></i> <a href="#" class="dropdown-menu"><?= t('Actions') ?></a>
<ul>
<?= $this->render('project/dropdown', array('project' => $project)) ?>
</ul>
</span>
</span>
</li>
<li>
<i class="fa fa-table fa-fw"></i>
<?= $this->url->link(t('Back to the board'), 'board', 'show', array('project_id' => $project['id'])) ?>
</li>
<li>
<i class="fa fa-folder fa-fw"></i>
<?= $this->url->link(t('All projects'), 'project', 'index') ?>
</li>
</ul>
<?= $this->render('project/filters', array(
'project' => $project,
'filters' => $filters,
)) ?>
<div id="calendar"
data-save-url="<?= $this->url->href('calendar', 'save') ?>"
data-check-url="<?= $this->url->href('calendar', 'project', array('project_id' => $project['id'])) ?>"
data-check-interval="<?= $check_interval ?>"
>
</div>
<section class="sidebar-container">
<?= $this->render('calendar/sidebar', array(
'project' => $project,
'users_list' => $users_list,
'categories_list' => $categories_list,
'columns_list' => $columns_list,
'swimlanes_list' => $swimlanes_list,
'colors_list' => $colors_list,
'status_list' => $status_list
)) ?>
<div class="sidebar-content">
<div id="calendar"
data-project-id="<?= $project['id'] ?>"
data-save-url="<?= $this->url->href('calendar', 'save') ?>"
data-check-url="<?= $this->url->href('calendar', 'project', array('project_id' => $project['id'])) ?>"
data-check-interval="<?= $check_interval ?>"
>
</div>
</div>
</section>
</section>

View File

@@ -1,40 +0,0 @@
<div class="sidebar">
<ul class="no-bullet">
<li>
<?= t('Filter by user') ?>
</li>
<li>
<?= $this->form->select('owner_id', $users_list, array(), array(), array(), 'calendar-filter') ?>
</li>
<li>
<?= t('Filter by category') ?>
</li>
<li>
<?= $this->form->select('category_id', $categories_list, array(), array(), array(), 'calendar-filter') ?>
</li>
<li>
<?= t('Filter by column') ?>
</li>
<li>
<?= $this->form->select('column_id', $columns_list, array(), array(), array(), 'calendar-filter') ?>
</li>
<li>
<?= t('Filter by swimlane') ?>
</li>
<li>
<?= $this->form->select('swimlane_id', $swimlanes_list, array(), array(), array(), 'calendar-filter') ?>
</li>
<li>
<?= t('Filter by color') ?>
</li>
<li>
<?= $this->form->select('color_id', $colors_list, array(), array(), array(), 'calendar-filter') ?>
</li>
<li>
<?= t('Filter by status') ?>
</li>
<li>
<?= $this->form->select('is_active', $status_list, array(), array(), array(), 'calendar-filter') ?>
</li>
</ul>
</div>

View File

@@ -0,0 +1,67 @@
<section id="main">
<?= $this->render('project/filters', array(
'project' => $project,
'filters' => $filters,
)) ?>
<?php if (! empty($values['search']) && $paginator->isEmpty()): ?>
<p class="alert"><?= t('No tasks found.') ?></p>
<?php elseif (! $paginator->isEmpty()): ?>
<table class="table-fixed table-small">
<tr>
<th class="column-5"><?= $paginator->order(t('Id'), 'tasks.id') ?></th>
<th class="column-8"><?= $paginator->order(t('Column'), 'tasks.column_id') ?></th>
<th class="column-8"><?= $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-10"><?= $paginator->order(t('Date created'), 'tasks.date_creation') ?></th>
<th class="column-10"><?= $paginator->order(t('Date completed'), 'tasks.date_completed') ?></th>
<th class="column-5"><?= $paginator->order(t('Status'), 'tasks.is_active') ?></th>
</tr>
<?php foreach ($paginator->getCollection() as $task): ?>
<tr>
<td class="task-table color-<?= $task['color_id'] ?>">
<?= $this->url->link('#'.$this->e($task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?>
</td>
<td>
<?= $this->e($task['column_name']) ?>
</td>
<td>
<?= $this->e($task['category_name']) ?>
</td>
<td>
<?= $this->url->link($this->e($task['title']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?>
</td>
<td>
<?php if ($task['assignee_username']): ?>
<?= $this->e($task['assignee_name'] ?: $task['assignee_username']) ?>
<?php else: ?>
<?= t('Unassigned') ?>
<?php endif ?>
</td>
<td>
<?= dt('%B %e, %Y', $task['date_due']) ?>
</td>
<td>
<?= dt('%B %e, %Y', $task['date_creation']) ?>
</td>
<td>
<?php if ($task['date_completed']): ?>
<?= dt('%B %e, %Y', $task['date_completed']) ?>
<?php endif ?>
</td>
<td>
<?php if ($task['is_active'] == \Model\Task::STATUS_OPEN): ?>
<?= t('Open') ?>
<?php else: ?>
<?= t('Closed') ?>
<?php endif ?>
</td>
</tr>
<?php endforeach ?>
</table>
<?= $paginator ?>
<?php endif ?>
</section>

View File

@@ -1,18 +1,6 @@
<li>
<i class="fa fa-search fa-fw"></i>
<?= $this->url->link(t('Search'), 'projectinfo', 'search', array('project_id' => $project['id'])) ?>
</li>
<li>
<i class="fa fa-check-square-o fa-fw"></i>
<?= $this->url->link(t('Completed tasks'), 'projectinfo', 'tasks', array('project_id' => $project['id'])) ?>
</li>
<li>
<i class="fa fa-dashboard fa-fw"></i>
<?= $this->url->link(t('Activity'), 'projectinfo', 'activity', array('project_id' => $project['id'])) ?>
</li>
<li>
<i class="fa fa-calendar fa-fw"></i>
<?= $this->url->link(t('Calendar'), 'calendar', 'show', array('project_id' => $project['id'])) ?>
<?= $this->url->link(t('Activity'), 'activity', 'project', array('project_id' => $project['id'])) ?>
</li>
<?php if ($project['is_public']): ?>

View File

@@ -0,0 +1,49 @@
<div class="page-header">
<div class="dropdown">
<span>
<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-collapse">
<i class="fa fa-compress fa-fw"></i> <a href="#" class="filter-collapse-link"><?= t('Collapse tasks') ?></a>
</span>
<span class="filter-expand" style="display: none">
<i class="fa fa-expand fa-fw"></i> <a href="#" class="filter-expand-link"><?= t('Expand tasks') ?></a>
</span>
</li>
<li>
<span class="filter-compact">
<i class="fa fa-th fa-fw"></i> <a href="#" class="filter-toggle-scrolling"><?= 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"><?= t('Horizontal scrolling') ?></a>
</span>
</li>
<?php endif ?>
<?= $this->render('project/dropdown', array('project' => $project)) ?>
</ul>
</span>
</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'])) ?>
</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'])) ?>
</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'])) ?>
</li>
</ul>
<form method="get" action="?" class="search">
<?= $this->form->hidden('project_id', $filters) ?>
<?= $this->form->hidden('controller', $filters) ?>
<?= $this->form->hidden('action', $filters) ?>
<?= $this->form->text('search', $filters, array(), array('placeholder="'.t('Filter').'"'), 'form-input-large') ?>
</form>
</div>

View File

@@ -35,7 +35,7 @@
<?= $this->e($project['identifier']) ?>
</td>
<td>
<?= $this->url->link('<i class="fa fa-table"></i>', 'board', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link', t('Board')) ?>&nbsp;
<?= $this->url->link('<i class="fa fa-th"></i>', 'board', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link', t('Board')) ?>&nbsp;
<?php if ($project['is_public']): ?>
<i class="fa fa-share-alt fa-fw"></i>

View File

@@ -12,9 +12,13 @@
</span>
</li>
<li>
<i class="fa fa-table fa-fw"></i>
<i class="fa fa-th fa-fw"></i>
<?= $this->url->link(t('Back to the board'), 'board', 'show', array('project_id' => $project['id'])) ?>
</li>
<li>
<i class="fa fa-calendar fa-fw"></i>
<?= $this->url->link(t('Back to the calendar'), 'calendar', 'show', array('project_id' => $project['id'])) ?>
</li>
<li>
<i class="fa fa-folder fa-fw"></i>
<?= $this->url->link(t('All projects'), 'project', 'index') ?>

View File

@@ -1,43 +0,0 @@
<section id="main">
<div class="page-header">
<ul>
<li>
<span class="dropdown">
<span>
<i class="fa fa-caret-down"></i> <a href="#" class="dropdown-menu"><?= t('Actions') ?></a>
<ul>
<?= $this->render('project/dropdown', array('project' => $project)) ?>
</ul>
</span>
</span>
</li>
<li>
<i class="fa fa-table fa-fw"></i>
<?= $this->url->link(t('Back to the board'), 'board', 'show', array('project_id' => $project['id'])) ?>
</li>
<li>
<i class="fa fa-folder fa-fw"></i>
<?= $this->url->link(t('All projects'), 'project', 'index') ?>
</li>
</ul>
</div>
<form method="get" action="?" autocomplete="off">
<?= $this->form->hidden('controller', $values) ?>
<?= $this->form->hidden('action', $values) ?>
<?= $this->form->hidden('project_id', $values) ?>
<?= $this->form->text('search', $values, array(), array('autofocus', 'required', 'placeholder="'.t('Search').'"'), 'form-input-large') ?>
<input type="submit" value="<?= t('Search') ?>" class="btn btn-blue"/>
</form>
<?php if (! empty($values['search']) && $paginator->isEmpty()): ?>
<p class="alert"><?= t('Nothing found.') ?></p>
<?php elseif (! $paginator->isEmpty()): ?>
<?= $this->render('task/table', array(
'paginator' => $paginator,
'categories' => $categories,
'columns' => $columns,
)) ?>
<?php endif ?>
</section>

View File

@@ -1,33 +0,0 @@
<section id="main">
<div class="page-header">
<ul>
<li>
<span class="dropdown">
<span>
<i class="fa fa-caret-down"></i> <a href="#" class="dropdown-menu"><?= t('Actions') ?></a>
<ul>
<?= $this->render('project/dropdown', array('project' => $project)) ?>
</ul>
</span>
</span>
</li>
<li>
<i class="fa fa-table fa-fw"></i>
<?= $this->url->link(t('Back to the board'), 'board', 'show', array('project_id' => $project['id'])) ?>
</li>
<li>
<i class="fa fa-folder fa-fw"></i>
<?= $this->url->link(t('All projects'), 'project', 'index') ?>
</li>
</ul>
</div>
<?php if ($paginator->isEmpty()): ?>
<p class="alert"><?= t('There is no completed tasks at the moment.') ?></p>
<?php else: ?>
<?= $this->render('task/table', array(
'paginator' => $paginator,
'categories' => $categories,
'columns' => $columns,
)) ?>
<?php endif ?>
</section>

View File

@@ -2,19 +2,19 @@
<div class="page-header">
<ul>
<li>
<i class="fa fa-table fa-fw"></i>
<i class="fa fa-th fa-fw"></i>
<?= $this->url->link(t('Back to the board'), 'board', 'show', array('project_id' => $task['project_id']), false, '', '', false, 'swimlane-'.$task['swimlane_id']) ?>
</li>
<li>
<i class="fa fa-calendar fa-fw"></i>
<?= $this->url->link(t('Back to the calendar'), 'calendar', 'show', array('project_id' => $task['project_id'])) ?>
</li>
<?php if ($this->user->isManager($task['project_id'])): ?>
<li>
<i class="fa fa-cog fa-fw"></i>
<?= $this->url->link(t('Project settings'), 'project', 'show', array('project_id' => $task['project_id'])) ?>
</li>
<?php endif ?>
<li>
<i class="fa fa-calendar fa-fw"></i>
<?= $this->url->link(t('Project calendar'), 'calendar', 'show', array('project_id' => $task['project_id'])) ?>
</li>
</ul>
</div>
<section class="sidebar-container" id="task-section">

View File

@@ -1,7 +1,7 @@
<?php if (! $ajax): ?>
<div class="page-header">
<ul>
<li><i class="fa fa-table fa-fw"></i><?= $this->url->link(t('Back to the board'), 'board', 'show', array('project_id' => $values['project_id'])) ?></li>
<li><i class="fa fa-th fa-fw"></i><?= $this->url->link(t('Back to the board'), 'board', 'show', array('project_id' => $values['project_id'])) ?></li>
</ul>
</div>
<?php else: ?>

View File

@@ -1,56 +0,0 @@
<table class="table-fixed table-small">
<tr>
<th class="column-8"><?= $paginator->order(t('Id'), 'tasks.id') ?></th>
<th class="column-8"><?= $paginator->order(t('Column'), 'tasks.column_id') ?></th>
<th class="column-8"><?= $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-10"><?= $paginator->order(t('Date created'), 'tasks.date_creation') ?></th>
<th class="column-10"><?= $paginator->order(t('Date completed'), 'tasks.date_completed') ?></th>
<th class="column-5"><?= $paginator->order(t('Status'), 'tasks.is_active') ?></th>
</tr>
<?php foreach ($paginator->getCollection() as $task): ?>
<tr>
<td class="task-table color-<?= $task['color_id'] ?>">
<?= $this->url->link('#'.$this->e($task['id']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?>
</td>
<td>
<?= $this->text->in($task['column_id'], $columns) ?>
</td>
<td>
<?= $this->text->in($task['category_id'], $categories, '') ?>
</td>
<td>
<?= $this->url->link($this->e($task['title']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?>
</td>
<td>
<?php if ($task['assignee_username']): ?>
<?= $this->e($task['assignee_name'] ?: $task['assignee_username']) ?>
<?php else: ?>
<?= t('Unassigned') ?>
<?php endif ?>
</td>
<td>
<?= dt('%B %e, %Y', $task['date_due']) ?>
</td>
<td>
<?= dt('%B %e, %Y', $task['date_creation']) ?>
</td>
<td>
<?php if ($task['date_completed']): ?>
<?= dt('%B %e, %Y', $task['date_completed']) ?>
<?php endif ?>
</td>
<td>
<?php if ($task['is_active'] == \Model\Task::STATUS_OPEN): ?>
<?= t('Open') ?>
<?php else: ?>
<?= t('Closed') ?>
<?php endif ?>
</td>
</tr>
<?php endforeach ?>
</table>
<?= $paginator ?>