{{!
    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 mod_videotime/next_activity_button

    This template will render the button for the next activity

    Variables optional for this template:
    * nextcm_url - The URL to the next activity if available
    * hasnextcm - Whether the is another course module
    * availibility_info - The link message
    * availibility_title - The link message
    * is_restricted - Whether availibility conditions must still be fullfilled

    Example context (json):
    {
        "hasnextcm": true,
        "is_restricted": true,
        "availabitiy_info": "Restricted",
        "availabitiy_title": "Available from June 30, 2021",
        "nextcm_url": "#"
    }

}}
{{#hasnextcm}}
    <div class="clearfix" style="margin-bottom: 10px">
        <div class="pull-right">
            {{#is_restricted}}
                <span>{{#str}}next{{/str}}: </span>
                <button type="button" class="btn btn-dark btn-secondary btn-default" data-container="body" data-toggle="popover" data-html="true" data-placement="left" data-content="{{availability_info}}" {{#availability_title}}title="{{availability_title}}"{{/availability_title}}>
                    {{#pix}}i/lock, mod_videotime{{/pix}}
                    {{nextcm_name}}
                </button>
            {{/is_restricted}}
            {{^is_restricted}}
                <span>{{#str}}next{{/str}}: </span><a href="{{nextcm_url}}" class="btn btn-dark btn-secondary btn-default">{{{nextcm_name}}}</a>
            {{/is_restricted}}
        </div>
    </div>
{{/hasnextcm}}
