[feature] allow to edit multiple participations at once

ref #7
This commit is contained in:
2016-04-12 22:40:11 +02:00
parent c1b9069138
commit 78c53fe7b0
6 changed files with 220 additions and 3 deletions

View File

@@ -14,3 +14,12 @@ chill_event_participation_update:
path: /{participation_id}/update
defaults: { _controller: ChillEventBundle:Participation:update }
methods: [POST]
chill_event_participation_edit_multiple:
path: /{event_id}/edit_multiple
defaults: { _controller: ChillEventBundle:Participation:editMultiple }
chill_event_participation_update_multiple:
path: /{event_id}/update_multiple
defaults: { _controller: ChillEventBundle:Participation:updateMultiple }
methods: [POST]

View File

@@ -8,6 +8,7 @@ Event: Événement
Events: Événements
'Event : %label%': Événement "%label%"
Participation: Participation
Participations: Participations
Status: Statut
Last update: Dernière mise à jour
'%count% participations to this event': '{0} Aucun participant à l''événement | {1} Un participant à l''événement | ]1,Inf] %count% participants à l''événement'
@@ -34,6 +35,8 @@ The participation was updated: La participation a été mise à jour
Participation Edit: Modifier une participation
'Any of the requested people may be added on the event: they are maybe already participating.': 'Aucune des personnes suggérées ne peut être ajoutée à l''événement: elles sont peut-être déjà inscrites comme participantes.'
'The following people have been ignored because they are already participating on the event': '{1} La personne suivante a été ignorée parce qu''elle participe déjà à l''événement | ]1,Inf] Les personnes suivantes ont été ignorées parce qu''elles participent déjà à l''événement'
There are no participation to edit for this event: Il n'y a pas de participation pour cet événement
The participations have been successfully updated.: Les participations ont été mises à jour.
#search
Event search: Recherche d'événements

View File

@@ -80,7 +80,7 @@
<ul class="record_actions">
{% if count > 0 %}
<li><a href="#" class="sc-button bt-edit">{{ 'Edit all the participations'|trans }}</a></li>
<li><a href="{{ path('chill_event_participation_edit_multiple', { 'event_id' : event.id } ) }}" class="sc-button bt-edit">{{ 'Edit all the participations'|trans }}</a></li>
{% endif %}
</ul>

View File

@@ -0,0 +1,60 @@
{% extends 'ChillEventBundle::layout.html.twig' %}
{% import 'ChillPersonBundle:Person:macro.html.twig' as person_macro %}
{% block event_content -%}
<h1>{{ 'Participation Edit'|trans }}</h1>
<table>
<tbody>
<tr>
<th>{{ 'Associated event'|trans }} </th>
<td>{{ event.name }}</td>
</tr>
<tr>
<th>{{ 'Date'|trans }} </th>
<td>{{ event.date|localizeddate('long', 'none') }}</td>
</tr>
</tbody>
</table>
<h2>{{ 'Participations'|trans }}</h2>
{{ form_start(form) }}
<table>
<thead>
<tr>
<th>{{ 'Person'|trans }}</th>
<th>{{ 'Role'|trans }}</th>
<th>{{ 'Status'|trans }}</th>
<th>{{ 'Last update'|trans }}</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
{% for participation in form.participations %}
<tr>
<td>{{ person_macro.render(participation.vars.value.person) }}</td>
<td>{{ form_widget(participation.role) }}</td>
<td>{{ form_widget(participation.status) }}</td>
<td>{{ participation.vars.value.lastUpdate|time_diff }} <i class="fa fa-info-circle" title="{{ participation.vars.value.lastUpdate|localizeddate("long", "medium")|escape('html_attr') }}"></i></td>
</tr>
{% endfor %}
</tbody>
</table>
<ul class="record_actions">
<li>
<a href="{{ path('chill_event__event_show', { 'event_id' : event.id } ) }}" class="sc-button bt-cancel">
<i class="fa fa-arrow-left"></i>
{{ 'Back to the event'|trans }}
</a>
</li>
<li>
{{ form_widget(form.submit, { 'attr' : { 'class' : 'sc-button bt-edit' } } ) }}
</li>
</ul>
{{ form_end(form) }}
{% endblock %}