{{!
    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">
        <div id="frontpage-banner">
            <div id="frontpage-banner-content">
	            <h2 class="pb-4 pl-3 mb-3">{{{frontpagetitle}}}</h2>
	            <h3 class="mb-3">{{{frontpagesubtitle}}}</h3>
	            <a href="{{frontpagebuttonhref}}" class="m-3 btn {{frontpagebuttonclass}}" role="button">{{frontpagebuttontext}}</a>
            </div>
            {{{ output.frontpage_settings_menu }}}
        </div>

        {{#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">
                    <h2 class="border-bottom p-3 m-2 mb-4">{{{cardstitle}}}</h2>
                    <p class="font-weight-light">
                        {{{cardssubtitle}}}
                    </p>
                </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}}
require(['theme_boost/loader']);
require(['theme_boost/drawer'], function(mod) {
    mod.init();
});
{{/js}}
