MDL-69454 core_search: consistent backup search
[moodle.git] / lib / templates / search_input.mustache
CommitLineData
ebfee99d
BB
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",
eb9935c9 27 "inform": false,
ebfee99d
BB
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 }}}">
eb9935c9 41 {{^inform}}
ebfee99d 42 <form autocomplete="off" action="{{{ action }}}" method="get" accept-charset="utf-8" class="mform form-inline simplesearchform">
eb9935c9 43 {{/inform}}
ebfee99d
BB
44 {{#hiddenfields}}
45 <input type="hidden" name="{{ name }}" value="{{ value }}">
46 {{/hiddenfields}}
47 <div class="input-group">
48 <label for="searchinput-{{uniqid}}">
49 <span class="sr-only">{{{ searchstring }}}</span>
50 </label>
51 <input type="text"
52 id="searchinput-{{uniqid}}"
53 class="form-control"
54 placeholder="{{{ searchstring }}}"
55 aria-label="{{{ searchstring }}}"
56 name="{{{ inputname }}}"
57 data-region="input"
58 autocomplete="off"
59 value="{{{ query }}}"
60 >
61 <div class="input-group-append">
62 <button type="submit" class="btn {{^btnclass}}btn-submit{{/btnclass}} {{{ btnclass }}} search-icon">
63 {{#pix}} a/search, core {{/pix}}
64 <span class="sr-only">{{{ searchstring }}}</span>
65 </button>
66 </div>
eb9935c9 67
ebfee99d 68 </div>
4c71e1d0
BB
69 {{#otherfields}}
70 <div class="ml-2">{{{ otherfields }}}</div>
71 {{/otherfields}}
eb9935c9
BB
72{{^inform}}
73 </form>
74{{/inform}}
ebfee99d 75</div>