{{!
    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_trema/frontpage
    Frontpage area

    Context variables required for this template:
    * sitename - The name of the site
    * output - The core renderer for the page
    * bodyattributes - attributes for the body tag as a string of html attributes
    * sidepreblocks - HTML for the blocks
    * hasblocks - true if there are blocks on this page
    * navdraweropen - true if the nav drawer should be open on page load
    * regionmainsettingsmenu - HTML for the region main settings menu
    * hasregionmainsettingsmenu - There is a region main settings menu on this page.
}}
{{> theme_boost/head }}

<body {{{ bodyattributes }}}>

<div id="page-wrapper">

    {{{ output.standard_top_of_body_html }}}

    {{>theme_trema/navbar}}

    <div id="page" class="container-fluid">
        <h1 class="sr-only container pb-0 mb-0 mt-5">{{sitename}}</h1>
        <div id="carouselTrema" class="carousel slide carousel-fade {{^frontpagecarrousel}}d-none{{/frontpagecarrousel}}" data-ride="carousel">
                <div class="carousel-inner" data-interval="false">
                    <ol class="carousel-indicators">
                        {{#frontpagecarrousel}}
                            <li data-target="#carouselTrema" data-slide-to="{{index}}" class="{{active}}"></li>
                        {{/frontpagecarrousel}}
                    </ol>
                {{#frontpagecarrousel}}
                    <div class="carousel-item {{active}}">
                        <img src="{{image}}" class="d-block w-100" alt="{{title}}">
                        <div class="frontpage-banner-content">
                            {{#title}}<h2 class="pb-4 pl-3 mb-3">{{title}}</h2>{{/title}}
                            {{#subtitle}}<h3 class="mb-3 d-none d-md-block">{{{subtitle}}}</h3>{{/subtitle}}
                            {{#btntext}}{{#btnhref}}<a href="{{btnhref}}" class="m-3 btn d-none d-md-inline-block {{btnclass}}" role="button">{{{btntext}}}</a>{{/btnhref}}{{/btntext}}
                        </div>
                    </div>
                {{/frontpagecarrousel}}
                    <a class="carousel-control-prev" href="#carouselTrema" role="button" data-slide="prev">
                        <span class="carousel-control-prev-icon" aria-hidden="true"></span>
                        <span class="sr-only">{{#str}} previous, core {{/str}}</span>
                    </a>
                    <a class="carousel-control-next" href="#carouselTrema" role="button" data-slide="next">
                        <span class="carousel-control-next-icon" aria-hidden="true"></span>
                        <span class="sr-only">{{#str}} next, core {{/str}}</span>
                    </a>
                </div>
            </div>
        {{^frontpagecarrousel}}
        <div id="frontpage-banner">
            <div id="frontpage-banner-content">
	            {{#frontpagetitle}}<h2 class="pb-4 pl-3 mb-3">{{{frontpagetitle}}}</h2>{{/frontpagetitle}}
	            {{#frontpagesubtitle}}<h3 class="mb-3">{{{frontpagesubtitle}}}</h3>{{/frontpagesubtitle}}
	            {{#frontpagebuttontext}}{{#frontpagebuttonhref}}<a href="{{frontpagebuttonhref}}" class="m-3 btn {{frontpagebuttonclass}}" role="button">{{{frontpagebuttontext}}}</a>{{/frontpagebuttonhref}}{{/frontpagebuttontext}}
            </div>
            {{{ output.frontpage_settings_menu }}}
        </div>
        {{/frontpagecarrousel}}

        {{#hascards}}
        <div id="frontpage-cards" class="container mt-5">

            <div id="frontpage-cards-title" class="row mx-3 p-4 pt-0 text-center">
                <div class="col-12 pt-3 pb-3">
                    {{#cardstitle}}
                    <h2 class="border-bottom p-3 m-2 mb-4">{{{cardstitle}}}</h2>
                    {{/cardstitle}}
                    {{#cardssubtitle}}
                    <p class="font-weight-light">
                        {{{cardssubtitle}}}
                    </p>
                    {{/cardssubtitle}}
                </div>
            </div>

            <div id="frontpage-cards-content" class="row">
            {{#cardssettings}}
            <div class="frontpage-card col-sm-6 p-4 text-center">
                    {{#cardlink}}<a href="{{cardlink}}">{{/cardlink}}<span class="fa {{cardicon}} fa-4x" style="color: {{cardiconcolor}};"></span>{{#cardlink}}</a>{{/cardlink}}
                    {{#cardlink}}<a href="{{cardlink}}">{{/cardlink}}<h3>{{{cardtitle}}}</h3>{{#cardlink}}</a>{{/cardlink}}
                    <p class="font-weight-light">{{{cardsubtitle}}}</p>
                </div>
                {{/cardssettings}}
            </div>
        </div>
        {{/hascards}}

        <div id="page-content" class="container p-0 mb-5">
            <div id="region-main-box" class="row col-12 p-0">
                {{#hasregionmainsettingsmenu}}
                <div id="region-main-settings-menu" class="d-print-none {{#hasblocks}}has-blocks{{/hasblocks}}">
                    <div> {{{ output.region_main_settings_menu }}} </div>
                </div>
                {{/hasregionmainsettingsmenu}}
                <section id="region-main" {{#hasblocks}}class="has-blocks"{{/hasblocks}}>
                    {{#hasregionmainsettingsmenu}}
                        <div class="region_main_settings_menu_proxy"></div>
                    {{/hasregionmainsettingsmenu}}
                    <div id="defaultfrontpagebody" class="mb-4">
                        {{{defaultfrontpagebody}}}
                    </div>
                    {{{ output.course_content_header }}}
                    {{{ output.main_content }}}
                    {{{ output.activity_navigation }}}
                    {{{ output.course_content_footer }}}

                    {{#hasblocks}}
                    <div data-region="blocks-frontpage" class="d-print-none">
                        {{{ sidepreblocks }}}
                    </div>
                    {{/hasblocks}}
                </section>
            </div>
        </div>
    </div>
    {{{ output.standard_after_main_region_html }}}
    {{> theme_boost/nav-drawer }}
    {{#hasadminblocks}}
        <div id="side-admin-blocks">
            <div class="container py-3">
                <h3 class="text-center my-2">{{#str}}adminarea, theme_trema{{/str}}</h3>
                {{{ sideadminblocks }}}
            </div>
        </div>
    {{/hasadminblocks}}

    {{> theme_trema/footer }}
</div>

</body>
</html>
{{#js}}
M.util.js_pending('theme_boost/loader');
require(['theme_boost/loader'], function() {
    M.util.js_complete('theme_boost/loader');
});

M.util.js_pending('theme_boost/drawer');
require(['theme_boost/drawer'], function(drawer) {
    drawer.init();
    M.util.js_complete('theme_boost/drawer');
});
{{/js}}
