summaryrefslogtreecommitdiff
path: root/app/Template/dashboard
diff options
context:
space:
mode:
Diffstat (limited to 'app/Template/dashboard')
-rw-r--r--app/Template/dashboard/layout.php29
-rw-r--r--app/Template/dashboard/overview.php (renamed from app/Template/dashboard/show.php)59
-rw-r--r--app/Template/dashboard/projects.php27
-rw-r--r--app/Template/dashboard/sidebar.php17
-rw-r--r--app/Template/dashboard/subtasks.php48
-rw-r--r--app/Template/dashboard/tasks.php38
6 files changed, 194 insertions, 24 deletions
diff --git a/app/Template/dashboard/layout.php b/app/Template/dashboard/layout.php
new file mode 100644
index 00000000..45b52451
--- /dev/null
+++ b/app/Template/dashboard/layout.php
@@ -0,0 +1,29 @@
+<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>
+ <?= $this->hook->render('template:dashboard:page-header:menu', array('user' => $user)) ?>
+ </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/show.php b/app/Template/dashboard/overview.php
index 64b90516..e732a387 100644
--- a/app/Template/dashboard/show.php
+++ b/app/Template/dashboard/overview.php
@@ -1,25 +1,3 @@
-<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>
- <?= $this->hook->render('template:dashboard:page-header:menu', array('user' => $user)) ?>
- </ul>
-</div>
-
<div class="filter-box margin-bottom">
<form method="get" action="<?= $this->url->dir() ?>" class="search">
<?= $this->form->hidden('controller', array('controller' => 'SearchController')) ?>
@@ -34,10 +12,43 @@
</form>
</div>
-<?php if (empty($results)): ?>
+<?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 ($results as $result): ?>
+ <?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>
diff --git a/app/Template/dashboard/projects.php b/app/Template/dashboard/projects.php
new file mode 100644
index 00000000..e84a9415
--- /dev/null
+++ b/app/Template/dashboard/projects.php
@@ -0,0 +1,27 @@
+<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: ?>
+ <div class="table-list">
+ <?= $this->render('project_list/header', array('paginator' => $paginator)) ?>
+ <?php foreach ($paginator->getCollection() as $project): ?>
+ <div class="table-list-row table-border-left">
+ <?= $this->render('project_list/project_title', array(
+ 'project' => $project,
+ )) ?>
+
+ <?= $this->render('project_list/project_details', array(
+ 'project' => $project,
+ )) ?>
+
+ <?= $this->render('project_list/project_icons', array(
+ 'project' => $project,
+ )) ?>
+ </div>
+ <?php endforeach ?>
+ </div>
+
+ <?= $paginator ?>
+<?php endif ?>
diff --git a/app/Template/dashboard/sidebar.php b/app/Template/dashboard/sidebar.php
new file mode 100644
index 00000000..7507b00d
--- /dev/null
+++ b/app/Template/dashboard/sidebar.php
@@ -0,0 +1,17 @@
+<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
new file mode 100644
index 00000000..ccc08c59
--- /dev/null
+++ b/app/Template/dashboard/subtasks.php
@@ -0,0 +1,48 @@
+<div class="page-header">
+ <h2><?= $this->url->link(t('My subtasks'), 'DashboardController', 'subtasks', array('user_id' => $user['id'])) ?> (<?= $nb_subtasks ?>)</h2>
+</div>
+<?php if ($nb_subtasks == 0): ?>
+ <p class="alert"><?= t('There is nothing assigned to you.') ?></p>
+<?php else: ?>
+ <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 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,
+ )) ?>
+ </div>
+ <?php endforeach ?>
+ </div>
+
+ <?= $paginator ?>
+<?php endif ?>
diff --git a/app/Template/dashboard/tasks.php b/app/Template/dashboard/tasks.php
new file mode 100644
index 00000000..23aef990
--- /dev/null
+++ b/app/Template/dashboard/tasks.php
@@ -0,0 +1,38 @@
+<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: ?>
+ <div class="table-list">
+ <?= $this->render('task_list/header', array(
+ 'paginator' => $paginator,
+ )) ?>
+
+ <?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_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>
+
+ <?= $paginator ?>
+<?php endif ?>