    {% extends 'django_spire/card/title_card.html' %}

    {% block card_title %}
        Edit {{ portal_user.get_full_name }}
    {% endblock %}

    {% block card_title_content %}
        <form
            x-data="{
                async init () {
                    toggle_loading_overlay()
                    await this.get_glue()
                    toggle_loading_overlay()
                    console.log(this.user)
                },
                user: new ModelObjectGlue('portal_user'),
                async get_glue() {
                    await this.user.get()
                    // this.user.set_properties('{{ initial_data }}')
                },
                set_fields() {
                    this.user.glue_fields.first_name.required = true
                    this.user.glue_fields.last_name.required = true
                    this.user.glue_fields.email.required = true
                }

            }"
            method="post"
        >
            {% csrf_token %}

            <div class="row g-2 mb-3">
                <div class="col-6">
                    {% include 'django_glue/form/field/char_field.html' with glue_model_field='user.first_name' %}
                </div>
                <div class="col-6">
                    {% include 'django_glue/form/field/char_field.html' with glue_model_field='user.last_name' %}
                </div>
                <div class="col-6">
                    {% include 'django_glue/form/field/email_field.html' with glue_model_field='user.email' %}
                </div>
                <div class="col-6">
                    {% include 'django_glue/form/field/select_field.html' with glue_model_field='user.is_active' %}
                </div>
            </div>

            {% include 'django_spire/contrib/form/button/form_submit_button.html' %}
        </form>
    {% endblock %}
