Start to implement a project overview page
This commit is contained in:
parent
5272a7a980
commit
5bbc903dca
|
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
namespace Kanboard\Controller;
|
||||
|
||||
/**
|
||||
* Project Overview Controller
|
||||
*
|
||||
* @package controller
|
||||
* @author Frederic Guillot
|
||||
*/
|
||||
class ProjectOverview extends Base
|
||||
{
|
||||
/**
|
||||
* Show project overview
|
||||
*/
|
||||
public function show()
|
||||
{
|
||||
$params = $this->getProjectFilters('ProjectOverview', 'show');
|
||||
$params['users'] = $this->projectUserRole->getAllUsersGroupedByRole($params['project']['id']);
|
||||
$params['roles'] = $this->role->getProjectRoles();
|
||||
$params['events'] = $this->projectActivity->getProject($params['project']['id'], 10);
|
||||
|
||||
$this->project->getColumnStats($params['project']);
|
||||
|
||||
$this->response->html($this->helper->layout->app('project_overview/show', $params));
|
||||
}
|
||||
}
|
||||
|
|
@ -63,6 +63,9 @@ class RouteProvider implements ServiceProviderInterface
|
|||
$container['route']->addRoute('project/:project_id/permissions', 'ProjectPermission', 'index');
|
||||
$container['route']->addRoute('project/:project_id/import', 'taskImport', 'step1');
|
||||
|
||||
// Project Overview
|
||||
$container['route']->addRoute('project/:project_id/overview', 'ProjectOverview', 'show');
|
||||
|
||||
// ProjectEdit routes
|
||||
$container['route']->addRoute('project/:project_id/edit', 'ProjectEdit', 'edit');
|
||||
$container['route']->addRoute('project/:project_id/edit/dates', 'ProjectEdit', 'dates');
|
||||
|
|
|
|||
|
|
@ -1,18 +1,22 @@
|
|||
<ul class="views">
|
||||
<li <?= $filters['controller'] === 'board' ? 'class="active"' : '' ?>>
|
||||
<li <?= $this->app->getRouterController() === 'ProjectOverview' ? 'class="active"' : '' ?>>
|
||||
<i class="fa fa-eye fa-fw"></i>
|
||||
<?= $this->url->link(t('Overview'), 'ProjectOverview', 'show', array('project_id' => $project['id']), false, 'view-overview', t('Keyboard shortcut: "%s"', 'v o')) ?>
|
||||
</li>
|
||||
<li <?= $this->app->getRouterController() === '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']), false, 'view-board', t('Keyboard shortcut: "%s"', 'v b')) ?>
|
||||
</li>
|
||||
<li <?= $filters['controller'] === 'calendar' ? 'class="active"' : '' ?>>
|
||||
<li <?= $this->app->getRouterController() === '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']), false, 'view-calendar', t('Keyboard shortcut: "%s"', 'v c')) ?>
|
||||
</li>
|
||||
<li <?= $filters['controller'] === 'listing' ? 'class="active"' : '' ?>>
|
||||
<li <?= $this->app->getRouterController() === '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']), false, 'view-listing', t('Keyboard shortcut: "%s"', 'v l')) ?>
|
||||
</li>
|
||||
<?php if ($this->user->hasProjectAccess('gantt', 'project', $project['id'])): ?>
|
||||
<li <?= $filters['controller'] === 'gantt' ? 'class="active"' : '' ?>>
|
||||
<li <?= $this->app->getRouterController() === 'Gantt' ? 'class="active"' : '' ?>>
|
||||
<i class="fa fa-sliders fa-fw"></i>
|
||||
<?= $this->url->link(t('Gantt'), 'gantt', 'project', array('project_id' => $project['id'], 'search' => $filters['search']), false, 'view-gantt', t('Keyboard shortcut: "%s"', 'v g')) ?>
|
||||
</li>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,66 @@
|
|||
<section id="main">
|
||||
<?= $this->render('project_header/header', array(
|
||||
'project' => $project,
|
||||
'filters' => $filters,
|
||||
)) ?>
|
||||
|
||||
<div class="project-overview-columns">
|
||||
<?php foreach ($project['columns'] as $column): ?>
|
||||
<div class="project-overview-column">
|
||||
<strong title="<?= t('Task count') ?>"><?= $column['nb_tasks'] ?></strong><br>
|
||||
<span><?= $this->e($column['title']) ?></span>
|
||||
</div>
|
||||
<?php endforeach ?>
|
||||
</div>
|
||||
|
||||
<?php if (! empty($project['description'])): ?>
|
||||
<div class="page-header">
|
||||
<h2><?= $this->e($project['name']) ?></h2>
|
||||
</div>
|
||||
<article class="markdown">
|
||||
<?= $this->text->markdown($project['description']) ?>
|
||||
</article>
|
||||
<?php endif ?>
|
||||
|
||||
<div class="page-header">
|
||||
<h2><?= t('Information') ?></h2>
|
||||
</div>
|
||||
<div class="listing">
|
||||
<ul>
|
||||
|
||||
<?php if ($project['owner_id'] > 0): ?>
|
||||
<li><?= t('Project owner: ') ?><strong><?= $this->e($project['owner_name'] ?: $project['owner_username']) ?></strong></li>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if (! empty($users)): ?>
|
||||
<?php foreach ($roles as $role => $role_name): ?>
|
||||
<?php if (isset($users[$role])): ?>
|
||||
<li>
|
||||
<?= $role_name ?>:
|
||||
<strong><?= implode(', ', $users[$role]) ?></strong>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
<?php endforeach ?>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if ($project['start_date']): ?>
|
||||
<li><?= t('Start date: ').$this->dt->date($project['start_date']) ?></li>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if ($project['end_date']): ?>
|
||||
<li><?= t('End date: ').$this->dt->date($project['end_date']) ?></li>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if ($project['is_public']): ?>
|
||||
<li><i class="fa fa-share-alt"></i> <?= $this->url->link(t('Public link'), 'board', 'readonly', array('token' => $project['token']), false, '', '', true) ?></li>
|
||||
<li><i class="fa fa-rss-square"></i> <?= $this->url->link(t('RSS feed'), 'feed', 'project', array('token' => $project['token']), false, '', '', true) ?></li>
|
||||
<li><i class="fa fa-calendar"></i> <?= $this->url->link(t('iCal feed'), 'ical', 'project', array('token' => $project['token'])) ?></li>
|
||||
<?php endif ?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="page-header">
|
||||
<h2><?= t('Last activity') ?></h2>
|
||||
</div>
|
||||
<?= $this->render('event/events', array('events' => $events)) ?>
|
||||
</section>
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -5,4 +5,38 @@
|
|||
padding-left: 15px;
|
||||
padding-bottom: 5px;
|
||||
padding-top: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.project-overview-columns {
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
-webkit-flex-direction: row;
|
||||
flex-direction: row;
|
||||
|
||||
-webkit-flex-wrap: wrap;
|
||||
flex-wrap: wrap;
|
||||
|
||||
-webkit-align-items: center;
|
||||
align-items: center;
|
||||
|
||||
-webkit-justify-content: center;
|
||||
justify-content: center;
|
||||
|
||||
margin-bottom: 20px;
|
||||
font-size: 1.4em;
|
||||
}
|
||||
|
||||
.project-overview-column {
|
||||
text-align: center;
|
||||
margin-right: 80px;
|
||||
}
|
||||
|
||||
.project-overview-column strong {
|
||||
font-size: 1.3em;
|
||||
color: #444;
|
||||
}
|
||||
|
||||
.project-overview-column span {
|
||||
font-size: 0.8em;
|
||||
color: #777;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue