<% if recordings.present? %>
  <div class="list-group">
    <% recordings.each do |recording| %>
      <div class="list-group-item list-group-item-action">
        <div class="d-flex align-items-start">
          <% if (controller.class.module_parent.to_s != "Public" && policy(BroadcastRecording).update?) %>
            <%= link_to fa_icon("#{recording.starred ? 'star' : 'star-o'} fw"), [broadcast.project, broadcast, recording, :broadcast_recording_starrings], method: :post, class: "text-warning mr-3", remote: true %>
          <% end %>
          <%= image_tag(recording.thumbnail_url, class: 'img-thumbnail img-fluid max-w-75') %>
          <div class="ml-auto">
            <% if (controller.class.module_parent.to_s != "Public" && policy(BroadcastRecording).edit?) %>
              <%= link_to fa_icon('edit'), [:edit, broadcast.project, broadcast, recording], remote: true %>
            <% end %>
            <%= link_to(fa_icon('download'), recording.download_url, target: "_blank") %>
          </div>
        </div>
        <div class="d-flex flex-column align-items-start justify-content-start p-4">
          <h5><%= recording.name %></h5>
          <p><%= recording.description %></p>
        </div>
      </div>
    <% end %>
  </div>
  <div id="recordings_pagination" class="row mt-5 justify-content-center">
    <%= will_paginate(recordings, params: {controller: "broadcasts", action: "show", project_id: broadcast.project_id, id: broadcast.id, page: params[:page], active_tab: 'recordings'}) %>
  </div>
<% else %>
  <p class="mt-4">Recording of the live stream will appear here.</p>
<% end %>
