{{!
    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_plugnmeet/room_info_tables

    Example context (json):
    {
        "room_info": {
            "room_id": "room123",
            "is_recording": true,
            "joined_participants": 5,
            "creation_time": 1678912345,
            "total_webcams": 2,
            "total_mics": 3,
            "total_screen_shares": 1
        },
        "has_participants": true,
        "participants_info": [
            {
                "name": "John Doe",
                "user_id": "user1",
                "is_admin": true,
                "is_presenter": false,
                "joined_at": 1678912400,
                "webcams": 1,
                "mics": 1,
                "screenshares": 0
            }
        ]
    }
}}
{{#room_info}}
    <h5 class="mt-4">{{#str}}room_info, mod_plugnmeet{{/str}}</h5>
    <table class="generaltable">
        <tbody>
            <tr>
                <td>{{#str}}room_id, mod_plugnmeet{{/str}}</td>
                <td>{{room_id}}</td>
            </tr>
            <tr>
                <td>{{#str}}is_recording, mod_plugnmeet{{/str}}</td>
                <td>{{#is_recording}}{{#str}}yes{{/str}}{{/is_recording}}{{^is_recording}}{{#str}}no{{/str}}{{/is_recording}}</td>
            </tr>
            <tr>
                <td>{{#str}}participants, mod_plugnmeet{{/str}}</td>
                <td>{{joined_participants}}</td>
            </tr>
            <tr>
                <td>{{#str}}total_webcams, mod_plugnmeet{{/str}}</td>
                <td>{{total_webcams}}</td>
            </tr>
            <tr>
                <td>{{#str}}total_mics, mod_plugnmeet{{/str}}</td>
                <td>{{total_mics}}</td>
            </tr>
            <tr>
                <td>{{#str}}total_screen_shares, mod_plugnmeet{{/str}}</td>
                <td>{{total_screen_shares}}</td>
            </tr>
            <tr>
                <td>{{#str}}creation_time, mod_plugnmeet{{/str}}</td>
                <td>{{#userdate}} {{creation_time}}, {{#str}} strftimedaydatetime, core_langconfig {{/str}} {{/userdate}}</td>
            </tr>
        </tbody>
    </table>
{{/room_info}}

{{#has_participants}}
    <h5 class="mt-4">{{#str}}participants_info, mod_plugnmeet{{/str}}</h5>
    <table class="generaltable">
        <thead>
            <tr>
                <th class="text-center">{{#str}}name, mod_plugnmeet{{/str}}</th>
                <th class="text-center">{{#str}}user_id, mod_plugnmeet{{/str}}</th>
                <th class="text-center">{{#str}}is_admin, mod_plugnmeet{{/str}}</th>
                <th class="text-center">{{#str}}is_presenter, mod_plugnmeet{{/str}}</th>
                <th class="text-center">{{#str}}webcams, mod_plugnmeet{{/str}}</th>
                <th class="text-center">{{#str}}mics, mod_plugnmeet{{/str}}</th>
                <th class="text-center">{{#str}}screenshares, mod_plugnmeet{{/str}}</th>
                <th class="text-center">{{#str}}joined_at, mod_plugnmeet{{/str}}</th>
            </tr>
        </thead>
        <tbody>
            {{#participants_info}}
                <tr>
                    <td class="text-center">{{name}}</td>
                    <td class="text-center">{{user_id}}</td>
                    <td class="text-center">{{#is_admin}}{{#str}}yes{{/str}}{{/is_admin}}{{^is_admin}}{{#str}}no{{/str}}{{/is_admin}}</td>
                    <td class="text-center">{{#is_presenter}}{{#str}}yes{{/str}}{{/is_presenter}}{{^is_presenter}}{{#str}}no{{/str}}{{/is_presenter}}</td>
                    <td class="text-center">{{#webcams}}{{#str}}yes{{/str}}{{/webcams}}{{^webcams}}{{#str}}no{{/str}}{{/webcams}}</td>
                    <td class="text-center">{{#mics}}{{#str}}yes{{/str}}{{/mics}}{{^mics}}{{#str}}no{{/str}}{{/mics}}</td>
                    <td class="text-center">{{#screenshares}}{{#str}}yes{{/str}}{{/screenshares}}{{^screenshares}}{{#str}}no{{/str}}{{/screenshares}}</td>
                    <td class="text-center">{{#userdate}} {{joined_at}}, {{#str}} strftimedaydatetime, core_langconfig {{/str}} {{/userdate}}</td>
                </tr>
            {{/participants_info}}
        </tbody>
    </table>
{{/has_participants}}
