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 gradereport_grader/search/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/monocolor/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/monocolor/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
        "hasusers": true
51
    }
52
}}
53
<div class="d-flex flex-column mh-100 h-100">
54
    {{#hasusers}}
55
        <ul class="searchresultitemscontainer d-flex flex-column mw-100 position-relative list-group h-100 mh-100 m-0 p-0" role="listbox" data-region="search-result-items-container" tabindex="-1">
56
            {{#users}}
57
                {{>gradereport_grader/search/resultitem}}
58
            {{/users}}
59
            <li class="w-100 result-row p-1 border-top bottom-0 mb-0 position-sticky" role="none" id="result-row-{{id}}">
60
                <a role="option" class="dropdown-item d-flex small" id="select-all" href="{{{selectall}}}" tabindex="-1">
61
                    {{#str}}viewallresults, gradereport_grader, {{matches}}{{/str}}
62
                </a>
63
            </li>
64
        </ul>
65
    {{/hasusers}}
66
    {{^hasusers}}
67
        <span class="small d-block px-2 my-2">{{#str}} noresultsfor, core_grades, {{searchterm}}{{/str}}</span>
68
    {{/hasusers}}
69
</div>