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/>.
18 @template core_tag/taglist
20 Displays a tag list, usually the list of tags some entry is tagged with
22 Classes required for JS:
27 Data attributes required for JS:
30 Context variables required for this template:
33 Example context (json):
36 {"id":1,"name":"Cats","viewurl":"http://moodle.org/tag/index.php?tag=Cats","isstandard":"1","flag":0},
37 {"id":1,"name":"Dogs","viewurl":"http://moodle.org/tag/index.php?tag=Dogs","isstandard":"0","flag":1},
38 {"id":1,"name":"Mice","viewurl":"http://moodle.org/tag/index.php?tag=Mice","isstandard":"0","flag":0}
43 "classes": "someadditionalclass"
48 <div class="tag_list hideoverlimit {{classes}}">
52 <ul class="inline-list">
54 <li {{#overlimit}}class="overlimit"{{/overlimit}}>
55 <a href="{{viewurl}}" class="badge badge-info {{#isstandard}}standardtag{{/isstandard}}" >
57 <span class="flagged-tag">{{name}}</span></a>
65 <li class="visibleifjs">
66 <a href="#" class="tagmorelink">{{#str}}moretags, core_tag{{/str}}</a>
68 <li class="visibleifjs">
69 <a href="#" class="taglesslink">{{#str}}lesstags, core_tag{{/str}}</a>
77 require(['jquery'], function($) {
78 $('.tag_list .tagmorelink').click(function(e) {
80 $(this).closest('.tag_list').removeClass('hideoverlimit');
82 $('.tag_list .taglesslink').click(function(e) {
84 $(this).closest('.tag_list').addClass('hideoverlimit');