[FIX] ASSET: Fix to remove the asset unwanted filter tags
This commit is contained in:
@@ -16,7 +16,6 @@
|
|||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<!-- end of messages -->
|
<!-- end of messages -->
|
||||||
{% include 'filter_tags.html' %}
|
|
||||||
<div
|
<div
|
||||||
class="oh-sticky-table oh-sticky-table--no-overflow mb-5"
|
class="oh-sticky-table oh-sticky-table--no-overflow mb-5"
|
||||||
id="assetList{{asset_category.id}}"
|
id="assetList{{asset_category.id}}"
|
||||||
@@ -70,7 +69,7 @@
|
|||||||
class="oh-btn oh-btn--light-bkg w-100"
|
class="oh-btn oh-btn--light-bkg w-100"
|
||||||
data-toggle="oh-modal-toggle"
|
data-toggle="oh-modal-toggle"
|
||||||
data-target="#objectUpdateModal"
|
data-target="#objectUpdateModal"
|
||||||
hx-get="{% url 'asset-update' asset_id=asset.id %}?asset_under=asset_filter&{{pg}}"
|
hx-get="{% url 'asset-update' asset_id=asset.id %}?asset_under=asset_filter&{{request.GET.urlencode}}"
|
||||||
title="{% trans 'Update' %}"
|
title="{% trans 'Update' %}"
|
||||||
hx-target="#objectUpdateModalTarget"
|
hx-target="#objectUpdateModalTarget"
|
||||||
onclick="event.stopPropagation()"
|
onclick="event.stopPropagation()"
|
||||||
@@ -88,7 +87,7 @@
|
|||||||
class="oh-btn oh-btn--light-bkg w-100"
|
class="oh-btn oh-btn--light-bkg w-100"
|
||||||
data-toggle="oh-modal-toggle"
|
data-toggle="oh-modal-toggle"
|
||||||
data-target="#objectUpdateModal"
|
data-target="#objectUpdateModal"
|
||||||
hx-get="{% url 'asset-update' asset_id=asset.id %}?{{pg}}"
|
hx-get="{% url 'asset-update' asset_id=asset.id %}?{{request.GET.urlencode}}"
|
||||||
title="{% trans 'Update' %}"
|
title="{% trans 'Update' %}"
|
||||||
hx-target="#objectUpdateModalTarget"
|
hx-target="#objectUpdateModalTarget"
|
||||||
onclick="event.stopPropagation()"
|
onclick="event.stopPropagation()"
|
||||||
@@ -108,7 +107,7 @@
|
|||||||
class="oh-btn oh-btn--light-bkg w-100"
|
class="oh-btn oh-btn--light-bkg w-100"
|
||||||
data-toggle="oh-modal-toggle"
|
data-toggle="oh-modal-toggle"
|
||||||
data-target="#objectCreateModal"
|
data-target="#objectCreateModal"
|
||||||
hx-get="{% url 'duplicate-asset' asset.id %}?{{pg}}"
|
hx-get="{% url 'duplicate-asset' asset.id %}?{{request.GET.urlencode}}"
|
||||||
hx-target="#objectCreateModalTarget"
|
hx-target="#objectCreateModalTarget"
|
||||||
title="{% trans 'Duplicate' %}"
|
title="{% trans 'Duplicate' %}"
|
||||||
onclick="event.stopPropagation()"
|
onclick="event.stopPropagation()"
|
||||||
@@ -142,7 +141,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% if perms.asset.delete_asset %}
|
{% if perms.asset.delete_asset %}
|
||||||
{% if asset_under == 'asset_filter' %}
|
{% if asset_under == 'asset_filter' %}
|
||||||
<form action="{% url 'asset-delete' asset.id %}?asset_list=asset_filter&{{pg}}"
|
<form action="{% url 'asset-delete' asset.id %}?asset_list=asset_filter&{{request.GET.urlencode}}"
|
||||||
onsubmit="return confirm('{% trans "Do you want to delete this asset?" %}')"
|
onsubmit="return confirm('{% trans "Do you want to delete this asset?" %}')"
|
||||||
method="post" style="width:100%">
|
method="post" style="width:100%">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
@@ -161,7 +160,7 @@
|
|||||||
</form>
|
</form>
|
||||||
{% else %}
|
{% else %}
|
||||||
<form hx-confirm="{% trans 'Do you want to delete this asset?' %}"
|
<form hx-confirm="{% trans 'Do you want to delete this asset?' %}"
|
||||||
hx-post="{% url 'asset-delete' asset_id=asset.id %}?{{pg}}"
|
hx-post="{% url 'asset-delete' asset_id=asset.id %}?{{request.GET.urlencode}}"
|
||||||
hx-target="#assetCategory{{asset.asset_category_id.id}}"
|
hx-target="#assetCategory{{asset.asset_category_id.id}}"
|
||||||
onclick="event.stopPropagation()"
|
onclick="event.stopPropagation()"
|
||||||
style="width:100%">
|
style="width:100%">
|
||||||
@@ -205,7 +204,7 @@
|
|||||||
class="oh-pagination__input"
|
class="oh-pagination__input"
|
||||||
value="{{assets.number }}"
|
value="{{assets.number }}"
|
||||||
min="1"
|
min="1"
|
||||||
hx-get="{% url 'asset-list' cat_id=asset_category_id %}?{{pg}}"
|
hx-get="{% url 'asset-list' cat_id=asset_category_id %}?{{request.GET.urlencode}}"
|
||||||
hx-target="#assetCategory{{asset_category_id}}"
|
hx-target="#assetCategory{{asset_category_id}}"
|
||||||
/>
|
/>
|
||||||
<span class="oh-pagination__label"
|
<span class="oh-pagination__label"
|
||||||
@@ -216,7 +215,7 @@
|
|||||||
{% if assets.has_previous %}
|
{% if assets.has_previous %}
|
||||||
<li class="oh-pagination__item oh-pagination__item--wide">
|
<li class="oh-pagination__item oh-pagination__item--wide">
|
||||||
<a
|
<a
|
||||||
hx-get="{% url 'asset-list' cat_id=asset_category_id %}?{{pg}}&page=1"
|
hx-get="{% url 'asset-list' cat_id=asset_category_id %}?{{request.GET.urlencode}}&page=1"
|
||||||
class="oh-pagination__link"
|
class="oh-pagination__link"
|
||||||
hx-target="#assetCategory{{asset_category_id}}"
|
hx-target="#assetCategory{{asset_category_id}}"
|
||||||
>{% trans "First" %}</a
|
>{% trans "First" %}</a
|
||||||
@@ -224,7 +223,7 @@
|
|||||||
</li>
|
</li>
|
||||||
<li class="oh-pagination__item oh-pagination__item--wide">
|
<li class="oh-pagination__item oh-pagination__item--wide">
|
||||||
<a
|
<a
|
||||||
hx-get="{% url 'asset-list' cat_id=asset_category_id %}?{{pg}}&page={{ assets.previous_page_number }}"
|
hx-get="{% url 'asset-list' cat_id=asset_category_id %}?{{request.GET.urlencode}}&page={{ assets.previous_page_number }}"
|
||||||
class="oh-pagination__link"
|
class="oh-pagination__link"
|
||||||
hx-target="#assetCategory{{asset_category_id}}"
|
hx-target="#assetCategory{{asset_category_id}}"
|
||||||
>{% trans "Previous" %}</a
|
>{% trans "Previous" %}</a
|
||||||
@@ -233,7 +232,7 @@
|
|||||||
{%endif %} {% if assets.has_next %}
|
{%endif %} {% if assets.has_next %}
|
||||||
<li class="oh-pagination__item oh-pagination__item--wide">
|
<li class="oh-pagination__item oh-pagination__item--wide">
|
||||||
<a
|
<a
|
||||||
hx-get="{% url 'asset-list' cat_id=asset_category_id %}?{{pg}}&page={{ assets.next_page_number }}"
|
hx-get="{% url 'asset-list' cat_id=asset_category_id %}?{{request.GET.urlencode}}&page={{ assets.next_page_number }}"
|
||||||
class="btn btn-outline-secondary"
|
class="btn btn-outline-secondary"
|
||||||
hx-target="#assetCategory{{asset_category_id}}"
|
hx-target="#assetCategory{{asset_category_id}}"
|
||||||
>{% trans "Next" %}</a
|
>{% trans "Next" %}</a
|
||||||
@@ -241,7 +240,7 @@
|
|||||||
</li>
|
</li>
|
||||||
<li class="oh-pagination__item oh-pagination__item--wide">
|
<li class="oh-pagination__item oh-pagination__item--wide">
|
||||||
<a
|
<a
|
||||||
hx-get="{% url 'asset-list' cat_id=asset_category_id %}?{{pg}}&page={{ assets.paginator.num_pages }}"
|
hx-get="{% url 'asset-list' cat_id=asset_category_id %}?{{request.GET.urlencode}}&page={{ assets.paginator.num_pages }}"
|
||||||
hx-target="#assetCategory{{asset_category_id}}"
|
hx-target="#assetCategory{{asset_category_id}}"
|
||||||
class="oh-pagination__link"
|
class="oh-pagination__link"
|
||||||
>{% trans "Last" %}</a
|
>{% trans "Last" %}</a
|
||||||
|
|||||||
@@ -457,6 +457,8 @@ def filter_pagination_asset_category(request):
|
|||||||
data_dict = parse_qs(previous_data)
|
data_dict = parse_qs(previous_data)
|
||||||
get_key_instances(AssetCategory, data_dict)
|
get_key_instances(AssetCategory, data_dict)
|
||||||
asset_creation_form = AssetForm()
|
asset_creation_form = AssetForm()
|
||||||
|
if data_dict.get("type"):
|
||||||
|
del data_dict["type"]
|
||||||
asset_category_form = AssetCategoryForm()
|
asset_category_form = AssetCategoryForm()
|
||||||
asset_filter_form = AssetFilter()
|
asset_filter_form = AssetFilter()
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in New Issue
Block a user