lecture-attendance-manager/app/views/attendance_tracker/_lecture_status_icons.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

48 lines
1.7 KiB
Plaintext

<div class="flex flex-row gap-2">
<% prep_icon_class = if lecture.prepared?
'text-green-700'
else
'text-slate-300'
end %>
<i class="fa fa-hourglass-start <%= prep_icon_class %>"></i>
<% if lecture.attended? %>
<% if lecture.entirely_attended_in_person? %>
<i class="fa fa-chalkboard-user text-green-700"></i>
<% else %>
<i class="fa fa-video text-green-700"></i>
<% end %>
<% elsif lecture.is_live? %>
<i class="fa fa-video text-blue-700"></i>
<% elsif lecture.start_time.past? %>
<i class="fa fa-times text-red-700"></i>
<% else %>
<div class="flex-grow"></div>
<% end %>
<% reviewed_icon_class = if lecture.start_time.future?
'invisible'
elsif lecture.reviewed?
'text-green-700'
else
'text-slate-300'
end %>
<i class="fa fa-hourglass-end <%= reviewed_icon_class %>"></i>
</div>
<template data-popover-target="content">
<% unless lecture.tracked_time_entries.empty? %>
<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">
<div>
Preparation: <%= humanise_duration(lecture.total_preparation_time) %>
</div>
<div>
In lecture: <%= humanise_duration(lecture.total_attendance_time) %>
</div>
<div>
Review: <%= humanise_duration(lecture.total_review_time) %>
</div>
</div>
<% end %>
</template>