{{!
    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 core_course/defaultactivitycompletion

    Activity completion selector.

    Example context (json):
    {
        "courseid": "2",
        "sesskey": "AAAAAA",
        "modules": [{
            "id": "10",
            "formattedname": "Assignment",
            "canmanage": true,
            "icon": "https://raw.githubusercontent.com/moodle/moodle/master/mod/assign/pix/monologo.svg",
            "completionstatus": {
                "string": "Manual",
                "icon": "https://raw.githubusercontent.com/moodle/moodle/master/pix/i/completion-manual-enabled.png"
            }
        }],
        "issite": true
    }
}}
<div class="container-fluid">
    <div class="row my-5 defaultactivitycompletion-header">
        <div class="col">
            {{#issite}}{{#str}}defaultactivitycompletionsite, core_completion{{/str}}{{/issite}}
            {{^issite}}{{#str}}defaultactivitycompletioncourse, core_completion{{/str}}{{/issite}}
        </div>
    </div>
    <div class="modules pt-3">
        {{#modules}}
            {{#canmanage}}
            {{<core/local/collapsable_section}}
                {{$titlecontent}}
                    {{#activityicon}}
                        {{>core_course/activity_icon}}
                    {{/activityicon}}
                    <span class="activityname ms-3 mb-0">{{{formattedname}}}</span>
                {{/titlecontent}}
                {{$elementid}}activitycompletioncollapse-{{id}}{{/elementid}}
                {{$extraclasses}}defaultactivitycompletion-item{{/extraclasses}}
                {{$expandlabel}}
                    {{#str}} expandcategory, core, {{formattedname}} {{/str}}
                {{/expandlabel}}
                {{$collapselabel}}
                    {{#str}} collapsecategory, core, {{formattedname}} {{/str}}
                {{/collapselabel}}
                {{$extras}}
                    data-region="activitycompletion-{{name}}"
                {{/extras}}
                {{$sectioncontent}}
                    <hr>
                    <div class="py-3">{{{formhtml}}}</div>
                {{/sectioncontent}}
            {{/core/local/collapsable_section}}
            <hr>
            {{/canmanage}}
        {{/modules}}
    </div>
</div>
