{% load static i18n %}
{% load i18n %}
<!-- start of messages -->
{% if messages %}
<div class="oh-wrapper">
    {% for message in messages %}
    <div class="oh-alert-container">
        <div class="oh-alert oh-alert--animated {{message.tags}}">
            {{ message }}
        </div>
    </div>
    {% endfor %}
    <script>
        setTimeout(function () {
            $('.oh-modal__close').click()
        }, 1000);
    </script>
</div>
{% endif %}
<!-- end of messages -->

<!-- asset cretion form -->
<div class="oh-modal__dialog-header">
    <button type="button" class="oh-modal__close" data-dismiss="oh-modal" aria-label="Close" {% if messages %}
        hx-get="{%url 'asset-category-view-search-filter'%}?{{pg}}" hx-target="#assetCategoryList" {% endif %}>
        <ion-icon name="close-outline"></ion-icon>
    </button>
    <span class="oh-modal__dialog-title ml-5" id="addEmployeeObjectiveModalLabel">
        <h5>{% trans "Asset Category Update" %}</h5>
    </span>
</div>
<div class="oh-modal__dialog-body">
    <form hx-post="{%url 'asset-category-update' cat_id=asset_category_update_form.instance.id %}?{{pg}}"
        hx-target="#objectUpdateModalTarget">
        {% csrf_token %}
        <div class="oh-profile-section pt-0">
            <div class="oh-input__group ">
                <label class="oh-input__label" for="{{asset_category_update_form.asset_category_name.id_for_label}}">{% trans "Name" %}</label>
                {{asset_category_update_form.asset_category_name.errors}}
                {{asset_category_update_form.asset_category_name}}
            </div>
            <div class="oh-input__group ">
                <label class="oh-input__label" for="{{asset_category_update_form.asset_category_description.id_for_label}}">{% trans "Description" %}</label>
                {{asset_category_update_form.asset_category_description.errors}}
                {{asset_category_update_form.asset_category_description}}
            </div>
            <div class="oh-input__group ">
                <label class="oh-input__label" for="{{asset_category_update_form.company_id.id_for_label}}">{% trans "Company" %}</label>
                {{asset_category_update_form.company_id.errors}}
                {{asset_category_update_form.company_id}}
            </div>

            <div class="oh-modal__dialog-footer p-0 mt-3">
                <button type="submit" class="oh-btn oh-btn--secondary oh-btn--shadow  ">
                    {% trans "Save" %}
                </button>
            </div>
        </div>
    </form>
</div>
