All checks were successful
Build and Publish Docker Container / build (push) Successful in 5m13s
76 lines
3.5 KiB
Plaintext
76 lines
3.5 KiB
Plaintext
<h1 class="text-3xl font-medium"><%= @course.title %></h1>
|
|
|
|
<div class="flex flex-col gap-4">
|
|
<div class="mt-8 flow-root">
|
|
<div class="-mx-4 -my-2 overflow-x-auto sm:-mx-6 lg:-mx-8">
|
|
<div class="inline-block py-2 align-middle px-6 lg:px-8 w-full">
|
|
<div class="overflow-hidden shadow ring-1 ring-black ring-opacity-5 rounded-lg">
|
|
<div class="divide-y divide-gray-300 w-full">
|
|
<div class="py-3.5 justify-between bg-gray-50 text-left text-sm font-semibold text-gray-900 px-6 grid grid-cols-4">
|
|
<div>Lecture</div>
|
|
<div>Status</div>
|
|
<div>Action</div>
|
|
<div>Recording</div>
|
|
</div>
|
|
|
|
<% @course.lectures.sort_by(&:start_time).group_by(&:week_number).each do |(week_number, lectures)| %>
|
|
<div class="py-3.5 bg-gray-50 text-left text-sm font-semibold text-gray-900 px-6 grid grid-cols-4">
|
|
Week <%= week_number %>
|
|
</div>
|
|
|
|
<% lectures.each do |lecture| %>
|
|
<% status_classes = class_names({
|
|
'lecture-future': lecture.start_time.future?,
|
|
'bg-green-100': lecture.attended?,
|
|
}) %>
|
|
|
|
<div class="<%= status_classes %> px-6 py-4 flex justify-between bg-white items-center grid grid-cols-4">
|
|
<div class="whitespace-nowrap text-sm font-medium text-gray-900">
|
|
<%= lecture.title %>
|
|
</div>
|
|
|
|
<div class="whitespace-nowrap text-sm font-medium text-gray-900" data-controller="popover" data-action="mouseenter->popover#show mouseleave->popover#hide">
|
|
<%= render partial: 'lecture_status_icons', locals: { lecture: } %>
|
|
</div>
|
|
|
|
<div class="whitespace-nowrap text-sm font-medium text-gray-900">
|
|
<% joinable_time = lecture.start_time - 5.minutes %>
|
|
|
|
<% if joinable_time.future? %>
|
|
<%= button_to "Prepare",
|
|
lecture_start_preparation_path(id: lecture.id),
|
|
class: 'action-button'
|
|
%>
|
|
<% elsif joinable_time.past? && !lecture.attended? %>
|
|
<% start_label = if lecture.is_live? then
|
|
"Join"
|
|
else
|
|
"Start"
|
|
end %>
|
|
<%= button_to start_label,
|
|
lectures_start_path(id: lecture.id),
|
|
class: 'action-button'
|
|
%>
|
|
<% else %>
|
|
<%= button_to "Review",
|
|
lecture_start_review_path(id: lecture.id),
|
|
class: 'action-button'
|
|
%>
|
|
<% end %>
|
|
</div>
|
|
|
|
<div class="whitespace-nowrap text-sm font-medium text-gray-900">
|
|
<% if lecture.recording %>
|
|
<%= link_to "Open recording", lecture.recording&.recording_url %>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|