1 |
efrain |
1 |
{{!
|
|
|
2 |
This file is part of Moodle - http://moodle.org/
|
|
|
3 |
|
|
|
4 |
Moodle is free software: you can redistribute it and/or modify
|
|
|
5 |
it under the terms of the GNU General Public License as published by
|
|
|
6 |
the Free Software Foundation, either version 3 of the License, or
|
|
|
7 |
(at your option) any later version.
|
|
|
8 |
|
|
|
9 |
Moodle is distributed in the hope that it will be useful,
|
|
|
10 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
11 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
12 |
GNU General Public License for more details.
|
|
|
13 |
|
|
|
14 |
You should have received a copy of the GNU General Public License
|
|
|
15 |
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
|
|
16 |
}}
|
|
|
17 |
{{!
|
|
|
18 |
@template core/search_input
|
|
|
19 |
|
|
|
20 |
Simple search input.
|
|
|
21 |
|
|
|
22 |
Example context (json):
|
|
|
23 |
{
|
|
|
24 |
"action": "https://moodle.local/admin/search.php",
|
|
|
25 |
"extraclasses": "my-2",
|
|
|
26 |
"inputname": "search",
|
|
|
27 |
"inform": false,
|
|
|
28 |
"searchstring": "Search settings",
|
|
|
29 |
"value": "policy",
|
|
|
30 |
"btnclass": "primary",
|
|
|
31 |
"query": "themedesigner",
|
|
|
32 |
"hiddenfields": [
|
|
|
33 |
{
|
|
|
34 |
"name": "context",
|
|
|
35 |
"value": "11"
|
|
|
36 |
}
|
|
|
37 |
]
|
|
|
38 |
}
|
|
|
39 |
}}
|
|
|
40 |
<div class="simplesearchform {{ extraclasses }}">
|
|
|
41 |
{{^inform}}
|
|
|
42 |
<form autocomplete="off" action="{{ action }}" method="get" accept-charset="utf-8" class="mform form-inline w-100">
|
|
|
43 |
{{/inform}}
|
|
|
44 |
{{#hiddenfields}}
|
|
|
45 |
<input type="hidden" name="{{ name }}" value="{{ value }}">
|
|
|
46 |
{{/hiddenfields}}
|
|
|
47 |
<div class="search-input-group d-inline-flex justify-content-between w-100">
|
|
|
48 |
<label for="searchinput-{{uniqid}}">
|
|
|
49 |
<span class="sr-only">{{{ searchstring }}}</span>
|
|
|
50 |
</label>
|
|
|
51 |
|
|
|
52 |
<span class="search-input-icon">
|
|
|
53 |
<svg width="22" height="22" fill="none" viewBox="0 0 24 24">
|
|
|
54 |
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19.25 19.25L15.5 15.5M4.75 11C4.75 7.54822 7.54822 4.75 11 4.75C14.4518 4.75 17.25 7.54822 17.25 11C17.25 14.4518 14.4518 17.25 11 17.25C7.54822 17.25 4.75 14.4518 4.75 11Z"></path>
|
|
|
55 |
</svg>
|
|
|
56 |
</span>
|
|
|
57 |
|
|
|
58 |
<input type="text"
|
|
|
59 |
id="searchinput-{{uniqid}}"
|
|
|
60 |
class="search-input w-100"
|
|
|
61 |
placeholder="{{ searchstring }}"
|
|
|
62 |
aria-label="{{ searchstring }}"
|
|
|
63 |
name="{{ inputname }}"
|
|
|
64 |
data-region="input"
|
|
|
65 |
autocomplete="off"
|
|
|
66 |
value="{{ query }}"
|
|
|
67 |
>
|
|
|
68 |
<button type="submit" class="search-input-btn">
|
|
|
69 |
<svg width="22" height="22" fill="none" viewBox="0 0 24 24">
|
|
|
70 |
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13.75 6.75L19.25 12L13.75 17.25"></path>
|
|
|
71 |
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 12H4.75"></path>
|
|
|
72 |
</svg>
|
|
|
73 |
<span class="sr-only">{{ searchstring }}</span>
|
|
|
74 |
</button>
|
|
|
75 |
|
|
|
76 |
</div>
|
|
|
77 |
{{#otherfields}}
|
|
|
78 |
<div class="ml-2">{{{ otherfields }}}</div>
|
|
|
79 |
{{/otherfields}}
|
|
|
80 |
{{^inform}}
|
|
|
81 |
</form>
|
|
|
82 |
{{/inform}}
|
|
|
83 |
</div>
|