[UPDT] BASE : In settings page helpdesk tag and ticket type creation form bug fixes and form design change to common design

This commit is contained in:
Horilla
2024-05-15 14:33:47 +05:30
parent 78d2de0d89
commit 9d9b483e2d
4 changed files with 9 additions and 12 deletions

View File

@@ -1605,6 +1605,14 @@ class TagsForm(ModelForm):
widgets = {"color": TextInput(attrs={"type": "color", "style": "height:50px"})}
exclude = ["objects", "is_active"]
def as_p(self, *args, **kwargs):
"""
Render the form fields as HTML table rows with Bootstrap styling.
"""
context = {"form": self}
table_html = render_to_string("attendance_form.html", context)
return table_html
class EmployeeTagForm(ModelForm):
"""

View File

@@ -66,7 +66,7 @@
<div class="oh-modal__dialog">
<div class="oh-modal__dialog-header">
<h2 class="oh-modal__dialog-title" id="editModaltitle">
{% trans "Helpdesk Tag Update" %}
{% trans "Update Helpdesk Tag" %}
</h2>
<button class="oh-modal__close" aria-label="Close">
<ion-icon name="close-outline"></ion-icon>

View File

@@ -22,9 +22,4 @@
hx-encoding="multipart/form-data">
{% csrf_token %}
{{form.as_p}}
<div class="d-flex flex-row-reverse mt-3">
<button type="submit" class="oh-btn oh-btn--secondary mt-2 mr-0 pl-4 pr-5 oh-btn--w-100-resp">
{% trans "Save" %}
</button>
</div>
</form>

View File

@@ -11,10 +11,4 @@
{% csrf_token %}
{{form.non_field_errors}}
{{form.as_p}}
<div class="d-flex flex-row-reverse">
<button type="submit" class="oh-btn oh-btn--secondary mt-2 mr-0 pl-4 pr-5 oh-btn--w-100-resp">
{% trans "Save" %}
</button>
</div>
<div class="oh-inner-sidebar-content__footer"></div>
</form>