mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-22 02:04:24 +00:00
improve actions buttons display for granted cases
This commit is contained in:
parent
f71e273aae
commit
91124893fd
@ -16,7 +16,6 @@
|
||||
#}
|
||||
{% extends "ChillPersonBundle::layout.html.twig" %}
|
||||
|
||||
|
||||
{% set activeRouteKey = 'chill_event__list_by_person' %}
|
||||
|
||||
{% block title %}{{ 'Events participation' |trans }}{% endblock title %}
|
||||
@ -38,11 +37,7 @@
|
||||
<tbody>
|
||||
{% for participation in participations %}
|
||||
<tr>
|
||||
<td>
|
||||
<a href="{{ path('chill_event__event_show', { 'event_id': participation.event.id }) }}">
|
||||
{{ participation.event.name }}
|
||||
</a>
|
||||
</td>
|
||||
<td>{{ participation.event.name }}</td>
|
||||
<td>{{ participation.event.date|localizeddate('long', 'short') }}</td>
|
||||
<td>{{ participation.event.type.name|localize_translatable_string }}</td>
|
||||
<td>{{ participation.role.name|localize_translatable_string }}</td>
|
||||
@ -50,21 +45,40 @@
|
||||
<td>
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
{% if is_granted('CHILL_EVENT_SEE_DETAILS', participation.event) %} #}
|
||||
<a href="{{ path('chill_event__event_show', { 'event_id' : participation.event.id } ) }}" class="sc-button black">
|
||||
{{ 'See'|trans }}
|
||||
</a>
|
||||
{% if is_granted('CHILL_EVENT_SEE_DETAILS', participation.event) %}
|
||||
<a href="{{ path('chill_event__event_show', { 'event_id' : participation.event.id } ) }}" class="sc-button bt-show"></a>
|
||||
{% endif %}
|
||||
{% if is_granted('CHILL_EVENT_UPDATE', participation.event) %}
|
||||
|
||||
{% if is_granted('CHILL_EVENT_UPDATE', participation.event)
|
||||
and is_granted('CHILL_EVENT_PARTICIPATION_UPDATE', participation) %}
|
||||
|
||||
<div class="bt-dropdown">
|
||||
<a href="" class="sc-button bt-update"></a>
|
||||
<div class="bt-dropdown-content">
|
||||
|
||||
<a href="{{ path('chill_event__event_edit', { 'event_id' : participation.event.id } ) }}" class="sc-button bt-update">
|
||||
{{ 'Edit'|trans }}
|
||||
{{ 'Event edit'|trans }}
|
||||
</a>
|
||||
<a href="{{ path('chill_event_participation_edit', { 'participation_id' : participation.id } ) }}" class="sc-button bt-update">
|
||||
{{ 'Participation Edit'|trans }}
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
|
||||
{% if is_granted('CHILL_EVENT_UPDATE', participation.event) %}
|
||||
<a href="{{ path('chill_event__event_edit', { 'event_id' : participation.event.id } ) }}" class="sc-button bt-update has-hidden">
|
||||
<span class="show-on-hover">{{ 'Event edit'|trans }}</span>
|
||||
</a>
|
||||
{% endif %}
|
||||
{% if is_granted('CHILL_EVENT_PARTICIPATION_UPDATE', participation) %}
|
||||
<a href="{{ path('chill_event_participation_edit', { 'participation_id' : participation.id } ) }}" class="sc-button bt-edit">
|
||||
{{ 'Edit'|trans }}
|
||||
<a href="{{ path('chill_event_participation_edit', { 'participation_id' : participation.id } ) }}" class="sc-button bt-update has-hidden">
|
||||
<span class="show-on-hover">{{ 'Participation Edit'|trans }}</span>
|
||||
</a>
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
</li>
|
||||
</ul>
|
||||
</td>
|
||||
@ -73,23 +87,12 @@
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
{% if participations|length < paginator.getTotalItems %}
|
||||
{{ chill_pagination(paginator) }}
|
||||
{% endif %}
|
||||
|
||||
|
||||
{#
|
||||
<pre>
|
||||
/!\ dev notes
|
||||
=============
|
||||
- problème de cohérence avec le bouton voir et avec le bouton modifier
|
||||
- checker les autorisations pour les boutons
|
||||
- affichage différencié pour les événements passés/présents/futur
|
||||
- person menu, utiliser authorizationHelper ou authorizationChecker ??
|
||||
</pre>
|
||||
|
||||
{{ dump() }}
|
||||
#}
|
||||
{{ dump() }}
|
||||
|
||||
{% endblock %}
|
@ -27,7 +27,7 @@
|
||||
{{ form_row(form.status) }}
|
||||
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<li class="cancel">
|
||||
<a href="{{ path('chill_event__event_show', { 'event_id' : participation.event.id } ) }}" class="sc-button bt-cancel">
|
||||
{{ 'Back to the event'|trans }}
|
||||
</a>
|
||||
|
@ -32,7 +32,7 @@
|
||||
|
||||
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<li class="cancel">
|
||||
<a href="{{ path('chill_event__event_show', { 'event_id' : participation.event.id } ) }}" class="sc-button btn-cancel">
|
||||
<i class="fa fa-arrow-left"></i>
|
||||
{{ 'Back to the event'|trans }}
|
||||
|
Loading…
x
Reference in New Issue
Block a user