2023-05-10 15:06:57 +05:30
|
|
|
{% load i18n %}
|
2023-11-01 12:05:41 +05:30
|
|
|
{% load static %}
|
2024-05-07 12:23:36 +05:30
|
|
|
<form hx-post="{% url 'shift-request-update' form.instance.id %}"
|
2023-11-01 12:05:41 +05:30
|
|
|
hx-target="#shiftRequestModalUpdateBody">
|
|
|
|
|
{% comment %} <div id="updateformBody"> {% endcomment %}
|
2023-05-10 15:06:57 +05:30
|
|
|
{{form.as_p}}
|
2023-11-01 12:05:41 +05:30
|
|
|
{% comment %} </div> {% endcomment %}
|
|
|
|
|
</form>
|
|
|
|
|
<script>
|
2024-02-08 12:52:13 +05:30
|
|
|
function toggleFunctionShiftRequestForm(element){
|
|
|
|
|
if (element.is(":checked")){
|
|
|
|
|
$("[id=id_requested_till]").parent().hide();
|
2023-11-01 12:05:41 +05:30
|
|
|
} else {
|
2024-02-08 12:52:13 +05:30
|
|
|
$("[id=id_requested_till]").parent().show();
|
2023-11-01 12:05:41 +05:30
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$(document).ready(function(){
|
|
|
|
|
$("[type=checkbox]").change(function (e) {
|
|
|
|
|
e.preventDefault();
|
2024-02-08 12:52:13 +05:30
|
|
|
toggleFunctionShiftRequestForm($(this));
|
2023-11-01 12:05:41 +05:30
|
|
|
});
|
|
|
|
|
})
|
2024-02-08 12:52:13 +05:30
|
|
|
toggleFunctionShiftRequestForm($("#shiftRequestModalUpdateBody #id_is_permanent_shift"));
|
2024-08-05 14:22:44 +05:30
|
|
|
</script>
|