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_lp/user_competency_summary
19
 
20
    Moodle template for the the summary of a user competency
21
 
22
    Classes required for JS:
23
    * none
24
 
25
    Data attributes required for JS:
26
    * none
27
 
28
    Context variables required for this template:
29
    * usercompetencysummary - object containing:
30
        * showrelatedcompetencies - boolean
31
        * cangrade - boolean
32
        * competency - competency summary record
33
        * user - user record
34
        * usercompetency - user competency record
35
        * evidence - array of evidence
36
 
37
    This template does not have an example context because it includes ajax functionality.
38
}}
39
<div data-region="user-competency-full-info" data-node="user-competency" data-competencyid="{{usercompetency.competencyid}}" data-userid="{{usercompetency.userid}}" data-region-id="{{uniqid}}">
40
    <div data-region="competency-summary">
41
        {{#competency}}
42
            {{> tool_lp/competency_summary }}
43
        {{/competency}}
44
        <dl>
45
            {{#usercompetency}}
46
            <dt>{{#str}}reviewstatus, tool_lp{{/str}}</dt>
47
            <dd data-region="user-competency-status">{{statusname}}
48
 
49
                {{#isstatusinreview}}
50
                    - {{reviewer.fullname}}
51
                {{/isstatusinreview}}
52
 
53
                {{#isrequestreviewallowed}}<button class="btn btn-secondary" data-action="request-review">{{#str}}requestreview, tool_lp{{/str}}</button>{{/isrequestreviewallowed}}
54
                {{#iscancelreviewrequestallowed}}<button class="btn btn-secondary" data-action="cancel-review-request">{{#str}}cancelreviewrequest, tool_lp{{/str}}</button>{{/iscancelreviewrequestallowed}}
55
                {{#isstartreviewallowed}}<button class="btn btn-secondary" data-action="start-review">{{#str}}startreview, tool_lp{{/str}}</button>{{/isstartreviewallowed}}
56
                {{#isstopreviewallowed}}<button class="btn btn-secondary" data-action="stop-review">{{#str}}stopreview, tool_lp{{/str}}</button>{{/isstopreviewallowed}}
57
            </dd>
58
            <dt>{{#str}}proficient, tool_lp{{/str}}</dt>
59
            <dd>
60
                <span class="badge {{#proficiency}}bg-success{{/proficiency}}{{^proficiency}}bg-danger{{/proficiency}} text-white float-left">
61
                    {{proficiencyname}}
62
                </span>
63
            </dd>
64
            <dt>{{#str}}rating, tool_lp{{/str}}</dt>
65
            <dd>{{gradename}}
66
                {{#cangrade}}
67
                    <button class="btn btn-secondary" id="rate_{{uniqid}}">{{#str}}rate, tool_lp{{/str}}</button>
68
                {{/cangrade}}
69
            </dd>
70
            {{#js}}
71
            require(['jquery', 'tool_lp/grade_user_competency_inline', 'tool_lp/user_competency_info', 'tool_lp/user_competency_workflow'], function($, mod, info, UserCompWorkflow) {
72
 
73
                var competencyElement = $('[data-region-id="{{uniqid}}"]');
74
                var infoReloader = new info(competencyElement, '{{competency.competency.id}}', '{{user.id}}');
75
 
76
                var ucw = new UserCompWorkflow();
77
                ucw.registerEvents('[data-region="user-competency-status"]');
78
                ucw.on('status-changed', infoReloader.reload.bind(infoReloader));
79
                ucw.on('error-occured', infoReloader.reload.bind(infoReloader));
80
                {{#cangrade}}
81
                    var inlineGrader = new mod('#rate_{{uniqid}}', '{{competency.scaleid}}', '{{competency.competency.id}}', '{{user.id}}', '{{plan.id}}', '', '{{#str}}chooserating, tool_lp{{/str}}');
82
                    inlineGrader.on('competencyupdated', infoReloader.reload.bind(infoReloader));
83
                {{/cangrade}}
84
            });
85
            {{/js}}
86
            {{/usercompetency}}
87
        </dl>
88
        {{#commentarea}}
89
            {{#canpostorhascomments}}
90
                {{>tool_lp/comment_area}}
91
            {{/canpostorhascomments}}
92
        {{/commentarea}}
93
        <dl data-region="evidence-listing">
94
            <dt>{{#str}}evidence, tool_lp{{/str}}</dt>
95
            <dd>
96
                {{#evidence}}
97
                    {{> tool_lp/evidence_summary }}
98
                {{/evidence}}
99
                {{^evidence}}
100
                    <p>{{#str}}noevidence, tool_lp{{/str}}</p>
101
                {{/evidence}}
102
            </dd>
103
        </dl>
104
    </div>
105
</div>