lecture-attendance-manager/app/views/lectures/_lecture.html.erb
Joshua Coles 4c2272b1f0
All checks were successful
Build and Publish Docker Container / build (push) Successful in 5m44s
Fix regression in lecture ordering, add time of lecture on hover, fix lecture duration using hours instead of minutes
The update includes modifications in the lectures' order by start_time in course model. The lecture duration is now correctly calculated by minutes instead of hours. Additionally, in the lecture view, an online indicator is added for each lecture and popover is implemented to show the lecture start and end times..
2024-02-04 15:37:56 +00:00

64 lines
2.3 KiB
Plaintext

<tr class="<%= class_names({
'lecture-future': lecture.start_time.future?,
'bg-green-100': lecture.attended?,
}) %>">
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm font-medium text-gray-900 sm:pl-6">
<%= lecture.title %>
<% if lecture.online %>
<i class="fa fa-solid fa-globe text-gray-500"></i>
<% end %>
</td>
<td
class="whitespace-nowrap px-3 py-4 text-sm text-gray-500"
data-controller="popover"
data-action="mouseenter->popover#show mouseleave->popover#hide"
>
<%= lecture.start_time.to_fs(:dmy) %>
<template data-popover-target="content">
<div class="absolute p-1 w-max whitespace-normal break-words rounded-lg border border-blue-gray-50 bg-white text-blue-gray-500 shadow-lg shadow-blue-gray-500/10 focus:outline-none" data-popover-target="card">
<%= lecture.start_time.to_fs(:time) %> &dash; <%= lecture.end_time.to_fs(:time) %>
</div>
</template>
</td>
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500" data-controller="popover" data-action="mouseenter->popover#show mouseleave->popover#hide">
<%= render partial: 'lecture_status_icons', locals: { lecture: } %>
</td>
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">
<% 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 %>
<div class="flex justify-center">
<%= button_to "Review",
lecture_start_review_path(id: lecture.id),
class: 'action-button'
%>
</div>
<% end %>
</td>
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">
<% if lecture.recording %>
<%= link_to "Open recording", lecture.recording&.recording_url %>
<% end %>
</td>
</tr>