diff --git a/helpdesk/forms.py b/helpdesk/forms.py index b907d86e7..9e119e868 100644 --- a/helpdesk/forms.py +++ b/helpdesk/forms.py @@ -69,7 +69,7 @@ class FAQForm(ModelForm): "tags": forms.SelectMultiple( attrs={ "class": "oh-select oh-select-2 select2-hidden-accessible", - "onchange": "updateTag()", + "onchange": "updateTag(this)", } ), } diff --git a/helpdesk/templates/helpdesk/faq/faq_category_create.html b/helpdesk/templates/helpdesk/faq/faq_category_create.html index 4194a78e6..1b5f109fa 100644 --- a/helpdesk/templates/helpdesk/faq/faq_category_create.html +++ b/helpdesk/templates/helpdesk/faq/faq_category_create.html @@ -1,10 +1,19 @@ {% load i18n %} +{% if messages %} + + + +{% endif %}
-
+

{% if faq_category %} {% trans "FAQ category Update" %} - {% else %} + {% else %} {% trans "FAQ category Create" %} {% endif %}

@@ -13,21 +22,13 @@
-
+ hx-target="#faqCategoryCreate" hx-swap="innerHTML" method="post" hx-encoding="multipart/form-data"> {{form.as_p}}
- +
diff --git a/helpdesk/templates/helpdesk/faq/faq_category_list.html b/helpdesk/templates/helpdesk/faq/faq_category_list.html index 371ae8920..3d909d142 100644 --- a/helpdesk/templates/helpdesk/faq/faq_category_list.html +++ b/helpdesk/templates/helpdesk/faq/faq_category_list.html @@ -3,69 +3,47 @@ {% include 'filter_tags.html' %}
{% for category in faq_categories %} -
-
-

{{category.title}}

- {% if perms.helpdesk.change_faqcategory or perms.helpdesk.delete_faqcategory %} -
- +
+
+

{{category.title}}

+ {% if perms.helpdesk.change_faqcategory or perms.helpdesk.delete_faqcategory %} +
+ -
-
    - {% if perms.helpdesk.change_faqcategory %} -
  • - {% trans "Edit" %} -
  • - {% endif %} - {% if perms.helpdesk.delete_faqcategory %} -
  • -
    - {% csrf_token %} - -
    -
  • - {% endif %} -
+
+
    + {% if perms.helpdesk.change_faqcategory %} +
  • + {% trans "Edit" %} +
  • + {% endif %} + {% if perms.helpdesk.delete_faqcategory %} +
  • +
    + {% csrf_token %} + +
    +
  • + {% endif %} +
+
-
- {% endif %} -
+ {% endif %} +
-

{{category.description}}

- {% trans "View FAQs" %} -
+

{{category.description}}

+ {% trans "View FAQs" %} +
{% endfor %}
diff --git a/helpdesk/templates/helpdesk/faq/faq_create.html b/helpdesk/templates/helpdesk/faq/faq_create.html index d7a6466c7..b6eb6b390 100644 --- a/helpdesk/templates/helpdesk/faq/faq_create.html +++ b/helpdesk/templates/helpdesk/faq/faq_create.html @@ -1,10 +1,17 @@ {% load i18n %} +{% if messages %} + + +{% endif %}

{% if faq %} {% trans "FAQ Update" %} - {% else %} + {% else %} {% trans "FAQ Create" %} {% endif %}

@@ -13,21 +20,13 @@
-
+ hx-target="#faqCreate" hx-swap="innerHTML" method="post" hx-encoding="multipart/form-data"> {{form.as_p}}
- +
diff --git a/helpdesk/templates/helpdesk/faq/faq_list.html b/helpdesk/templates/helpdesk/faq/faq_list.html index d1d917228..597bc7624 100644 --- a/helpdesk/templates/helpdesk/faq/faq_list.html +++ b/helpdesk/templates/helpdesk/faq/faq_list.html @@ -1,60 +1,45 @@ {% load i18n %} {% include 'filter_tags.html' %} -
+
    {% for faq in faqs %} -
  • -
    -
    - {{faq.question}} -
      - {% for tag in faq.tags.all %} -
    • {{tag|capfirst}}
    • - {% endfor %} -
    -
    -
    - {% if perms.helpdesk.change_faq %} - - {% endif %} - {% if perms.helpdesk.delete_faq %} -
    - {% csrf_token %} - -
    - {% endif %} + {% endif %} + {% if perms.helpdesk.delete_faq %} +
    + {% csrf_token %} + +
    + {% endif %} +
    -
-
{{faq.answer}}
- +
{{faq.answer}}
+ {% endfor %}
diff --git a/helpdesk/templates/helpdesk/faq/faq_list_view.html b/helpdesk/templates/helpdesk/faq/faq_list_view.html index 3056c2179..73cc22ed2 100644 --- a/helpdesk/templates/helpdesk/faq/faq_list_view.html +++ b/helpdesk/templates/helpdesk/faq/faq_list_view.html @@ -5,54 +5,56 @@ background: #e9dfec9c; opacity: 0.7; } + .oh-faq__tag { border-radius: 10px; font-weight: 600; } + .oh-faq__item-body { max-height: 0; - transition: max-height 0.3s ease,padding 0.3s ease; + transition: max-height 0.3s ease, padding 0.3s ease; overflow-y: auto; } .oh-faq__item--show .oh-faq__item-body { - max-height: 200px; /* Adjust the max-height as needed */ - } - .oh-title_faq__main-header { - width:70%; - } - .oh-select-faq { - width:12%; - } - .oh-select-faq , .oh-select-faq:last-child , .oh-faq__input-search { - margin :1rem 0; - } - .oh-faq_search--icon{ - top:17px; + max-height: 200px; + /* Adjust the max-height as needed */ } + .oh-title_faq__main-header { + width: 70%; + } + + .oh-select-faq { + width: 12%; + } + + .oh-select-faq, + .oh-select-faq:last-child, + .oh-faq__input-search { + margin: 1rem 0; + } + + .oh-faq_search--icon { + top: 17px; + } -
+
{% if faqs %} -
- {% include "helpdesk/faq/faq_list.html" %} -
+
+ {% include "helpdesk/faq/faq_list.html" %} +
{% else %} -
+ ">
- +

{% trans "There are no FAQs at the moment." %}

@@ -62,52 +64,33 @@
- +
-
+
-