{{!
    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_zoom/breakoutrooms_rooms

    Context variables required for this template:
    * roomscount Number of rooms.
    * rooms Array of rooms.
    * roomtoclone Room that is being cloned.
      
    Example context (json):
    {
        "roomscount": 1,
        "rooms": [
            {
                "roomid": "1",
                "roomname": "room1",
                "roomactive": true,
                "courseparticipants": [
                    {
                        "participantid": "2",
                        "participantname": "John Doe",
                        "selected": true
                    }
                ],
                "coursegroups": [
                    {
                        "groupid": "3",
                        "groupname": "group3",
                        "selected": true
                    }
                ]
            }
        ],
        "roomtoclone": [
            {
                "toclone": "toclone",
                "courseparticipants": [
                    {
                        "participantid": "2",
                        "participantname": "John Doe"
                    }
                ],
                "coursegroups": [
                    {
                        "groupid": "3",
                        "groupname": "group3"
                    }
                ]
            }
        ]
    }
}}
<table id="mod-zoom-breakout-rooms-table" class="table table-bordered">
  <tr>
    <td>
      <div id="mod-zoom-meeting-rooms-list" data-initial-rooms-count="{{roomscount}}">
        <div class="mb-2">
          <span>{{#str}} rooms, zoom {{/str}}</span>
          <button id="add-room" type="button" title="{{#str}} addroom, zoom {{/str}}" class="btn btn-default btn-sm">
            <span class="fa fa-plus-circle fa-lg" aria-hidden="true"></span>
          </button>
        </div>
        <ul class="nav nav-pills flex-column" role="tablist">
          {{#rooms}}
          <li id="tab-{{roomid}}" class="nav-item">
            <a class="nav-link {{#roomactive}}active{{/roomactive}}" href="#link{{roomid}}" data-toggle="tab" role="tab">
              <span class="tab-name">{{roomname}}</span>
            </a>
            <button type="button" class="pull-right delete-room" title="{{#str}} deleteroom, zoom {{/str}}">
              <span class="fa fa-trash-o fa-lg" aria-hidden="true"></span>
            </button>
          </li>
          {{/rooms}}
        </ul>
        <div class="empty-alert text-center hidden">
          <p><strong>{{#str}} norooms, zoom {{/str}}</strong></p>
          <span>
            {{#str}} addroomalert, zoom {{/str}}
            <span class="fa fa-plus-circle" aria-hidden="true"></span>
          </span>
        </div>
      </div>
    </td>
    <td>
      <div id="mod-zoom-meeting-rooms-data">
        <div class="tab-content">
          {{#rooms}}
          <div class="tab-pane {{#roomactive}}active{{/roomactive}}" id="link{{roomid}}" role="tabpanel">
              {{> zoom/breakoutrooms_room_data }}
          </div>
          {{/rooms}}
        </div>
      </div>
    </td>
  </tr>
</table>

{{#roomtoclone}}
{{> zoom/breakoutrooms_room_datatoclone }}
{{/roomtoclone}}
