{{!
    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.

    Edwiser RemUI
    @package theme_remui
    @copyright (c) 2023 WisdmLabs (https://wisdmlabs.com/)
    @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

}}
{{!
    @template theme_remui/common_end
}}

{{{homepagedepricationmodal}}}

 {{#canaddbottomblocks}}
    <section id="region-bottom-blocks" class="has-blocks" aria-label="region bottom blocks">
        <div role="region-main">
            {{{addblockbuttonbottom}}}
            {{{ sidebottomblocks }}}
            {{#addblockbuttonbottom}}
            <div id="region-bottom-blocks-indicator" class="container-fluid block-indicator">
                <font class="text-center p-px-2d5 m-0  bg-white block-indicator-text-wrapper ">
                    {{#str}}side-bottom,theme_remui {{/str}}
                </font>
            </div>
            {{/addblockbuttonbottom}}
        </div>
    </section>
    {{/canaddbottomblocks}}

</div>
    </div>
    {{#canaddfullwidthbottomblocks}}
    <section id="region-fullwidthbottom-blocks" class="has-blocks" aria-label="region top blocks">
        <div role="region-main">
            {{{addblockbuttonfullwidthbottom}}}
            {{{ sidefullwidthbottomblocks }}}
            {{#addblockbuttonfullwidthbottom}}
                <div id="region-fullwidthbottom-blocks-indicator" class="container-fluid block-indicator">
                    <font class="text-center p-px-2d5 m-0  bg-white block-indicator-text-wrapper ">
                        {{#str}}full-bottom,theme_remui {{/str}}
                    </font>
                </div>
            {{/addblockbuttonfullwidthbottom}}
        </div>
    </section>
    {{/canaddfullwidthbottomblocks}}
    </div>
    {{> theme_remui/footer }}
    {{{ output.standard_after_main_region_html }}}
</div>

{{#edw_quick_menu}}
{{> theme_remui/edw_quick_menu}}
{{/edw_quick_menu}}

{{#addblockfloatmenu}}
    {{{addblockfloatmenu}}}
{{/addblockfloatmenu}}
</body>
</html>

{{! It will add some js for the migrated blocks }}
{{#pagebuilderfileexist}}
    {{>local_edwiserpagebuilder/layout_require_js}}
{{/pagebuilderfileexist}}
{{#js}}
M.util.js_pending('theme_remui/loader');
require(['theme_remui/loader', 'theme_remui/drawer'], function(Loader, Drawer) {
    Drawer.init();
    M.util.js_complete('theme_remui/loader');
});
{{/js}}

{{#enabledictionary}}
{{#js}}
require(['theme_remui/dictionary'], function(dictionary) {
    dictionary.init();
});
{{/js}}
{{/enabledictionary}}


<div id="feedbackcollection"></div>

<!--
{{#sitenotification}}
{{#js}}
require(['jquery'], function($){
    $(document).ready(function(){
        // Hide and Show Go to top button.
        $(window).scroll(function() {
            if ($(this).scrollTop() > 50) {
                $(".alert.site-announcement").addClass("fixedtop-0");
            } else {
                $(".alert.site-announcement").removeClass("fixedtop-0");
            }
        });
    });
});
{{/js}}
{{/sitenotification}}
-->
{{#js}}
require(['jquery'], function($){
    $(document).ready(function() {
        // Iterate over each delegated-section
        setTimeout(function(){
                $('body:not(.editing) .courseindex .delegated-section').each(function() {
                // Find the courseindex-sectioncontent inside the current section
                const sectionContent = $(this).find('.courseindex-sectioncontent');

                // Check if sectionContent is empty
                if ($.trim(sectionContent.html()).length === 0 || sectionContent.children().length === 0) {
                    // Hide the span with the expand icon class
                    $(this).find('.collapsed-icon').hide();
                    $(this).find('.expanded-icon').hide();
                }

            });
            const $option = $('#id_customfield_edwskilllevel option[value="0"]');
            if ($option.length) {
                $option.text('None'); // Change the text content of the option
            }
            const $edwfocusoption = $('#id_customfield_edwfocusmode option[value="0"]');
            if ($edwfocusoption.length) {
                $edwfocusoption.text('Default'); // Change the text content of the option
            }
        },300);
    });
});
{{/js}}
