45 lines
1.8 KiB
HTML
45 lines
1.8 KiB
HTML
{% extends "base.html" %}
|
|
{% block title %}Rapports{% endblock %}
|
|
{% block content %}
|
|
<section class="card">
|
|
<div class="card-head">
|
|
<h2>Rapport</h2>
|
|
<span class="total">{{ report.total() }}</span>
|
|
</div>
|
|
{% include "_presets.html" %}
|
|
<form method="get" class="row wrap filters">
|
|
<label>Du <input type="date" name="from" value="{{ report.from }}"></label>
|
|
<label>au <input type="date" name="to" value="{{ report.to }}"></label>
|
|
<select name="group_by" aria-label="Regrouper par">
|
|
<option value="project"{% if group_by == "project" %} selected{% endif %}>Par projet</option>
|
|
<option value="client"{% if group_by == "client" %} selected{% endif %}>Par client</option>
|
|
<option value="day"{% if group_by == "day" %} selected{% endif %}>Par jour</option>
|
|
</select>
|
|
<select name="client_id" aria-label="Client">
|
|
<option value="">Tous les clients</option>
|
|
{% for c in clients %}<option value="{{ c.id }}"{% if c.selected %} selected{% endif %}>{{ c.name }}</option>{% endfor %}
|
|
</select>
|
|
<button class="btn">Afficher</button>
|
|
</form>
|
|
|
|
{% if report.rows.is_empty() %}
|
|
<p class="empty">Aucun temps sur cette période.</p>
|
|
{% else %}
|
|
<table class="report">
|
|
<tbody>
|
|
{% for r in report.rows %}
|
|
<tr>
|
|
<td class="label">{% if let Some(c) = r.color %}<span class="dot" style="--color: {{ c }}"></span>{% endif %}{{ r.label }}</td>
|
|
<td class="bar-cell"><div class="bar" style="width: {{ r.percent }}%{% if let Some(c) = r.color %}; --color: {{ c }}{% endif %}"></div></td>
|
|
<td class="num">{{ r.duration() }}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
<tfoot>
|
|
<tr><td>Total</td><td></td><td class="num">{{ report.total() }}</td></tr>
|
|
</tfoot>
|
|
</table>
|
|
{% endif %}
|
|
</section>
|
|
{% endblock %}
|