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
    Moodle is free software: you can redistribute it and/or modify
4
    it under the terms of the GNU General Public License as published by
5
    the Free Software Foundation, either version 3 of the License, or
6
    (at your option) any later version.
7
    Moodle is distributed in the hope that it will be useful,
8
    but WITHOUT ANY WARRANTY; without even the implied warranty of
9
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10
    GNU General Public License for more details.
11
    You should have received a copy of the GNU General Public License
12
    along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
13
}}
14
{{!
15
    @template core/local/comboboxsearch/resultset
16
 
17
    Wrapping template for returned result items.
18
 
19
    Context variables required for this template:
20
    * instance - The instance ID of the combo box.
21
    * results - Our returned results to render.
22
    * searchterm - The entered text to find these results.
23
    * hasresult - Allow the handling where no results exist for the returned search term.
24
 
25
    Example context (json):
26
    {
27
        "instance": 25,
28
        "results": [
29
            {
30
                "id": 2,
31
                "name": "Foo bar"
32
            },
33
            {
34
                "id": 3,
35
                "name": "Bar Foo"
36
            }
37
        ],
38
        "searchterm": "Foo",
39
        "hasresults": true
40
    }
41
}}
42
<div class="d-flex flex-column mh-100 h-100">
43
    <ul
44
        id="{{$listid}}list{{/listid}}-{{instance}}-result-listbox"
45
        class="searchresultitemscontainer d-flex flex-column mw-100 position-relative py-2 list-group h-100 mx-0 {{$listclasses}}{{/listclasses}}"
46
        role="listbox"
47
        data-region="search-result-items-container"
48
    >
49
        {{#hasresults}}
50
            {{$results}}
51
                {{#results}}
52
                    {{>core/local/comboboxsearch/resultitem}}
53
                {{/results}}
54
            {{/results}}
55
            {{$selectall}}{{/selectall}}
56
        {{/hasresults}}
57
    </ul>
58
    {{^hasresults}}
59
        <span class="small d-block px-4 mt-2 mb-4">{{#str}} noresultsfor, core, {{searchterm}}{{/str}}</span>
60
    {{/hasresults}}
61
</div>