From 315fc7f63af2d0ad0ca126a68ac3a65ab2936ef6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 9 Jun 2021 22:12:55 +0200 Subject: [PATCH 1/5] set default for Position attributes --- .../Entity/Household/Position.php | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Entity/Household/Position.php b/src/Bundle/ChillPersonBundle/Entity/Household/Position.php index 3ce95189d..b8fb5a990 100644 --- a/src/Bundle/ChillPersonBundle/Entity/Household/Position.php +++ b/src/Bundle/ChillPersonBundle/Entity/Household/Position.php @@ -21,34 +21,34 @@ class Position * @ORM\Column(type="integer") * @Serializer\Groups({ "read" }) */ - private $id; + private ?int $id; /** * @ORM\Column(type="json") */ - private $label = []; + private array $label = []; /** * @ORM\Column(type="boolean") */ - private $shareHouseHold; + private bool $shareHouseHold = true; /** * @ORM\Column(type="boolean") */ - private $allowHolder; + private bool $allowHolder = false; /** * @ORM\Column(type="float") */ - private $ordering; + private float $ordering = 0.00; public function getId(): ?int { return $this->id; } - public function getLabel(): ?array + public function getLabel(): array { return $this->label; } @@ -60,7 +60,7 @@ class Position return $this; } - public function getShareHousehold(): ?bool + public function getShareHousehold(): bool { return $this->shareHouseHold; } @@ -72,12 +72,12 @@ class Position return $this; } - public function getAllowHolder(): ?bool + public function getAllowHolder(): bool { return $this->allowHolder; } - public function isAllowHolder(): ?bool + public function isAllowHolder(): bool { return $this->getAllowHolder(); } @@ -89,7 +89,7 @@ class Position return $this; } - public function getOrdering(): ?float + public function getOrdering(): float { return $this->ordering; } From 7fddf1d5e0bc1f5cc2599be1763537f69a27caff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 9 Jun 2021 22:18:47 +0200 Subject: [PATCH 2/5] fix indentation --- .../views/Household/members.html.twig | 224 +++++++++--------- 1 file changed, 112 insertions(+), 112 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Household/members.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Household/members.html.twig index 610f80cde..cc1c8f321 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/Household/members.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/Household/members.html.twig @@ -6,127 +6,127 @@

{{ block('title') }}

{% for p in positions %} -

{{ p.label|localize_translatable_string }}

+

{{ p.label|localize_translatable_string }}

-{% if false == p.shareHousehold %} -

{{ 'household.Those members does not share address'|trans }}

-{% endif %} + {% if false == p.shareHousehold %} +

{{ 'household.Those members does not share address'|trans }}

+ {% endif %} -{%- set members = household.currentMembersByPosition(p) %} -{% if members|length > 0 %} -
- {% for m in members %} -
-
-
-
- {{ m.person|chill_entity_render_box({'addLink': true}) }} - {% if m.holder %} - {{ 'household.holder'|trans }} + {%- set members = household.currentMembersByPosition(p) %} + {% if members|length > 0 %} +
+ {% for m in members %} +
+
+
+
+ {{ m.person|chill_entity_render_box({'addLink': true}) }} + {% if m.holder %} + {{ 'household.holder'|trans }} + {% endif %} +
+
+ {{ 'Born the date'|trans({ 'gender': m.person.gender, 'birthdate': m.person.birthdate|format_date('long') }) }} +
+
+
+
    + {% if m.startDate is not empty %} +
  • {{ 'Since %date%'|trans({'%date%': m.startDate|format_date('long') }) }}
  • + {% endif %} + {% if m.endDate is not empty %} +
  • {{ 'Until %date%'|trans({'%date%': m.endDate|format_date('long') }) }}
  • + {% endif %} +
+ +
+
+ {% if m.comment is not empty %} +
+
+ {{ m.comment|chill_markdown_to_html }} +
+
{% endif %}
-
- {{ 'Born the date'|trans({ 'gender': m.person.gender, 'birthdate': m.person.birthdate|format_date('long') }) }} -
-
-
-
    - {% if m.startDate is not empty %} -
  • {{ 'Since %date%'|trans({'%date%': m.startDate|format_date('long') }) }}
  • - {% endif %} - {% if m.endDate is not empty %} -
  • {{ 'Until %date%'|trans({'%date%': m.endDate|format_date('long') }) }}
  • - {% endif %} -
- + {% endfor %} +
+ {% else %} +

{{ 'household.Any persons into this position'|trans }}

+ {% endif %} + + {% set members = household.nonCurrentMembersByPosition(p) %} + {% if members|length > 0 %} +

+ + +
+
+ {% for m in members %} +
+
+
+
+ {{ m.person|chill_entity_render_box({'addLink': true}) }} + {% if m.holder %} + {{ 'household.holder'|trans }} + {% endif %} +
+
+ {{ 'Born the date'|trans({ 'gender': m.person.gender, 'birthdate': m.person.birthdate|format_date('long') }) }} +
+
+
+
    + {% if m.startDate is not empty %} +
  • {{ 'Since %date%'|trans({'%date%': m.startDate|format_date('long') }) }}
  • + {% endif %} + {% if m.endDate is not empty %} +
  • {{ 'Until %date%'|trans({'%date%': m.endDate|format_date('long') }) }}
  • + {% endif %} +
+ +
+
+ {% if m.comment is not empty %} +
+
+ {{ m.comment|chill_markdown_to_html }} +
+
+ {% endif %} +
+ {% endfor %}
- {% if m.comment is not empty %} -
-
- {{ m.comment|chill_markdown_to_html }} -
-
- {% endif %} -
- {% endfor %} -
-{% else %} -

{{ 'household.Any persons into this position'|trans }}

-{% endif %} -{% set members = household.nonCurrentMembersByPosition(p) %} -{% if members|length > 0 %} -

- - -
-
- {% for m in members %} -
-
-
-
- {{ m.person|chill_entity_render_box({'addLink': true}) }} - {% if m.holder %} - {{ 'household.holder'|trans }} - {% endif %} -
-
- {{ 'Born the date'|trans({ 'gender': m.person.gender, 'birthdate': m.person.birthdate|format_date('long') }) }} -
-
-
-
    - {% if m.startDate is not empty %} -
  • {{ 'Since %date%'|trans({'%date%': m.startDate|format_date('long') }) }}
  • - {% endif %} - {% if m.endDate is not empty %} -
  • {{ 'Until %date%'|trans({'%date%': m.endDate|format_date('long') }) }}
  • - {% endif %} -
- -
-
- {% if m.comment is not empty %} -
-
- {{ m.comment|chill_markdown_to_html }} -
-
- {% endif %} -
- - {% endfor %} -
-
- -{% endif %} + {% endif %} {% endfor %} +