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_reportbuilder/local/settings/sorting
|
|
|
19 |
|
|
|
20 |
Template for custom report sortable columns settings area
|
|
|
21 |
|
|
|
22 |
Example context (json):
|
|
|
23 |
{
|
|
|
24 |
"sorting": [{
|
|
|
25 |
"hassortablecolumns": true,
|
|
|
26 |
"sortablecolumns": [{
|
|
|
27 |
"id": 1,
|
|
|
28 |
"title": "Email address",
|
|
|
29 |
"sortdirection": "4",
|
|
|
30 |
"sortenabled": true,
|
|
|
31 |
"sortorder": 1,
|
|
|
32 |
"sorticon": [{
|
|
|
33 |
"key": "t/uplong",
|
|
|
34 |
"component": "core",
|
|
|
35 |
"title": "Sort column 'Email address' ascending"
|
|
|
36 |
}],
|
|
|
37 |
"heading": "Email address"
|
|
|
38 |
}]
|
|
|
39 |
}]
|
|
|
40 |
}
|
|
|
41 |
}}
|
|
|
42 |
|
|
|
43 |
<div class="p-2" data-region="settings-sorting">
|
|
|
44 |
{{#sorting}}
|
|
|
45 |
{{#hassortablecolumns}}
|
|
|
46 |
<ul class="list-group reportbuilder-sortable-list ml-0">
|
|
|
47 |
{{#sortablecolumns}}
|
|
|
48 |
<li class="list-group-item list-group-item-action d-flex align-items-center text-dark"
|
|
|
49 |
data-column-sort-id="{{id}}"
|
|
|
50 |
data-column-sort-name="{{title}}"
|
|
|
51 |
data-column-sort-direction="{{sortdirection}}"
|
|
|
52 |
data-column-sort-position="{{sortorder}}">
|
|
|
53 |
{{>core/drag_handle}}
|
|
|
54 |
{{#sorticon}}
|
|
|
55 |
<span class="float-right">
|
|
|
56 |
<button id="toggle-sort-direction-{{id}}"
|
|
|
57 |
class="btn btn-link p-0"
|
|
|
58 |
data-action="report-toggle-sort-direction"
|
|
|
59 |
title="{{{title}}}"
|
|
|
60 |
aria-label="{{{title}}}"
|
|
|
61 |
{{^sortenabled}}disabled{{/sortenabled}}>
|
|
|
62 |
{{#sorticon}}{{#pix}}{{key}}, {{component}}{{/pix}}{{/sorticon}}
|
|
|
63 |
</button>
|
|
|
64 |
</span>
|
|
|
65 |
{{/sorticon}}
|
|
|
66 |
<input id="toggle-sort-{{id}}" title="{{{sortenabledtitle}}}" data-action="report-toggle-column-sorting" type="checkbox" {{#sortenabled}}checked{{/sortenabled}}>
|
|
|
67 |
<label for="toggle-sort-{{id}}" class="mb-0">
|
|
|
68 |
<span class="ml-2 text-dark {{^sortenabled}}text-muted{{/sortenabled}}">{{{heading}}}</span>
|
|
|
69 |
<span class="sr-only">{{{sortenabledtitle}}}</span>
|
|
|
70 |
</label>
|
|
|
71 |
</li>
|
|
|
72 |
{{/sortablecolumns}}
|
|
|
73 |
</ul>
|
|
|
74 |
{{/hassortablecolumns}}
|
|
|
75 |
|
|
|
76 |
{{^hassortablecolumns}}
|
|
|
77 |
{{< core_reportbuilder/local/settings/empty_message }}
|
|
|
78 |
{{$nothingtoshow}}{{#str}} nosortablecolumns, core_reportbuilder {{/str}} {{/nothingtoshow}}
|
|
|
79 |
{{/ core_reportbuilder/local/settings/empty_message }}
|
|
|
80 |
{{/hassortablecolumns}}
|
|
|
81 |
{{/sorting}}
|
|
|
82 |
</div>
|