[UPDT] ATTENDANCE: Updated attendance app by adding widget for date fields in attendance request form
This commit is contained in:
@@ -646,6 +646,13 @@ class AttendanceRequestForm(BaseModelForm):
|
||||
"request_description",
|
||||
"batch_attendance_id",
|
||||
]
|
||||
widgets = {
|
||||
"attendance_date": DateTimeInput(attrs={"type": "date"}),
|
||||
"attendance_clock_in": DateTimeInput(attrs={"type": "time"}),
|
||||
"attendance_clock_in_date": DateTimeInput(attrs={"type": "date"}),
|
||||
"attendance_clock_out": DateTimeInput(attrs={"type": "time"}),
|
||||
"attendance_clock_out_date": DateTimeInput(attrs={"type": "date"}),
|
||||
}
|
||||
|
||||
def as_p(self, *args, **kwargs):
|
||||
"""
|
||||
|
||||
@@ -4,10 +4,3 @@
|
||||
>
|
||||
{{form.as_p}}
|
||||
</form>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$("select").on("select2:select", function (e) {
|
||||
$(this).closest("select")[0].dispatchEvent(new Event("change"));
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -1,11 +1,4 @@
|
||||
{% load i18n %}
|
||||
<form hx-post="{% url 'attendance-update' obj_id %}?{{urlencode}}" hx-swap="#updateAttendanceModalBody" id="attendanceUpdateForm" data-url="{% url 'attendance-update' obj_id %}">
|
||||
{{form.as_p}}
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$("select").on("select2:select", function (e) {
|
||||
$(this).closest("select")[0].dispatchEvent(new Event("change"));
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</form>
|
||||
|
||||
@@ -1,8 +1 @@
|
||||
{{form.as_p}}
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$("select").on("select2:select", function (e) {
|
||||
$(this).closest("select")[0].dispatchEvent(new Event("change"));
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
{% load i18n %}
|
||||
<label class="oh-label" for="id_{{field.name }}" title="{{field.help_text|safe }}">{{field.label}}</label>
|
||||
{{field}}
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$("select").on("select2:select", function (e) {
|
||||
$(this).closest("select")[0].dispatchEvent(new Event("change"));
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -60,12 +60,4 @@
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$("select").on("select2:select", function (e) {
|
||||
$(".leave-message").hide()
|
||||
$(this).closest("select")[0].dispatchEvent(new Event("change"));
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user