Remove table view from _lecture partial
This commit is contained in:
parent
c1c7342497
commit
bb7f0a824d
@ -16,12 +16,11 @@
|
|||||||
<%# TODO: Improve this figure, atm it is for lectures in week, not time spent in week (ie
|
<%# TODO: Improve this figure, atm it is for lectures in week, not time spent in week (ie
|
||||||
prepping for lecture next week will count in next week not current week) %>
|
prepping for lecture next week will count in next week not current week) %>
|
||||||
<% if total_for_week > 0 %>
|
<% if total_for_week > 0 %>
|
||||||
(Total <%= humanise_duration(lectures.sum { |lecture| lecture.total_overall_time }.seconds) %>
|
(Total <%= humanise_duration(lectures.sum { |lecture| lecture.total_overall_time }.seconds) %>)
|
||||||
)
|
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<%= render lectures, { div: true } %>
|
<%= render lectures %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
<div>Action</div>
|
<div>Action</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<%= render @lectures, { div: true, today_view: true } %>
|
<%= render @lectures, { today_view: true } %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1,69 +1,26 @@
|
|||||||
<% if local_assigns[:div] %>
|
<% status_classes = class_names({
|
||||||
<% status_classes = class_names({
|
'lecture-future': lecture.start_time.future?,
|
||||||
'lecture-future': lecture.start_time.future?,
|
'bg-purple-100': lecture == @current_lecture,
|
||||||
'bg-purple-100': lecture == @current_lecture,
|
'bg-green-100': lecture.attended?,
|
||||||
'bg-green-100': lecture.attended?,
|
}) %>
|
||||||
}) %>
|
|
||||||
|
|
||||||
<div class="<%= status_classes %> px-6 py-4 flex justify-between items-center grid grid-cols-5">
|
<div class="<%= status_classes %> px-6 py-4 flex justify-between items-center grid grid-cols-5 gap-2">
|
||||||
<div class="whitespace-nowrap text-sm font-medium text-gray-900">
|
<div class="whitespace-nowrap text-sm font-medium text-gray-900">
|
||||||
<%= lecture.title %>
|
<%= lecture.title %>
|
||||||
|
|
||||||
<% if lecture.online %>
|
<% if lecture.online %>
|
||||||
<i class="fa fa-solid fa-globe text-gray-500"></i>
|
<i class="fa fa-solid fa-globe text-gray-500"></i>
|
||||||
<% end %>
|
<% 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) %> ‐ <%= 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) %> ‐ <%= 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>
|
</div>
|
||||||
<% else %>
|
|
||||||
<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 %>
|
<div
|
||||||
<i class="fa fa-solid fa-globe text-gray-500"></i>
|
class="whitespace-nowrap text-sm text-gray-500"
|
||||||
<% end %>
|
data-controller="popover"
|
||||||
</td>
|
data-action="mouseenter->popover#show mouseleave->popover#hide"
|
||||||
|
>
|
||||||
<td
|
<% if local_assigns[:today_view] %>
|
||||||
class="whitespace-nowrap px-3 py-4 text-sm text-gray-500"
|
<%= lecture.start_time.to_fs(:time) %> ‐ <%= lecture.end_time.to_fs(:time) %>
|
||||||
data-controller="popover"
|
<% else %>
|
||||||
data-action="mouseenter->popover#show mouseleave->popover#hide"
|
|
||||||
>
|
|
||||||
<%= lecture.start_time.to_fs(:dmy) %>
|
<%= lecture.start_time.to_fs(:dmy) %>
|
||||||
|
|
||||||
<template data-popover-target="content">
|
<template data-popover-target="content">
|
||||||
@ -71,43 +28,21 @@
|
|||||||
<%= lecture.start_time.to_fs(:time) %> ‐ <%= lecture.end_time.to_fs(:time) %>
|
<%= lecture.start_time.to_fs(:time) %> ‐ <%= lecture.end_time.to_fs(:time) %>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</td>
|
<% end %>
|
||||||
|
</div>
|
||||||
|
|
||||||
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500" data-controller="popover" data-action="mouseenter->popover#show mouseleave->popover#hide">
|
<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: } %>
|
<%= render partial: 'lectures/lecture_status_icons', locals: { lecture: } %>
|
||||||
</td>
|
</div>
|
||||||
|
|
||||||
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">
|
<div class="whitespace-nowrap text-sm font-medium text-gray-900">
|
||||||
<% joinable_time = lecture.start_time - 5.minutes %>
|
<%= render partial: 'lectures/lecture_action', locals: { lecture: } %>
|
||||||
<% if joinable_time.future? %>
|
</div>
|
||||||
<%= button_to "Prepare",
|
|
||||||
lecture_start_preparation_path(id: lecture.id),
|
<div class="whitespace-nowrap text-sm font-medium text-gray-900">
|
||||||
class: 'action-button'
|
<% if lecture.recording %>
|
||||||
%>
|
<%= link_to "Open recording", lecture.recording&.recording_url %>
|
||||||
<% elsif joinable_time.past? && !lecture.attended? %>
|
<% end %>
|
||||||
<% start_label = if lecture.is_live? then
|
</div>
|
||||||
"Join"
|
</div>
|
||||||
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>
|
|
||||||
<% end %>
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user