Merge branch 'master' into 'feature/add-requestor-in-search-results'

# Conflicts:
#   CHANGELOG.md
This commit is contained in:
2021-10-03 19:16:17 +00:00
58 changed files with 868 additions and 439 deletions

View File

@@ -1,41 +1,16 @@
<div class="border border-warning">
<div class="alert alert-warning alert-with-actions mb-0">
<div class="message">
{{ 'Some peoples does not belong to any household currently. Add them to an household soon'|trans }}
</div>
<ul class="record_actions">
<li>
<button class="btn btn-chill-beige" data-bs-toggle="collapse" href="#withoutHouseholdList">
<i class="fa fa-fw fa-caret-down"></i><span class="">{{ 'Add to household now'|trans }}</span>
</button>
</li>
</ul>
</div>
<div id="withoutHouseholdList" class="collapse p-3">
<form method="GET"
action="{{ path('chill_person_household_members_editor') }}">
<h3>{{ 'household.Select people to move'|trans }}</h3>
<ul>
{% for p in withoutHousehold %}
<li>
<input type="checkbox" name="persons[]" value="{{ p.id }}" checked />
{{ p|chill_entity_render_box }}
</li>
{% endfor %}
</ul>
<input type="hidden" name="expand_suggestions" value="true" />
<input type="hidden" name="returnPath" value="{{ app.request.requestUri|escape('html_attr') }}" />
<input type="hidden" name="accompanying_period_id" value="{{ accompanyingCourse.id }}" />
<ul class="record_actions mb-0">
<div class="alert alert-warning alert-with-actions">
<div class="float-button bottom"><div class="box">
<div class="action">
<ul class="record_actions">
<li>
<button type="submit" class="btn btn-edit">
{{ 'household.Household editor'|trans }}
</button>
<a class="btn btn-sm btn-update change-icon"
href="{{ path('chill_person_accompanying_course_edit', { 'accompanying_period_id': accompanyingCourse.id, '_fragment': 'section-10' }) }}">
<i class="fa fa-fw fa-crosshairs"></i>
Corriger
</a>
</li>
</ul>
</form>
</div>
</div>
{{ 'Some peoples does not belong to any household currently. Add them to an household soon'|trans }}
</div></div>
</div>

View File

@@ -0,0 +1,16 @@
<div class="alert alert-warning">
<div class="float-button bottom"><div class="box">
<div class="action">
<ul class="record_actions">
<li>
<a class="btn btn-sm btn-update change-icon"
href="{{ path('chill_person_accompanying_course_edit', { 'accompanying_period_id': accompanyingCourse.id, '_fragment': 'section-100' } ) }}">
<i class="fa fa-fw fa-crosshairs"></i>
{{ 'Edit & activate accompanying course'|trans }}
</a>
</li>
</ul>
</div>
<p>{{ 'This accompanying course is still a draft'|trans }}</p>
</div></div>
</div>

View File

@@ -1,61 +1,23 @@
{%- set countPersonLocation = accompanyingCourse.availablePersonLocation|length -%}
{%- set hasPersonLocation = countPersonLocation|length > 0 -%}
{% macro quickLocationForm(accompanyingCourse, person, whichButton) %}
<form method="PATCH" action="{{ path('chill_api_single_accompanying_course__entity', {'id': accompanyingCourse.id, '_format': 'json'}) }}" class="quickLocationForm">
<input type="hidden" name="personLocation" value="{{ person.id }}" />
<input type="hidden" name="periodId" value="{{ accompanyingCourse.id }}" />
{% if whichButton == 'string' %}
<button type="submit" class="btn btn-chill-pink">
<span class="text-light">{{ 'Locate by'|trans }} {{ person|chill_entity_render_string }}</span>
</button>
{% elseif whichButton == 'icon' %}
<button type="submit" class="btn btn-sm btn-secondary">
<i class="fa fa-map-marker"></i>
</button>
{% endif %}
</form>
{% endmacro %}
<div class="border border-danger">
<div class="alert alert-danger {% if hasPersonLocation %}alert-with-actions{% endif %} mb-0">
<div class="message">
{{ 'This course is located at a temporarily address. You should locate this course to an user'|trans }}
{% if not hasPersonLocation %}
{{ 'Associate at least one member with an household, and set an address to this household'|trans }}
{% endif %}
</div>
{% if 1 == countPersonLocation %}
{%- set hasPersonLocation = countPersonLocation > 0 -%}
<div class="alert alert-danger {% if hasPersonLocation %}alert-with-actions{% endif %}">
<div class="float-button bottom"><div class="box">
<div class="action">
<ul class="record_actions">
<li>
{{ _self.quickLocationForm(accompanyingCourse, accompanyingCourse.availablePersonLocation.first, 'string') }}
<a class="btn btn-sm btn-update change-icon"
href="{{ path('chill_person_accompanying_course_edit', { 'accompanying_period_id': accompanyingCourse.id, '_fragment': 'section-20' }) }}">
<i class="fa fa-fw fa-crosshairs"></i>
Corriger
</a>
</li>
</ul>
{% elseif 1 < countPersonLocation %}
<ul class="record_actions">
<li>
<button class="btn btn-chill-pink" data-bs-toggle="collapse" href="#locateAtPerson">
<i class="fa fa-fw fa-caret-down"></i><span class="text-light">{{ 'Choose a person to locate by'|trans }}</span>
</button>
</li>
</ul>
{% endif %}
</div>
{% if 1 < countPersonLocation %}
<div id="locateAtPerson" class="collapse">
<p>{{ 'Locate by'|trans }}:</p>
<div class="flex-table mb-3">
{% for p in accompanyingCourse.availablePersonLocation %}
<div class="item-bloc">
{{ p|chill_entity_render_box({
'render': 'bloc', 'addLink': false, 'addInfo': true, 'addAltNames': false, 'customButtons': {
'replace': _self.quickLocationForm(accompanyingCourse, p, 'icon')
}
}) }}
</div>
{% endfor %}
</div>
</div>
{% endif %}
<p>
{{ 'This course is located at a temporarily address. You should locate this course to an user'|trans }}</p>
{% if not hasPersonLocation %}
<p>
{{ 'Associate at least one member with an household, and set an address to this household'|trans }}</p>
{% endif %}
</div></div>
</div>

View File

@@ -21,22 +21,69 @@
{% endblock %}
{% block content %}
<div class="accompanyingcourse-resume">
<div class="accompanyingcourse-resume row">
<div class="associated-persons mb-5">
{% for h in participationsByHousehold %}
{% set householdClass = (h.household is not null) ? 'household-' ~ h.household.id : 'no-household alert alert-warning' %}
{% set householdTitle = (h.household is not null) ?
'household.Household number'|trans({'household_num': h.household.id }) : 'household.Never in any household'|trans %}
<span class="household {{ householdClass }}" title="{{ householdTitle }}">
{% if h.household is not null %}
<a href="{{ path('chill_person_household_summary', { 'household_id': h.household.id }) }}"
title="{{ 'household.Household number'|trans({'household_num': h.household.id }) }}"
><i class="fa fa-home fa-fw"></i></a>
{% endif %}
{% for p in h.members %}
{# include vue_onthefly component #}
{% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
targetEntity: { name: 'person', id: p.person.id },
action: 'show',
displayBadge: true,
buttonText: p.person|chill_entity_render_string
} %}
{% endfor %}
</span>
{% endfor %}
</div>
<div class="col-md-6 location mb-5">
{% if accompanyingCourse.locationStatus == 'person' %}
<h5>{{ 'This course is located by'|trans }}</h5>
<h4>{{ accompanyingCourse.personLocation|chill_entity_render_string }}</h4>
{% elseif accompanyingCourse.locationStatus == 'address' %}
<h4>{{ 'This course has a temporarily location'|trans }}</h4>
{% endif %}
{% if accompanyingCourse.locationStatus != 'none' %}
{{ accompanyingCourse.location|chill_entity_render_box }}
{% endif %}
</div>
{% if 'DRAFT' == accompanyingCourse.step %}
<div class="alert alert-danger flash_message mb-5">
<span>
{{ 'This accompanying course is still a draft'|trans }}
<a href="{{ path('chill_person_accompanying_course_edit', { 'accompanying_period_id': accompanyingCourse.id } ) }}">
{{ 'Edit & activate accompanying course'|trans }}
</a>
</span>
<div class="col-md-6 warnings mb-5">
{% include '@ChillPerson/AccompanyingCourse/_still_draft.html.twig' %}
</div>
{% endif %}
<pre>WIP .. AccompanyingCourse Resume dashboard</pre>
{% if accompanyingCourse.locationStatus == 'address' or accompanyingCourse.locationStatus == 'none' %}
<div class="col-md-6 warnings mb-5">
{% include '@ChillPerson/AccompanyingCourse/_warning_address.html.twig' %}
</div>
{% endif %}
{#
{% if 'DRAFT' != accompanyingCourse.step %}
{% if withoutHousehold|length > 0 %}
<div class="col-md-6 warnings mb-5">
{% include '@ChillPerson/AccompanyingCourse/_join_household.html.twig' %}
</div>
{% endif %}
{% endif %}
{# DISABLED
<h1>{{ 'Resume Accompanying Course'|trans }}</h1>
<div class="associated-persons mb-5">
@@ -53,13 +100,6 @@
{% endif %}
{% endfor %}
</div>
#}
{% if 'DRAFT' != accompanyingCourse.step %}
{% if withoutHousehold|length > 0 %}
{% include '@ChillPerson/AccompanyingCourse/_join_household.html.twig' with {} %}
{% endif %}
{% endif %}
{#
</div>
<div class="location mb-5">
@@ -80,11 +120,6 @@
</div>
</div>
{% endif %}
#}
{% if accompanyingCourse.locationStatus == 'address' or accompanyingCourse.locationStatus == 'none' %}
{% include '@ChillPerson/AccompanyingCourse/_warning_address.html.twig' with {} %}
{% endif %}
{#
</div>
<div class="requestor mb-5">

View File

@@ -32,7 +32,7 @@
{% include '@ChillMain/Address/_insert_vue_address.html.twig' with {
targetEntity: { name: 'household', id: household.id },
backUrl: path('chill_person_household_summary', { 'household_id': household.id }),
hideAddress: true,
onlyButton: true,
mode: 'new',
buttonSize: 'btn-sm',
buttonText: 'Move household',

View File

@@ -17,11 +17,19 @@
{%- endif -%}
</div>
<div class="text-md-end">
{% if person|chill_resolve_center is not null%}
{% if person|chill_resolve_center is not null %}
<span class="open_sansbold">
{{ 'Center'|trans|upper}} :
</span>
{{ person|chill_resolve_center.name|upper }}
{% if person|chill_resolve_center is iterable %}
{% for c in person|chill_resolve_center %}
{{ c.name|upper }}{% if not loop.last %}, {% endif %}
{% endfor %}
{% else %}
{{ person|chill_resolve_center.name|upper }}
{% endif %}
{%- endif -%}
</div>
</div>