Remove lecture cancellation display

This commit is contained in:
Joshua Coles 2023-10-08 16:21:55 +01:00
parent c8b688ce57
commit 9da49ceed8

View File

@ -9,82 +9,74 @@
<%= lecture.start_time.to_fs(:dmy) %> <%= lecture.start_time.to_fs(:dmy) %>
</td> </td>
<% if lecture.cancelled %> <td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500" data-controller="popover" data-action="mouseenter->popover#show mouseleave->popover#hide">
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500" colspan="3"> <div class="flex flex-row gap-2">
<div class="flex justify-center"> <% prep_icon_class = if lecture.prepared?
Cancelled 'text-green-700'
</div> else
</td> 'text-slate-300'
<% else %> end %>
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500" data-controller="popover" data-action="mouseenter->popover#show mouseleave->popover#hide"> <i class="fa fa-hourglass-start <%= prep_icon_class %>"></i>
<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.attended? %>
<i class="fa fa-chalkboard-user text-green-700"></i> <i class="fa fa-chalkboard-user text-green-700"></i>
<% elsif lecture.start_time.past? %> <% elsif lecture.start_time.past? %>
<i class="fa fa-times text-red-700"></i> <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>
</td>
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">
<% if lecture.start_time.future? %>
<%= button_to "Prepare",
lecture_start_preparation_path(id: lecture.id),
class: 'action-button'
%>
<% elsif lecture.start_time.past? && !lecture.attended? %>
<%= button_to "Start",
lectures_start_path(id: lecture.id),
class: 'action-button'
%>
<% else %> <% else %>
<div class="flex justify-center"> <div class="flex-grow"></div>
<%= button_to "Review", <% end %>
lecture_start_review_path(id: lecture.id),
class: 'action-button' <% 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> </div>
<% end %> <% end %>
</td> </template>
</td>
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500"> <td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">
<% if lecture.recording %> <% if lecture.start_time.future? %>
<%= link_to "Open recording", lecture.recording&.recording_url %> <%= button_to "Prepare",
<% end %> lecture_start_preparation_path(id: lecture.id),
</td> class: 'action-button'
<% end %> %>
<% elsif lecture.start_time.past? && !lecture.attended? %>
<%= button_to "Start",
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> </tr>