{% 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 "Update" %} {{form.verbose_name}}
    </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">
                {% for error in form.non_field_errors %}
                    <ul class="errorlist">
                        <li>{{error}}</li>
                    </ul>
                {% endfor %}
                <div class="col-12 col-sm-12 col-md-12 col-lg-12">
                    <label class="oh-label" for="{{form.title.id_for_label}}">{{form.title.label}}
                        <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}}">{{form.description.label}}
                        <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}}">{{form.open_positions.label}}
                        <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}}">{{form.recruitment_managers.label}}
                        <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}}">{{form.start_date.label}}</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}}">{{form.end_date.label}}</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}}">{{form.vacancy.label}}</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}}">{{form.company_id.label}}</label>
                    {{form.company_id}} {{form.company_id.errors}}
                </div>
                <div class="col-12 col-sm-12 col-md-12 col-lg-6">
                    <label class="oh-label"
                        for="{{form.survey_templates.id_for_label}}">{{form.survey_templates.label}}</label>
                    {{form.survey_templates}}
                </div>
                <div class="col-12 col-sm-12 col-md-12 col-lg-6">
                    <label class="oh-label" for="{{form.skills.id_for_label}}">{{form.skills.label}}</label>
                    {{form.skills}}
                </div>
                <div class="col-12 col-sm-12 col-md-12 col-lg-6">
                    <label class="oh-label" for="{{form.publish_in_linkedin.id_for_label}}"
                        title="{{form.publish_in_linkedin.help_text|safe}}">{{form.publish_in_linkedin.label}}</label>
                    <div class="w-100 d-flex" style="align-items: center" 6>
                        <div class="oh-switch">{{form.publish_in_linkedin}}</div>
                    </div>
                </div>
                <div class="col-12 col-sm-12 col-md-12 col-lg-6" id="">
                    <label class="oh-label"
                        for="{{form.linkedin_account_id.id_for_label}}">{{form.linkedin_account_id.label}}</label>
                    {{form.linkedin_account_id}} {{form.linkedin_account_id.errors}}
                </div>
                <div class="col-12 col-sm-12 col-md-12 col-lg-4">
                    <label class="oh-label" for="{{form.is_published.id_for_label}}"
                        title="{{form.is_published.help_text|safe}}">{{form.is_published.label}} ?</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="{{form.optional_profile_image.id_for_label}}"
                        title="{{form.optional_profile_image.help_text|safe}}">
                        {{form.optional_profile_image.label}} ?
                    </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="{{form.optional_resume.id_for_label}}"
                        title="{{form.optional_resume.help_text|safe}}">
                        {{form.optional_resume.label}} ?
                    </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>
