Julien Fastré 993882e925 feature: update an existing participation
The update allow to modify the status and role of a participation.

ref #8
2016-03-24 14:18:03 +01:00

93 lines
3.7 KiB
Twig

{% extends 'ChillEventBundle::layout.html.twig' %}
{% block title 'Event : %label%'|trans({ '%label%' : event.label } ) %}
{% import 'ChillPersonBundle:Person:macro.html.twig' as person_macro %}
{% block event_content -%}
<h1>{{ 'Details of an event'|trans }}</h1>
<table class="record_properties">
<tbody>
<tr>
<th>{{ 'Name'|trans }}</th>
<td>{{ event.label }}</td>
</tr>
<tr>
<th>{{ 'Date'|trans }}</th>
<td>{{ event.date|localizeddate('long', 'none') }}</td>
</tr>
<tr>
<th>{{ 'Event type'|trans }}</th>
<td>{{ event.type.label|localize_translatable_string }}</td>
</tr>
<tr>
<th>{{ 'Circle'|trans }}</th>
<td>{{ event.circle.name|localize_translatable_string }}</td>
</tr>
</tbody>
</table>
<ul class="record_actions">
<li>
<a href="{{ path('event_edit', { 'id': event.id }) }}" class="sc-button btn-edit">
{{ 'Edit'|trans }}
</a>
</li>
</ul>
<h2>{{ 'Participations'|trans }}</h2>
{% set count = event.participations|length %}
<p>{% transchoice count %}%count% participations to this event{% endtranschoice %}</p>
{% if count > 0 %}
<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 event.participations %}
<tr>
<td>{{ person_macro.render(participation.person) }}</td>
<td>{{ participation.role.label|localize_translatable_string }}</td>
<td>{{ participation.status.label|localize_translatable_string }}</td>
<td>{{ participation.lastUpdate|time_diff }} <i class="fa fa-calendar-o" title="{{ participation.lastUpdate|localizeddate("long", "medium")|escape('html_attr') }}"></i></td>
<td>
<ul class="record_actions">
{% if is_granted('CHILL_EVENT_PARTICIPATION_UPDATE', participation) %}
<li>
<a href="{{ path('chill_event_participation_edit', { 'participation_id' : participation.id } ) }}"
class="sc-button btn-edit">
{{ 'Edit'|trans }}
</a>
</li>
{% endif %}
</ul>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<ul class="record_actions">
<li><a href="#" class="sc-button btn-edit">{{ 'Edit all the participations'|trans }}</a></li>
<li><div style="padding-left: 3em;">
{{ form_start(form_add_participation_by_person) }}
{{ form_widget(form_add_participation_by_person.person_id, { 'attr' : { 'style' : 'width: 20em; display:inline-block; ' } } ) }}
{{ form_widget(form_add_participation_by_person.submit, { 'attr' : { 'class' : 'sc-button btn-create' } } ) }}
{{ form_rest(form_add_participation_by_person) }}
{{ form_end(form_add_participation_by_person) }}
</div>
</li>
</ul>
{% endif %}
{% endblock %}