{{!
    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 mod_plenum/main

    This template will render the Plenary meeting main page

    Variables required for this template:
    * instance - Plenary meeting instance record
    * throttle - Deft socket throttle

    Variables optional for this template:

    Example context (json):
    {
        "contextid": 3,
        "roomid": 7,
        "instance": "{}"
    }
}}

{{# invalidform }}
    <div class="alert alert-danger m-2" role="alert">
        {{# str }} formdisabled, mod_plenum {{/ str }}
    </div>
{{/ invalidform }}
{{# instance }}
<div class="container-fluid">
{{# grade }}
    {{# cangrade }}
        {{> mod_plenum/grades/grade_button }}
    {{/ cangrade }}
    {{^ cangrade }}
        {{> mod_plenum/grades/view_grade_button }}
    {{/ cangrade }}
{{/ grade }}
{{# grouprequired }}
    <div class="alert alert-warning m-2" role="alert">
       {{# str }} grouprequired, mod_plenum {{/ str }}
    </div>
{{/ grouprequired }}
{{^ grouprequired }}
    <div data-contextid="{{ contextid }}" data-region="plenum" class="row">
        {{$ formcontent }}
        {{/ formcontent }}
        <div class="{{$ motionclasses }} col col-12 {{/ motionclasses }}">
            <div data-region="plenum-deft-controls"
                data-contextid="{{ contextid }}"
            >
            </div>
            <div data-contextid="{{ contextid }}" data-region="plenum-motions">
                {{$motions}}{{> mod_plenum/motions }}{{/motions}}
            </div>
        </div>
    </div>
{{/ grouprequired }}
</div>
{{/ instance }}
{{# js }}
{{^ grouprequired }}
{{# contextid }}
    require([
        'mod_plenum/plenum'
    ], function(PlenumManager) {
        new PlenumManager({{ contextid }}, '{{ token }}');
    });
{{/ contextid }}
{{/ grouprequired }}
{{/ js }}
