{{!
    This file is part of Moodle - http://moodle.org/

    Moodle is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Moodle is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
}}
{{!
    @template block_myoverview/timeline-view

    This template renders the timeline view for the myoverview block.

    Example context (json):
    {}
}}
<div id="timeline-view-{{uniqid}}" data-region="timeline-view">
    <div class="row text-center">
        <div class="btn-group m-b-1" role="group" data-toggle="btns">
            <a class="btn btn-default active" href="#myoverview_timeline_dates" data-toggle="tab">
                {{#str}} sortbydates, block_myoverview {{/str}}
            </a>
            <a class="btn btn-default" href="#myoverview_timeline_courses" data-toggle="tab">
                {{#str}} sortbycourses, block_myoverview {{/str}}
            </a>
        </div>
    </div>

    <div class="tab-content">
        <div class="tab-pane active fade in" id="myoverview_timeline_dates">
            {{> block_myoverview/timeline-view-dates }}
        </div>
        <div class="tab-pane fade" id="myoverview_timeline_courses">
            {{> block_myoverview/timeline-view-courses }}
        </div>
    </div>
</div>
{{#js}}
require(['jquery', 'core/custom_interaction_events'], function($, customEvents) {
    var root = $('#timeline-view-{{uniqid}}');
    customEvents.define(root, [customEvents.events.activate]);
    root.on(customEvents.events.activate, '[data-toggle="btns"] > .btn', function() {
        root.find('.btn.active').removeClass('active');
        $(this).addClass('active');
    });
});
{{/js}}
