27 lines
906 B
HTML
27 lines
906 B
HTML
{% load i18n %}
|
|
{% load static %}
|
|
<form hx-post="{% url 'shift-request-update' form.instance.id %}"
|
|
hx-target="#shiftRequestModalUpdateBody">
|
|
{% comment %} <div id="updateformBody"> {% endcomment %}
|
|
{{form.as_p}}
|
|
{% comment %} </div> {% endcomment %}
|
|
</form>
|
|
<script>
|
|
function toggleFunctionShiftRequestForm(){
|
|
if ($('#id_is_permanent_shift').is(":checked")){
|
|
$("[for=id_requested_date],[for=id_requested_till]").hide();
|
|
$("#id_requested_date,#id_requested_till").hide();
|
|
} else {
|
|
$("[for=id_requested_date],[for=id_requested_till]").show();
|
|
$("#id_requested_date,#id_requested_till").show();
|
|
}
|
|
}
|
|
|
|
$(document).ready(function(){
|
|
$("[type=checkbox]").change(function (e) {
|
|
e.preventDefault();
|
|
toggleFunctionShiftRequestForm();
|
|
});
|
|
})
|
|
toggleFunctionShiftRequestForm();
|
|
</script> |