{{!
    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_academi/course_blocks

    Academi course blocks template.
    Example context (json):
    {
        "sitename": "Moodle",
        "output": {
            "doctype": "<!DOCTYPE html>",
            "page_title": "course blocks page",
            "main_content": "<h1>Headings make html validators happier</h1>"
        },
        "bodyattributes":"",
        "availablecourses": "true",
        "promatedcourse": "true",
        "promotedtitle": "promoted courses"
    }
}}

{{! Available course }}
{{#availablecourses}}
    <div class="available-courses" id="available-courses">
        <div class="available-block">
            <div class="container">
                <div class="row">
                    <div class="course-slider col-md-12" data-crow="{{totalavacount}}">
                        {{#courses}}
                            <div class="available-content">
                                <div class="available-img">
                                    <a href={{link}}>
                                        <img src="{{imgurl}}" width="249" height="200" alt={{name}}>
                                    </a>
                                </div>
                                <div class="available-info">
                                    <div class="title-block">
                                        <h6><a href={{link}}>{{name}}</a></h6>
                                    </div>
                                    {{#summary}}
                                        <div class="desc-block">
                                            <p>{{#shortentext}} 120, {{{summary}}} {{/shortentext}}</p>
                                        </div>
                                    {{/summary}}
                                </div>
                            </div>
                        {{/courses}}
                    </div>
                </div>
            </div>
        </div>
    </div>
{{/availablecourses}}

{{! Promototed course }}
{{#promatedcourse}}
    {{#isblockempty}}
        <div class="custom-alert-block alert alert-warning">
            {{#str}}blockemptymessage, theme_academi{{/str}}
        </div>
    {{/isblockempty}}

    {{#blockisempty}}
        <div class="promoted-courses" id="promoted-courses">
            <div class="container">
                {{#promotedcontent}}
                    <div class="titlebar">
                        {{#promotedtitle}}
                            <h2><b>{{promotedtitle}}</b></h2>
                        {{/promotedtitle}}
                        {{#promotedcoursedesc}}
                            <p>{{promotedcoursedesc}}</p>
                        {{/promotedcoursedesc}}
                    </div>
                {{/promotedcontent}}
                {{#coursestatus}}
                    <div class="promatedcourse-slider" data-crow="{{totalfcourse}}">
                        {{#courses}}
                            {{#.}}
                                <div class="slider-item">
                                    <div class="course-box">
                                        <div class="thumb">
                                            <a href="{{courseurl}}"><img src="{{imgurl}}" width="135" height="135" alt=""></a>
                                        </div>
                                        <div class="info">
                                            <h5><a href="{{courseurl}}"> {{coursename}} </a></h5>
                                        </div>
                                    </div>
                                </div>
                            {{/.}}
                        {{/courses}}
                    </div>
                {{/coursestatus}}
            </div>
        </div>
    {{/blockisempty}}
{{/promatedcourse}}