MDL-78438 gradereport_grader: use lang string for collapsed columns.
[moodle.git] / calendar / templates / minicalendar_day_link.mustache
blob13ac37b0b02b7219e85a128fc30047d11a2f79fe
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/>.
17 {{!
18     @template core_calendar/minicalendar_day_link
20     Displays link to calendar day in mini calendar, with hover tooltip.
22     Example context (json):
23     {
24         "day": "Today",
25         "url": "http://example.com/",
26         "title": "Monday 2nd January",
27         "content": "<img class='icon smallicon' src='../../../pix/i/siteevent.svg'>Test site event"
28     }
30 <a {{!
31     }} id="calendar-day-popover-link-{{courseid}}-{{year}}-{{yday}}-{{uniqid}}"{{!
32     }} href="{{$url}}{{url}}{{/url}}"{{!
33     }} data-container="body"{{!
34     }} data-toggle="popover"{{!
35     }} data-html="true"{{!
36     }} data-region="mini-day-link"{{!
37     }} data-trigger="hover focus"{{!
38     }} data-placement="top"{{!
39     }} data-year="{{year}}"{{!
40     }} data-month="{{date.mon}}"{{!
41     }} data-courseid="{{courseid}}"{{!
42     }} data-categoryid="{{categoryid}}"{{!
43     }} data-title="{{$title}}{{title}}{{/title}}"{{!
44     }} data-alternate="{{$nocontent}}{{/nocontent}}"{{!
45     }} aria-label="{{viewdaylinktitle}}"{{!
46 }}>{{$day}}{{day}}{{/day}}</a>
47 <div class="hidden">
48     {{$content}}{{/content}}
49 </div>
50 {{#js}}
51 require(['jquery'], function($) {
52     require(['theme_boost/bootstrap/popover'], function() {
53         var target = $("#calendar-day-popover-link-{{courseid}}-{{year}}-{{yday}}-{{uniqid}}");
54         target.popover({
55             content: function() {
56                 var source = target.next().find("> *:not('.hidden')");
57                 var content = $('<div>');
59                 if (source.length) {
60                     content.html(source.clone(false));
61                 } else {
62                     content.html(target.data('alternate'));
63                 }
65                 return content.html();
66             }
67         });
68     });
69 });
70 {{/js}}