household: safe display of household members without positions

This commit is contained in:
nobohan 2022-04-19 17:09:10 +02:00
parent 4bc8da9655
commit c214c2f4a4
2 changed files with 11 additions and 6 deletions

View File

@ -26,12 +26,15 @@ class HouseholdMemberType extends AbstractType
'input' => 'datetime_immutable', 'input' => 'datetime_immutable',
]); ]);
if (!$options['data']->getPosition()->getShareHousehold()) { if (null !== $options['data']->getPosition()) {
$builder->add('endDate', ChillDateType::class, [ if (!$options['data']->getPosition()->getShareHousehold()) {
'label' => 'household.End date', $builder->add('endDate', ChillDateType::class, [
'input' => 'datetime_immutable', 'label' => 'household.End date',
]); 'input' => 'datetime_immutable',
]);
}
} }
$builder $builder
->add('comment', ChillTextareaType::class, [ ->add('comment', ChillTextareaType::class, [
'label' => 'household.Comment', 'label' => 'household.Comment',

View File

@ -48,7 +48,9 @@
</div> </div>
<div class="wl-col list"> <div class="wl-col list">
<p class="item"> <p class="item">
{{ p.position.label|localize_translatable_string }} {% if p.position %}
{{ p.position.label|localize_translatable_string }}
{% endif %}
{% if p.holder %} {% if p.holder %}
<span class="fa-stack fa-holder" title="{{ 'houshold.holder'|trans|e('html_attr') }}"> <span class="fa-stack fa-holder" title="{{ 'houshold.holder'|trans|e('html_attr') }}">
<i class="fa fa-circle fa-stack-1x text-success"></i> <i class="fa fa-circle fa-stack-1x text-success"></i>