MDL-64506 templates: BS2 pull-x -> BS4 float-x
[moodle.git] / admin / tool / lp / templates / related_competencies.mustache
1 {{!
2     This file is part of Moodle - http://moodle.org/
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.
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.
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/related_competencies
20     List of related competencies.
22     Classes required for JS:
23     * none
25     Data attributes required for JS:
26     * none
28     Context variables required for this template:
29     * showdeleterelatedaction boolean
30     * relatedcompetencies array
31       * id int
32       * shortname string
33       * idnumber string
35     Example context (json):
36     {
37         "showdeleterelatedaction": false,
38         "relatedcompetencies":
39         [
40             {
41                 "id": 1,
42                 "shortname": "Competency",
43                 "idnumber": "C1"
44             }
45         ]
46     }
48 }}
49 <div data-region="relatedcompetencies">
50 <p>
51     <strong>{{#str}}crossreferencedcompetencies, tool_lp{{/str}}:</strong>
52 </p>
53 <ul>
54     {{#relatedcompetencies}}
55         <li>
56             {{#showdeleterelatedaction}}
57                 <div class="float-sm-right">
58                     <a href="#" data-action="deleterelation" id="id-related-{{id}}">{{#pix}}t/delete, core, {{#str}}delete{{/str}}{{/pix}}</a>
59                 </div>
60             {{/showdeleterelatedaction}}
61             <p>
62                 <a href="#" data-action="competency-dialogue" data-id="{{id}}">
63                     {{{shortname}}}{{#idnumber}} {{idnumber}}{{/idnumber}}
64                 </a>
65             </p>
66         </li>
67     {{/relatedcompetencies}}
68 </ul>
69 {{^relatedcompetencies}}
70     {{#str}}nocrossreferencedcompetencies, tool_lp{{/str}}
71 {{/relatedcompetencies}}
72 </div>
73 {{#js}}
74 require(['tool_lp/competencydialogue'], function(Compdialogue) {
75     Compdialogue.init();
76 });
77 {{/js}}