{{!
    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 theme_snap/course_toc_progress_bar

    This template renders a simple progress bar for the course TOC.

    Example context (json):
    {
        "userid": 2,
        "courseid": 3,
        "courseprogress": 3/20,
        "progresspercentage": 15,
        "hasprogress": true
    }
}}
{{#hasprogress}}
<div id="course-toc-progress-bar">
    <div class="progress-text">
        <span class="sr-only">{{#str}}aria:courseprogress, block_myoverview{{/str}}</span>
        <span id="courseprogress">{{#str}}progress, theme_snap{{/str}}: {{courseprogress}}</span>
        <span id="progresspercentage">{{progresspercentage}}%</span>
    </div>
    <div class="progress">
        <div class="progress-bar" role="progressbar" style="width: {{progresspercentage}}%" aria-valuenow="{{progresspercentage}}" aria-valuemin="0" aria-valuemax="100"></div>
    </div>
</div>
{{#js}}
    require(['theme_snap/progress_bar_component'], function(component) {
        component.init('#course-toc-progress-bar',{},
        {
            userid: {{userid}},
            courseid: {{courseid}},
        });
    });
{{/js}}
{{/hasprogress}}