Improve dashboard

This commit is contained in:
Frederic Guillot
2017-04-08 13:58:25 -04:00
parent fe9f3ba707
commit d7b0cfbbe5
21 changed files with 493 additions and 30 deletions

View File

@@ -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>

View File

@@ -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>

View File

@@ -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 ?>

View File

@@ -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>

View File

@@ -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 ?>

View File

@@ -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 ?>