Adjust templates and translations

This commit is contained in:
Julie Lenaerts 2025-04-29 10:03:57 +02:00
parent bc555ce3f5
commit 1836e24acd
6 changed files with 112 additions and 97 deletions

View File

@ -17,9 +17,6 @@ use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
class AdminMenuBuilder implements LocalMenuBuilderInterface
{
/**
* @var AuthorizationCheckerInterface
*/
protected AuthorizationCheckerInterface $authorizationChecker;
public function __construct(AuthorizationCheckerInterface $authorizationChecker)
@ -53,7 +50,7 @@ class AdminMenuBuilder implements LocalMenuBuilderInterface
'route' => 'chill_event_admin_role',
])->setExtras(['order' => 6530]);
$menu->addChild('Theme', [
$menu->addChild('event.theme.label', [
'route' => 'chill_crud_event_theme_index',
])->setExtras(['order' => 6540]);
}

View File

@ -17,6 +17,7 @@
{{ form_row(edit_form.date) }}
{{ form_row(edit_form.type, { label: "Event type" }) }}
{{ form_row(edit_form.themes) }}
{{ form_row(edit_form.moderator) }}
{{ form_row(edit_form.location) }}
{{ form_row(edit_form.organizationCost) }}

View File

@ -13,10 +13,12 @@
{{ form_start(form) }}
{{ form_errors(form) }}
{{ form_row(form.circle) }}
{# {{ form_row(form.circle) }}#}
{{ form_row(form.name) }}
{{ form_row(form.circle) }}
{{ form_row(form.date) }}
{{ form_row(form.type, { label: "Event type" }) }}
{{ form_row(form.themes) }}
{{ form_row(form.moderator) }}
{{ form_row(form.location) }}
{{ form_row(form.organizationCost) }}

View File

@ -41,6 +41,11 @@ block js %}
{{ e.moderator | chill_entity_render_box }}
</p>
{% endif %}
<div>
{% for t in e.themes %}
<span>{{ t|chill_entity_render_box }}</span>
{% endfor %}
</div>
</div>
<div class="item-col">
<div class="container" style="text-align: right">

View File

@ -38,6 +38,14 @@
<th>{{ 'Event type'|trans }}</th>
<td>{{ event.type.name|localize_translatable_string }}</td>
</tr>
<tr>
<th>{{ 'event.theme.label'|trans }}
<td>
{% for t in event.themes %}
{{ t|chill_entity_render_box }}
{% endfor %}
</td>
</tr>
<tr>
<th>{{ 'Moderator'|trans }}</th>
<td>{{ event.moderator|trans|default('-') }}</td>
@ -80,6 +88,97 @@
</div>
{% endif %}
<div class="participations-wrapper" style="background-color: whitesmoke; padding: 1rem; margin-bottom: .5rem;">
<h2>{{ 'Participations'|trans }}</h2>
{% set count = event.participations|length %}
<p>{{ 'count participations to this event'|trans({'count': count}) }}</p>
{% if count > 0 %}
<table class="table table-bordered border-dark align-middle">
<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>
{% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
targetEntity: { name: 'person', id: participation.person.id },
action: 'show',
displayBadge: true,
buttonText: participation.person|chill_entity_render_string,
isDead: participation.person.deathdate is not null
} %}
</td>
<td>{{ participation.role.name|localize_translatable_string }}</td>
<td>{{ participation.status.name|localize_translatable_string }}</td>
<td>{{ participation.lastUpdate|ago }} {# sf4 check: filter 'time_diff' is abandoned,
alternative: knplabs/knp-time-bundle provide filter 'ago' #}
<i class="fa fa-info-circle" title="{{ participation.lastUpdate|format_date("long")|escape('html_attr') }}"></i>
</td>
<td>
<ul class="record_actions">
{% if is_granted('CHILL_EVENT_PARTICIPATION_UPDATE', participation) %}
<li>
<a href="{{ chill_path_add_return_path('chill_event_participation_edit', { 'participation_id' : participation.id }, false, 'See'|trans ) }}"
class="btn btn-edit" title="{{ 'Edit'|trans }}"></a>
</li>
<li>
<a href="{{ path('chill_event_participation_delete', {'participation_id' : participation.id } ) }}"
class="btn btn-delete" title="{{ 'Delete'|trans }}"></a>
</li>
{% endif %}
</ul>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
<div class="row">
<div class="col-8">
{{ form_start(form_add_participation_by_person) }}
<div class="input-group">
{{ form_widget(form_add_participation_by_person.person_id, { 'attr' : {
'class' : 'custom-select',
'style': 'min-width: 15em; max-width: 18em; display: inline-block;'
}} ) }}
</div>
<input type="hidden" name="returnPath" value="{{ app.request.requestUri }}" />
{{ form_end(form_add_participation_by_person) }}
</div>
</div>
<ul class="record_actions">
{% if count > 0 %}
<li>
{{ form_start(form_export, {'attr': {'id': 'export_tableur'}}) }}
<div class="input-group">
{{ form_widget(form_export.format, { 'attr' : { 'class': 'custom-select' } }) }}
<div class="input-group-append">
{{ form_widget(form_export.submit, { 'attr' : { 'class': 'btn btn-save' } }) }}
</div>
<a class="bt-"></a>
</div>
{{ form_rest(form_export) }}
{{ form_end(form_export) }}
</li>
<li><a href="{{ path('chill_event_participation_edit_multiple', { 'event_id' : event.id } ) }}" class="btn btn-edit">{{ 'Edit all the participations'|trans }}</a></li>
{% endif %}
</ul>
</div>
<div class="post_show">
{{ chill_delegated_block('block_footer_show', { 'event': event }) }}
</div>
<ul class="record_actions">
@ -100,97 +199,5 @@
</li>
</ul>
<h2>{{ 'Participations'|trans }}</h2>
{% set count = event.participations|length %}
<p>{{ 'count participations to this event'|trans({'count': count}) }}</p>
{% if count > 0 %}
<table class="table table-bordered border-dark align-middle">
<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>
{% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
targetEntity: { name: 'person', id: participation.person.id },
action: 'show',
displayBadge: true,
buttonText: participation.person|chill_entity_render_string,
isDead: participation.person.deathdate is not null
} %}
</td>
<td>{{ participation.role.name|localize_translatable_string }}</td>
<td>{{ participation.status.name|localize_translatable_string }}</td>
<td>{{ participation.lastUpdate|ago }} {# sf4 check: filter 'time_diff' is abandoned,
alternative: knplabs/knp-time-bundle provide filter 'ago' #}
<i class="fa fa-info-circle" title="{{ participation.lastUpdate|format_date("long")|escape('html_attr') }}"></i>
</td>
<td>
<ul class="record_actions">
{% if is_granted('CHILL_EVENT_PARTICIPATION_UPDATE', participation) %}
<li>
<a href="{{ chill_path_add_return_path('chill_event_participation_edit', { 'participation_id' : participation.id }, false, 'See'|trans ) }}"
class="btn btn-edit" title="{{ 'Edit'|trans }}"></a>
</li>
<li>
<a href="{{ path('chill_event_participation_delete', {'participation_id' : participation.id } ) }}"
class="btn btn-delete" title="{{ 'Delete'|trans }}"></a>
</li>
{% endif %}
</ul>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
<ul class="record_actions">
{% if count > 0 %}
<li><a href="{{ path('chill_event_participation_edit_multiple', { 'event_id' : event.id } ) }}" class="btn btn-edit">{{ 'Edit all the participations'|trans }}</a></li>
{% endif %}
</ul>
<div class="row" style="margin-bottom: 10em;">
<div class="col-8">
{{ form_start(form_add_participation_by_person) }}
<div class="input-group">
{{ form_widget(form_add_participation_by_person.person_id, { 'attr' : {
'class' : 'custom-select',
'style': 'min-width: 15em; max-width: 18em; display: inline-block;'
}} ) }}
</div>
<input type="hidden" name="returnPath" value="{{ app.request.requestUri }}" />
{{ form_end(form_add_participation_by_person) }}
</div>
<div class="col-4">
{{ form_start(form_export, {'attr': {'id': 'export_tableur'}}) }}
<div class="input-group">
{{ form_widget(form_export.format, { 'attr' : { 'class': 'custom-select' } }) }}
<div class="input-group-append">
{{ form_widget(form_export.submit, { 'attr' : { 'class': 'btn btn-save' } }) }}
</div>
<a class="bt-"></a>
</div>
{{ form_rest(form_export) }}
{{ form_end(form_export) }}
</div>
</div>
<div class="post_show">
{{ chill_delegated_block('block_footer_show', { 'event': event }) }}
</div>
</div>
{% endblock %}

View File

@ -128,6 +128,8 @@ Create a new type: Créer un nouveau type
Create a new status: Créer un nouveau statut
event:
theme:
label: Thématiques
fields:
organizationCost: Coût d'organisation
location: Localisation
@ -136,6 +138,7 @@ event:
organisationCost_help: Coût d'organisation pour la structure. Utile pour les statistiques.
add_document: Ajouter un document
remove_document: Supprimer le document
Select one or more themes: Selectionnez une ou plusieurs thématiques
filter:
event_types: Par types d'événement
event_dates: Par date d'événement