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/dynamictabs/editor
19
 
20
    Template for the custom report editor
21
 
22
    Example context (json):
23
    {
24
        "id": 1,
25
        "type": 1,
26
        "table": "table",
27
        "editmode": true,
28
        "attributes": [{
29
            "name": "data-custom",
30
            "value": "1"
31
        }],
32
        "sidebarmenucards": [{
33
            "menucards": [{
34
                "name": "General",
35
                "items": [{
36
                    "name": "Manually added users",
37
                    "identifier": "core_reportbuilder:users"
38
                }]
39
            }]
40
        }],
41
        "conditions": [{
42
            "hasavailableconditions": true,
43
            "availableconditions": [{
44
                "optiongroup": [{
45
                    "text": "User",
46
                    "values": [{
47
                        "value": 1,
48
                        "visiblename": "User name"
49
                    }]
50
                }]
51
            }],
52
            "hasactiveconditions": true,
53
            "activeconditionsform": "form"
54
        }],
55
        "filters": [{
56
            "hasavailablefilters": true,
57
            "availablefilters": [{
58
                "optiongroup": [{
59
                    "text": "User",
60
                    "values": [{
61
                        "value": 1,
62
                        "visiblename": "User name"
63
                    }]
64
                }]
65
            }],
66
            "hasactivefilters": true,
67
            "activefilters": [{
68
                "heading": "Email address",
69
                "entityname": "user",
70
                "headingeditable": "Email address"
71
            }]
72
        }],
73
        "sorting": [{
74
            "hassortablecolumns": true,
75
            "sortablecolumns": [{
76
                "id": 1,
77
                "title": "Email address",
78
                "sortdirection": "4",
79
                "sortenabled": true,
80
                "sortorder": 1,
81
                "sorticon": [{
82
                    "key": "t/uplong",
83
                    "component": "core",
84
                    "title": "Sort column 'Email address' ascending"
85
                }],
86
                "heading": "Email address"
87
            }]
88
        }],
89
        "cardview": {
90
            "form": "form"
91
        }
92
    }
93
}}
94
<h2 class="sr-only">{{#str}} editor, core_reportbuilder {{/str}}</h2>
95
<div class="reportbuilder-report"
96
     data-region="core_reportbuilder/report"
97
     data-report-id="{{id}}"
98
     data-report-type="{{type}}"
99
     data-parameter="[]"
100
     {{#editmode}}data-editing{{/editmode}}
101
     {{#attributes}}{{name}}="{{value}}" {{/attributes}}>
102
    <div class="reportbuilder-wrapper d-flex flex-column flex-lg-row">
103
        {{#editmode}}
104
            {{! Menu sidebar }}
105
            {{> core_reportbuilder/local/sidebar-menu/area}}
106
        {{/editmode}}
107
        {{! Report }}
108
        <div class="reportbuilder-report-container">
109
            <div class="{{#editmode}}p-2 border{{/editmode}}">
110
                <div data-region="core_reportbuilder/report-header" class="dropdown d-flex justify-content-end">
111
                    {{! Preview/Edit button }}
112
                    <button data-action="toggle-edit-preview" class="btn btn-outline-secondary"
113
                        {{#editmode}}
114
                            data-edit-mode="1" title="{{#str}} switchpreview, core_reportbuilder {{/str}}"
115
                        {{/editmode}}
116
                        {{^editmode}}
117
                            data-edit-mode="0" title="{{#str}} switchedit, core_reportbuilder {{/str}}"
118
                        {{/editmode}}
119
                    >
120
                        {{#editmode}}
121
                            {{#pix}} i/preview, core {{/pix}}
122
                            {{#str}} preview, core {{/str}}
123
                        {{/editmode}}
124
                        {{^editmode}}
125
                            {{#pix}} t/editstring, core {{/pix}}
126
                            {{#str}} edit, core {{/str}}
127
                        {{/editmode}}
128
                    </button>
129
                    {{^editmode}}
130
                        {{! Filters }}
131
                        {{#filterspresent}}
132
                            {{>core_reportbuilder/local/filters/area}}
133
                        {{/filterspresent}}
134
                    {{/editmode}}
135
                </div>
136
                <div class="reportbuilder-editor-table-container mt-2">
137
                    {{! Table }}
138
                    {{{table}}}
139
                </div>
140
            </div>
141
        </div>
142
        {{#editmode}}
143
            {{! Settings sidebar }}
144
            {{> core_reportbuilder/local/settings/area}}
145
        {{/editmode}}
146
    </div>
147
</div>
148
 
149
{{#js}}
150
    require(['core_reportbuilder/editor', 'core_reportbuilder/report'],
151
    function(editor, report) {
152
        editor.init();
153
        report.init();
154
    });
155
{{/js}}