From f6d4a6843a604113836a1dd9f77d8cf9a80fdba5 Mon Sep 17 00:00:00 2001 From: Horilla Date: Thu, 7 Mar 2024 15:44:41 +0530 Subject: [PATCH] [UPDT] BASE: Updated rotating work type assign delete and archive method by adding hx-attribute --- base/forms.py | 3 +- .../rotating_work_type/htmx/group_by.html | 61 +++---- .../rotating_work_type/individual_view.html | 58 +++++-- .../rotating_work_type_assign_view.html | 78 +++++---- base/urls.py | 4 +- base/views.py | 151 +++++++++++++----- 6 files changed, 236 insertions(+), 119 deletions(-) diff --git a/base/forms.py b/base/forms.py index d056be2b2..c7222d4d8 100644 --- a/base/forms.py +++ b/base/forms.py @@ -12,7 +12,7 @@ from datetime import date, timedelta from django.contrib.auth import authenticate from django import forms from django.contrib.auth.models import Group, Permission, User -from django.forms import DateInput, TextInput +from django.forms import DateInput, HiddenInput, TextInput from django.core.exceptions import ValidationError from django.utils.translation import gettext as _ from django.utils.translation import gettext_lazy as _trans @@ -529,6 +529,7 @@ class RotatingWorkTypeAssignForm(ModelForm): exclude = ("next_change_date", "current_work_type", "next_work_type") widgets = { "start_date": DateInput(attrs={"type": "date"}), + "is_active":HiddenInput() } labels = { "is_active": _trans("Is Active"), diff --git a/base/templates/base/rotating_work_type/htmx/group_by.html b/base/templates/base/rotating_work_type/htmx/group_by.html index 76a972a4c..381ba0a22 100644 --- a/base/templates/base/rotating_work_type/htmx/group_by.html +++ b/base/templates/base/rotating_work_type/htmx/group_by.html @@ -1,5 +1,16 @@ {% load attendancefilters %} {% load basefilters %} {% load static %} {% load i18n %} {% include 'filter_tags.html' %} +{% if messages %} +
+ {% for message in messages %} +
+
+ {{ message }} +
+
+ {% endfor %} +
+{% endif %} {% if perms.base.view_worktyperequest %}