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
{{!
18
    Plan page template.
19
}}
20
<div data-region="plan-page" data-id="{{plan.id}}" data-userid="{{plan.userid}}">
21
    <h2>
22
        {{{plan.name}}}
23
        {{#plan.canbeedited}}
1441 ariadna 24
            <a href="{{pluginbaseurl}}/editplan.php?id={{plan.id}}&amp;userid={{plan.userid}}">
25
                {{#pix}}i/settings, core, {{#str}}editplan, tool_lp{{/str}}{{/pix}}
26
            </a>
1 efrain 27
        {{/plan.canbeedited}}
28
    </h2>
29
    {{#plan.canbeedited}}
30
    <div data-region="actions" class="clearfix">
1441 ariadna 31
        <div class="float-start">
1 efrain 32
            <!-- Button to add competencies to the plan -->
33
            <button class="btn btn-secondary" data-action="add">{{#pix}}t/add{{/pix}} {{#str}}addcompetency, tool_lp{{/str}}</button>
34
        </div>
35
    </div>
36
    {{/plan.canbeedited}}
37
    <div data-region="plan-summary" class="mt-1">
38
        {{{plan.description}}}
39
        <dl>
40
            <dt>{{#str}}status, tool_lp{{/str}}</dt>
41
            <dd>
42
                {{plan.statusname}}
43
 
44
                {{#plan.isinreview}}
45
                    - {{plan.reviewer.fullname}}
46
                {{/plan.isinreview}}
47
 
48
                {{#plan.iscompleteallowed}}
49
                    (<a data-action="plan-complete" href="#">{{#str}}completeplan, tool_lp{{/str}}</a>)
50
                {{/plan.iscompleteallowed}}
51
                {{#plan.isreopenallowed}}
52
                    (<a data-action="plan-reopen" href="#">{{#str}}reopenplan, tool_lp{{/str}}</a>)
53
                {{/plan.isreopenallowed}}
54
                {{#plan.isrequestreviewallowed}}
55
                    (<a data-action="plan-request-review" href="#">{{#str}}requestreview, tool_lp{{/str}}</a>)
56
                {{/plan.isrequestreviewallowed}}
57
                {{#plan.iscancelreviewrequestallowed}}
58
                    (<a data-action="plan-cancel-review-request" href="#">{{#str}}cancelreviewrequest, tool_lp{{/str}}</a>)
59
                {{/plan.iscancelreviewrequestallowed}}
60
                {{#plan.isstartreviewallowed}}
61
                    (<a data-action="plan-start-review" href="#">{{#str}}startreview, tool_lp{{/str}}</a>)
62
                {{/plan.isstartreviewallowed}}
63
                {{#plan.isstopreviewallowed}}
64
                    (<a data-action="plan-stop-review" href="#">{{#str}}stopreview, tool_lp{{/str}}</a>)
65
                {{/plan.isstopreviewallowed}}
66
                {{#plan.isapproveallowed}}
67
                    (<a data-action="plan-approve" href="#">{{#str}}planapprove, tool_lp{{/str}}</a>)
68
                {{/plan.isapproveallowed}}
69
                {{#plan.isunapproveallowed}}
70
                    (<a data-action="plan-unapprove" href="#">{{#str}}planunapprove, tool_lp{{/str}}</a>)
71
                {{/plan.isunapproveallowed}}
72
 
73
            </dd>
74
            {{#plan.duedate}}
75
                <dt>{{#str}}duedate, tool_lp{{/str}}</dt>
76
                <dd>{{plan.duedateformatted}}</dd>
77
            {{/plan.duedate}}
78
            {{#plan.template}}
79
                <dt>{{#str}}template, tool_lp{{/str}}</dt>
80
                <dd>
81
                    {{#canread}}
82
                        <a href="{{pluginbaseurl}}/templatecompetencies.php?templateid={{id}}&amp;pagecontextid={{contextid}}">
83
                    {{/canread}}
84
                    {{{plan.template.shortname}}}{{#canread}}</a>{{/canread}}
85
                    {{#plan.isunlinkallowed}}
86
                        (<a data-action="plan-unlink" href="#">{{#str}}unlinkplantemplate, tool_lp{{/str}}</a>)
87
                    {{/plan.isunlinkallowed}}
88
                </dd>
89
            {{/plan.template}}
90
            {{#description}}
91
                <dt>{{#str}}description{{/str}}</dt>
92
                <dd>{{{plan.description}}}</dd>
93
            {{/description}}
94
            <dt>{{#str}}progress, tool_lp{{/str}}</dt>
95
            <dd>
96
            {{< tool_lp/progress_bar}}
97
                {{$progresstext}}
98
                    {{#str}}xcompetenciesproficientoutofy, tool_lp, { "x": "{{proficientcompetencycount}}", "y": "{{competencycount}}" }{{/str}}
99
                {{/progresstext}}
100
                {{$percentage}}{{proficientcompetencypercentage}}{{/percentage}}
101
                {{$percentlabel}}{{proficientcompetencypercentageformatted}}&nbsp;%{{/percentlabel}}
102
            {{/tool_lp/progress_bar}}
103
            </dd>
104
        </dl>
105
    </div>
106
    {{#plan.commentarea}}
107
        {{#canpostorhascomments}}
108
            <div data-region="comments" class="mt-1">
109
                {{>tool_lp/comment_area}}
110
            </div>
111
        {{/canpostorhascomments}}
112
    {{/plan.commentarea}}
113
    <div data-region="plan-competencies" class="mt-1">
114
        <h3>{{#str}}learningplancompetencies, tool_lp{{/str}}</h3>
115
        <table class="generaltable fullwidth managecompetencies">
116
            <thead>
117
                <tr>
118
                    <th scope="col">{{#str}}shortname, tool_lp{{/str}}</th>
119
                    <th scope="col">{{#str}}rating, tool_lp{{/str}}</th>
120
                    <th scope="col">{{#str}}proficient, tool_lp{{/str}}</th>
121
                    {{^plan.iscompleted}}
122
                        <th scope="col">{{#str}}status, tool_lp{{/str}}</th>
123
                        <th scope="col">{{#str}}actions, tool_lp{{/str}}</th>
124
                    {{/plan.iscompleted}}
125
                </tr>
126
            </thead>
127
            <tbody class="drag-parentnode">
128
                {{#competencies}}
129
                <tr class="drag-samenode" data-node="user-competency" data-id="{{competency.id}}"
130
                        data-competencyid="{{competency.id}}"
131
                        data-userid="{{plan.userid}}">
132
                    <td>
133
                        {{#plan.canbeedited}}
1441 ariadna 134
                        <span class="drag-handlecontainer float-start"></span>
1 efrain 135
                        {{/plan.canbeedited}}
136
                        <a data-usercompetency="true" href="#">{{{competency.shortname}}}</a>
137
                        <em>{{competency.idnumber}}</em>
138
                        {{#comppath}}
139
                            <br>
1441 ariadna 140
                            <span class="float-start">{{#str}}path, tool_lp{{/str}}&nbsp;</span>{{> tool_lp/competency_path }}
1 efrain 141
                        {{/comppath}}
142
                    </td>
143
                    {{#plan.iscompleted}}
144
                        <td>{{usercompetencyplan.gradename}}</td>
145
                        <td>{{usercompetencyplan.proficiencyname}}</td>
146
                    {{/plan.iscompleted}}
147
                    {{^plan.iscompleted}}
148
                        <td>{{usercompetency.gradename}}</td>
149
                        <td>{{usercompetency.proficiencyname}}</td>
150
                        <td>{{usercompetency.statusname}}</td>
151
                    {{/plan.iscompleted}}
152
                    {{^plan.iscompleted}}
153
                        <td>
154
                            <ul title="{{#str}}edit{{/str}}" class="user-competency-actions">
155
                                <li>
156
                                    <a href="#">{{#str}}edit{{/str}}</a><b class="caret"></b>
157
                                    <ul class="dropdown dropdown-menu">
158
                                        {{#usercompetency.isrequestreviewallowed}}
159
                                            <li class="dropdown-item">
160
                                                <a href="#" data-action="request-review">{{#pix}}t/edit, core{{/pix}} {{#str}}requestreview, tool_lp{{/str}}</a>
161
                                            </li>
162
                                        {{/usercompetency.isrequestreviewallowed}}
163
                                        {{#usercompetency.iscancelreviewrequestallowed}}
164
                                            <li class="dropdown-item">
165
                                                <a href="#" data-action="cancel-review-request">{{#pix}}t/edit, core{{/pix}} {{#str}}cancelreviewrequest, tool_lp{{/str}}</a>
166
                                            </li>
167
                                        {{/usercompetency.iscancelreviewrequestallowed}}
168
                                        {{#plan.canbeedited}}
169
                                            <li class="dropdown-item">
170
                                                <a href="#" data-action="delete-competency-link" data-id="{{competency.id}}">{{#pix}}t/delete, core{{/pix}} {{#str}}delete{{/str}}</a>
171
                                            </li>
172
                                        {{/plan.canbeedited}}
173
                                        <li class="dropdown-item">
174
                                            <a href="#" data-action="find-courses-link" data-id="{{competency.id}}">{{#pix}}t/preview, core{{/pix}} {{#str}}findcourses, tool_lp{{/str}}</a>
175
                                        </li>
176
                                    </ul>
177
                                </li>
178
                            </ul>
179
                        </td>
180
                    {{/plan.iscompleted}}
181
                </tr>
182
                {{/competencies}}
183
            </tbody>
184
        </table>
185
        {{^competencies}}
186
            <p class="alert alert-info">
187
                {{#str}}nocompetenciesinlearningplan, tool_lp{{/str}}
188
            </p>
189
        {{/competencies}}
190
    </div>
191
</div>
192
{{#js}}
193
require(['tool_lp/competencies', 'tool_lp/planactions', 'tool_lp/user_competency_workflow', 'tool_lp/user_competency_plan_popup'], function(mod, actionsMod, UserCompWorkflow, Popup) {
194
    var planActions = new actionsMod('plan');
195
 
196
    (new mod({{plan.id}}, 'plan', {{contextid}}));
197
    (new Popup('[data-region=plan-page]', '[data-usercompetency=true]', {{plan.id}}));
198
    planActions.registerEvents();
199
 
200
    var ucw = new UserCompWorkflow();
201
    ucw.enhanceMenubar('.user-competency-actions');
202
    ucw.on('status-changed', planActions.refresh.bind(planActions, '[data-region="plan-summary"]'));
203
    ucw.on('error-occured', planActions.refresh.bind(planActions, '[data-region="plan-summary"]'));
204
});
205
{{/js}}