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 core_calendar/minicalendar_day_link
19
 
20
    Displays link to calendar day in mini calendar, with hover tooltip.
21
 
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
    }
29
}}
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_universe/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>');
58
 
59
                if (source.length) {
60
                    content.html(source.clone(false));
61
                } else {
62
                    content.html(target.data('alternate'));
63
                }
64
 
65
                return content.html();
66
            }
67
        });
68
    });
69
});
70
{{/js}}