forked from apluslms/a-plus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ajax_search_select.html
82 lines (78 loc) · 2.52 KB
/
ajax_search_select.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
{% load i18n %}
<div {% include "django/forms/widgets/attrs.html" %}>
<ul class="list-inline search-selected">
<li>
<button>
<span class="name">None</span>
<span aria-label="{% translate 'REMOVE' %}">×</span>
</button>
</li>
</ul>
<div class="input-group">
<div class="input-group-btn search-button">
<div class="btn-group">
<button class="btn btn-default dropdown-toggle" aria-haspopup="true" aria-expanded="false" data-toggle="dropdown" type="button" aria-label="{% translate 'SEARCH' %}">
<span class="glyphicon glyphicon-search" aria-hidden="true"></span>
</button>
<ul class="dropdown-menu search-options" role="menu">
{% if clipboard_options %}
{% for option in clipboard_options %}
<li class="paste-option" data-field="{{ option.field }}">
<a href="#">{% translate 'IMPORT_LIST' %} ({{ option.label }})</a>
</li>
{% endfor %}
{% else %}
<li class="paste-option">
<a href="#">{% translate 'IMPORT_LIST' %}</a>
</li>
{% endif %}
<li class="not-found">
<a href="#">{% translate "NO_MATCHES" %}</a>
</li>
</ul>
</div>
</div>
<input
type="text"
id="{{ widget.input_id }}"
aria-label="{% translate 'SEARCH_OR_PASTE' %}"
class="form-control"
placeholder="{% translate 'SEARCH_OR_PASTE' %}"
/>
<div class="input-group-btn">
{# The copy button acts as a dropdown if there are multiple search clipboard options, otherwise it copies IDs directly. #}
<div
class="btn-group"
data-container="body"
data-toggle="tooltip"
aria-label="{% translate 'COPY_SELECTION' %}"
title="{% translate 'COPY_SELECTION' %}"
>
<button
type="button"
{% if clipboard_options %}
class="btn btn-default dropdown-toggle" aria-haspopup="true" aria-expanded="false" data-toggle="dropdown"
{% else %}
class="btn btn-default copy-option" data-clipboard-target="#{{ widget.attrs.id }} input"
{% endif %}
>
<span class="glyphicon glyphicon-copy" aria-hidden="true"></span>
</button>
{% if clipboard_options %}
<ul class="dropdown-menu dropdown-menu-right" role="menu">
{% for option in clipboard_options %}
<li>
<a href="#" class="copy-option" data-field="{{ option.field }}" data-clipboard-target="#{{ widget.attrs.id }} input">
{{ option.label }}
</a>
</li>
{% endfor %}
</ul>
{% endif %}
</div>
</div>
</div>
<div class="hidden">
{% include "django/forms/widgets/select.html" with widget=inner_widget %}
</div>
</div>