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
{{!
1441 ariadna 18
    @template tool_lp/manage_competency_frameworks_page
19
 
1 efrain 20
    Manage competency frameworks template.
21
 
22
    Classes required for JS:
23
    * drag-parentnode
24
    * drag-handlecontainer
25
    * drag-samenode
26
    * competencyframeworkactions
27
 
28
    Data attributes required for JS:
29
    * data-region = managecompetencies
30
    * data-frameworkid = id
31
    * data-action = deletecompetencyframework
32
 
33
    Context variables required for this template:
34
    * competencyframeworks - array of objects containing id, shortname, idnumber, visible
35
    * canmanage - true if this user has permission to manage the frameworks
36
    * navigation - array of strings containing buttons for navigation
1441 ariadna 37
 
38
    Example context (json):
39
    {
40
        "competencyframeworks": {
41
            "id": 1,
42
            "shortname": "Framework1",
43
            "idnumber": "FRAME1",
44
            "visible": true,
45
            "contextnamenoprefix": "System",
46
            "competenciescount": 26,
47
            "pluginbaseurl": "https://example.com",
48
            "pagecontextid": 1
49
        },
50
        "canmanage": true
51
    }
1 efrain 52
}}
53
<div data-region="managecompetencies">
1441 ariadna 54
<div class="float-start">
1 efrain 55
    {{#navigation}}
56
    {{{.}}}
57
    {{/navigation}}
58
</div>
59
<table class="generaltable fullwidth managecompetencies">
60
    <caption>{{#str}}listcompetencyframeworkscaption, tool_lp{{/str}}</caption>
61
    <thead>
62
        <tr>
63
            <th scope="col">{{#str}}competencyframeworkname, tool_lp{{/str}}</th>
64
            <th scope="col">{{#str}}competencies, core_competency{{/str}}</th>
65
            <th scope="col">{{#str}}category, tool_lp{{/str}}</th>
66
            <th scope="col">{{#str}}actions, tool_lp{{/str}}</th>
67
        </tr>
68
    </thead>
69
    <tbody class="drag-parentnode">
70
        {{#competencyframeworks}}
71
        <tr class="drag-samenode" data-frameworkid="{{id}}">
72
            <td><span class="drag-handlecontainer"></span><span><a href="{{pluginbaseurl}}/competencies.php?competencyframeworkid={{id}}&amp;pagecontextid={{pagecontextid}}">{{{shortname}}} ({{idnumber}})</a></span> {{^visible}}{{#str}}hiddenhint, tool_lp{{/str}}{{/visible}}</td>
73
            <td>{{competenciescount}}</td>
74
            <td>{{contextnamenoprefix}}</td>
75
            <td>
76
            {{#canmanage}}
77
            <ul title="{{#str}}edit{{/str}}" class="competencyframeworkactions">
78
                <li>
79
                    <a href="#">{{#str}}edit{{/str}}</a><b class="caret"></b>
80
                    <ul class="dropdown dropdown-menu">
81
                        <li class="dropdown-item">
82
                            <a href="{{pluginbaseurl}}/editcompetencyframework.php?id={{id}}&amp;pagecontextid={{pagecontextid}}">
1441 ariadna 83
                                {{#pix}}i/settings{{/pix}} {{#str}}edit{{/str}}
1 efrain 84
                            </a>
85
                        </li>
86
                        <li class="dropdown-item">
87
                            <a data-action="duplicatecompetencyframework" href="#" data-frameworkid="{{id}}">
88
                                {{#pix}}t/copy{{/pix}} {{#str}}duplicate{{/str}}
89
                            </a>
90
                        </li>
91
                        <li class="dropdown-item">
92
                            <a data-action="deletecompetencyframework" href="#" data-frameworkid="{{id}}">
93
                                {{#pix}}t/delete{{/pix}} {{#str}}delete{{/str}}
94
                            </a>
95
                        </li>
96
                    </ul>
97
                </li>
98
            </ul>
99
            {{/canmanage}}
100
            </td>
101
        </tr>
102
        {{/competencyframeworks}}
103
    </tbody>
104
</table>
105
{{^competencyframeworks}}
106
<p class="alert alert-info">
107
    {{#str}}nocompetencyframeworks, tool_lp{{/str}}
108
</p>
109
{{/competencyframeworks}}
110
 
111
{{#js}}
112
// Initialise the JS.
113
require(['tool_lp/frameworkactions',
114
         'tool_lp/menubar'],
115
        function(actionsMod, menubar) {
116
 
117
    actionsMod.init({{pagecontextid}});
118
 
119
    menubar.enhance('.competencyframeworkactions', {
120
        "[data-action='deletecompetencyframework']": actionsMod.deleteHandler,
121
        "[data-action='duplicatecompetencyframework']": actionsMod.duplicateHandler,
122
    });
123
});
124
 
125
{{/js}}
126
 
127
</div>