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_grades/bulkactions/edit/tree/bulk_move_category_item
19
 
20
    Recursively renders a grade category tree for the bulk move modal.
21
 
22
    Context variables required for this template:
23
    * id - The id of the category.
24
    * name - The name of the category.
25
    * children - An array of child categories.
26
    * iscategory - Whether the item is a category or not.
27
    * haschildcategories - Whether the item has child categories or not.
28
 
29
    Example context (json):
30
    {
31
        "id": 1,
32
        "name": "Category 1",
33
        "children": [
34
            {
35
                "id": 2,
36
                "name": "Category 2",
37
                "children": [
38
                    {
39
                        "id": 3,
40
                        "name": "Category 3",
41
                        "children": [
42
                            {
43
                                "id": 4,
44
                                "name": "Category 4",
45
                                "children": [],
46
                                "iscategory": true
47
                            }
48
                        ],
49
                        "iscategory": true,
50
                        "haschildcategories": true
51
                    }
52
                ],
53
                "iscategory": true,
54
                "haschildcategories": true
55
            }
56
        ],
57
        "iscategory": true,
58
        "haschildcategories": true
59
    }
60
}}
61
 
62
{{#haschildcategories}}
63
    <li data-for="sectionnode" role="treeitem" aria-owns="movemodalcollapse{{id}}" data-type="category" data-id="{{id}}" data-selected="false" aria-expanded="true" data-collapsible="true">
64
        <div class="collapse-list-item d-flex" id="movemodalsection{{id}}">
65
            <a role="button" href="#movemodalcollapse{{id}}" aria-controls="movemodalcollapse{{id}}" class="collapse-list-link btn" tabindex="-1">
66
                <span class="expanded-icon text-nowrap" data-toggle="tooltip"  title="{{#str}} collapse, core {{/str}}">
67
                    {{#pix}} t/expandedchevron, core, {{#str}} collapse, core {{/str}} {{/pix}}
68
                </span>
69
                <span class="collapsed-icon text-nowrap" data-toggle="tooltip"  title="{{#str}} expand, core {{/str}}">
70
                    <span class="dir-rtl-hide">{{#pix}} t/collapsedchevron, core, {{#str}} expand, core {{/str}} {{/pix}}</span>
71
                    <span class="dir-ltr-hide">{{#pix}} t/collapsedchevron_rtl, core, {{#str}} expand, core {{/str}} {{/pix}}</span>
72
                </span>
73
            </a>
74
            <span class="collapse-list-item-name">{{name}}</span>
75
        </div>
76
        <div id="movemodalcollapse{{id}}" class="collapse-list-item-content">
77
            <ul class="unlist" role="group" aria-labelledby="movemodalsection{{id}}">
78
                {{#children}}
79
                    {{#iscategory}}
80
                        {{> core_grades/bulkactions/edit/tree/bulk_move_category_item }}
81
                    {{/iscategory}}
82
                {{/children}}
83
            </ul>
84
        </div>
85
    </li>
86
{{/haschildcategories}}
87
{{^haschildcategories}}
88
    <li data-for="sectionnode" role="treeitem" data-type="category" data-id="{{id}}" data-selected="false">
89
        <div class="collapse-list-item d-flex">
90
            <span class="collapse-list-item-name ml-2">{{name}}</span>
91
        </div>
92
    </li>
93
{{/haschildcategories}}