[UPDT] EMPLOYEE: Updated employee form widgets

This commit is contained in:
Horilla
2025-09-16 10:51:32 +05:30
parent f0d9b74c9e
commit e686c093f7

View File

@@ -71,7 +71,7 @@ class ModelForm(forms.ModelForm):
now = datetime.now()
default_input_class = "oh-input w-100"
select_class = "oh-select oh-select-2 select2-hidden-accessible"
select_class = "oh-select oh-select-2"
checkbox_class = "oh-switch__checkbox"
for field_name, field in self.fields.items():
@@ -401,7 +401,7 @@ class EmployeeWorkInformationForm(ModelForm):
initial=field.initial,
widget=forms.Select(
attrs={
"class": "oh-select oh-select-2 select2-hidden-accessible",
"class": "oh-select oh-select-2",
"onchange": f'onDynamicCreate(this.value,"{urls.get(field.label)}");',
}
),
@@ -601,9 +601,7 @@ class BulkUpdateFieldForm(forms.Form):
]
self.fields["update_fields"].choices = updated_choices
for visible in self.visible_fields():
visible.field.widget.attrs["class"] = (
"oh-select oh-select-2 select2-hidden-accessible oh-input w-100"
)
visible.field.widget.attrs["class"] = "oh-select oh-select-2 oh-input w-100"
class EmployeeNoteForm(ModelForm):
@@ -741,7 +739,7 @@ class DisciplinaryActionForm(ModelForm):
label=_("Action"),
widget=forms.Select(
attrs={
"class": "oh-select oh-select-2 select2-hidden-accessible",
"class": "oh-select oh-select-2",
"onchange": "actionTypeChange($(this))",
}
),