mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-02 13:03:50 +00:00
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
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
<tr>
|
||||
<th class="chill-red">{{ 'Date' | trans }}</th>
|
||||
<th class="chill-green">{{ 'Report type' | trans }}</th>
|
||||
<th class="chill-orange">{{ 'Report scope' | trans }}</th>
|
||||
<th class="chill-orange">{{ 'Circle' | trans }}</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
@@ -37,8 +37,20 @@
|
||||
<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><a href="{{ path('report_view', { 'person_id': report.person.id, 'report_id': report.id }) }}" class="sc-button black">{{ 'View' | trans }}</a></td>
|
||||
<td><a href="{{ path('report_edit', { 'person_id': report.person.id, 'report_id': report.id }) }}" class="sc-button bt-update">{{ 'Update' | trans }}</a></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>
|
||||
|
@@ -23,7 +23,9 @@
|
||||
{% block personcontent %}
|
||||
{{ form_start(form) }}
|
||||
|
||||
{{ form_widget(form) }}
|
||||
{{ form_row(form.user) }}
|
||||
{{ form_row(form.date) }}
|
||||
{{ form_row(form.scope) }}
|
||||
<div class="grid-12 centered sticky-form-buttons">
|
||||
<button class="sc-button green margin-10" type="submit"><i class="fa fa-save"></i> {{ 'Add report'|trans }}</button>
|
||||
</div>
|
||||
|
@@ -27,8 +27,8 @@
|
||||
<dl>
|
||||
<dt>{{ 'Person'|trans }} :</dt>
|
||||
<dd>{{ entity.person }}</dd>
|
||||
<dt>{{ 'Scope'|trans }} :</dt>
|
||||
<dd><span class="scope">{{ entity.scope.name|localize_translatable_string }}</span></dd>
|
||||
<dt>{{ 'Circle'|trans }} :</dt>
|
||||
<dd><span class="scope circle">{{ entity.scope.name|localize_translatable_string }}</span></dd>
|
||||
<dt>{{ 'Date'|trans }} :</dt>
|
||||
<dd>{{ entity.date|localizeddate('long', 'none') }}</dd>
|
||||
<dt>{{ 'User'|trans }} :</dt>
|
||||
@@ -38,7 +38,8 @@
|
||||
|
||||
{{ chill_custom_fields_group_widget(entity.cFData, entity.cFGroup) }}
|
||||
</dl>
|
||||
|
||||
|
||||
{% if is_granted('CHILL_REPORT_UPDATE', entity) %}
|
||||
<a class="sc-button bt-update" href="{{ path('report_edit', { 'person_id': entity.person.id, 'report_id': entity.id }) }}"><i class="fa fa-pencil"></i> {{ 'Update the report' | trans }}</a>
|
||||
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
Reference in New Issue
Block a user