improve layout of list when no report

This commit is contained in:
Julien Fastré 2016-12-09 18:19:17 +01:00
parent 8ebacb22ac
commit 7d19b4d8b7
2 changed files with 25 additions and 4 deletions

View File

@ -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éé !"

View File

@ -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 %}