diff options
author | Frédéric Guillot <fred@kanboard.net> | 2014-11-15 21:55:42 -0500 |
---|---|---|
committer | Frédéric Guillot <fred@kanboard.net> | 2014-11-15 21:55:42 -0500 |
commit | 557bc2c3cd1fd2dddf1d7c03731aaaf173cd2bb7 (patch) | |
tree | 717c5b015b52127dca2674bffcc98a3e92893e12 /app/Template/analytic/tasks.php | |
parent | aa6fffb05a7d84a36991341610675499b6ea8a79 (diff) |
Don't display analytics if not enough data
Diffstat (limited to 'app/Template/analytic/tasks.php')
-rw-r--r-- | app/Template/analytic/tasks.php | 51 |
1 files changed, 28 insertions, 23 deletions
diff --git a/app/Template/analytic/tasks.php b/app/Template/analytic/tasks.php index 7ae9c254..01338d2e 100644 --- a/app/Template/analytic/tasks.php +++ b/app/Template/analytic/tasks.php @@ -1,29 +1,34 @@ <div class="page-header"> <h2><?= t('Task distribution') ?></h2> </div> -<section id="analytic-task-repartition"> -<div id="chart" data-url="<?= Helper\u('analytic', 'tasks', array('project_id' => $project['id'])) ?>"></div> +<?php if (empty($metrics)): ?> + <p class="alert"><?= t('Not enough data.') ?></p> +<?php else: ?> + <section id="analytic-task-repartition"> -<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> + <div id="chart" data-url="<?= Helper\u('analytic', 'tasks', array('project_id' => $project['id'])) ?>"></div> -</section> + <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> +<?php endif ?> |