{{!
    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_booking/booked_users

    Classes required for JS:
    * none

    Data attributes required for JS:
    * data-region

    Example context (json):
    {
        "bookedusers" : "<div></div>",
        "waitinglist" : "<div></div>",
        "reservedusers" : "<div></div>",
        "userstonotify" : "<div></div>",
        "deletedusers" : "<div></div>"
    }
}}
{{^reduced}}
    <div class="accordion mt-3 mb-3" id="accordion-usertables">
        {{#bookedusers}}
            <div class="card">
                <div class="card-header bg-transparent" id="accordion-heading-bookedusers">
                    <div class="bookingstracker-header" role="button" data-toggle="collapse" data-bs-toggle="collapse" data-target="#accordion-item-bookedusers" data-bs-target="#accordion-item-bookedusers" aria-expanded="true" aria-controls="accordion-item-bookedusers">
                        <i class="fa fa-fw fa-ticket" aria-hidden="true"></i>&nbsp;{{#str}} bookings, mod_booking {{/str}}
                    </div>
                </div>
                <div id="accordion-item-bookedusers" class="collapse show" aria-labelledby="accordion-heading-bookedusers" data-parent="#accordion-usertables">
                <div class="card-body p-0">
                    {{{bookedusers}}}
                </div>
                </div>
            </div>
        {{/bookedusers}}
        {{#waitinglist}}
            <div class="card">
                <div class="card-header bg-transparent" id="accordion-heading-waitinglist">
                    <div class="bookingstracker-header" role="button" data-toggle="collapse" data-bs-toggle="collapse" data-target="#accordion-item-waitinglist" data-bs-target="#accordion-item-waitinglist" aria-expanded="false" aria-controls="accordion-item-waitinglist">
                        <i class="fa fa-fw fa-hourglass" aria-hidden="true"></i>&nbsp;{{#str}} waitinglist, mod_booking {{/str}}
                    </div>
                </div>
                <div id="accordion-item-waitinglist" class="collapse" aria-labelledby="accordion-heading-waitinglist" data-parent="#accordion-usertables">
                <div class="card-body p-0">
                    {{{waitinglist}}}
                </div>
                </div>
            </div>
        {{/waitinglist}}
        {{#reservedusers}}
            <div class="card">
                <div class="card-header bg-transparent" id="accordion-heading-reservedusers">
                    <div class="bookingstracker-header" role="button" data-toggle="collapse" data-bs-toggle="collapse" data-target="#accordion-item-reservedusers" data-bs-target="#accordion-item-reservedusers" aria-expanded="false" aria-controls="accordion-item-reservedusers">
                        <i class="fa fa-fw fa-shopping-cart" aria-hidden="true"></i>&nbsp;{{#str}} reservedusers, mod_booking {{/str}}
                    </div>
                </div>
                <div id="accordion-item-reservedusers" class="collapse" aria-labelledby="accordion-heading-reservedusers" data-parent="#accordion-usertables">
                <div class="card-body p-0">
                    {{{reservedusers}}}
                </div>
                </div>
            </div>
        {{/reservedusers}}
        {{#userstonotify}}
            <div class="card">
                <div class="card-header bg-transparent" id="accordion-heading-userstonotify">
                    <div class="bookingstracker-header" role="button" data-toggle="collapse" data-bs-toggle="collapse" data-target="#accordion-item-userstonotify" data-bs-target="#accordion-item-userstonotify" aria-expanded="false" aria-controls="accordion-item-userstonotify">
                        <i class="fa fa-fw fa-bell-o" aria-hidden="true"></i>&nbsp;{{#str}} userstonotify, mod_booking {{/str}}
                    </div>
                </div>
                <div id="accordion-item-userstonotify" class="collapse" aria-labelledby="accordion-heading-userstonotify" data-parent="#accordion-usertables">
                <div class="card-body p-0">
                    {{{userstonotify}}}
                </div>
                </div>
            </div>
        {{/userstonotify}}
        {{#deletedusers}}
            <div class="card">
                <div class="card-header bg-transparent" id="accordion-heading-deletedusers">
                    <div class="bookingstracker-header" role="button" data-toggle="collapse" data-bs-toggle="collapse" data-target="#accordion-item-deletedusers" data-bs-target="#accordion-item-deletedusers" aria-expanded="false" aria-controls="accordion-item-deletedusers">
                        <i class="fa fa-fw fa-ban" aria-hidden="true"></i>&nbsp;{{#str}} deletedbookings, mod_booking {{/str}}
                    </div>
                </div>
                <div id="accordion-item-deletedusers" class="collapse" aria-labelledby="accordion-heading-deletedusers" data-parent="#accordion-usertables">
                <div class="card-body p-0">
                    {{{deletedusers}}}
                </div>
                </div>
            </div>
        {{/deletedusers}}
        {{#bookinghistory}}
            <div class="card">
                <div class="card-header bg-transparent" id="accordion-heading-bookinghistory">
                    <div class="bookingstracker-header" role="button" data-toggle="collapse" data-bs-toggle="collapse" data-target="#accordion-item-bookinghistory" data-bs-target="#accordion-item-bookinghistory" aria-expanded="false" aria-controls="accordion-item-bookinghistory">
                        <i class="fa fa-history" aria-hidden="true"></i>&nbsp;{{#str}} bookinghistory, mod_booking {{/str}}
                    </div>
                </div>
                <div id="accordion-item-bookinghistory" class="collapse" aria-labelledby="accordion-heading-bookinghistory" data-parent="#accordion-usertables">
                    <div class="card-body p-0">
                        {{{bookinghistory}}}
                    </div>
                </div>
            </div>
        {{/bookinghistory}}
        {{#optionstoconfirm}}
            <div class="card">
                {{#deputyselect}}
                    {{> mod_booking/deputyselect }}
                {{/deputyselect}}
                {{#deputydisplay}}
                    {{> mod_booking/deputydisplay }}
                {{/deputydisplay}}
                <div class="card-header bg-transparent" id="accordion-heading-optionstoconfirm">
                    <div class="bookingstracker-header" role="button" data-toggle="collapse" data-bs-toggle="collapse" data-target="#accordion-item-optionstoconfirm" data-bs-target="#accordion-item-optionstoconfirm" aria-expanded="false" aria-controls="accordion-item-optionstoconfirm">
                        <i class="fa fa-fw fa-hourglass" aria-hidden="true"></i>&nbsp;{{#labels.6}}{{.}}{{/labels.6}}
                    </div>
                </div>
                <div id="accordion-item-optionstoconfirm" class="collapse" aria-labelledby="accordion-heading-optionstoconfirm" data-parent="#accordion-usertables">
                <div class="card-body p-0">
                    {{{optionstoconfirm}}}
                </div>
                </div>
            </div>
        {{/optionstoconfirm}}
        {{#previouslybooked}}
            <div class="card">
                <div class="card-header bg-transparent" id="accordion-heading-previouslybooked">
                    <div class="bookingstracker-header" role="button" data-toggle="collapse" data-target="#accordion-item-previouslybooked" aria-expanded="false" aria-controls="accordion-item-optionstoconfirm">
                        <i class="fa fa-fw fa-hourglass" aria-hidden="true"></i>&nbsp;{{#labels.7}}{{.}}{{/labels.7}}
                    </div>
                </div>
                <div id="accordion-item-previouslybooked" class="collapse" aria-labelledby="accordion-heading-previouslybooked" data-parent="#accordion-usertables">
                <div class="card-body p-0">
                    {{{previouslybooked}}}
                </div>
                </div>
            </div>
        {{/previouslybooked}}
    </div>
{{/reduced}}
{{#reduced}}
    {{#bookedusers}}
            <div id="bookedusers">
                    {{{bookedusers}}}
            </div>
    {{/bookedusers}}
    {{#waitinglist}}
            <div id="waitinglist">
                    {{{waitinglist}}}
            </div>
        {{/waitinglist}}
        {{#reservedusers}}
             <div id="reservedusers">
                    {{{reservedusers}}}
            </div>
        {{/reservedusers}}
        {{#userstonotify}}
            <div id="userstonotify">
                   {{{userstonotify}}}
            </div>
        {{/userstonotify}}
        {{#deletedusers}}
            <div class="card" id="deletedusers">
                <div class="card-body p-0">
                   {{{deletedusers}}}
                </div>
            </div>
        {{/deletedusers}}
        {{#bookinghistory}}
            <div class="card" id="bookinghistory">
                <div class="card-body p-0">
                   {{{bookinghistory}}}
                </div>
            </div>
        {{/bookinghistory}}
        {{#optionstoconfirm}}
            <div class="card">
             {{#deputydisplay}}
                    {{> mod_booking/deputydisplay }}
                {{/deputydisplay}}
                {{#deputyselect}}
                    {{> mod_booking/deputyselect }}
                {{/deputyselect}}
                <div>
                   {{{optionstoconfirm}}}
                </div>
            </div>
        {{/optionstoconfirm}}
        {{#previouslybooked}}
            <div class="card" id="previouslybooked">
                <div class="card-body p-0">
                   {{{previouslybooked}}}
                </div>
            </div>
        {{/previouslybooked}}
{{/reduced}}