{% load i18n gdaps crispy_forms_tags %}

{#      <div#}
{#          class="card-body" id="user-settings-{{ element.parent }}-{{ element.name }}"#}
{#          hx-get="{% url 'elements:'|add:element.name user.id %}"#}
{#          hx-swap="outerHTML"#}
{#          hx-trigger="load"#}
{#      ></div>#}
<div
    id="user-settings-{{ element.name }}"
    {% if reload_trigger %}
    hx-trigger="{{ reload_trigger }}"
    hx-get="{% url 'elements:'|add:element.name %}"
    {% endif %}
    {# the following attributes should be inherited: #}
    hx-swap="outerHTML"
    hx-target="#user-settings-{{ element.name }}"
>
  <div class="card-header">
    {% if element.title %}
      <h3 class="card-title">
        {% block title %}
          {{ element.title }}
        {% endblock %}
      </h3>
    {% endif %}
    <div class="card-actions btn-actions">
      {% block actions %}{% endblock %}
    </div>
    {% block header %}{% endblock %}
  </div>
  <div class="card-body"  >
    {% block pre-content %}{% endblock %}
    {% block content %}
      {% if form %}
        <form
            hx-post="{% url 'elements:'|add:element.name %}"
            {# hx-select="#user-settings-{{ element.parent }}-{{ element.name }}"#}
            enctype="multipart/form-data">
          {% crispy form %}
        </form>
      {% endif %}
    {% endblock %}
  </div>
</div>