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
 
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/filters
19
 
20
    Template for custom report filters settings area
21
 
22
    Example context (json):
23
    {
24
        "filters": [{
25
            "hasavailablefilters": true,
26
            "availablefilters": [{
27
                "optiongroup": [{
28
                    "text": "User",
29
                    "values": [{
30
                        "value": 1,
31
                        "visiblename": "User name"
32
                    }]
33
                }]
34
            }],
35
            "hasactivefilters": true,
36
            "activefilters": [{
37
                "heading": "Email address",
38
                "entityname": "user",
39
                "headingeditable": "Email address"
40
            }]
41
        }]
42
    }
43
}}
44
 
45
<div class="p-2" data-region="settings-filters">
46
    {{#filters}}
47
        {{#hasavailablefilters}}
48
            <div class="reportbuilder-filters-select">
49
                <label for="addfilterselect" class="sr-only">{{#str}}selectafilter, core_reportbuilder{{/str}}</label>
50
                <select id="addfilterselect" name="addfilterselect" data-action="report-add-filter" class="w-100 custom-select">
51
                    <option value="0"></option>
52
                    {{#availablefilters}}
53
                        {{#optiongroup}}
54
                            <option disabled class="suggestions-heading">{{text}}</option>
55
                            {{#values}}
56
                                <option value="{{value}}">{{visiblename}}</option>
57
                            {{/values}}
58
                        {{/optiongroup}}
59
                    {{/availablefilters}}
60
                </select>
61
            </div>
62
        {{/hasavailablefilters}}
63
 
64
        <div data-region="active-filters" class="form-vertical">
65
            {{#hasactivefilters}}
66
                <ul class="list-group reportbuilder-sortable-list mt-2 ml-0">
67
                    {{#activefilters}}
68
                        <li class="list-group-item list-group-item-action d-flex align-items-start text-dark"
69
                            data-region="active-filter" data-filter-id="{{id}}" data-filter-name="{{heading}}" data-filter-position="{{sortorder}}">
70
                            {{>core/drag_handle}}
71
                            <div>
72
                                <div class="d-flex">
73
                                    <small class="text-muted text-uppercase">{{entityname}} • {{heading}}</small>
74
                                </div>
75
                                <div>
76
                                    {{{headingeditable}}}
77
                                </div>
78
                            </div>
79
                            <button class="btn btn-link p-0 ml-auto"
80
                                    type="button"
81
                                    data-action="report-remove-filter"
82
                                    title="{{#str}}deletefilter, core_reportbuilder, {{{heading}}}{{/str}}"
83
                                    aria-label="{{#str}}deletefilter, core_reportbuilder, {{{heading}}}{{/str}}">
84
                                {{#pix}}e/cancel, core{{/pix}}
85
                            </button>
86
                        </li>
87
                    {{/activefilters}}
88
                </ul>
89
            {{/hasactivefilters}}
90
 
91
            {{^hasactivefilters}}
92
                {{< core_reportbuilder/local/settings/empty_message }}
93
                    {{$nothingtoshow}} {{#str}} nofilters, core_reportbuilder {{/str}} {{/nothingtoshow}}
94
                {{/ core_reportbuilder/local/settings/empty_message }}
95
            {{/hasactivefilters}}
96
        </div>
97
    {{/filters}}
98
</div>