{% load i18n %}
{% if form.non_field_errors %}
    <ul class="errorlist">
        {% for error in form.non_field_errors %}
        <li>{{ error }}</li>
        {% endfor %}
    </ul>
{% endif %}
<div class="oh-modal__dialog-header pb-0">
    <h5 class="oh-modal__dialog-title" id="recruitmentUpdateModalLabel">
        {% trans "Edit Recruitment" %}
    </h5>
    <button class="oh-modal__close" aria-label="Close">
        <ion-icon name="close-outline"></ion-icon>
    </button>
</div>
<div class="oh-modal__dialog-body" id="">
    <form hx-post="{% url 'recruitment-update-pipeline' form.instance.id %}" hx-target="#objectUpdateModalTarget"
        class="oh-general__tab-target oh-profile-section">
        {% csrf_token %}
        <div>
            {% csrf_token %}
            <div class="row" id="recruitmentUpdateContainer">
                <div class="col-12 col-sm-12 col-md-12 col-lg-12">
                    <label class="oh-label" for="{{form.title.id_for_label}}">{% trans "Title" %} <span
                            class="text-danger">*</span></label>
                    {{form.title}} {{form.title.errors}}
                </div>

                <div class="col-12 col-sm-12 col-md-12 col-lg-12">
                    <label class="oh-label" for="{{form.description.id_for_label}}">{% trans "Description" %} <span
                            class="text-danger">*</span></label>
                    {{form.description}} {{form.description.errors}}
                </div>

                <div class="col-12 col-sm-12 col-md-12 col-lg-6" id="openPositionUpdateContainer">
                    <label class="oh-label" for="{{form.open_positions.id_for_label}}">{% trans "Job Position" %} <span
                            class="text-danger">*</span></label>
                    {{form.open_positions}} {{form.open_positions.errors}}
                </div>

                <div class="col-12 col-sm-12 col-md-12 col-lg-6">
                    <label class="oh-label" for="{{form.recruitment_managers.id_for_label}}">{% trans "Managers" %}
                        <span class="text-danger">*</span></label>
                    {{form.recruitment_managers}} {{form.recruitment_managers.errors}}
                </div>

                <div class="col-12 col-sm-12 col-md-12 col-lg-6">
                    <label class="oh-label" for="{{form.start_date.id_for_label}}">{% trans "Start Date" %}</label>
                    {{form.start_date}} {{form.start_date.errors}}
                </div>

                <div class="col-12 col-sm-12 col-md-12 col-lg-6">
                    <label class="oh-label" for="{{form.end_date.id_for_label}}">{% trans "End Date" %}</label>
                    {{form.end_date}} {{form.end_date.errors}}
                </div>

                <div class="col-12 col-sm-12 col-md-12 col-lg-6">
                    <label class="oh-label" for="{{form.vacancy.id_for_label}}">{% trans "Vacancy" %}</label>
                    {{form.vacancy}} {{form.vacancy.errors}}
                </div>

                <div class="col-12 col-sm-12 col-md-12 col-lg-6">
                    <label class="oh-label" for="{{form.company_id.id_for_label}}">{% trans "Company" %}</label>
                    {{form.company_id}} {{form.company_id.errors}}
                </div>

                <div class="col-12 col-sm-12 col-md-12 col-lg-12">
                    <label class="oh-label" for="id_survey_templates">{% trans "Survey Templates" %}</label>
                    {{form.survey_templates}}
                </div>

                <div class="col-12 col-sm-12 col-md-12 col-lg-4">
                    <label class="oh-label" for="id_is_published" title="{{form.is_published.help_text|safe}}">
                        {% trans "Is Published?" %}
                    </label>
                    <div class="w-100 d-flex" style="align-items: center">
                        <div class="oh-switch">{{form.is_published}}</div>
                    </div>
                </div>
                <div class="col-12 col-sm-12 col-md-12 col-lg-4">
                    <label class="oh-label" for="id_optional_profile_image" title="{{form.optional_profile_image.help_text|safe}}">
                        {% trans "Optional Profile Image?" %}
                    </label>
                    <div class="w-100 d-flex" style="align-items: center">
                        <div class="oh-switch">{{form.optional_profile_image}}</div>
                    </div>
                </div>
                <div class="col-12 col-sm-12 col-md-12 col-lg-4">
                    <label class="oh-label" for="id_optional_resume" title="{{form.optional_resume.help_text|safe}}">
                        {% trans "Optional Resume?" %}
                    </label>
                    <div class="w-100 d-flex" style="align-items: center">
                        <div class="oh-switch">{{form.optional_resume}}</div>
                    </div>
                </div>
            </div>
        </div>
        <div class="d-flex flex-row-reverse">
            <button type="submit" class="mt-4 pl-5 pr-5 oh-btn oh-btn--secondary">
                {% trans "Save" %}
            </button>
        </div>
    </form>
    <script>
        $("[hx-target='#recruitmentUpdate'] [name=description]").hide();
    </script>
</div>
