Add a dashboard (first version)

This commit is contained in:
Frédéric Guillot
2014-10-14 22:02:35 -04:00
parent d0e6d2e1f1
commit 286b193566
23 changed files with 218 additions and 44 deletions

View File

@@ -0,0 +1,45 @@
<section id="main">
<div class="page-header">
<h2><?= t('Dashboard') ?></h2>
</div>
<section id="dashboard">
<div class="dashboard-left-column">
<h2><?= t('My tasks') ?></h2>
<?php if (empty($tasks)): ?>
<p class="alert"><?= t('There is nothing assigned to you.') ?></p>
<?php else: ?>
<table>
<tr>
<th>&nbsp;</th>
<th width="15%"><?= t('Project') ?></th>
<th width="40%"><?= t('Title') ?></th>
<th><?= t('Due date') ?></th>
<th><?= t('Date created') ?></th>
</tr>
<?php foreach ($tasks as $task): ?>
<tr>
<td class="task-table task-<?= $task['color_id'] ?>">
<?= Helper\a('#'.$task['id'], 'task', 'show', array('task_id' => $task['id'])) ?>
</td>
<td>
<?= Helper\a(Helper\escape($task['project_name']), 'board', 'show', array('project_id' => $task['project_id'])) ?>
</td>
<td>
<?= Helper\a(Helper\escape($task['title']), 'task', 'show', array('task_id' => $task['id'])) ?>
</td>
<td>
<?= dt('%B %e, %Y', $task['date_due']) ?>
</td>
<td>
<?= dt('%B %e, %Y', $task['date_creation']) ?>
</td>
</tr>
<?php endforeach ?>
</table>
<?php endif ?>
</div>
<div class="dashboard-right-column">
<h2><?= t('Activity stream') ?></h2>
<?= Helper\template('project_events', array('events' => $events)) ?>
</section>
</section>

View File

@@ -50,6 +50,9 @@
</select>
</li>
<?php endif ?>
<li <?= isset($menu) && $menu === 'dashboard' ? 'class="active"' : '' ?>>
<a href="?controller=app"><?= t('Dashboard') ?></a>
</li>
<li <?= isset($menu) && $menu === 'boards' ? 'class="active"' : '' ?>>
<a href="?controller=board"><?= t('Boards') ?></a>
</li>

View File

@@ -9,29 +9,10 @@
</ul>
</div>
<section>
<?php if (empty($events)): ?>
<p class="alert"><?= t('No activity.') ?></p>
<?php else: ?>
<?php if ($project['is_public']): ?>
<p class="pull-right"><i class="fa fa-rss-square"></i> <?= Helper\a(t('RSS feed'), 'project', 'feed', array('token' => $project['token'])) ?></p>
<?php endif ?>
<?php foreach ($events as $event): ?>
<div class="activity-event">
<p class="activity-datetime">
<?php if (Helper\contains($event['event_name'], 'task')): ?>
<i class="fa fa-newspaper-o"></i>
<?php elseif (Helper\contains($event['event_name'], 'subtask')): ?>
<i class="fa fa-tasks"></i>
<?php elseif (Helper\contains($event['event_name'], 'comment')): ?>
<i class="fa fa-comments-o"></i>
<?php endif ?>
&nbsp;<?= dt('%B %e, %Y at %k:%M %p', $event['date_creation']) ?>
</p>
<div class="activity-content"><?= $event['event_content'] ?></div>
</div>
<?php endforeach ?>
<?php endif ?>
<?= Helper\template('project_events', array('events' => $events)) ?>
</section>
</section>

View File

@@ -0,0 +1,21 @@
<?php if (empty($events)): ?>
<p class="alert"><?= t('No activity.') ?></p>
<?php else: ?>
<?php foreach ($events as $event): ?>
<div class="activity-event">
<p class="activity-datetime">
<?php if (Helper\contains($event['event_name'], 'subtask')): ?>
<i class="fa fa-tasks"></i>
<?php elseif (Helper\contains($event['event_name'], 'task')): ?>
<i class="fa fa-newspaper-o"></i>
<?php elseif (Helper\contains($event['event_name'], 'comment')): ?>
<i class="fa fa-comments-o"></i>
<?php endif ?>
&nbsp;<?= dt('%B %e, %Y at %k:%M %p', $event['date_creation']) ?>
</p>
<div class="activity-content"><?= $event['event_content'] ?></div>
</div>
<?php endforeach ?>
<?php endif ?>

View File

@@ -13,7 +13,7 @@
<?php foreach ($tasks as $task): ?>
<tr>
<td class="task-table task-<?= $task['color_id'] ?>">
<a href="?controller=task&amp;action=show&amp;task_id=<?= $task['id'] ?>" title="<?= t('View this task') ?>"><?= Helper\escape($task['id']) ?></a>
<a href="?controller=task&amp;action=show&amp;task_id=<?= $task['id'] ?>" title="<?= t('View this task') ?>">#<?= Helper\escape($task['id']) ?></a>
</td>
<td>
<?= Helper\in_list($task['column_id'], $columns) ?>