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_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,
1441 ariadna 31
                "sortenabledtitle": "Disable initial sorting for column 'Email address'",
1 efrain 32
                "sortorder": 1,
33
                "sorticon": [{
1441 ariadna 34
                    "key": "t/sort_asc",
35
                    "component": "moodle",
36
                    "title": "Change initial sorting for column 'Email address' to descending"
1 efrain 37
                }],
1441 ariadna 38
                "movetitle": "Move sorting for column 'Email address'",
1 efrain 39
                "heading": "Email address"
40
            }]
41
        }]
42
    }
43
}}
44
 
45
<div class="p-2" data-region="settings-sorting">
46
    {{#sorting}}
47
        {{#hassortablecolumns}}
1441 ariadna 48
            <ul class="list-group reportbuilder-sortable-list ms-0">
1 efrain 49
                {{#sortablecolumns}}
50
                    <li class="list-group-item list-group-item-action d-flex align-items-center text-dark"
1441 ariadna 51
                        data-region="active-column-sort"
1 efrain 52
                        data-column-sort-id="{{id}}"
53
                        data-column-sort-name="{{title}}"
54
                        data-column-sort-direction="{{sortdirection}}"
55
                        data-column-sort-position="{{sortorder}}">
56
                        {{>core/drag_handle}}
57
                        {{#sorticon}}
1441 ariadna 58
                            <span class="float-end">
1 efrain 59
                                <button id="toggle-sort-direction-{{id}}"
60
                                        class="btn btn-link p-0"
61
                                        data-action="report-toggle-sort-direction"
62
                                        title="{{{title}}}"
63
                                        aria-label="{{{title}}}"
64
                                        {{^sortenabled}}disabled{{/sortenabled}}>
65
                                    {{#sorticon}}{{#pix}}{{key}}, {{component}}{{/pix}}{{/sorticon}}
66
                                </button>
67
                            </span>
68
                        {{/sorticon}}
69
                        <input id="toggle-sort-{{id}}" title="{{{sortenabledtitle}}}" data-action="report-toggle-column-sorting" type="checkbox" {{#sortenabled}}checked{{/sortenabled}}>
70
                        <label for="toggle-sort-{{id}}" class="mb-0">
1441 ariadna 71
                            <span class="ms-2 text-dark {{^sortenabled}}text-muted{{/sortenabled}}">{{{heading}}}</span>
72
                            <span class="visually-hidden">{{{sortenabledtitle}}}</span>
1 efrain 73
                        </label>
74
                    </li>
75
                {{/sortablecolumns}}
76
            </ul>
77
        {{/hassortablecolumns}}
78
 
79
        {{^hassortablecolumns}}
80
            {{< core_reportbuilder/local/settings/empty_message }}
81
                {{$nothingtoshow}}{{#str}} nosortablecolumns, core_reportbuilder {{/str}} {{/nothingtoshow}}
82
            {{/ core_reportbuilder/local/settings/empty_message }}
83
        {{/hassortablecolumns}}
84
    {{/sorting}}
85
</div>