summaryrefslogtreecommitdiff
path: root/app/Template/dashboard
diff options
context:
space:
mode:
Diffstat (limited to 'app/Template/dashboard')
-rw-r--r--app/Template/dashboard/layout.php10
-rw-r--r--app/Template/dashboard/overview.php93
-rw-r--r--app/Template/dashboard/projects.php56
-rw-r--r--app/Template/dashboard/show.php19
-rw-r--r--app/Template/dashboard/subtasks.php74
-rw-r--r--app/Template/dashboard/tasks.php67
6 files changed, 176 insertions, 143 deletions
diff --git a/app/Template/dashboard/layout.php b/app/Template/dashboard/layout.php
index dbd16886..45b52451 100644
--- a/app/Template/dashboard/layout.php
+++ b/app/Template/dashboard/layout.php
@@ -7,9 +7,9 @@
</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>
+ <li>
+ <?= $this->modal->medium('lock', t('New private project'), 'ProjectCreationController', 'createPrivate') ?>
+ </li>
<?php endif ?>
<li>
<?= $this->url->icon('folder', t('Project management'), 'ProjectListController', 'show') ?>
@@ -17,9 +17,7 @@
<li>
<?= $this->modal->medium('dashboard', t('My activity stream'), 'ActivityController', 'user') ?>
</li>
- <li>
- <?= $this->modal->medium('calendar', t('My calendar'), 'CalendarController', 'user') ?>
- </li>
+ <?= $this->hook->render('template:dashboard:page-header:menu', array('user' => $user)) ?>
</ul>
</div>
<section class="sidebar-container" id="dashboard">
diff --git a/app/Template/dashboard/overview.php b/app/Template/dashboard/overview.php
new file mode 100644
index 00000000..e732a387
--- /dev/null
+++ b/app/Template/dashboard/overview.php
@@ -0,0 +1,93 @@
+<div class="filter-box margin-bottom">
+ <form method="get" action="<?= $this->url->dir() ?>" class="search">
+ <?= $this->form->hidden('controller', array('controller' => 'SearchController')) ?>
+ <?= $this->form->hidden('action', array('action' => 'index')) ?>
+
+ <div class="input-addon">
+ <?= $this->form->text('search', array(), array(), array('placeholder="'.t('Search').'"'), 'input-addon-field') ?>
+ <div class="input-addon-item">
+ <?= $this->render('app/filters_helper') ?>
+ </div>
+ </div>
+ </form>
+</div>
+
+<?php if (! $project_paginator->isEmpty()): ?>
+ <div class="table-list">
+ <?= $this->render('project_list/header', array('paginator' => $project_paginator)) ?>
+ <?php foreach ($project_paginator->getCollection() as $project): ?>
+ <div class="table-list-row table-border-left">
+ <div>
+ <?php if ($this->user->hasProjectAccess('ProjectViewController', 'show', $project['id'])): ?>
+ <?= $this->render('project/dropdown', array('project' => $project)) ?>
+ <?php else: ?>
+ <strong><?= '#'.$project['id'] ?></strong>
+ <?php endif ?>
+
+ <span class="table-list-title <?= $project['is_active'] == 0 ? 'status-closed' : '' ?>">
+ <?= $this->url->link($this->text->e($project['name']), 'BoardViewController', 'show', array('project_id' => $project['id'])) ?>
+ </span>
+
+ <?php if ($project['is_private']): ?>
+ <i class="fa fa-lock fa-fw" title="<?= t('Private project') ?>"></i>
+ <?php endif ?>
+ </div>
+ <div class="table-list-details">
+ <?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 ?>
+ </div>
+ </div>
+ <?php endforeach ?>
+ </div>
+
+ <?= $project_paginator ?>
+<?php endif ?>
+
+<?php if (empty($overview_paginator)): ?>
+ <p class="alert"><?= t('There is nothing assigned to you.') ?></p>
+<?php else: ?>
+ <?php foreach ($overview_paginator 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,
+ 'user_id' => $user['id'],
+ )) ?>
+ </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/projects.php b/app/Template/dashboard/projects.php
index 7e35b059..e84a9415 100644
--- a/app/Template/dashboard/projects.php
+++ b/app/Template/dashboard/projects.php
@@ -4,52 +4,24 @@
<?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>
+ <div class="table-list">
+ <?= $this->render('project_list/header', array('paginator' => $paginator)) ?>
<?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 ?>
+ <div class="table-list-row table-border-left">
+ <?= $this->render('project_list/project_title', array(
+ 'project' => $project,
+ )) ?>
- <?= $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->render('project_list/project_details', array(
+ 'project' => $project,
+ )) ?>
- <?= $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>
+ <?= $this->render('project_list/project_icons', array(
+ 'project' => $project,
+ )) ?>
+ </div>
<?php endforeach ?>
- </table>
+ </div>
<?= $paginator ?>
<?php endif ?>
diff --git a/app/Template/dashboard/show.php b/app/Template/dashboard/show.php
deleted file mode 100644
index b1d877cf..00000000
--- a/app/Template/dashboard/show.php
+++ /dev/null
@@ -1,19 +0,0 @@
-<div class="filter-box margin-bottom">
- <form method="get" action="<?= $this->url->dir() ?>" class="search">
- <?= $this->form->hidden('controller', array('controller' => 'SearchController')) ?>
- <?= $this->form->hidden('action', array('action' => 'index')) ?>
-
- <div class="input-addon">
- <?= $this->form->text('search', array(), array(), array('placeholder="'.t('Search').'"'), 'input-addon-field') ?>
- <div class="input-addon-item">
- <?= $this->render('app/filters_helper') ?>
- </div>
- </div>
- </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)) ?>
-
-<?= $this->hook->render('template:dashboard:show', array('user' => $user)) ?>
diff --git a/app/Template/dashboard/subtasks.php b/app/Template/dashboard/subtasks.php
index d86b1ef9..96bb13cc 100644
--- a/app/Template/dashboard/subtasks.php
+++ b/app/Template/dashboard/subtasks.php
@@ -1,45 +1,49 @@
<div class="page-header">
- <h2><?= $this->url->link(t('My subtasks'), 'DashboardController', 'subtasks', array('user_id' => $user['id'])) ?> (<?= $paginator->getTotal() ?>)</h2>
+ <h2><?= $this->url->link(t('My subtasks'), 'DashboardController', 'subtasks', array('user_id' => $user['id'])) ?> (<?= $nb_subtasks ?>)</h2>
</div>
-<?php if ($paginator->isEmpty()): ?>
+<?php if ($nb_subtasks == 0): ?>
<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') ?>
+ <div class="table-list">
+ <div class="table-list-header">
+ <div class="table-list-header-count">
+ <?php if ($nb_subtasks > 1): ?>
+ <?= t('%d subtasks', $nb_subtasks) ?>
+ <?php else: ?>
+ <?= t('%d subtask', $nb_subtasks) ?>
<?php endif ?>
+ </div>
+ <div class="table-list-header-menu">
+ <div class="dropdown">
+ <a href="#" class="dropdown-menu dropdown-menu-link-icon"><strong><?= t('Sort') ?> <i class="fa fa-caret-down"></i></strong></a>
+ <ul>
+ <li>
+ <?= $paginator->order(t('Task ID'), \Kanboard\Model\TaskModel::TABLE.'.id') ?>
+ </li>
+ <li>
+ <?= $paginator->order(t('Title'), \Kanboard\Model\TaskModel::TABLE.'.title') ?>
+ </li>
+ <li>
+ <?= $paginator->order(t('Priority'), \Kanboard\Model\TaskModel::TABLE.'.priority') ?>
+ </li>
+ </ul>
+ </div>
+ </div>
+ </div>
- <?php if (! empty($subtask['time_estimated'])): ?>
- <strong><?= $this->text->e($subtask['time_estimated']).'h' ?></strong> <?= t('estimated') ?>
- <?php endif ?>
- </td>
- </tr>
+ <?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_subtasks', array(
+ 'task' => $task,
+ 'user_id' => $user['id'],
+ )) ?>
+ </div>
<?php endforeach ?>
- </table>
+ </div>
<?= $paginator ?>
<?php endif ?>
diff --git a/app/Template/dashboard/tasks.php b/app/Template/dashboard/tasks.php
index 427b903d..23aef990 100644
--- a/app/Template/dashboard/tasks.php
+++ b/app/Template/dashboard/tasks.php
@@ -4,50 +4,35 @@
<?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>
+ <div class="table-list">
+ <?= $this->render('task_list/header', array(
+ 'paginator' => $paginator,
+ )) ?>
+
<?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 ?>
+ <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,
+ )) ?>
- <?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>
+ <?= $this->render('task_list/task_subtasks', array(
+ 'task' => $task,
+ )) ?>
+ </div>
<?php endforeach ?>
- </table>
+ </div>
<?= $paginator ?>
<?php endif ?>