summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-02-16 17:28:11 -0500
committerFrederic Guillot <fred@kanboard.net>2016-02-16 17:28:11 -0500
commit5bbc903dcab12dcf53abc40bf67c2cd7898e0420 (patch)
tree9dfe65b5837ca42c6a9352b738dcc381151fbb19 /app
parent5272a7a980ed192a87d2319a51c8185670f62141 (diff)
Start to implement a project overview page
Diffstat (limited to 'app')
-rw-r--r--app/Controller/ProjectOverview.php27
-rw-r--r--app/ServiceProvider/RouteProvider.php3
-rw-r--r--app/Template/project_header/views.php12
-rw-r--r--app/Template/project_overview/show.php66
4 files changed, 104 insertions, 4 deletions
diff --git a/app/Controller/ProjectOverview.php b/app/Controller/ProjectOverview.php
new file mode 100644
index 00000000..cbd65777
--- /dev/null
+++ b/app/Controller/ProjectOverview.php
@@ -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));
+ }
+}
diff --git a/app/ServiceProvider/RouteProvider.php b/app/ServiceProvider/RouteProvider.php
index c723140e..d551f25d 100644
--- a/app/ServiceProvider/RouteProvider.php
+++ b/app/ServiceProvider/RouteProvider.php
@@ -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');
diff --git a/app/Template/project_header/views.php b/app/Template/project_header/views.php
index 1219a213..f8fdbb02 100644
--- a/app/Template/project_header/views.php
+++ b/app/Template/project_header/views.php
@@ -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>
diff --git a/app/Template/project_overview/show.php b/app/Template/project_overview/show.php
new file mode 100644
index 00000000..b53b1c26
--- /dev/null
+++ b/app/Template/project_overview/show.php
@@ -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>