[UPDT] HORILLA VIEWS: Added cols for custom width and updated variable declaration

This commit is contained in:
Horilla
2024-10-30 17:39:44 +05:30
parent 0322f996db
commit 82bc9075f3
3 changed files with 11 additions and 6 deletions

View File

@@ -87,6 +87,7 @@ class HorillaListView(ListView):
selected_instances_key_id: str = "selectedInstances"
show_filter_tags: bool = True
show_toggle_form: bool = True
filter_keys_to_remove: list = []
records_per_page: int = 50
@@ -235,6 +236,7 @@ class HorillaListView(ListView):
context["columns"] = self.visible_column
context["hidden_columns"] = list(set(self.columns) - set(self.visible_column))
context["toggle_form"] = self.toggle_form
context["show_toggle_form"] = self.show_toggle_form
context["search_url"] = self.search_url
context["action_method"] = self.action_method
@@ -497,6 +499,7 @@ class HorillaDetailedView(DetailView):
action_method: list = []
actions: list = []
cols: dict = {}
ids_key: str = "instance_ids"
@@ -534,6 +537,7 @@ class HorillaDetailedView(DetailView):
context["body"] = self.body
context["actions"] = self.actions
context["action_method"] = self.action_method
context["cols"] = self.cols
CACHE.get(self.request.session.session_key + "cbv")[
HorillaDetailedView

View File

@@ -168,10 +168,10 @@
</div>
<script>
var tabId = $("#{{view_id}}").closest(".oh-tabs__content").attr("id");
let badge = $(`#badge-${tabId}`);
let count = "{{queryset.paginator.count}}";
let label = badge.attr("data-badge-label") || "";
let title = count + " " + label;
var badge = $(`#badge-${tabId}`);
var count = "{{queryset.paginator.count}}";
var label = badge.attr("data-badge-label") || "";
var title = count + " " + label;
badge.html(count);
badge.attr("title", title);
</script>

View File

@@ -36,6 +36,7 @@
<div id="keyResultsContainer">
<div class="my-3" id="keyResultCard">
<div class="oh-card oh-card--no-shadow oh-card__body">
{% if header %}
<a
class="oh-timeoff-modal__profile-content"
style="text-decoration: none"
@@ -61,14 +62,14 @@
</div>
</div>
</a>
{% endif %}
<div
class="oh-modal__dialog-header {% if header %} oh-card__footer--border-top{% endif %}"
style="padding-top: 5px; padding-rigth: 0px; padding-left: 0px"
>
<div class="row">
{% for col in body %}
<div class="col-6 mt-3">
<div class="col-{% if cols|get_item:col.1 %}{{cols|get_item:col.1}}{% else %}6{% endif %} mt-3">
{% if not col.2 %}
<div class="oh-timeoff-modal__stat">
<span class="oh-timeoff-modal__stat-title">{{col.0}}</span>