Analytics: add the first graph (task repartition)

This commit is contained in:
Frédéric Guillot
2014-11-09 17:59:02 -05:00
parent 3df63e051f
commit e89ba5e9e6
29 changed files with 392 additions and 10 deletions

View File

@@ -0,0 +1,18 @@
<?= Helper\js('assets/js/d3.v3.4.8.min.js') ?>
<?= Helper\js('assets/js/dimple.v2.1.0.min.js') ?>
<section id="main">
<div class="page-header">
<ul>
<li><i class="fa fa-table fa-fw"></i><?= Helper\a(t('Back to the board'), 'board', 'show', array('project_id' => $project['id'])) ?></li>
</ul>
</div>
<section class="sidebar-container" id="analytic-section">
<?= Helper\template('analytic/sidebar', array('project' => $project)) ?>
<div class="sidebar-content">
<?= $analytic_content_for_layout ?>
</div>
</section>
</section>

View File

@@ -0,0 +1,29 @@
<div class="page-header">
<h2><?= t('Task distribution') ?></h2>
</div>
<section id="analytic-repartition">
<div id="chart" data-url="<?= Helper\u('analytic', 'repartition', array('project_id' => $project['id'])) ?>"></div>
<table>
<tr>
<th><?= t('Column') ?></th>
<th><?= t('Number of tasks') ?></th>
<th><?= t('Percentage') ?></th>
</tr>
<?php foreach ($metrics as $metric): ?>
<tr>
<td>
<?= Helper\escape($metric['column_title']) ?>
</td>
<td>
<?= $metric['nb_tasks'] ?>
</td>
<td>
<?= n($metric['percentage']) ?>%
</td>
</tr>
<?php endforeach ?>
</table>
</section>

View File

@@ -0,0 +1,8 @@
<div class="sidebar">
<h2><?= t('Reportings') ?></h2>
<ul>
<li>
<?= Helper\a(t('Task distribution'), 'analytic', 'repartition', array('project_id' => $project['id'])) ?>
</li>
</ul>
</div>

View File

@@ -1,8 +1,4 @@
<section id="main">
<div class="page-header">
<h2><?= t('Page not found') ?></h2>
</div>
<p class="alert alert-error">
<?= t('Sorry, I didn\'t found this information in my database!') ?>
</p>

View File

@@ -24,6 +24,10 @@
<i class="fa fa-dashboard fa-fw"></i>
<?= Helper\a(t('Activity'), 'project', 'activity', array('project_id' => $current_project_id)) ?>
</li>
<li>
<i class="fa fa-line-chart fa-fw"></i>
<?= Helper\a(t('Analytics'), 'analytic', 'repartition', array('project_id' => $current_project_id)) ?>
</li>
<?php if (Helper\is_admin()): ?>
<li><i class="fa fa-cog fa-fw"></i>
<?= Helper\a(t('Configure'), 'project', 'show', array('project_id' => $current_project_id)) ?>