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 tool_dataprivacy/categories
19
 
20
    Manage categories.
21
 
22
    Classes required for JS:
23
 
24
    Data attributes required for JS:
25
 
26
    Context variables required for this template:
27
    * categories - array of objects
28
    * actions - array of actions (already in HTML).
29
 
30
    Example context (json):
31
    {
32
        "categoriesexist": 1,
33
        "categories": [
34
            {
35
                "name" : "Category 1",
36
                "description": "<strong>Description 1</strong>",
37
                "actions": [
38
                ]
39
            }, {
40
                "name" : "Category 2",
41
                "description": "<strong>Description 2</strong>",
42
                "actions": [
43
                ]
44
            }
45
        ]
46
    }
47
}}
48
 
49
{{#navigation}}
50
    {{> core/action_link}}
51
{{/navigation}}
52
 
53
<div data-region="categories" class="mt-3 mb-1">
54
    <div class="my-1">
55
        <button class="btn btn-secondary" data-add-element="category" title="{{#str}}addcategory, tool_dataprivacy{{/str}}">
56
            {{#pix}}t/add, moodle, {{#str}}addcategory, tool_dataprivacy{{/str}}{{/pix}}
57
        </button>
58
    </div>
59
    <table class="table table-striped table-hover">
60
        <caption class="accesshide">{{#str}}categorieslist, tool_dataprivacy{{/str}}</caption>
61
        <thead>
62
            <tr>
63
                <th scope="col">{{#str}}name{{/str}}</th>
64
                <th scope="col" class="w-50">{{#str}}description{{/str}}</th>
65
                <th scope="col">{{#str}}actions{{/str}}</th>
66
            </tr>
67
        </thead>
68
        <tbody>
69
            {{#categories}}
70
            <tr data-categoryid="{{id}}">
71
                <td>{{{name}}}</td>
72
                <td>{{{description}}}</td>
73
                <td>
74
                    {{#actions}}
75
                        {{> core/action_menu}}
76
                    {{/actions}}
77
                </td>
78
            </tr>
79
            {{/categories}}
80
        </tbody>
81
    </table>
82
    {{^categories}}
83
        <p>
84
            {{#str}}nocategories, tool_dataprivacy{{/str}}
85
        </p>
86
    {{/categories}}
87
</div>