summaryrefslogtreecommitdiff
path: root/app/Template
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2017-03-12 21:36:52 -0400
committerFrederic Guillot <fred@kanboard.net>2017-03-12 21:36:52 -0400
commit9b34631135f29480dda3ed2df463fbb5aab7c9e4 (patch)
tree46da2f342a440cc699b7aa9c61bd18d0d2ea01f5 /app/Template
parentf6b42eb8024b7db959f6d75118b3de0f96301262 (diff)
Simplify dashboard to use new tasks list view
Diffstat (limited to 'app/Template')
-rw-r--r--app/Template/dashboard/layout.php31
-rw-r--r--app/Template/dashboard/projects.php55
-rw-r--r--app/Template/dashboard/show.php70
-rw-r--r--app/Template/dashboard/sidebar.php17
-rw-r--r--app/Template/dashboard/subtasks.php45
-rw-r--r--app/Template/dashboard/tasks.php53
-rw-r--r--app/Template/task_list/listing.php64
7 files changed, 98 insertions, 237 deletions
diff --git a/app/Template/dashboard/layout.php b/app/Template/dashboard/layout.php
deleted file mode 100644
index dbd16886..00000000
--- a/app/Template/dashboard/layout.php
+++ /dev/null
@@ -1,31 +0,0 @@
-<section id="main">
- <div class="page-header">
- <ul>
- <?php if ($this->user->hasAccess('ProjectCreationController', 'create')): ?>
- <li>
- <?= $this->modal->medium('plus', t('New project'), 'ProjectCreationController', 'create') ?>
- </li>
- <?php endif ?>
- <?php if ($this->app->config('disable_private_project', 0) == 0): ?>
- <li>
- <?= $this->modal->medium('lock', t('New private project'), 'ProjectCreationController', 'createPrivate') ?>
- </li>
- <?php endif ?>
- <li>
- <?= $this->url->icon('folder', t('Project management'), 'ProjectListController', 'show') ?>
- </li>
- <li>
- <?= $this->modal->medium('dashboard', t('My activity stream'), 'ActivityController', 'user') ?>
- </li>
- <li>
- <?= $this->modal->medium('calendar', t('My calendar'), 'CalendarController', 'user') ?>
- </li>
- </ul>
- </div>
- <section class="sidebar-container" id="dashboard">
- <?= $this->render($sidebar_template, array('user' => $user)) ?>
- <div class="sidebar-content">
- <?= $content_for_sublayout ?>
- </div>
- </section>
-</section>
diff --git a/app/Template/dashboard/projects.php b/app/Template/dashboard/projects.php
deleted file mode 100644
index 7e35b059..00000000
--- a/app/Template/dashboard/projects.php
+++ /dev/null
@@ -1,55 +0,0 @@
-<div class="page-header">
- <h2><?= $this->url->link(t('My projects'), 'DashboardController', 'projects', array('user_id' => $user['id'])) ?> (<?= $paginator->getTotal() ?>)</h2>
-</div>
-<?php if ($paginator->isEmpty()): ?>
- <p class="alert"><?= t('Your are not member of any project.') ?></p>
-<?php else: ?>
- <table class="table-striped table-small table-scrolling">
- <tr>
- <th class="column-5"><?= $paginator->order('Id', \Kanboard\Model\ProjectModel::TABLE.'.id') ?></th>
- <th class="column-3"><?= $paginator->order('<i class="fa fa-lock fa-fw" title="'.t('Private project').'"></i>', \Kanboard\Model\ProjectModel::TABLE.'.is_private') ?></th>
- <th class="column-25"><?= $paginator->order(t('Project'), \Kanboard\Model\ProjectModel::TABLE.'.name') ?></th>
- <th class="column-10"><?= t('Tasks') ?></th>
- <th><?= t('Columns') ?></th>
- </tr>
- <?php foreach ($paginator->getCollection() as $project): ?>
- <tr>
- <td>
- <?= $this->render('project/dropdown', array('project' => $project)) ?>
- </td>
- <td>
- <?php if ($project['is_private']): ?>
- <i class="fa fa-lock fa-fw" title="<?= t('Private project') ?>"></i>
- <?php endif ?>
- </td>
- <td>
- <?php if ($this->user->hasProjectAccess('TaskGanttController', 'show', $project['id'])): ?>
- <?= $this->url->link('<i class="fa fa-sliders fa-fw"></i>', 'TaskGanttController', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link', t('Gantt chart')) ?>
- <?php endif ?>
-
- <?= $this->url->link('<i class="fa fa-list"></i>', 'TaskListController', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link', t('List')) ?>&nbsp;
- <?= $this->url->link('<i class="fa fa-calendar"></i>', 'CalendarController', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link', t('Calendar')) ?>&nbsp;
-
- <?= $this->url->link($this->text->e($project['name']), 'BoardViewController', 'show', array('project_id' => $project['id'])) ?>
- <?php if (! empty($project['description'])): ?>
- <span class="tooltip" title="<?= $this->text->markdownAttribute($project['description']) ?>">
- <i class="fa fa-info-circle"></i>
- </span>
- <?php endif ?>
- </td>
- <td>
- <?= $project['nb_active_tasks'] ?>
- </td>
- <td class="dashboard-project-stats">
- <?php foreach ($project['columns'] as $column): ?>
- <strong title="<?= t('Task count') ?>"><?= $column['nb_open_tasks'] ?></strong>
- <small><?= $this->text->e($column['title']) ?></small>
- <?php endforeach ?>
- </td>
-
- </tr>
- <?php endforeach ?>
- </table>
-
- <?= $paginator ?>
-<?php endif ?>
diff --git a/app/Template/dashboard/show.php b/app/Template/dashboard/show.php
index b1d877cf..df5b03e0 100644
--- a/app/Template/dashboard/show.php
+++ b/app/Template/dashboard/show.php
@@ -1,3 +1,27 @@
+<div class="page-header">
+ <ul>
+ <?php if ($this->user->hasAccess('ProjectCreationController', 'create')): ?>
+ <li>
+ <?= $this->modal->medium('plus', t('New project'), 'ProjectCreationController', 'create') ?>
+ </li>
+ <?php endif ?>
+ <?php if ($this->app->config('disable_private_project', 0) == 0): ?>
+ <li>
+ <?= $this->modal->medium('lock', t('New private project'), 'ProjectCreationController', 'createPrivate') ?>
+ </li>
+ <?php endif ?>
+ <li>
+ <?= $this->url->icon('folder', t('Project management'), 'ProjectListController', 'show') ?>
+ </li>
+ <li>
+ <?= $this->modal->medium('dashboard', t('My activity stream'), 'ActivityController', 'user') ?>
+ </li>
+ <li>
+ <?= $this->modal->medium('calendar', t('My calendar'), 'CalendarController', 'user') ?>
+ </li>
+ </ul>
+</div>
+
<div class="filter-box margin-bottom">
<form method="get" action="<?= $this->url->dir() ?>" class="search">
<?= $this->form->hidden('controller', array('controller' => 'SearchController')) ?>
@@ -12,8 +36,48 @@
</form>
</div>
-<?= $this->render('dashboard/projects', array('paginator' => $project_paginator, 'user' => $user)) ?>
-<?= $this->render('dashboard/tasks', array('paginator' => $task_paginator, 'user' => $user)) ?>
-<?= $this->render('dashboard/subtasks', array('paginator' => $subtask_paginator, 'user' => $user)) ?>
+<?php if (empty($results)): ?>
+ <p class="alert"><?= t('There is nothing assigned to you.') ?></p>
+<?php else: ?>
+ <?php foreach ($results as $result): ?>
+ <?php if (! $result['paginator']->isEmpty()): ?>
+ <div class="page-header">
+ <h2><?= $this->url->link($this->text->e($result['project_name']), 'BoardViewController', 'show', array('project_id' => $result['project_id'])) ?></h2>
+ </div>
+
+ <div class="table-list">
+ <?= $this->render('task_list/header', array(
+ 'paginator' => $result['paginator'],
+ )) ?>
+
+ <?php foreach ($result['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>
+
+ <?= $result['paginator'] ?>
+ <?php endif ?>
+ <?php endforeach ?>
+<?php endif ?>
<?= $this->hook->render('template:dashboard:show', array('user' => $user)) ?>
diff --git a/app/Template/dashboard/sidebar.php b/app/Template/dashboard/sidebar.php
deleted file mode 100644
index 7507b00d..00000000
--- a/app/Template/dashboard/sidebar.php
+++ /dev/null
@@ -1,17 +0,0 @@
-<div class="sidebar">
- <ul>
- <li <?= $this->app->checkMenuSelection('DashboardController', 'show') ?>>
- <?= $this->url->link(t('Overview'), 'DashboardController', 'show', array('user_id' => $user['id'])) ?>
- </li>
- <li <?= $this->app->checkMenuSelection('DashboardController', 'projects') ?>>
- <?= $this->url->link(t('My projects'), 'DashboardController', 'projects', array('user_id' => $user['id'])) ?>
- </li>
- <li <?= $this->app->checkMenuSelection('DashboardController', 'tasks') ?>>
- <?= $this->url->link(t('My tasks'), 'DashboardController', 'tasks', array('user_id' => $user['id'])) ?>
- </li>
- <li <?= $this->app->checkMenuSelection('DashboardController', 'subtasks') ?>>
- <?= $this->url->link(t('My subtasks'), 'DashboardController', 'subtasks', array('user_id' => $user['id'])) ?>
- </li>
- <?= $this->hook->render('template:dashboard:sidebar', array('user' => $user)) ?>
- </ul>
-</div>
diff --git a/app/Template/dashboard/subtasks.php b/app/Template/dashboard/subtasks.php
deleted file mode 100644
index d86b1ef9..00000000
--- a/app/Template/dashboard/subtasks.php
+++ /dev/null
@@ -1,45 +0,0 @@
-<div class="page-header">
- <h2><?= $this->url->link(t('My subtasks'), 'DashboardController', 'subtasks', array('user_id' => $user['id'])) ?> (<?= $paginator->getTotal() ?>)</h2>
-</div>
-<?php if ($paginator->isEmpty()): ?>
- <p class="alert"><?= t('There is nothing assigned to you.') ?></p>
-<?php else: ?>
- <table class="table-striped table-small table-scrolling">
- <tr>
- <th class="column-5"><?= $paginator->order('Id', \Kanboard\Model\TaskModel::TABLE.'.id') ?></th>
- <th class="column-20"><?= $paginator->order(t('Project'), 'project_name') ?></th>
- <th><?= $paginator->order(t('Task'), 'task_name') ?></th>
- <th><?= $paginator->order(t('Subtask'), \Kanboard\Model\SubtaskModel::TABLE.'.title') ?></th>
- <?= $this->hook->render('template:dashboard:subtasks:header:before-timetracking', array('paginator' => $paginator)) ?>
- <th class="column-20"><?= t('Time tracking') ?></th>
- </tr>
- <?php foreach ($paginator->getCollection() as $subtask): ?>
- <tr>
- <td class="task-table color-<?= $subtask['color_id'] ?>">
- <?= $this->render('task/dropdown', array('task' => array('id' => $subtask['task_id'], 'project_id' => $subtask['project_id']))) ?>
- </td>
- <td>
- <?= $this->url->link($this->text->e($subtask['project_name']), 'BoardViewController', 'show', array('project_id' => $subtask['project_id'])) ?>
- </td>
- <td>
- <?= $this->url->link($this->text->e($subtask['task_name']), 'TaskViewController', 'show', array('task_id' => $subtask['task_id'], 'project_id' => $subtask['project_id'])) ?>
- </td>
- <td>
- <?= $this->subtask->renderToggleStatus(array('project_id' => $subtask['project_id']), $subtask) ?>
- </td>
- <?= $this->hook->render('template:dashboard:subtasks:rows', array('subtask' => $subtask)) ?>
- <td>
- <?php if (! empty($subtask['time_spent'])): ?>
- <strong><?= $this->text->e($subtask['time_spent']).'h' ?></strong> <?= t('spent') ?>
- <?php endif ?>
-
- <?php if (! empty($subtask['time_estimated'])): ?>
- <strong><?= $this->text->e($subtask['time_estimated']).'h' ?></strong> <?= t('estimated') ?>
- <?php endif ?>
- </td>
- </tr>
- <?php endforeach ?>
- </table>
-
- <?= $paginator ?>
-<?php endif ?>
diff --git a/app/Template/dashboard/tasks.php b/app/Template/dashboard/tasks.php
deleted file mode 100644
index 427b903d..00000000
--- a/app/Template/dashboard/tasks.php
+++ /dev/null
@@ -1,53 +0,0 @@
-<div class="page-header">
- <h2><?= $this->url->link(t('My tasks'), 'DashboardController', 'tasks', array('user_id' => $user['id'])) ?> (<?= $paginator->getTotal() ?>)</h2>
-</div>
-<?php if ($paginator->isEmpty()): ?>
- <p class="alert"><?= t('There is nothing assigned to you.') ?></p>
-<?php else: ?>
- <table class="table-striped table-small table-scrolling">
- <tr>
- <th class="column-5"><?= $paginator->order('Id', \Kanboard\Model\TaskModel::TABLE.'.id') ?></th>
- <th class="column-20"><?= $paginator->order(t('Project'), 'project_name') ?></th>
- <th><?= $paginator->order(t('Task'), \Kanboard\Model\TaskModel::TABLE.'.title') ?></th>
- <th class="column-8"><?= $paginator->order(t('Priority'), \Kanboard\Model\TaskModel::TABLE.'.priority') ?></th>
- <th class="column-20"><?= t('Time tracking') ?></th>
- <th class="column-10"><?= $paginator->order(t('Due date'), \Kanboard\Model\TaskModel::TABLE.'.date_due') ?></th>
- <th class="column-10"><?= $paginator->order(t('Column'), 'column_title') ?></th>
- </tr>
- <?php foreach ($paginator->getCollection() as $task): ?>
- <tr>
- <td class="task-table color-<?= $task['color_id'] ?>">
- <?= $this->render('task/dropdown', array('task' => $task)) ?>
- </td>
- <td>
- <?= $this->url->link($this->text->e($task['project_name']), 'BoardViewController', 'show', array('project_id' => $task['project_id'])) ?>
- </td>
- <td>
- <?= $this->url->link($this->text->e($task['title']), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
- </td>
- <td>
- <?php if ($task['priority'] >= 0): ?>
- P<?= $this->text->e($task['priority'])?>
- <?php endif?>
- </td>
- <td>
- <?php if (! empty($task['time_spent'])): ?>
- <strong><?= $this->text->e($task['time_spent']).'h' ?></strong> <?= t('spent') ?>
- <?php endif ?>
-
- <?php if (! empty($task['time_estimated'])): ?>
- <strong><?= $this->text->e($task['time_estimated']).'h' ?></strong> <?= t('estimated') ?>
- <?php endif ?>
- </td>
- <td>
- <?= $this->dt->date($task['date_due']) ?>
- </td>
- <td>
- <?= $this->text->e($task['column_title']) ?>
- </td>
- </tr>
- <?php endforeach ?>
- </table>
-
- <?= $paginator ?>
-<?php endif ?>
diff --git a/app/Template/task_list/listing.php b/app/Template/task_list/listing.php
index b3c66aa6..97393972 100644
--- a/app/Template/task_list/listing.php
+++ b/app/Template/task_list/listing.php
@@ -1,40 +1,38 @@
-<section id="main">
- <?= $this->projectHeader->render($project, 'TaskListController', 'show') ?>
+<?= $this->projectHeader->render($project, 'TaskListController', 'show') ?>
- <?php if ($paginator->isEmpty()): ?>
- <p class="alert"><?= t('No tasks found.') ?></p>
- <?php elseif (! $paginator->isEmpty()): ?>
- <div class="table-list">
- <?= $this->render('task_list/header', array(
- 'paginator' => $paginator,
- 'project' => $project,
- )) ?>
+<?php if ($paginator->isEmpty()): ?>
+ <p class="alert"><?= t('No tasks found.') ?></p>
+<?php elseif (! $paginator->isEmpty()): ?>
+ <div class="table-list">
+ <?= $this->render('task_list/header', array(
+ 'paginator' => $paginator,
+ 'project' => $project,
+ )) ?>
- <?php foreach ($paginator->getCollection() as $task): ?>
- <div class="table-list-row color-<?= $task['color_id'] ?>">
- <?= $this->render('task_list/task_title', array(
- 'task' => $task,
- )) ?>
+ <?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_details', array(
+ 'task' => $task,
+ )) ?>
- <?= $this->render('task_list/task_avatars', 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_icons', array(
+ 'task' => $task,
+ )) ?>
- <?= $this->render('task_list/task_subtasks', array(
- 'task' => $task,
- )) ?>
- </div>
- <?php endforeach ?>
- </div>
+ <?= $this->render('task_list/task_subtasks', array(
+ 'task' => $task,
+ )) ?>
+ </div>
+ <?php endforeach ?>
+ </div>
- <?= $paginator ?>
- <?php endif ?>
-</section>
+ <?= $paginator ?>
+<?php endif ?>