diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Household/summary.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Household/summary.html.twig index 3567d1f7e..e88e07013 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/Household/summary.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/Household/summary.html.twig @@ -133,7 +133,7 @@ {% macro customButtons(member, household) %}
  • + class="btn btn-sm btn-misc" title="{{ 'household.person.leave'|trans }}">
  • diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Person/household_history.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Person/household_history.html.twig index 5dff4b074..d75106132 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/Person/household_history.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/Person/household_history.html.twig @@ -4,176 +4,163 @@ {% block title 'household.Household history for person'|trans %} +{% macro bloc_content(p) %} +
    +
    + +
    +
    + {% if p.endDate %} +
    + Jusqu'au {{ p.endDate|format_date('long') }} +
    + {% endif %} +
    +
    +
    +
    +
    +
    +
    +

    En tant que

    +
    +
    +

    {{ p.position.label|localize_translatable_string }} + {% if p.holder %} + {{ 'household.holder'|trans }} + {% endif %} +

    +
    +
    +
    +
    +

    {{ 'household.Members at same time'|trans }}

    +
    +
    + {% set simultaneous = p.household.getMembersDuringMembership(p) %} + {% if simultaneous|length == 0 %} +

    + {{ 'household.Any simultaneous members'|trans }} +

    + {% else %} + {% for m in simultaneous -%} + {% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with { + action: 'show', displayBadge: true, + targetEntity: { name: 'person', id: m.person.id }, + buttonText: m.person|chill_entity_render_string + } %} + {%- endfor -%} + {% endif %} +
    +
    +
    +
    +{% endmacro %} + {% block personcontent %}
    +

    {{ 'household.Household history'|trans }}

    -

    {{ 'household.Household history'|trans }}

    -

    {{ 'household.Household shared'|trans }}

    +
    +

    {{ 'household.Household shared'|trans }}

    + {% set memberships = person.getHouseholdParticipationsShareHousehold() %} - {% set memberships = person.getHouseholdParticipationsShareHousehold() %} + {% if memberships|length == 0 %} +

    {{ 'household.Never in any household'|trans }}

    - {% if memberships|length == 0 %} -

    {{ 'household.Never in any household'|trans }}

    + + {% else %} +
    + {% for p in memberships %} +
    + + {{ _self.bloc_content(p) }} + +
    + +
    + +
    + {% endfor %} +
    + + {% if not person.isSharingHousehold() %} - - {% else %} - -
    -
    - - {% if not person.isSharingHousehold() %} - - {% endif %} - - {% for p in memberships %} -
    -
    -
    -
    - {{ p.startDate|format_date('long') }} -
    -
    -
    -
    -
    - -
    -
    -

    - - - {{ 'household.Household number'|trans({'household_num': p.household.id }) }} - -

    -

    {{ p.position.label|localize_translatable_string }} {% if p.holder %}{{ 'household.holder'|trans }}{% endif %} -

    -
    - {% set simultaneous = p.household.getMembersDuringMembership(p) %} - {% if simultaneous|length == 0 %} -

    - {{ 'household.Any simultaneous members'|trans }} -

    - {% else %} - {{ 'household.Members at same time'|trans }}: - {% for p in simultaneous -%} - {{- p.person|chill_entity_render_box({'addLink': true }) -}} - {%- if p.holder %} {{'household.holder'|trans }} {% endif %} - {%- if not loop.last %}, {% endif -%} - {%- endfor -%} - {% endif %} - -
    -
    -
    -
    -
    - {% endfor %} -
    - -
    {% endif %} -

    {{ 'household.Household not shared'|trans }}

    + {% endif %} - {% set memberships = person.getHouseholdParticipationsNotShareHousehold() %} +
    +
    + {% set memberships = person.getHouseholdParticipationsNotShareHousehold() %} + {% if memberships|length > 0 %} - {% if memberships|length == 0 %} -

    {{ 'household.Never in any household'|trans }}

    - {% else %} - - - - - - - - - - {% for p in memberships %} - - - - - - - {% endfor %} - -
    {{ 'household.from'|trans }}{{ 'household.to'|trans }}{{ 'household.Household'|trans }}
    {{ p.startDate|format_date('long') }} - {% if p.endDate is not empty %} - {{ p.endDate|format_date('long') }} - {% else %} - {{ 'household.Membership currently running'|trans }} - {% endif %} - -
    -

    - - - {{ 'household.Household number'|trans({'household_num': p.household.id }) }} - -

    -

    - {{ p.position.label|localize_translatable_string }} - {% if p.holder %} - {{ 'household.holder'|trans }} - {% endif %} -

    -
    - {% set simultaneous = p.household.getMembersDuringMembership(p) %} - {% if simultaneous|length == 0 %} -

    - {{ 'household.Any simultaneous members'|trans }} -

    - {% else %} - {{ 'household.Members at same time'|trans }}: - {% for p in simultaneous -%} - {{- p.person|chill_entity_render_box({'addLink': true }) -}} - {%- if p.holder %} {{'household.holder'|trans }} {% endif %} - {%- if not loop.last %}, {% endif -%} - {%- endfor -%} - {% endif %} -
    -
    - -
    - {% endif %} +

    {{ 'household.Household not shared'|trans }}

    + +
    + {% for p in memberships %} +
    + + {{ _self.bloc_content(p) }} + +
    +
      +
    • + +
    • +
    +
    + +
    + {% endfor %} +
    + {% endif %} +
    {% endblock %}