Features: 1) Simplify autocomplete_list_filter.html template by removing unused static assets and unnecessary label tag; 2) Refactor indentation for better readability;

Fixes: None;

Extra: Streamline template code by removing redundant HTML elements and unused script imports;
This commit is contained in:
Egor Pavlovich Gorbunov 2025-07-01 18:45:02 +03:00
parent 306f54b4a2
commit f15897f20d

View file

@ -1,6 +1,6 @@
{% load i18n static %} {% load i18n %}
<div class="filter-autocomplete"> <div class="filter-autocomplete">
<label for="id_{{ spec.lookup_kwarg }}"></label><select name="{{ spec.lookup_kwarg }}" <select name="{{ spec.lookup_kwarg }}"
id="id_{{ spec.lookup_kwarg }}" id="id_{{ spec.lookup_kwarg }}"
class="admin-autocomplete" class="admin-autocomplete"
style="width:90%;" style="width:90%;"
@ -13,15 +13,5 @@
{% if spec.lookup_val %} {% if spec.lookup_val %}
<option value="{{ spec.lookup_val }}" selected>{{ spec.initial_text }}</option> <option value="{{ spec.lookup_val }}" selected>{{ spec.initial_text }}</option>
{% endif %} {% endif %}
</select> </select>
</div> </div>
<link rel="stylesheet"
href="{% static 'admin/css/vendor/select2/select2.css' %}"/>
<link rel="stylesheet"
href="{% static 'admin/css/autocomplete.css' %}"/>
<script src="{% static 'admin/js/vendor/jquery/jquery.min.js' %}"></script>
<script src="{% static 'admin/js/vendor/select2/select2.full.min.js' %}"></script>
<script src="{% static 'admin/js/jquery.init.js' %}"></script>
<script src="{% static 'admin/js/autocomplete.js' %}"></script>