{% set container_style = get_style_variant(schema.style, template_mode) %}
{% set show_title = ((show_object_title is none and config['SHOW_OBJECT_TITLE']) or show_object_title) and schema.title %}
{% if show_title or container_style in ("collapsible", "expandable") %}
  <div style="font-size:1.5em; padding-left: {% if not indent_level %}14{% else %}9{% endif %}px; margin-bottom: 5px; margin-top: 10px;">
    {% if container_style in ("collapsible", "expandable") %}
      <i class="fa fa-w {% if container_style == "collapsible" %}fa-minus-square-o{% else %}fa-plus-square-o{% endif %} collapse-expand-button" data-id-prefix="{{ id_prefix }}" style="font-size:0.8em;" data-toggle="tooltip" data-placement="top" title="{% if container_style == "collapsible" %}{{ _("Collapse") }}{% else %}{{ _("Expand") }}{% endif %}" data-collapse-text="{{ _("Collapse") }}" data-expand-text="{{ _("Expand") }}"></i>
    {% endif %}
    {% if show_title %}
      <span>{{ schema.title | get_translated_text }}</span>
    {% endif %}
  </div>
{% endif %}
{% set indent_level = indent_level + 1 %}
<div style="border-left: 1px solid {% if show_indent_border %}#dddddd{% else %}transparent{% endif %}; margin-left: 9px; padding-left: 5px; {% if container_style == "expandable" %}display:none;{% endif %}" class="collapsible-object-container" data-id-prefix="{{ id_prefix }}">
  <div style="{% if container_style == 'horizontal' %}display: flex; flex-wrap: wrap; padding-left: 15px;{% endif %}">
    {% set show_indent_border = True %}
    {% set property_names = get_property_names_in_order(schema) %}
    {% for property_name in property_names %}
      {% if data | are_conditions_fulfilled(schema.properties[property_name]) %}
        {% set hidden = (not (workflow_display_mode and 'workflow_show_more' in schema.keys()) and 'show_more' in schema.keys() and property_name in schema['show_more']) or (workflow_display_mode and 'workflow_show_more' in schema.keys() and property_name in schema['workflow_show_more']) %}
        {% set schema = schema.properties[property_name] %}
        {% set parent_id_prefix = id_prefix %}
        {% set property_path = property_path + (property_name,) %}
        {% set id_prefix = id_prefix_for_property_path(property_path, id_prefix_root) %}
        {% if data is not none and property_name in data %}
          {% set data = data[property_name] %}
        {% else %}
          {% set data = none %}
        {% endif %}
        {% if diff is not none and previous_schema is not none and property_name in diff %}
          {% set diff = diff[property_name] %}
          {% set previous_schema = previous_schema['properties'][property_name] %}
        {% else %}
          {% set diff = none %}
          {% set previous_schema = none %}
        {% endif %}
        <div {% if hidden %}class="hidden show-more-{{ parent_id_prefix }}"{% endif %}>
          {% include "objects/view/any.html" %}
        </div>
      {% endif %}
    {% endfor %}
    {% if schema.get("show_more") or (workflow_display_mode and schema.get("workflow_show_more")) %}
      <div class="row">
        <div class="col-md-3" style="padding-right: 0;"></div>
        <div class="col-md-9" style="padding-left: 5px;">
          <button id="show-more-{{ id_prefix }}-btn" class="btn btn-default btn-xs show-more-button" data-id-prefix="{{ id_prefix }}">{{ _('Show more') }}</button>
        </div>
      </div>
    {% endif %}
  </div>
</div>
