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_user/comboboxsearch/resultset
16
 
17
    Wrapping template for returned result items.
18
 
19
    Context variables required for this template:
20
    * users - Our returned users to render.
21
    * found - Count of the found users.
22
    * total - Total count of users within this report.
23
    * selectall - The created link that allows users to select all of the results.
24
    * searchterm - The entered text to find these results.
25
    * hasusers - Allow the handling where no users exist for the returned search term.
26
 
27
    Example context (json):
28
    {
29
        "users": [
30
            {
31
                "id": 2,
32
                "fullname": "Foo bar",
33
                "profileimageurl": "http://foo.bar/pluginfile.php/79/user/icon/boost/f1?rev=7630",
34
                "matchingField": "<span class=\"font-weight-bold\">Foo</span> bar",
35
                "matchingFieldName": "Fullname",
36
                "link": "http://foo.bar/grade/report/grader/index.php?id=42&userid=2"
37
            },
38
            {
39
                "id": 3,
40
                "fullname": "Bar Foo",
41
                "profileimageurl": "http://foo.bar/pluginfile.php/80/user/icon/boost/f1?rev=7631",
42
                "matchingField": "Bar <span class=\"font-weight-bold\">Foo</span>",
43
                "matchingFieldName": "Fullname",
44
                "link": "http://foo.bar/grade/report/grader/index.php?id=42&userid=3"
45
            }
46
        ],
47
        "matches": 20,
48
        "selectall": "https://foo.bar/grade/report/grader/index.php?id=2&searchvalue=abe",
49
        "searchterm": "Foo",
50
        "hasresults": true
51
    }
52
}}
53
{{<core/local/comboboxsearch/resultset}}
54
    {{$listid}}user{{/listid}}
55
    {{$results}}
56
        {{#users}}
57
            {{>core_user/comboboxsearch/resultitem}}
58
        {{/users}}
59
    {{/results}}
60
    {{$selectall}}
61
        {{#selectall}}
62
            <li class="w-100 result-row p-1 border-top bottom-0 position-sticky" role="none" id="result-row-{{id}}">
63
                <a role="option" class="dropdown-item d-flex small btn btn-sm" id="select-all" href="{{{selectall}}}" tabindex="-1">
64
                    {{#str}}viewallresults, core, {{matches}}{{/str}}
65
                </a>
66
            </li>
67
        {{/selectall}}
68
    {{/selectall}}
69
    {{$listclasses}}mh-100{{/listclasses}}
70
{{/core/local/comboboxsearch/resultset}}