add the possibility to add a participation of a person to an event

ref #5
This commit is contained in:
2016-03-24 01:44:32 +01:00
parent 167a147f52
commit 627b9fb08f
13 changed files with 489 additions and 5 deletions

View File

@@ -1,3 +1,7 @@
chill_event_participation_new:
path: /new
defaults: { _controller: ChillEventBundle:Participation:new }
chill_event_participation_create:
path: /create
defaults: { _controller: ChillEventBundle:Participation:create }

View File

@@ -6,3 +6,11 @@ services:
tags:
- { name: chill.role }
- { name: security.voter }
chill_event.event_participation:
class: Chill\EventBundle\Security\Authorization\ParticipationVoter
arguments:
- "@chill.main.security.authorization.helper"
tags:
- { name: chill.role }
- { name: security.voter }

View File

@@ -14,3 +14,10 @@ services:
- "@chill.main.helper.translatable_string"
tags:
- { name: form.type }
chill.event.form.participation_type:
class: Chill\EventBundle\Form\ParticipationType
arguments:
- "@chill.main.helper.translatable_string"
tags:
- { name: form.type }

View File

@@ -0,0 +1,10 @@
Chill\EventBundle\Event\Participation:
properties:
event:
- NotNull: ~
status:
- NotNull: ~
person:
- NotNull: ~
constraints:
- Callback: [isConsistent]

View File

@@ -12,9 +12,13 @@ Last update: Dernière mise à jour
#CRUD
Details of an event: Détails d'un événement
Edit all the participations: Modifier toutes les participations
Add a participation: Ajouter un participant
Participation creation: Ajouter une participation
Associated person: Personne associée
Associated event: Événement associé
Back to the event: Retour à l'événement
The participation was created: La participation a été créée
#search
Event search: Recherche d'événements

View File

@@ -75,9 +75,11 @@
<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>

View File

@@ -0,0 +1,37 @@
{% extends 'ChillEventBundle::layout.html.twig' %}
{% import 'ChillPersonBundle:Person:macro.html.twig' as person_macro %}
{% block event_content -%}
<h1>{{ 'Participation creation'|trans }}</h1>
<table>
<tbody>
<tr>
<th>{{ 'Associated person'|trans }}</th>
<td>{{ person_macro.render(participation.person) }}</td>
</tr>
<tr>
<th>{{ 'Associated event'|trans }} </th>
<td>{{ participation.event.label }}</td>
</tr>
</tbody>
</table>
{{ form_start(form) }}
{{ form_row(form.role) }}
{{ form_row(form.status) }}
<ul class="record_actions">
<li>
<a href="{{ path('event_show', { 'event_id' : participation.event.id } ) }}" class="sc-button btn-cancel">
{{ 'Back to the event'|trans }}
</a>
</li>
<li>
{{ form_widget(form.submit, { 'attr' : { 'class' : 'sc-button btn-create' } } ) }}
</li>
</ul>
{{ form_end(form) }}
{% endblock %}