{{!
    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/subbooking/additionalperson

    Classes required for JS:
    * none

    Data attributes required for JS:
    * data-action
    * data-component
    * data-area
    * data-itemid

    Example context (json):
    {
       "id": "1"
    }
}}

<div class="w-100 d-flex justify-content-center">
    <div id="accordionSb" class="w-75 mt-3">
        {{#subbookings}}
        <div class="card mb-2">
            <div class="card-header text-left" id="headingSb{{itemid}}">
                <h5 class="mb-0">
                <button class="btn btn-link"
                    data-toggle="collapse" data-bs-toggle="collapse"
                    data-target="#collapseSb{{itemid}}" data-bs-target="#collapseSb{{itemid}}"
                    aria-expanded="true" aria-controls="collapseSb{{itemid}}">
                    <i class="fa fa-plus-square" aria-hidden="true"></i>&nbsp;{{name}}
                </button>
                </h5>
            </div>

            <div id="collapseSb{{itemid}}" class="collapse" aria-labelledby="headingSb{{itemid}}" data-parent="#accordionSb">
                <div class="card-body subbooking-additionalperson-form mb-3" data-id="{{itemid}}"></div>
            </div>
        </div>
        {{/subbookings}}
    </div>
</div>

{{#js}}
    require(['mod_booking/condition/subbookingAdditionalPerson'], function(init) {
    init.init({{shoppingcartisinstalled}});
    });
{{/js}}
