Merge branch 'master' into features/sql-vue-from-household-address-to-person

This commit is contained in:
2021-06-15 22:53:21 +02:00
208 changed files with 9047 additions and 6038 deletions

View File

@@ -15,5 +15,5 @@
window.accompanyingCourseId = {{ accompanyingCourse.id|e('js') }};
window.vueRootComponent = 'app';
</script>
{{ encore_entry_script_tags('accompanying_course') }}
{{ encore_entry_script_tags('vue_accourse') }}
{% endblock %}

View File

@@ -31,7 +31,7 @@
{% set gender = (p.person.gender == 'woman') ? 'fa-venus' :
(p.person.gender == 'man') ? 'fa-mars' : 'fa-neuter' %}
{% set genderTitle = (p.person.gender == 'woman') ? 'femme' :
(p.person.gender == 'homme') ? 'fa-mars' : 'neutre' %}
(p.person.gender == 'man') ? 'homme' : 'neutre' %}
<i class="fa fa-fw {{ gender }}" title="{{ genderTitle }}"></i>{{ born ~ ' le ' ~ p.person.birthdate|format_date('short') }}
</p>
</div>
@@ -62,6 +62,19 @@
<li>
<a href="{{ path('chill_person_view', { person_id: p.person.id }) }}" class="sc-button bt-show" target="_blank" title="Voir"></a>
</li>
{% if p.person.isSharingHousehold %}
<li>
<a
href="{{ chill_path_add_return_path(
'chill_person_household_summary',
{ 'household_id': p.person.getCurrentHousehold.id }
) }}"
class="sc-button">
<i class="fa fa-home"></i>
{{ 'household.Household file'|trans }}
</a>
</li>
{% endif %}
</ul>
</div>
</div>

View File

@@ -16,7 +16,7 @@
{% endblock %}
{% block css %}
{{ encore_entry_link_tags('accompanying_course') }}
{{ encore_entry_link_tags('vue_accourse') }}
{% endblock %}
{% block js %}
@@ -24,5 +24,5 @@
window.accompanyingCourseId = {{ accompanyingCourse.id|e('js') }};
window.vueRootComponent = 'banner';
</script>
{{ encore_entry_script_tags('accompanying_course') }}
{{ encore_entry_script_tags('vue_accourse') }}
{% endblock %}

View File

@@ -1,15 +1,17 @@
<span class="chill-entity chill-entity__person">
{%- if addLink and is_granted('CHILL_PERSON_SEE', person) -%}
{%- set showLink = true -%}<a href="{{ chill_path_add_return_path('chill_person_view', { 'person_id': person.id }) }}">{%- endif -%}
<span class="chill-entity__person__first-name">{{ person.firstName }}</span>
<span class="chill-entity__person__last-name">{{ person.lastName }}</span>
<span class="chill_denomination">{{ person.firstName }}</span>
<span class="chill_denomination">{{ person.lastName }}</span>
{%- if addAltNames -%}
{%- for n in person.altNames -%}
{%- if loop.first -%}({% else %} {%- endif -%}
<span class="chill-entity__person__alt-name chill-entity__person__altname--{{ n.key }}">
{{ n.label }}
{{- n.label -}}
</span>
{%- if loop.last %}) {% endif -%}
{%- if loop.last -%}) {%- endif -%}
{%- endfor -%}
{%- endif -%}
{%- if showLink is defined -%}</a>{%- endif -%}</span>
{%- if showLink is defined -%}</a>{%- endif -%}
{#- tricks to remove easily whitespace after template -#}
{%- if true -%}</span>{%- endif -%}

View File

@@ -0,0 +1,13 @@
{% set reversed_parents = parents|reverse %}
<span class="chill-entity chill-entity__social-action">
<span class="badge badge-primary">
{%- for p in reversed_parents %}
<span class="chill-entity__social-action__parent--{{ loop.revindex0 }}">
{{ p.title|localize_translatable_string }}{{ options['default.separator'] }}
</span>
{%- endfor -%}
<span class="chill-entity__social-action__child">
{{ socialAction.title|localize_translatable_string }}
</span>
</span>
</span>

View File

@@ -0,0 +1,28 @@
{% extends '@ChillPerson/Household/layout.html.twig' %}
{% block title 'household.Edit member household'|trans %}
{% block content %}
<h1>{{ block('title') }}</h1>
{{ form_start(form) }}
{{ form_widget(form) }}
<ul class="record_actions sticky-form-buttons">
<li class="cancel">
<a
href="{{ chill_return_path_or('chill_person_household_members', { 'household_id': household.id}) }}"
class="sc-button bt-cancel"
>
{{ 'Cancel'|trans }}
</a>
</li>
<li>
<button type="submit" class="sc-button bt-save">{{ 'Save'|trans }}</button>
</li>
</ul>
{{ form_end(form) }}
{% endblock %}

View File

@@ -1,11 +1,11 @@
<div class="subheader">
<div class="subheader banner-household">
<div class="grid-12 parent" id="header-accompanying_course-name" >
<div class="grid-10 push-1 grid-mobile-12 grid-tablet-12 push-mobile-0 push-tablet-0 parent">
<div class="grid-6">{% set title = title %}
<h1>
<i class="fa fa-child"></i>
{{ 'Household'|trans }}
<i class="fa fa-home"></i>
{{ 'household.Household'|trans }}
<span style="font-weight: lighter; font-size: 50%;">(n°{{ household.id }})</span>
</h1>
</div>
@@ -18,9 +18,23 @@
</div>
<div class="grid-12 parent" id="header-accompanying_course-details" >
<div class="grid-10 push-1 grid-mobile-12 grid-tablet-12 push-mobile-0 push-tablet-0 parent">
<div id="banner-misc"></div>
<div id="banner-misc">
{%- set persons = household.getCurrentPersons() -%}
{%- if persons|length > 0 -%}
<span class="current-members-explain">
{{- 'household.Current household members'|trans }}:
</span>
{%- for p in persons|slice(0, 5) -%}
{{- p|chill_entity_render_box({'addLink': false}) -}}
{%- if false == loop.last -%}, {% endif -%}
{%- endfor -%}
{% if persons|length > 5 %}
<span class="current-members-more">
{{ 'household.and x other persons'|trans({'x': persons|length-5}) }}
</span>
{% endif %}
{%- endif -%}
</div>
</div>
</div>
</div>

View File

@@ -1,10 +1,151 @@
{% extends '@ChillPerson/Household/layout.html.twig' %}
{% block title 'Household members'|trans %}
{% block title 'household.Household members'|trans %}
{% block content %}
<h1>{{ block('title') }}</h1>
<p>Household with id {{ household.id }}</p>
{% for p in positions %}
<h3>{{ p.label|localize_translatable_string }}</h3>
{% if false == p.shareHousehold %}
<p>{{ 'household.Those members does not share address'|trans }}</p>
{% endif %}
{%- set members = household.currentMembersByPosition(p) %}
{% if members|length > 0 %}
<div class="flex-table list-household-members">
{% for m in members %}
<div class="item-bloc">
<div class="item-row person">
<div class="item-col box-person">
<div>
{{ m.person|chill_entity_render_box({'addLink': true}) }}
{% if m.holder %}
<span class="badge badge-primary">{{ 'household.holder'|trans }}</span>
{% endif %}
</div>
<div>
{{ 'Born the date'|trans({ 'gender': m.person.gender, 'birthdate': m.person.birthdate|format_date('long') }) }}
</div>
</div>
<div class="item-col box-where">
<ul class="list-content fa-ul">
{% if m.startDate is not empty %}
<li>{{ 'Since %date%'|trans({'%date%': m.startDate|format_date('long') }) }}</li>
{% endif %}
{% if m.endDate is not empty %}
<li>{{ 'Until %date%'|trans({'%date%': m.endDate|format_date('long') }) }}</li>
{% endif %}
</ul>
<ul class="record_actions">
<li>
<a
href="{{ chill_path_add_return_path('chill_person_household_member_edit', { 'id': m.id }) }}"
class="sc-button bt-edit"
/>
{{ 'household.Update membership'|trans }}
</a>
</li>
<li>
<a
href="{{ chill_path_add_return_path(
'chill_person_household_members_editor',
{
'persons': [ m.person.id ],
'allow_leave_without_household': true
} ) }}"
class="sc-button"
/>
<i class="fa fa-sign-out"></i>
{{ 'household.Leave'|trans }}
</a>
</li>
</ul>
</div>
</div>
{% if m.comment is not empty %}
<div class="item-row comment">
<blockquote class="chill-user-quote">
{{ m.comment|chill_markdown_to_html }}
</blockquote>
</div>
{% endif %}
</div>
{% endfor %}
</div>
{% else %}
<p class="chill-no-data-statement">{{ 'household.Any persons into this position'|trans }}</p>
{% endif %}
{% set members = household.nonCurrentMembersByPosition(p) %}
{% if members|length > 0 %}
<p><!-- force a space after table --></p>
<button class="sc-button bt-green" type="button" data-toggle="collapse" data-target="#nonCurrent_{{ p.id }}" aria-expanded="false" aria-controls="collapse non current members">
{{ 'household.Show future or past memberships'|trans({'length': members|length}) }}
</button>
<div id="nonCurrent_{{ p.id }}" class="collapse">
<div class="flex-table list-household-members">
{% for m in members %}
<div class="item-bloc">
<div class="item-row person">
<div class="item-col box-person">
<div>
{{ m.person|chill_entity_render_box({'addLink': true}) }}
{% if m.holder %}
<span class="badge badge-primary">{{ 'household.holder'|trans }}</span>
{% endif %}
</div>
<div>
{{ 'Born the date'|trans({ 'gender': m.person.gender, 'birthdate': m.person.birthdate|format_date('long') }) }}
</div>
</div>
<div class="item-col box-where">
<ul class="list-content fa-ul">
{% if m.startDate is not empty %}
<li>{{ 'Since %date%'|trans({'%date%': m.startDate|format_date('long') }) }}</li>
{% endif %}
{% if m.endDate is not empty %}
<li>{{ 'Until %date%'|trans({'%date%': m.endDate|format_date('long') }) }}</li>
{% endif %}
</ul>
<ul class="record_actions">
<li>
<a
href="{{ chill_path_add_return_path('chill_person_household_member_edit', { 'id': m.id }) }}"
class="sc-button bt-edit"
/>
{{ 'household.Update membership'|trans }}
</a>
</li>
</ul>
</div>
</div>
{% if m.comment is not empty %}
<div class="item-row comment">
<blockquote class="chill-user-quote">
{{ m.comment|chill_markdown_to_html }}
</blockquote>
</div>
{% endif %}
</div>
{% endfor %}
</div>
</div>
{% endif %}
{% endfor %}
<ul class="record_actions sticky-form-buttons">
<li>
<a
href="{{ chill_path_add_return_path('chill_person_household_members_editor', {'household': household.id }) }}"
class="sc-button bt-create">
{{ 'household.Add a member'|trans }}
</a>
</li>
</ul>
{% endblock %}

View File

@@ -0,0 +1,23 @@
{% extends '@ChillMain/layout.html.twig' %}
{% block title 'household.Edit household members'|trans %}
{% block content %}
<div class="grid-12 parent">
<div class="grid-10 push-1 parent">
<h1>{{ block('title') }}</h1>
<div id="household_members_editor"></div>
</div>
</div>
{% endblock %}
{% block js %}
<script type="text/javascript">
window.household_members_editor_data = {{ data|json_encode|raw }};
</script>
{{ encore_entry_script_tags('household_members_editor') }}
{% endblock %}
{% block css %}
{{ encore_entry_link_tags('household_members_editor') }}
{% endblock %}

View File

@@ -1,14 +1,53 @@
{% extends '@ChillPerson/Household/layout.html.twig' %}
{% block title 'Household summary'|trans %}
{% block title 'household.Household summary'|trans %}
{% block content %}
<h1>{{ block('title') }}</h1>
<p>Household with id {{ household.id }}</p>
<h2>{{ 'household.Current household members'|trans }}</h2>
<h2>{{ 'Actual household members'|trans }}</h2>
{% for p in positions %}
{%- set members = household.currentMembersByPosition(p) %}
{% if members|length > 0 %}
<h3>{{ p.label|localize_translatable_string }}</h3>
<p>TODO</p>
{% if false == p.shareHousehold %}
<p>{{ 'household.Those members does not share address'|trans }}</p>
{% endif %}
<div class="flex-table list-household-members--summary">
{% for m in members %}
<div class="item-bloc">
<div class="item-row person">
<div class="item-col box-person">
<div>
{{ m.person|chill_entity_render_box({'addLink': true}) }}
{% if m.holder %}
<span class="badge badge-primary">{{ 'household.holder'|trans }}</span>
{% endif %}
</div>
<div>
{{ 'Born the date'|trans({ 'gender': m.person.gender, 'birthdate': m.person.birthdate|format_date('long') }) }}
</div>
</div>
<div class="item-col box-where">
<ul class="list-content fa-ul">
{% if m.startDate is not empty %}
<li>{{ 'Since %date%'|trans({'%date%': m.startDate|format_date('long') }) }}</li>
{% endif %}
{% if m.endDate is not empty %}
<li>{{ 'Until %date%'|trans({'%date%': m.endDate|format_date('long') }) }}</li>
{% endif %}
</ul>
</div>
</div>
</div>
{% endfor %}
</div>
{% endif %}
{% endfor %}
{% endblock %}