[UPDT] Added style for current view type

This commit is contained in:
Horilla
2023-09-25 15:57:17 +05:30
parent ceceabb885
commit ce299bb288
12 changed files with 142 additions and 78 deletions

View File

@@ -18,6 +18,8 @@ $(document).ready(function () {
history.pushState({}, "", newURL);
$("#employee-search").attr("hx-vals", `{"view":"${view}"}`);
$('#filterForm').attr("hx-vals", `{"view":"${view}"}`);
$(".oh-btn--view-active").removeClass("oh-btn--view-active")
$(this).children("a").addClass("oh-btn--view-active")
}
});

View File

@@ -146,7 +146,7 @@
{% comment %} href = "{% url 'employee-view-list' %}" {% endcomment %}
hx-get="{% url 'employee-filter-view' %}?view=list"
hx-target="#view-container"
class="oh-btn oh-btn--view"
class="oh-btn oh-btn--view {% if request.GET.view != 'card' %} oh-btn--view-active {% endif %}"
title='{% trans "List" %}'
><ion-icon name="list-outline"></ion-icon
></a>
@@ -157,7 +157,7 @@
{% comment %} href = "{% url 'employee-view-card' %}" {% endcomment %}
hx-get="{% url 'employee-filter-view' %}?view=card"
hx-target="#view-container"
class="oh-btn oh-btn--view"
class="oh-btn oh-btn--view {% if request.GET.view == 'card' %} oh-btn--view-active {% endif %}"
title='{% trans "Card" %}'
><ion-icon name="grid-outline"></ion-icon
></a>