display table of events by person

This commit is contained in:
Tchama 2019-01-17 11:06:49 +01:00
parent c861c48b37
commit 7abf403463
2 changed files with 78 additions and 5 deletions

View File

@ -58,9 +58,9 @@ class PersonMenuBuilder implements LocalMenuBuilderInterface
'person_id' => $person->getId()
]
])
->setExtras([
'order' => 500
]);
->setExtras([
'order' => 500
]);
}
}

View File

@ -23,6 +23,79 @@
{% block personcontent %}
<h2>{{ 'Events participation' |trans }}</h2>
hop
{{ dump() }}
<table class="events">
<thead>
<tr>
<th class="chill-red">{{ 'Name'|trans }}</th>
<th class="chill-green">{{ 'Date'|trans }}</th>
<th class="chill-orange">{{ 'Event type'|trans }}</th>
{#
<th class="chill-green">{{ 'Circle'|trans }}</th>
<th class="chill-green">{{ 'Moderator'|trans }}</th>
#}
<th class="chill-red">{{ 'Role'|trans }}</th>
<th class="chill-green">{{ 'Status'|trans }}</th>
<th> </th>
</tr>
</thead>
<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.date|localizeddate('long', 'short') }}</td>
<td>{{ participation.event.type.name|localize_translatable_string }}</td>
{#
<td>{{ participation.event.circle.name|localize_translatable_string }}</td>
<td>{{ participation.event.moderator|trans|default('-') }}</td>
#}
<td>{{ participation.role.name|localize_translatable_string }}</td>
<td>{{ participation.status.name|localize_translatable_string }}</td>
<td>
<ul class="record_actions">
<li>
{# {% if is_granted('CHILL_EVENT_SEE_DETAILS', event) %} #}
<a href="{{ path('chill_event__event_show', { 'event_id' : participation.event.id } ) }}" class="sc-button black">
{{ 'See'|trans }}
</a>
{# {% endif %} #}
{% 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">
{{ 'Edit'|trans }}
</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>
{% endif %}
</li>
</ul>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<pre>
/!\ dev notes
=============
- problème de cohérence avec le bouton voir et avec le bouton modifier
- checker les autorisations pour les boutons
- TODO pagination
- affichage différencié pour les événements passés/présents/futur
- person menu, utiliser authorizationHelper ou authorizationChecker ??
</pre>
{#
{{ dump() }}
#}
{% endblock %}