Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
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
        "buttonattributes": [
32
            {
33
                "key": "name",
34
                "value": "hello"
35
            }
36
        ],
37
        "query": "themedesigner",
38
        "hiddenfields": [
39
            {
40
                "name": "context",
41
                "value": "11"
42
            }
43
        ]
44
    }
45
}}
46
<div class="simplesearchform {{ extraclasses }}">
47
    {{^inform}}
48
    <form autocomplete="off" action="{{ action }}" method="get" accept-charset="utf-8" class="mform d-flex flex-wrap align-items-center simplesearchform">
49
    {{/inform}}
50
    {{#hiddenfields}}
51
        <input type="hidden" name="{{ name }}" value="{{ value }}">
52
    {{/hiddenfields}}
53
    <div class="input-group">
54
        <label for="searchinput-{{uniqid}}">
55
            <span class="sr-only">{{{ searchstring }}}</span>
56
        </label>
57
        <input type="text"
58
           id="searchinput-{{uniqid}}"
59
           class="form-control"
60
           placeholder="{{ searchstring }}"
61
           aria-label="{{ searchstring }}"
62
           name="{{ inputname }}"
63
           data-region="input"
64
           autocomplete="off"
65
           value="{{ query }}"
66
        >
67
        <div class="input-group-append">
68
            <button type="submit"
69
                class="btn {{^btnclass}}btn-submit{{/btnclass}} {{ btnclass }} search-icon"
70
                {{#buttonattributes}}{{ key }}="{{ value }}" {{/buttonattributes}}
71
            >
72
                {{#pix}} a/search, core {{/pix}}
73
                <span class="sr-only">{{ searchstring }}</span>
74
            </button>
75
        </div>
76
 
77
    </div>
78
    {{#otherfields}}
79
        <div  class="ml-2">{{{ otherfields }}}</div>
80
    {{/otherfields}}
81
{{^inform}}
82
    </form>
83
{{/inform}}
84
</div>