57 lines
2.2 KiB
HTML
57 lines
2.2 KiB
HTML
{% extends "base.html" %}
|
|
{% block title %}Entrées{% endblock %}
|
|
{% block content %}
|
|
<section class="card">
|
|
<h2>Ajouter du temps</h2>
|
|
{% if groups.is_empty() %}
|
|
<p class="empty">Aucun projet actif. <a href="/clients">Crée un client et un projet</a> d'abord.</p>
|
|
{% else %}
|
|
<form method="post" action="/ui/entries" class="row wrap">
|
|
<select name="project_id" required aria-label="Projet">{% include "_project_select.html" %}</select>
|
|
<input type="datetime-local" name="started_at" value="{{ default_start }}" required aria-label="Début">
|
|
<input type="datetime-local" name="ended_at" value="{{ default_end }}" required aria-label="Fin">
|
|
<input name="note" placeholder="Note" aria-label="Note" class="grow">
|
|
<button class="btn primary">Ajouter</button>
|
|
</form>
|
|
{% endif %}
|
|
</section>
|
|
|
|
<section class="card">
|
|
<div class="card-head">
|
|
<h2>Entrées</h2>
|
|
<span class="total">{{ total }}</span>
|
|
</div>
|
|
{% include "_presets.html" %}
|
|
<form method="get" class="row wrap filters">
|
|
<label>Du <input type="date" name="from" value="{{ from }}"></label>
|
|
<label>au <input type="date" name="to" value="{{ to }}"></label>
|
|
<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>
|
|
<select name="project_id" aria-label="Projet">
|
|
<option value="">Tous les projets</option>
|
|
{% for g in filter_groups %}
|
|
<optgroup label="{{ g.name }}">
|
|
{% for p in g.projects %}<option value="{{ p.id }}"{% if p.selected %} selected{% endif %}>{{ p.name }}</option>{% endfor %}
|
|
</optgroup>
|
|
{% endfor %}
|
|
</select>
|
|
<button class="btn">Filtrer</button>
|
|
</form>
|
|
|
|
{% if entries.is_empty() %}
|
|
<p class="empty">Aucune entrée sur cette période.</p>
|
|
{% else %}
|
|
<div class="table-wrap">
|
|
<table class="entries">
|
|
<thead><tr><th>Jour</th><th>Horaire</th><th>Projet</th><th>Note</th><th class="num">Durée</th><th></th></tr></thead>
|
|
<tbody>
|
|
{% for e in entries %}{% include "_entry_row.html" %}{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% endif %}
|
|
</section>
|
|
{% endblock %}
|