<%
# BigBlueButton open source conferencing system - http://www.bigbluebutton.org/.
# Copyright (c) 2018 BigBlueButton Inc. and by respective authors (see below).
# This program is free software; you can redistribute it and/or modify it under the
# terms of the GNU Lesser General Public License as published by the Free Software
# Foundation; either version 3.0 of the License, or (at your option) any later
# version.
#
# BigBlueButton 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 Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public License along
# with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
%>

<div class="sessions pb-5">
  <div class="container pt-6">

    <%= render "shared/components/subtitle", subtitle: (only_public ? t("recording.visibility.public") + " " : "") + t("room.recordings"), search: true %>
    <div class="row">
      <div class="col-12">
        <div class="card">
          <div class="table-responsive">
            <table class="table table-hover table-outline table-vcenter text-nowrap card-table">
              <thead>
                <tr>
                  <th><%= t("recording.table.name") %></th>
                  <th><%= t("recording.table.thumbnails") %></th>
                  <th class="text-left"><%= t("recording.table.length") %></th>
                  <th class="text-left"><%= t("recording.table.users") %></th>
                  <th class="text-left"><%= t("recording.table.visibility") %></th>
                  <th><%= t("recording.table.formats") %></th>
                  <% unless only_public %>
                    <th class="text-center"><i class="icon-settings"></i></th>
                  <% end %>
                </tr>
              </thead>
              <tbody>
              <% if recordings.empty? %>
                <tr>
                  <td colspan="7" class="text-center h4 p-6 font-weight-normal">
                    <%= t("recording.no_recordings", inject: only_public ? t("recording.visibility.public").downcase + " "  : "") %>
                  </td>
                </tr>
              <% else %>
                <% recordings.each do |recording| %>
                  <% if only_public %>
                    <%= render "shared/components/public_recording_row", recording: recording %>
                  <% else %>
                    <%= render "shared/components/recording_row", recording: recording %>
                  <% end %>
                <% end %>
              <% end %>
              </tbody>
            </table>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
