<form
    x-data="{
        ticket: new ModelObjectGlue('ticket'),
        async init () {
            await this.ticket.get()
        }
    }"
    method="post"
    action="{% url 'django_spire:help_desk:form:update' pk=ticket.pk|default:0 %}"
>
    {% csrf_token %}

    <div class="row mb-3">
        <div class="col">
            {% include 'django_glue/form/field/select_field.html' with glue_model_field='ticket.purpose' %}
        </div>
        <div class="col">
            {% include 'django_glue/form/field/select_field.html' with glue_model_field='ticket.priority' %}
        </div>
        {% if ticket.pk is not None %}
            <div class="col">
                {% include 'django_glue/form/field/select_field.html' with glue_model_field='ticket.status' %}
            </div>
        {% endif %}
    </div>
    <div class="row">
        <div class="col-12 mb-1">
            {% include 'django_glue/form/field/text_field.html' with glue_model_field='ticket.description' %}
        </div>
    </div>
    <div class="row text-end my-2">
        {% include 'django_spire/contrib/form/button/form_submit_button.html' %}
    </div>
</form>
