2021-12-31 22:29:47 +01:00
|
|
|
<div class="dropdown">
|
2022-01-01 17:18:08 +01:00
|
|
|
<input autocomplete="off" id="{{widget.attrs.id}}" data-ac-url="{{custom.search_url}}" data-ac-name-field="{{custom.name_field_name}}" {% if custom.image_field_name %}data-ac-image-field="{{custom.image_field_name}}"{% endif %} data-bs-toggle="dropdown" type="text" placeholder="Search..." class="{{widget.attrs.class}}">
|
2021-12-31 22:40:58 +01:00
|
|
|
<ul id="{{widget.attrs.id}}-ac-ul" class="dropdown-menu">
|
|
|
|
</ul>
|
2022-01-01 14:06:46 +01:00
|
|
|
<div class="d-flex align-items-center mt-3 mb-3" id="{{widget.attrs.id}}-dflex-container">
|
2021-12-31 22:29:47 +01:00
|
|
|
{% if custom.current_instance %}
|
|
|
|
{% if custom.image_field_name %}
|
|
|
|
<div class="flex-shrink-0">
|
|
|
|
{% if custom.image %}
|
|
|
|
<img src="{{custom.image.url}}" style="max-width:64px;max-height:64px;" class="mr-3">
|
|
|
|
{% else %}
|
|
|
|
{% load static %}
|
|
|
|
<img src="{% static 'css/icons/card-image.svg' %}" style="width:64px;max-height:64px;" class="mr-3">
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
2022-01-01 14:06:46 +01:00
|
|
|
<div class="ms-3">
|
2021-12-31 22:29:47 +01:00
|
|
|
{% if custom.current_instance %}
|
2022-01-01 17:18:08 +01:00
|
|
|
{{custom.name}}
|
2021-12-31 22:29:47 +01:00
|
|
|
{% else %}
|
|
|
|
<span class="text-secondary">None selected</span>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
2022-01-01 14:06:46 +01:00
|
|
|
{% if custom.current_instance %}
|
|
|
|
<div class="ms-4">
|
|
|
|
<span class="btn btn-close" data-ac-delete="{{widget.attrs.id}}"></span>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
2021-12-31 22:29:47 +01:00
|
|
|
</div>
|
2022-01-01 14:06:46 +01:00
|
|
|
<input type="hidden" {% if widget.value != None %}value="{{widget.value}}"{%endif%} name={{widget.name}} id="{{widget.attrs.id}}-uuid-field">
|
2021-12-31 22:29:47 +01:00
|
|
|
</div>
|