Commit 7d19b4d8 authored by Julien Fastré's avatar Julien Fastré
Browse files

improve layout of list when no report

parent 8ebacb22
Pipeline #10044 failed with stages
in 3 minutes and 38 seconds
......@@ -18,6 +18,7 @@ User: Utilisateur
Report data: Données du rapport
'Report view : %name%': 'Rapport : %name%'
Report: Rapport
No report registered for this person.: Aucun rapport pour cette personne.
#Flash messages
'Success : report created!': "Succès : le rapport a bien été créé !"
......
......@@ -21,27 +21,35 @@
{% block title %}{{ 'Report list' |trans }}{% endblock title %}
{% block personcontent %}
<h1>{{ 'Report list'|trans }}</h1>
{% if reports|length == 0 %}
<p style="text-align:center;">
<span class="chill-no-data-statement">{{ "No report registered for this person."|trans }}</span>
<a href="{{ path('report_select_type', { 'person_id' : person.id } ) }}">{{ 'Create a new report'|trans }}</a>
</p>
{% else %}
<table class="" style="width:100%">
<thead>
<tr>
<th class="chill-red">{{ 'Date' | trans }}</th>
<th class="chill-green">{{ 'Report type' | trans }}</th>
<th class="chill-orange">{{ 'Circle' | trans }}</th>
<th></th>
<th></th>
<th>{{ 'Actions'|trans }}</th>
</tr>
</thead>
<tbody>
{% for report in reports %}
<tr>
<td>{% if report.date %}{{ report.date|localizeddate('long', 'none') }}{% endif %}</td>
<td>{{ report.cFGroup.getName(app.request.locale) }}</td>
<td>{{ report.cFGroup.getName|localize_translatable_string }}</td>
<td>{{ report.scope.name|localize_translatable_string }}</td>
<td>
<ul class="record_actions">
{% if is_granted('CHILL_REPORT_SEE', report) %}
<li>
<a href="{{ path('report_view', { 'person_id': report.person.id, 'report_id': report.id }) }}" class="sc-button black">{{ 'View the report' | trans | capitalize }}</a>
<a href="{{ path('report_view', { 'person_id': report.person.id, 'report_id': report.id }) }}" class="sc-button bt-view">{{ 'View the report' | trans | capitalize }}</a>
</li>
{% endif %}
{% if is_granted('CHILL_REPORT_UPDATE', report) %}
......@@ -55,4 +63,16 @@
{% endfor %}
</tbody>
</table>
{% endif %}
<ul class="record_actions">
<li>
<a href="{{ path('report_select_type', { 'person_id' : person.id } ) }}" class="sc-button bt-new">
<i class="fa fa-plus"></i>
{{ 'Create a new report'|trans }}
</a>
</li>
</ul>
{% endblock %}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment