{{!
    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/coursearchive

    Admin time setting template.

    remui 2 column layout template.

    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.

    Example context (json):
        {
        "sitename": "Moodle",
        "output": {
            "doctype": "
            <!DOCTYPE html>",
            "page_title": "Test page",
            "favicon": "favicon.ico",
            "main_content": "<h1>Headings make html validators happier</h1>"
        },
        "bodyattributes":"",
        "sidepreblocks": "<h2>Blocks html goes here</h2>",
        "hasblocks":true,
        "navdraweropen":true,
        "regionmainsettingsmenu": "",
        "hasregionmainsettingsmenu": false
        }
}}

{{> theme_remui/common_start }}

<section id="region-main" aria-label="{{#str}}content{{/str}}">
    {{#hasregionmainsettingsmenu}}
    <div class="region_main_settings_menu_proxy"></div>
    {{/hasregionmainsettingsmenu}}
    {{{ output.course_content_header }}}
    {{#headercontent}}
    {{> core/activity_header }}
    {{/headercontent}}
    {{#overflow}}
    <div class="container-fluid tertiary-navigation">
        <div class="navitem">
            {{> core/url_select}}
        </div>
    </div>
    {{/overflow}}
    <div class="hidden">
        {{{ output.main_content }}}
    </div>
    {{{ output.activity_navigation }}}

    <div class="layout-1 container-fluid p-0 ">
        <div id="course-archive-main-container"  class="container">

            {{> theme_remui/coursefilters}}
            <div class="loader-overlay d-flex justify-content-center align-items-center" style="min-height:200px;">
                <div class="inner" style="/* width: 50px; *//* height: 50px; */">
                    <img src="{{{siteinnerloader}}}" width="50px" height="50px"/>
                </div>
            </div>
            <div class="d-none tag-wrapper p-my-6" style="display: flex;align-items: center;">
                <!-- Here we will render the course tags from Javascript side. -->
            </div>

            <div class="d-none course-cards grid-view latest-cards edw-course-card-grid">
                <!-- Here we will render the cards from Javascript side. -->
            </div>

            <div class="d-flex align-items-center justify-content-between flex-gap-d5">

                {{#coursesperpagelistcontext}}
                <div class="btn-group dropup edw-custom-dropdown-wrapper max-course-shown p-mt-8">

                    {{#coursesperpagelist}}
                    <div class="dropdown-toggle btn btn-sm d-flex align-items-center flex-gap-d5 p-p-2" id="" role="menuitem" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" href="#" tabindex="-1" title="{{#str}}showcourseperpage, theme_remui{{/str}}">
                        <span class="max-course-default d-none" data-value={{{limitdefaultvalue}}}></span>
                        <span class="p-mr-1 h-semibold-6 toggle-text">{{{limitlabel}}}</span>
                    </div>

                    <div class="dropdown-menu dropdown-menu-right">
                        <div class="p-py-2d5 d-flex flex-column flex-gap-d5 select-optgroup-wrapper">
                            {{#limitlist}}
                                <p data-value="{{value}}" class="select-option m-0 text-link-regular {{#isactive}}active{{/isactive}}">{{{text}}}</p>
                            {{/limitlist}}
                        </div>
                    </div>
                    {{/coursesperpagelist}}
                </div>
                {{/coursesperpagelistcontext}}

                <div class="d-none w-100 cards-pagination">
                    <!-- Here we will render the pagination from Javascript side. -->
                </div>
            </div>
        </div>
    </div>

    {{{ output.course_content_footer }}}
</section>

{{> theme_remui/common_end }}

{{#js}}
    require(['theme_remui/coursecategory'], function(c){
        c.init('{{{defaultcat}}}');
    });
{{/js}}
