[UPDT] HORILLA DOCUMENTS: Updated horilla documents app by adding htmx script to trigger the bulk rejection action

This commit is contained in:
Horilla
2025-05-16 19:20:14 +05:30
parent 941c9488b8
commit 2a688851e0
9 changed files with 245 additions and 262 deletions

View File

@@ -92,13 +92,18 @@ class DocumentUpdateForm(ModelForm):
}
class DocumentRejectForm(ModelForm):
"""form to add rejection reason while rejecting a Document"""
class Meta:
model = Document
fields = ["reject_reason"]
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.fields["reject_reason"].widget.attrs["required"] = True
class DocumentRejectForm(forms.Form):
verbose_name = Document()._meta.get_field("reject_reason").verbose_name
reject_reason = forms.CharField(
widget=forms.Textarea(
attrs={
"class": "oh-input w-100",
"placeholder": verbose_name,
"rows": 2,
"cols": 40,
}
),
max_length=255,
required=True,
label=verbose_name,
)

View File

@@ -90,7 +90,9 @@ class Document(HorillaModel):
status = models.CharField(
choices=STATUS, max_length=10, default="requested", verbose_name=_("Status")
)
reject_reason = models.TextField(blank=True, null=True, max_length=255)
reject_reason = models.TextField(
blank=True, null=True, max_length=255, verbose_name=_("Reject Reason")
)
issue_date = models.DateField(null=True, blank=True, verbose_name=_("Issue Date"))
expiry_date = models.DateField(null=True, blank=True, verbose_name=_("Expiry Date"))
notify_before = models.IntegerField(