[UPDT] HORILLA_VIEWS: Added custom empty template to card view

This commit is contained in:
Horilla
2025-09-08 12:26:44 +05:30
parent f222181046
commit 946321816a
3 changed files with 29 additions and 9 deletions

View File

@@ -1646,6 +1646,7 @@ class HorillaCardView(ListView):
records_per_page: int = 50
card_status_class: str = """"""
card_status_indications: list = []
custom_empty_template: str = ""
def __init__(self, **kwargs: Any) -> None:
super().__init__(**kwargs)
@@ -1707,6 +1708,7 @@ class HorillaCardView(ListView):
context["show_filter_tags"] = self.show_filter_tags
context["card_status_class"] = self.card_status_class
context["card_status_indications"] = self.card_status_indications
context["custom_empty_template"] = self.custom_empty_template
if self.show_filter_tags:
data_dict = parse_qs(self._saved_filters.urlencode())

View File

@@ -32,6 +32,19 @@
</div>
</div>
<div class="oh-modal" id="objectDetailW75Modal" role="dialog" aria-labelledby="allocationModal">
<div class="oh-modal__dialog oh-modal__dialog-process max-w-[900px]">
<div class="oh-modal__dialog-header">
<button class="oh-modal__close" aria-label="Close" onclick="$(this).closest('.oh-modal--show').removeClass('oh-modal--show')">
<ion-icon name="close-outline" role="img" class="md hydrated"></ion-icon>
</button>
</div>
<div class="oh-modal__dialog-body" id="objectDetailW75ModalTarget"></div>
</div>
</div>
<script>
$(document).on("htmx:afterOnLoad", function (event) {
$("[data-toggle='oh-modal-toggle']").click(function (e) {

View File

@@ -186,14 +186,19 @@
</script>
{% endif %}
{% else %}
<div class="oh-wrapper" align="center" style="margin-top: 7vh; margin-bottom:7vh;">
<div align="center">
<img src="{% static "images/ui/search.svg" %}" class="oh-404__image" alt="Page not found. 404.">
<h1 class="oh-404__title">{% trans "No Records found" %}</h1>
<p class="oh-404__subtitle">
{% trans "No records found." %}
</p>
</div>
</div>
{% if custom_empty_template %}
{% include custom_empty_template %}
{% else %}
<div class="oh-wrapper" align="center" style="margin-top: 7vh; margin-bottom:7vh;">
<div align="center">
<img src="{% static "images/ui/search.svg" %}" class="oh-404__image" alt="Page not found. 404.">
<h1 class="oh-404__title">{% trans "No Records found" %}</h1>
<p class="oh-404__subtitle">
{% trans "No records found." %}
</p>
</div>
</div>
{% endif %}
{% endif %}
</div>