[UPDT] EMPLOYEE: Disciplinary action form

This commit is contained in:
Horilla
2024-02-02 19:39:02 +05:30
parent 515dce8bf0
commit 2cbbd90dbd

View File

@@ -1,5 +1,4 @@
{% load i18n %}
{% if messages %}
{% load i18n %} {% if messages %}
<div class="oh-wrapper">
{% for message in messages %}
<div class="oh-alert-container">
@@ -10,40 +9,70 @@
{% endfor %}
</div>
<script>
setTimeout(function () {
$(".oh-modal__close--custom").click();
}, 1000);
</script>
setTimeout(function () {
$(".oh-modal__close--custom").click();
}, 1000);
</script>
{% endif %}
<form hx-post="{% url 'create-actions' %}" hx-target="#createannouncementForm"
method="post" hx-encoding="multipart/form-data" id="disciplinaryActionForm">
{% csrf_token %}
<form
hx-post="{% url 'create-actions' %}"
hx-target="#createannouncementForm"
method="post"
hx-encoding="multipart/form-data"
id="disciplinaryActionForm"
>
{% csrf_token %}
<div id="employeeIdDiv">
<label class="oh-input__label" for="{{form.employee_id.id_for_label}}">{% trans "Employee" %}</label>
{{ form.employee_id }}
</div>
<div id="actionDiv">
<label class="oh-input__label" for="{{form.action.id_for_label}}">{% trans "Action" %}</label>
{{ form.action }}
</div>
<div id="daysDiv" style="display: none;">
<label class="oh-input__label" for="{{form.days.id_for_label}}">{% trans "Days" %}</label>
{{ form.days }}
</div>
<div id="startdateDiv">
<label class="oh-input__label" for="{{form.start_date.id_for_label}}">{% trans "Action Date" %}</label>
{{ form.start_date }}
</div>
<div id="employeeIdDiv">
<label class="oh-input__label" for="{{form.employee_id.id_for_label}}"
>{% trans "Employee" %}</label
>
{{ form.employee_id }}
</div>
<div id="actionDiv">
<label class="oh-input__label" for="{{form.action.id_for_label}}"
>{% trans "Action" %}</label
>
{{ form.action }}
</div>
<div id="daysDiv" style="display: none">
<label class="oh-input__label" for="{{form.days.id_for_label}}"
>{% trans "Days" %}</label
>
{{ form.days }}
</div>
<div id="startdateDiv">
<label class="oh-input__label" for="{{form.start_date.id_for_label}}"
>{% trans "Action Date" %}</label
>
{{ form.start_date }}
</div>
<div id="descriptionDiv">
<label class="oh-input__label" for="{{form.description.id_for_label}}">{% trans "Description" %}</label>
{{ form.description }}
</div>
<div id="attachmentDiv">
<label class="oh-input__label" for="{{form.attachment.id_for_label}}">{% trans "Attachment" %}</label>
{{ form.attachment }}
</div>
<div id="descriptionDiv">
<label class="oh-input__label" for="{{form.description.id_for_label}}"
>{% trans "Description" %}</label
>
{{ form.description }}
</div>
<div id="attachmentDiv">
<label class="oh-input__label" for="{{form.attachment.id_for_label}}"
>{% trans "Attachment" %}</label
>
{{ form.attachment }}
</div>
<button type="submit" class="oh-btn oh-btn--secondary">{% trans "Submit" %}</button>
</form>
<button type="submit" class="oh-btn oh-btn--secondary">
{% trans "Submit" %}
</button>
</form>
<script>
$(document).ready(function () {
var actionElement = $("#id_action");
if (actionElement.length > 0) {
var action = actionElement.val();
if (action) {
actionTypeChange(actionElement);
}
}
});
</script>