This commit is contained in:
Mathieu Jaumotte 2021-03-25 09:46:20 +01:00
parent bc240a6754
commit a13766e7d7
2 changed files with 71 additions and 41 deletions

View File

@ -24,7 +24,7 @@
{% block personcontent %} {% block personcontent %}
<h2>{{ 'Events participation' |trans }}</h2> <h2>{{ 'Events participation' |trans }}</h2>
<table class="events"> <table class="table table-striped table-bordered mt-3 events">
<thead> <thead>
<tr> <tr>
<th class="chill-green">{{ 'Date'|trans }}</th> <th class="chill-green">{{ 'Date'|trans }}</th>
@ -44,53 +44,58 @@
<td>{{ participation.role.name|localize_translatable_string }}</td> <td>{{ participation.role.name|localize_translatable_string }}</td>
<td>{{ participation.status.name|localize_translatable_string }}</td> <td>{{ participation.status.name|localize_translatable_string }}</td>
<td> <td>
<ul class="record_actions"> <ul class="list-inline">
<li>
{% set currentPath = path(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')) %} {% set currentPath = path(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')) %}
{% set returnLabel = 'Back to %person% events'|trans({ '%person%' : currentPerson } ) %} {% set returnLabel = 'Back to %person% events'|trans({ '%person%' : currentPerson } ) %}
{% if is_granted('CHILL_EVENT_SEE_DETAILS', participation.event) %} {% if is_granted('CHILL_EVENT_SEE_DETAILS', participation.event) %}
<a href="{{ path('chill_event__event_show', { 'event_id' : participation.event.id, 'return_path' : currentPath, 'return_label' : returnLabel } ) }}" <li class="list-inline-item">
class="sc-button bt-show" title="{{ 'See details of the event'|trans }}"></a> <a href="{{ path('chill_event__event_show', { 'event_id' : participation.event.id, 'return_path' : currentPath, 'return_label' : returnLabel } ) }}"
{% endif %} class="btn btn-primary btn-sm" title="{{ 'See details of the event'|trans }}"><i class="fa fa-fw fa-eye"></i></a>
</li>
{% endif %}
{% if is_granted('CHILL_EVENT_UPDATE', participation.event) {% if is_granted('CHILL_EVENT_UPDATE', participation.event)
and is_granted('CHILL_EVENT_PARTICIPATION_UPDATE', participation) %} and is_granted('CHILL_EVENT_PARTICIPATION_UPDATE', participation) %}
<div class="bt-dropdown"> <li class="list-inline-item">
<a href="" class="sc-button bt-update"></a> <div class="bt-dropdown">
<div class="bt-dropdown-content"> <a href="" class="btn btn-warning btn-sm"><i class="fa fa-fw fa-pencil"></i></a>
<div class="bt-dropdown-content">
<a href="{{ path('chill_event__event_edit', { 'event_id' : participation.event.id, 'return_path' : currentPath, 'return_label' : returnLabel }) }}"
class="sc-button bt-update">
{{ 'Edit the event'|trans }}
</a>
<a href="{{ path('chill_event_participation_edit', { 'participation_id' : participation.id, 'return_path' : currentPath, 'return_label' : returnLabel }) }}"
class="sc-button bt-update">
{{ 'Edit the participation'|trans }}
</a>
</div>
</div>
{% else %}
{% if is_granted('CHILL_EVENT_UPDATE', participation.event) %}
<a href="{{ path('chill_event__event_edit', { 'event_id' : participation.event.id, 'return_path' : currentPath, 'return_label' : returnLabel }) }}" <a href="{{ path('chill_event__event_edit', { 'event_id' : participation.event.id, 'return_path' : currentPath, 'return_label' : returnLabel }) }}"
class="sc-button bt-update"> class="btn btn-warning btn-sm">
{{ 'Edit the event'|trans }} {{ 'Edit the event'|trans }}
</a> </a>
{% endif %}
{% if is_granted('CHILL_EVENT_PARTICIPATION_UPDATE', participation) %}
<a href="{{ path('chill_event_participation_edit', { 'participation_id' : participation.id, 'return_path' : currentPath, 'return_label' : returnLabel }) }}" <a href="{{ path('chill_event_participation_edit', { 'participation_id' : participation.id, 'return_path' : currentPath, 'return_label' : returnLabel }) }}"
class="sc-button bt-update"> class="btn btn-warning btn-sm">
{{ 'Edit the participation'|trans }} {{ 'Edit the participation'|trans }}
</a> </a>
{% endif %}
{% endif %}
</div>
</div>
</li> </li>
{% else %}
<li class="list-inline-item">
{% if is_granted('CHILL_EVENT_UPDATE', participation.event) %}
<a href="{{ path('chill_event__event_edit', { 'event_id' : participation.event.id, 'return_path' : currentPath, 'return_label' : returnLabel }) }}"
class="btn btn-warning btn-sm">
{{ 'Edit the event'|trans }}
</a>
{% endif %}
{% if is_granted('CHILL_EVENT_PARTICIPATION_UPDATE', participation) %}
<a href="{{ path('chill_event_participation_edit', { 'participation_id' : participation.id, 'return_path' : currentPath, 'return_label' : returnLabel }) }}"
class="btn btn-warning btn-sm">
{{ 'Edit the participation'|trans }}
</a>
{% endif %}
</li>
{% endif %}
</ul> </ul>
</td> </td>
</tr> </tr>
@ -103,12 +108,33 @@
{{ chill_pagination(paginator) }} {{ chill_pagination(paginator) }}
{% endif %} {% endif %}
<div style="margin-bottom: 1.5em; margin-top: 2.5em;"> {% form_theme form_add_event_participation_by_person 'bootstrap_4_layout.html.twig' %}
{{ form_start(form_add_event_participation_by_person) }}
{{ form_widget(form_add_event_participation_by_person.event_id, { 'attr' : { 'style' : 'width: 25em; display:inline-block; ' } } ) }} <div class="input-group mb-3">
{{ form_widget(form_add_event_participation_by_person.submit, { 'attr' : { 'class' : 'sc-button bt-create' } } ) }} {{ form_start(form_add_event_participation_by_person) }}
{{ form_rest(form_add_event_participation_by_person) }} {#
{{ form_end(form_add_event_participation_by_person) }} <input type="text" class="form-control" placeholder="Recipient's username" aria-label="Recipient's username" aria-describedby="button-addon2">
#}
{{ form_widget(form_add_event_participation_by_person.event_id, { 'attr' : { 'class' : 'form-control' } } ) }}
<div class="input-group-append input-group-btn">
{#
<button class="btn btn-outline-secondary" type="button" id="button-addon2">Button</button>
#}
{{ form_widget(form_add_event_participation_by_person.submit, { 'attr' : { 'class' : 'btn btn-success' } } ) }}
</div>
{{ form_rest(form_add_event_participation_by_person) }}
{{ form_end(form_add_event_participation_by_person) }}
</div>
{#
{{ form(form_add_event_participation_by_person) }}
#}
<div class="input-group mb-3">
<input class="form-control" placeholder="Recipient's username">
<div class="input-group-append">
<button class="btn btn-success">Button</button>
</div>
</div> </div>
{% endblock %} {% endblock %}

View File

@ -53,6 +53,10 @@ form {
} }
} }
} }
label.required:after {
content: " *";
color: $red;
}
} }
.sticky-form-buttons { .sticky-form-buttons {