Merge remote-tracking branch 'origin/master' into features/household-editor

This commit is contained in:
Julien Fastré 2021-06-10 11:01:59 +02:00
commit abc79249a2
7 changed files with 143 additions and 144 deletions

View File

@ -41,12 +41,6 @@ table {
} }
} }
// règle la typo des étiquettes de dénomination rendues avec renderBox
.chill_denomination {
font-size: 1.3em;
font-weight: 700;
}
/* /*
* ACCOMPANYING_COURSE * ACCOMPANYING_COURSE
* Header custom for Accompanying Course * Header custom for Accompanying Course

View File

@ -21,38 +21,38 @@ class Position
* @ORM\Column(type="integer") * @ORM\Column(type="integer")
* @Serializer\Groups({ "read" }) * @Serializer\Groups({ "read" })
*/ */
private $id; private ?int $id;
/** /**
* @ORM\Column(type="json") * @ORM\Column(type="json")
* @Serializer\Groups({ "read" }) * @Serializer\Groups({ "read" })
*/ */
private $label = []; private array $label = [];
/** /**
* @ORM\Column(type="boolean") * @ORM\Column(type="boolean")
* @Serializer\Groups({ "read" }) * @Serializer\Groups({ "read" })
*/ */
private $shareHouseHold; private bool $shareHouseHold = true;
/** /**
* @ORM\Column(type="boolean") * @ORM\Column(type="boolean")
* @Serializer\Groups({ "read" }) * @Serializer\Groups({ "read" })
*/ */
private $allowHolder; private bool $allowHolder = false;
/** /**
* @ORM\Column(type="float") * @ORM\Column(type="float")
* @Serializer\Groups({ "read" }) * @Serializer\Groups({ "read" })
*/ */
private $ordering; private float $ordering = 0.00;
public function getId(): ?int public function getId(): ?int
{ {
return $this->id; return $this->id;
} }
public function getLabel(): ?array public function getLabel(): array
{ {
return $this->label; return $this->label;
} }
@ -64,7 +64,7 @@ class Position
return $this; return $this;
} }
public function getShareHousehold(): ?bool public function getShareHousehold(): bool
{ {
return $this->shareHouseHold; return $this->shareHouseHold;
} }
@ -76,12 +76,12 @@ class Position
return $this; return $this;
} }
public function getAllowHolder(): ?bool public function getAllowHolder(): bool
{ {
return $this->allowHolder; return $this->allowHolder;
} }
public function isAllowHolder(): ?bool public function isAllowHolder(): bool
{ {
return $this->getAllowHolder(); return $this->getAllowHolder();
} }
@ -93,7 +93,7 @@ class Position
return $this; return $this;
} }
public function getOrdering(): ?float public function getOrdering(): float
{ {
return $this->ordering; return $this->ordering;
} }

View File

@ -2,6 +2,20 @@
div.list-with-period, div.list-with-period,
div.list-household-members, div.list-household-members,
div.list-household-members--summary { div.list-household-members--summary {
.chill-entity__person {
.chill-entity__person__first-name,
.chill-entity__person__last-name {
font-size: 1.3em;
font-weight: 700;
}
}
.chill_denomination {
font-size: 1.3em;
font-weight: 700;
}
div.person { div.person {
ul.record_actions { ul.record_actions {
li { li {
@ -44,13 +58,4 @@ div.list-household-members--summary {
} }
} }
} }
.chill-entity__person {
.chill-entity__person__first-name,
.chill-entity__person__last-name,
// text is used in vue component 'Person'
.chill-entity__person__text {
font-size: 1.3em;
font-weight: 700;
}
}
} }

View File

@ -4,7 +4,7 @@
<div class="grid-6">{% set title = title %} <div class="grid-6">{% set title = title %}
<h1> <h1>
<i class="fa fa-child"></i> <i class="fa fa-home"></i>
{{ 'household.Household'|trans }} {{ 'household.Household'|trans }}
<span style="font-weight: lighter; font-size: 50%;">(n°{{ household.id }})</span> <span style="font-weight: lighter; font-size: 50%;">(n°{{ household.id }})</span>
</h1> </h1>

View File

@ -6,127 +6,127 @@
<h1>{{ block('title') }}</h1> <h1>{{ block('title') }}</h1>
{% for p in positions %} {% for p in positions %}
<h3>{{ p.label|localize_translatable_string }}</h3> <h3>{{ p.label|localize_translatable_string }}</h3>
{% if false == p.shareHousehold %} {% if false == p.shareHousehold %}
<p>{{ 'household.Those members does not share address'|trans }}</p> <p>{{ 'household.Those members does not share address'|trans }}</p>
{% endif %} {% endif %}
{%- set members = household.currentMembersByPosition(p) %} {%- set members = household.currentMembersByPosition(p) %}
{% if members|length > 0 %} {% if members|length > 0 %}
<div class="flex-table list-household-members"> <div class="flex-table list-household-members">
{% for m in members %} {% for m in members %}
<div class="item-bloc"> <div class="item-bloc">
<div class="item-row person"> <div class="item-row person">
<div class="item-col box-person"> <div class="item-col box-person">
<div> <div>
{{ m.person|chill_entity_render_box({'addLink': true}) }} {{ m.person|chill_entity_render_box({'addLink': true}) }}
{% if m.holder %} {% if m.holder %}
<span class="badge badge-primary">{{ 'household.holder'|trans }}</span> <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="#" 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 %} {% endif %}
</div> </div>
<div> {% endfor %}
{{ 'Born the date'|trans({ 'gender': m.person.gender, 'birthdate': m.person.birthdate|format_date('long') }) }} </div>
</div> {% else %}
</div> <p class="chill-no-data-statement">{{ 'household.Any persons into this position'|trans }}</p>
<div class="item-col box-where"> {% endif %}
<ul class="list-content fa-ul">
{% if m.startDate is not empty %} {% set members = household.nonCurrentMembersByPosition(p) %}
<li>{{ 'Since %date%'|trans({'%date%': m.startDate|format_date('long') }) }}</li> {% if members|length > 0 %}
{% endif %} <p><!-- force a space after table --></p>
{% if m.endDate is not empty %} <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">
<li>{{ 'Until %date%'|trans({'%date%': m.endDate|format_date('long') }) }}</li> {{ 'household.Show future or past memberships'|trans({'length': members|length}) }}
{% endif %} </button>
</ul>
<ul class="record_actions"> <div id="nonCurrent_{{ p.id }}" class="collapse">
<li> <div class="flex-table list-household-members">
<a {% for m in members %}
href="{{ chill_path_add_return_path('chill_person_household_member_edit', { 'id': m.id }) }}" <div class="item-bloc">
class="sc-button bt-edit" <div class="item-row person">
/> <div class="item-col box-person">
{{ 'household.Update membership'|trans }} <div>
</a> {{ m.person|chill_entity_render_box({'addLink': true}) }}
</li> {% if m.holder %}
<li> <span class="badge badge-primary">{{ 'household.holder'|trans }}</span>
<a href="#" class="sc-button" /><i class="fa fa-sign-out"></i>{{ 'household.Leave'|trans }}</a> {% endif %}
</li> </div>
</ul> <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>
</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) %} {% endif %}
{% 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 %} {% endfor %}
<ul class="record_actions sticky-form-buttons"> <ul class="record_actions sticky-form-buttons">
<li> <li>
<a class="sc-button bt-create"> <a class="sc-button bt-create">

View File

@ -84,7 +84,7 @@ class HouseholdMemberControllerTest extends WebTestCase
$form = $crawler->selectButton('Enregistrer') $form = $crawler->selectButton('Enregistrer')
->form(); ->form();
$form['household_member[endDate]'] = (new \DateTime('tomorrow')) $form['household_member[endDate]'] = (new \DateTime('tomorrow'))
->format('d-m-Y'); ->format('Y-m-d');
$crawler = $client->submit($form); $crawler = $client->submit($form);

View File

@ -63,14 +63,14 @@ services:
resource: '../Repository/' resource: '../Repository/'
tags: ['doctrine.repository_service'] tags: ['doctrine.repository_service']
Chill\PersonBundle\Controller\:
autowire: true
resource: '../Controller/'
tags: ['controller.service_arguments']
Chill\PersonBundle\Templating\Entity\: Chill\PersonBundle\Templating\Entity\:
autowire: true autowire: true
autoconfigure: true autoconfigure: true
resource: '../Templating/Entity' resource: '../Templating/Entity'
tags: tags:
- 'chill.render_entity' - 'chill.render_entity'
Chill\PersonBundle\Controller\:
autowire: true
resource: '../Controller/'
tags: ['controller.service_arguments']