Add in lecture time popover

This commit is contained in:
2023-10-06 20:49:53 +01:00
parent fda26e3b53
commit 41e3eebe52
4 changed files with 17 additions and 4 deletions
+10 -2
View File
@@ -58,8 +58,8 @@
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">
</td>
<% else %>
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500 flex justify-center">
<div>
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500 flex justify-center" data-controller="popover">
<div data-action="mouseenter->popover#show mouseleave->popover#hide">
<% if lecture.attendance.nil? %>
<i class="fa fa-times text-red-700"></i>
<% elsif lecture.attendance.kind == 'concurrent' %>
@@ -69,6 +69,14 @@
<% else %>
<% lecture.attendance.kind %>
<% end %>
<% if lecture.attendance.present? %>
<template data-popover-target="content">
<div class="content absolute max-w-xs bg-gray-300 rounded p-2" data-popover-target="card">
In lecture: <%= lecture.attendance.duration.in_minutes.round %> minutes
</div>
</template>
<% end %>
</div>
</td>