diff --git a/horilla_views/templates/generic/group_by.html b/horilla_views/templates/generic/group_by.html index d6be50167..643cba664 100644 --- a/horilla_views/templates/generic/group_by.html +++ b/horilla_views/templates/generic/group_by.html @@ -1,13 +1,18 @@ {% load static i18n generic_template_filters %}
+ {% if bulk_select_option %}
{% trans "Select All" %} ({{queryset.paginator.count}}) @@ -17,9 +22,9 @@ class="oh-checkpoint-badge text-secondary d-none" style="cursor: pointer;" onclick=" - $('#selectedInstances').attr('data-ids',JSON.stringify([])); - selectSelected('#{{view_id|safe}}'); - reloadSelectedCount($('#count_{{view_id|safe}}')); + $('#{{selected_instances_key_id}}').attr('data-ids',JSON.stringify([])); + selectSelected('#{{view_id|safe}}','{{selected_instances_key_id}}'); + reloadSelectedCount($('#count_{{view_id|safe}}'),'{{selected_instances_key_id}}'); $('#{{view_id}} .list-table-row').prop('checked',false); $('#{{view_id}} .highlight-selected').removeClass('highlight-selected'); $('#{{view_id}} .bulk-list-table-row').prop('checked',false); @@ -39,12 +44,31 @@ class="oh-checkpoint-badge text-info d-none" style="cursor: pointer;" onclick=" - selectedIds = $('#selectedInstances').attr('data-ids') + selectedIds = $('#{{selected_instances_key_id}}').attr('data-ids') window.location.href = '{{export_path}}' + '?ids='+selectedIds " > {% trans "Export" %}
+ {% for filter in stored_filters %} +
+ +
+ + + +
+
+ {% endfor %}
{% if row_status_indications %}
@@ -73,7 +97,6 @@ onclick=" event.stopPropagation() $(this).parent().find('.oh-accordion-meta__body').toggleClass('d-none') - $(this).toggleClass('oh-accordion-meta__header--show') " > @@ -112,7 +135,7 @@ onchange=" $(this).closest('.oh-sticky-table').find('.list-table-row').prop('checked',$(this).is(':checked')).change(); $(document).ready(function () { - reloadSelectedCount($('#count_{{view_id|safe}}')); + reloadSelectedCount($('#count_{{view_id|safe}}'),'{{selected_instances_key_id}}'); }); " title="Select All" @@ -163,7 +186,7 @@ if (!element.is(':checked')) { removeId(element) } - reloadSelectedCount($('#count_{{view_id|safe}}')); + reloadSelectedCount($('#count_{{view_id|safe}}'),'{{selected_instances_key_id}}'); }); " value = "{{instance.pk}}" @@ -176,7 +199,7 @@
- {{instance|getattribute:attribute|safe}} + {{instance|getattribute:attribute|selected_format:request.user.employee_get.employee_work_info.company_id|safe}}
{% else %}
ids = JSON.parse( - $("#selectedInstances").attr("data-ids") || "[]" + $("#{{selected_instances_key_id}}").attr("data-ids") || "[]" ); $.each(ids, function (indexInArray, valueOfElement) { $(`#{{view_id|safe}} .oh-sticky-table__tbody .list-table-row[value=${valueOfElement}]`).prop("checked",true).change() @@ -372,7 +395,7 @@ ) { id = $(this).val() ids = JSON.parse( - $("#selectedInstances").attr("data-ids") || "[]" + $("#{{selected_instances_key_id}}").attr("data-ids") || "[]" ); ids = Array.from(new Set(ids)); let index = ids.indexOf(id); @@ -383,7 +406,7 @@ ids.splice(index, 1); } } - $("#selectedInstances").attr("data-ids", JSON.stringify(ids)); + $("#{{selected_instances_key_id}}").attr("data-ids", JSON.stringify(ids)); } ); @@ -395,6 +418,11 @@ $(".oh-accordion-meta__header").click(function (e) { var open = $(this).attr("data-open"); open = JSON.parse(open) + if (!$(this).parent().parent().find(".oh-accordion-meta__body.d-none").length && !$(this).find(".oh-accordion-meta__header--show").length) { + $(this).removeClass("oh-accordion-meta__header--show"); + }else{ + $(this).addClass("oh-accordion-meta__header--show"); + } $(this).attr("data-open", !open); var field = $(this).attr("data-field"); var groupIndex = $(this).attr("data-group");