accompanying period: add location to accompanying period + add delete button

This commit is contained in:
juminet
2022-01-10 11:03:14 +00:00
committed by Julien Fastré
parent 8de5c8900a
commit 921dd639bf
24 changed files with 391 additions and 15 deletions

View File

@@ -0,0 +1,31 @@
{% macro insert_onthefly(type, entity) %}
{% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
action: 'show', displayBadge: true,
targetEntity: { name: type, id: entity.id },
buttonText: entity|chill_entity_render_string
} %}
{% endmacro %}
<div>
{% if accompanyingCourse.participations is not empty %}
<div class="col mb-4">
<h4 class="item-key">{{ 'Persons associated'|trans }}</h4>
{% for r in accompanyingCourse.participations %}
{{ _self.insert_onthefly('person', r.person) }}
{% endfor %}
</div>
{% endif %}
{% if accompanyingCourse.socialIssues is not empty %}
<div class="col mb-4">
<h4 class="item-key">{{ 'Social issues'|trans }}</h4>
{% for s in accompanyingCourse.socialIssues %}
{{ s|chill_entity_render_box }}
{% endfor %}
</div>
{% endif %}
</div>

View File

@@ -0,0 +1,18 @@
{% extends '@ChillPerson/AccompanyingCourse/layout.html.twig' %}
{% block title %}{{ 'Delete accompanying period'|trans }}{% endblock %}
{% block content %}
{% include '@ChillPerson/AccompanyingCourse/_confirm_delete.html.twig' %}
{{ include('@ChillMain/Util/confirmation_template.html.twig',
{
'title' : 'Delete accompanying period'|trans,
'confirm_question' : 'Are you sure you want to remove the accompanying period "%id%" ?'|trans({ '%id%' : accompanyingCourse.id } ),
'cancel_route' : 'chill_person_accompanying_course_edit',
'cancel_parameters' : {'accompanying_period_id' : accompanyingCourse.id},
'form' : delete_form
} ) }}
{% endblock %}

View File

@@ -0,0 +1,18 @@
{% extends '@ChillPerson/AccompanyingCourse/layout.html.twig' %}
{% block title %}{{ 'Delete accompanying period'|trans }}{% endblock %}
{% block content %}
{% include '@ChillPerson/AccompanyingCourse/_confirm_delete.html.twig' %}
{{ include('@ChillMain/Util/confirmation_template.html.twig',
{
'title' : 'Delete accompanying period'|trans,
'confirm_question' : 'Are you sure you want to remove the accompanying period "%id%" ?'|trans({ '%id%' : accompanyingCourse.id } ),
'cancel_route' : 'chill_person_accompanying_period_list',
'cancel_parameters' : {'person_id' : person_id},
'form' : delete_form
} ) }}
{% endblock %}

View File

@@ -149,6 +149,15 @@
</div>
{% endif %}
{% if accompanyingCourse.administrativeLocation is not null %}
<div class="mbloc col col-sm-6 col-lg-4">
<div class="administrative-location">
<h4 class="item-key">{{ 'accompanying_course.administrative_location'|trans }}</h4>
{{ accompanyingCourse.administrativeLocation.name }} ({{ accompanyingCourse.administrativeLocation.locationType.title|localize_translatable_string }})
</div>
</div>
{% endif %}
</div>
<div class="social-actions my-4">

View File

@@ -3,7 +3,6 @@
{% for accompanying_period in accompanying_periods %}
<div class="item-bloc">
<div class="item-row">
<div class="wrap-header">
<div class="wh-row">
<div class="wh-col">
@@ -127,6 +126,12 @@
<a href="{{ path('chill_person_accompanying_course_index', { 'accompanying_period_id': accompanying_period.id }) }}"
class="btn btn-show" title="{{ 'See accompanying period'|trans }}">{# {{ 'See this period'|trans }} #}</a>
</li>
{% if accompanying_period.step == 'DRAFT' %}
<li>
<a href="{{ path('chill_person_accompanying_course_delete', { 'accompanying_period_id': accompanying_period.id, 'person_id' : person.id }) }}"
class="btn btn-delete" title="{{ 'Delete accompanying period'|trans }}">{# {{ 'Delete this period'|trans }} #}</a>
</li>
{% endif %}
<!-- if new accompanying course, this is not necessary
{% if person is defined %}