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_calendar/minicalendar_day_link
20 Displays link to calendar day in mini calendar, with hover tooltip.
22 Example context (json):
25 "url": "http://example.com/",
26 "title": "Monday 2nd January",
27 "content": "<img class='icon smallicon' src='../../../pix/i/siteevent.svg'>Test site event"
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>
48 {{$content}}{{/content}}
51 require(['jquery'], function($) {
52 require(['theme_boost/bootstrap/popover'], function() {
53 var target = $("#calendar-day-popover-link-{{courseid}}-{{year}}-{{yday}}-{{uniqid}}");
56 var source = target.next().find("> *:not('.hidden')");
57 var content = $('<div>');
60 content.html(source.clone(false));
62 content.html(target.data('alternate'));
65 return content.html();