{% import "backend/macros.html" as macros %}
{% extends "backend/custom/surround.html" %}

{% block content %}
    {% if not origin %}
        {% set origin = False %}
    {% endif %}
            {{ macros.getRecordButtons(classname,classid,current_user,record,editable,backlink)}}
            {% if editable %}
            <form method="post" enctype="multipart/form-data" id="form-record" class="main-object-form">
            <!-- Inputs ocultos -->
            <input type="hidden" id="csrf_token" name="csrf_token" value="{{ csrf_token() }}">
            {% if record %}
                <input type="hidden" id="modifiedby_id" name="modifiedby_id" value="{{ current_user.id }}" >
            {%else%}
                <input type="hidden" id="createdby_id" name="createdby_id" value="{{ current_user.id }}" >
            {% endif %}
            {% endif %}
            <div class="bg-white shadow-sm rounded-3 p-4">
                <!-- Aquí va el contenido -->
                <div class="card mb-4">
                    <div class="card-header bg-light fw-semibold">
                        General
                    </div>
                    <div class="card-body">
                                {{ macros.fieldForm(fields["withFrame"],record,editable,origin)}}
                                {{ macros.fieldForm(fields["item"],record,editable,origin)}}
                                {{ macros.fieldForm(fields["units"],record,editable,origin)}}
                                {{ macros.fieldForm(fields["exactApprox"],record,editable,origin)}}
                                {{ macros.fieldForm(fields["width"],record,editable,origin)}}
                                {{ macros.fieldForm(fields["height"],record,editable,origin)}}
                                {{ macros.fieldForm(fields["depth"],record,editable,origin)}}
                                {{ macros.fieldForm(fields["thickness"],record,editable,origin)}}
                                {{ macros.fieldForm(fields["diameter"],record,editable,origin)}}
                                {{ macros.fieldForm(fields["circumference"],record,editable,origin)}}
                                {{ macros.fieldForm(fields["other"],record,editable,origin)}}
                    </div>
                </div>
                <!-- Aquí va el contenido -->
                <div class="card mb-4">
                    <div class="card-header bg-light fw-semibold">
                        Marco
                    </div>
                    <div class="card-body">
                        {{ macros.fieldForm(fields["insideSize"],record,editable,origin)}}
                        {{ macros.fieldForm(fields["outsideSize"],record,editable,origin)}}
                    </div>
                </div>
                <!-- Aquí va el contenido -->
                <div class="card mb-4">
                    <div class="card-header bg-light fw-semibold">
                        Vestimenta
                    </div>
                    <div class="card-body">
                        {{ macros.fieldForm(fields["size"],record,editable,origin)}}
                        {{ macros.fieldForm(fields["length"],record,editable,origin)}}
                        {{ macros.fieldForm(fields["contour"],record,editable,origin)}}
                    </div>
                </div>
                <!-- Aquí va el contenido -->
                <div class="card mb-4">
                    <div class="card-header bg-light fw-semibold">
                        Peso / Volumen
                    </div>
                    <div class="card-body">
                        {{ macros.fieldForm(fields["weightUnit"],record,editable,origin)}}
                        {{ macros.fieldForm(fields["weight"],record,editable,origin)}}
                        {{ macros.fieldForm(fields["volume"],record,editable,origin)}}
                    </div>
                </div>
            </div>
                {{ macros.fieldForm(fields["object"],record,editable,origin)}}
            {%if editable %}
            </form>
            {% endif %}
{% endblock %}

