| Lecture | Date | Status | Action | ||||
|---|---|---|---|---|---|---|---|
|
Week <%= week_number %>
<% total_for_week = lectures.sum { |lecture| lecture.total_overall_time }.seconds %>
<%# 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) %>
<% if total_for_week > 0 %>
(Total <%= humanise_duration(lectures.sum { |lecture| lecture.total_overall_time }.seconds) %>
)
<% end %>
|
|||||||
| <%= lecture.title %> | <%= lecture.start_time.to_fs(:dmy) %> | <% if lecture.cancelled %>
Cancelled
|
<% else %>
<% prep_icon_class = if lecture.prepared?
'text-green-700'
else
'text-slate-300'
end %>
<% if lecture.attended? %>
<% elsif lecture.start_time.past? %>
<% else %>
<% end %>
<% reviewed_icon_class = if lecture.start_time.future?
'invisible'
elsif lecture.reviewed?
'text-green-700'
else
'text-slate-300'
end %>
<% unless lecture.tracked_time_entries.empty? %>
Preparation: <%= humanise_duration(lecture.total_preparation_time) %>
In lecture: <%= humanise_duration(lecture.total_attendance_time) %>
Review: <%= humanise_duration(lecture.total_review_time) %>
|
<% 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 %>
<%= button_to "Review",
lecture_start_review_path(id: lecture.id),
class: 'action-button'
%>
<% end %>
|
<% if lecture.recording %> <%= link_to "Open recording", lecture.recording&.recording_url %> <% end %> | <% end %>||