lecture-attendance-manager/app/views/lectures/_lecture.html.erb
Joshua Coles 3f4d630ce2
All checks were successful
Build and Publish Docker Container / build (push) Successful in 6m0s
A few style changes
2024-02-05 09:53:47 +00:00

51 lines
2.0 KiB
Plaintext

<% status_classes = class_names({
'lecture-future': lecture.start_time.future?,
'bg-purple-100': lecture == @current_lecture,
'bg-green-100': lecture.attended?,
}) %>
<div id="<%= dom_id(lecture) %>" class="<%= status_classes %> px-6 py-4 justify-between items-center grid grid-flow-col gap-2">
<div class="whitespace-nowrap text-sm font-medium text-gray-900">
<%= lecture.title %>
<% if lecture.online %>
<i class="fa fa-solid fa-globe text-gray-500"></i>
<% else %>
<span class="inline-block w-4"></span>
<% end %>
</div>
<div
class="whitespace-nowrap text-sm text-gray-500"
data-controller="popover"
data-action="mouseenter->popover#show mouseleave->popover#hide"
>
<% if local_assigns[:today_view] %>
<%= lecture.start_time.to_fs(:time) %> &dash; <%= lecture.end_time.to_fs(:time) %>
<% else %>
<%= 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>
<% end %>
</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: 'lectures/lecture_status_icons', locals: { lecture: } %>
</div>
<div class="whitespace-nowrap text-sm font-medium text-gray-900">
<%= render partial: 'lectures/lecture_action', locals: { lecture: } %>
</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>