{{!
    This file is part of Moodle - https://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 format_ludilearn/filename

    Example context (json):
    {}
}}

<div id="ludilearn-course-badge-section-{{id}}" class="course-badge">
    <div class="{{#parameters.restricted }}restricted{{/parameters.restricted}} {{^url}} nourl {{/url}}">
        <div class="row m-2 block_section">
            {{#parameters.lastaccess}}
                {{#parameters.gamified}}
                <div class="col-9 rightdottedscore">
                    <div class="row mr-1">
                        <div class="col-4 mt-0 p-0 ">
                            <div data-for="ludilearn-course-section-bronzecount" data-id="{{id}}" class="text-center mb-1 badge-number
                                {{#parameters.bronzecount }} badge-number-bronze spinning {{/parameters.bronzecount}}">
                                {{ parameters.bronzecount }}
                            </div>
                            <img data-for="ludilearn-course-section-bronzeimg" data-id="{{id}}" class="ludilearn-img little-img img-responsive d-block mx-auto"
                                {{#parameters.bronzecount }}
                                 src="{{config.wwwroot}}/course/format/ludilearn/pix/{{ world }}/badge/badge_bronze.svg"
                                {{/parameters.bronzecount}}
                                {{^parameters.bronzecount }}
                                 src="{{config.wwwroot}}/course/format/ludilearn/pix/{{ world }}/badge/badge_bronze_none.svg"
                                {{/parameters.bronzecount }}
                                 alt="Image badge">
                        </div>
                        <div class="col-4 mt-0 p-0">
                            <div data-for="ludilearn-course-section-silvercount" data-id="{{id}}" class="text-center mb-1 badge-number
                                {{#parameters.silvercount }} badge-number-silver spinning {{/parameters.silvercount}}">
                                {{ parameters.silvercount }}
                            </div>
                            <img data-for="ludilearn-course-section-silverimg" data-id="{{id}}" class="ludilearn-img little-img img-responsive d-block mx-auto"
                                {{#parameters.silvercount }}
                                 src="{{config.wwwroot}}/course/format/ludilearn/pix/{{ world }}/badge/badge_silver.svg"
                                {{/parameters.silvercount}}
                                {{^parameters.silvercount }}
                                 src="{{config.wwwroot}}/course/format/ludilearn/pix/{{ world }}/badge/badge_silver_none.svg"
                                {{/parameters.silvercount }}
                                 alt="Image badge">
                        </div>
                        <div class="col-4 mt-0 p-0">
                            <div data-for="ludilearn-course-section-goldcount" data-id="{{id}}" class="text-center mb-1 badge-number
                                {{#parameters.goldcount }} badge-number-gold spinning {{/parameters.goldcount}}">
                                {{ parameters.goldcount }}
                            </div>
                            <img data-for="ludilearn-course-section-goldimg" data-id="{{id}}" class="ludilearn-img little-img img-responsive d-block mx-auto"
                                {{#parameters.goldcount }}
                                 src="{{config.wwwroot}}/course/format/ludilearn/pix/{{ world }}/badge/badge_gold.svg"
                                {{/parameters.goldcount}}
                                {{^parameters.goldcount }}
                                 src="{{config.wwwroot}}/course/format/ludilearn/pix/{{ world }}/badge/badge_gold_none.svg"
                                {{/parameters.goldcount }}
                                 alt="Image badge">
                        </div>
                    </div>
                </div>
                <div class="col-3" >
                    <div data-for="ludilearn-course-section-completioncount"  data-id="{{id}}" class="text-center mb-1 badge-number
                                {{#parameters.completioncount }} badge-number-bronze spinning {{/parameters.completioncount}}">
                        {{ parameters.completioncount }}
                    </div>
                    <img data-for="ludilearn-course-section-completionimg" data-id="{{id}}" class="ludilearn-img little-img img-responsive d-block mx-auto"
                        {{#parameters.completioncount }}
                         src="{{config.wwwroot}}/course/format/ludilearn/pix/{{ world }}/badge/badge_completion.svg"
                        {{/parameters.completioncount}}
                        {{^parameters.completioncount }}
                         src="{{config.wwwroot}}/course/format/ludilearn/pix/{{ world }}/badge/badge_completion_none.svg"
                        {{/parameters.completioncount }}
                         alt="Image badge">
                </div>
                {{/parameters.gamified}}
                {{^parameters.gamified}}
                <div class="col-12">
                    <img class="ludilearn-img img-responsive d-block mx-auto" src="{{config.wwwroot}}/course/format/ludilearn/pix/{{ world }}/none.svg" alt="Image no gamified">
                </div>
                {{/parameters.gamified}}
            {{/parameters.lastaccess}}
            {{^parameters.lastaccess}}
                <div class="col-12">
                    <img class="ludilearn-img img-responsive d-block mx-auto" src="{{config.wwwroot}}/course/format/ludilearn/pix/{{ world }}/unkown.svg" alt="Image not viewed">
                </div>
            {{/parameters.lastaccess}}
        </div>
        <p class="text-center scoretext">
            <span class="sectionname"><a href="{{ url }}" class="stretched-link">{{{ name }}}</a></span>
        </p>
        {{#parameters.restricted }}
            <div class="sectionrestrictedinfo small text-center"><i class="fa fa-lock"></i> {{{ parameters.restrictedinfo }}}</div>
        {{/parameters.restricted }}
        {{^visible}}
            <div class="section-hidden text-center">
                <span class="badge badge-info">{{#str}} hiddenfromstudents {{/str}}</span>
            </div>
        {{/visible}}
    </div>
</div>
{{> format_ludilearn/components/course }}