Proyectos de Subversion Moodle

Rev

Rev 1 | | Comparar con el anterior | 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/result
19
 
20
    Template which shows a search result.
21
 
22
    Classes required for JS:
23
    * none
24
 
25
    Data attributes required for JS:
26
    * none
27
 
28
    Context variables required for this template:
29
    * courseurl
30
    * coursefullname
31
    * title
32
    * docurl
33
    * contexturl
34
 
35
    Optional context variables for this template:
36
    * content
37
    * userurl
38
    * userfullname
39
    * description1
40
    * description2
41
    * filename
42
    * multiplefiles
43
    * filenames
44
    * itemid
45
    * contextid
46
    * userid
47
    * timemodified
1441 ariadna 48
    * iconname
49
    * iconcomponent
50
    * icon
51
    * iconurl
1 efrain 52
 
53
    Example context (json):
54
    {
55
        "courseurl": "https://example.com/course/view.php?id=2",
56
        "coursefullname": "Example course",
57
        "title": "Example title",
58
        "docurl": "https://example.com/mod/example/view.php?id=4",
59
        "content": "I am content",
60
        "contexturl": "https://example.com/mod/example/view.php?id=2",
61
        "userurl": "https://example.com/user/profile.php?id=3",
62
        "userfullname": "Example User Full Name",
63
        "multiplefiles": true,
64
        "filenames":
65
        [
66
            "file1.txt",
67
            "file2.txt"
1441 ariadna 68
        ],
69
        "iconname": "i/customfield"
1 efrain 70
    }
71
}}
72
<div class="result">
73
    <h4 class="result-title">
1441 ariadna 74
        {{#iconname}}
75
            {{#pix}}{{iconname}}, {{iconcomponent}}{{/pix}}
76
        {{/iconname}}
77
        <a href="{{{docurl}}}">{{{title}}}</a>
1 efrain 78
    </h4>
79
    {{#content}}
80
        <div class="result-content">{{{content}}}</div>
81
    {{/content}}
82
    {{#description1}}
83
        <div class="result-content">{{{description1}}}</div>
84
    {{/description1}}
85
    {{#description2}}
86
        <div class="result-content">{{{description2}}}</div>
87
    {{/description2}}
88
    {{#filename}}
89
        <div class="result-content-filename">
90
            {{#str}}matchingfile, search, {{{filename}}}{{/str}}
91
        </div>
92
    {{/filename}}
93
    {{#multiplefiles}}
94
        <div class="result-content-filenames">
95
            {{#str}}matchingfiles, search{{/str}}<br>
96
            <ul class="list">
97
            {{#filenames}}
98
                <li><span class="filename">{{.}}</span></li>
99
            {{/filenames}}
100
            </ul>
101
        </div>
102
    {{/multiplefiles}}
103
    <div class="result-context-info">
104
        <a href="{{{contexturl}}}">{{#str}}viewresultincontext, search{{/str}}</a> -
105
        <a href="{{{courseurl}}}">{{#str}}incourse, search, {{{coursefullname}}}{{/str}}</a>
106
        {{#userfullname}}
107
            - <a href="{{{userurl}}}">{{#str}}byname, moodle, {{{userfullname}}}{{/str}}</a>
108
        {{/userfullname}}
109
    </div>
110
</div>