Julien Fastré 2c89aa4812 improve ACL on report creation + various UI improvements
- show button to update report only to users with correct permissions;
- show new page only to users with correct permissions ;
- rename scope => circle in column, + translations
2015-12-14 22:55:13 +01:00

59 lines
2.5 KiB
Twig

{#
* Copyright (C) 2014, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
#}
{% extends "ChillPersonBundle::layout.html.twig" %}
{% set activeRouteKey = 'report_select_type' %}
{% block title %}{{ 'Report list' |trans }}{% endblock title %}
{% block personcontent %}
<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>
</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.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>
</li>
{% endif %}
{% if is_granted('CHILL_REPORT_UPDATE', report) %}
<li>
<a href="{{ path('report_edit', { 'person_id': report.person.id, 'report_id': report.id }) }}" class="sc-button bt-update">{{ 'Update' | trans }}</a>
</li>
{% endif %}
</ul>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}