Move the display to attendances
This commit is contained in:
parent
2934d21f5f
commit
598c1204e3
@ -25,6 +25,8 @@ class ScrapeTogglJob < ApplicationJob
|
|||||||
)
|
)
|
||||||
|
|
||||||
lectures.each do |lecture|
|
lectures.each do |lecture|
|
||||||
|
return if lecture.attendance.present?
|
||||||
|
|
||||||
entries_data.each do |entry|
|
entries_data.each do |entry|
|
||||||
concurrent_time_entry = entry['time_entries'].find do |inner_entry|
|
concurrent_time_entry = entry['time_entries'].find do |inner_entry|
|
||||||
(Time.new(inner_entry['start']) - lecture.start_time) < 10.minutes
|
(Time.new(inner_entry['start']) - lecture.start_time) < 10.minutes
|
||||||
|
|||||||
@ -17,8 +17,8 @@
|
|||||||
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">Action</th>
|
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">Action</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody class="divide-y divide-gray-200 bg-white">
|
|
||||||
|
|
||||||
|
<tbody class="divide-y divide-gray-200 bg-white">
|
||||||
<% course.lectures.order(:start_time).group_by { |lecture| lecture.week_number }.each do |(week_number, lectures)| %>
|
<% course.lectures.order(:start_time).group_by { |lecture| lecture.week_number }.each do |(week_number, lectures)| %>
|
||||||
<tr class="border-t border-gray-200">
|
<tr class="border-t border-gray-200">
|
||||||
<th colspan="4" scope="colgroup" class="bg-gray-50 py-2 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">Week <%= week_number %></th>
|
<th colspan="4" scope="colgroup" class="bg-gray-50 py-2 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6">Week <%= week_number %></th>
|
||||||
@ -32,39 +32,36 @@
|
|||||||
<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">
|
||||||
<%= lecture.start_time.to_fs(:dmy) %>
|
<%= lecture.start_time.to_fs(:dmy) %>
|
||||||
</td>
|
</td>
|
||||||
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">
|
|
||||||
<% if lecture.status == 'future' %>
|
|
||||||
Future
|
|
||||||
<% elsif lecture.status == 'happening_now' %>
|
|
||||||
Happening Now
|
|
||||||
<% elsif lecture.status == 'attended_in_person' %>
|
|
||||||
<i class="fa fa-chalkboard-user fa-green-700"></i>
|
|
||||||
<% elsif lecture.status == 'watched_recording' %>
|
|
||||||
<i class="fa fa-video fa-green-700"></i>
|
|
||||||
<% elsif lecture.status == 'missed' %>
|
|
||||||
<i class="fa fa-times text-red-700"></i>
|
|
||||||
<% else %>
|
|
||||||
<% lecture.status %>
|
|
||||||
<% end %>
|
|
||||||
</td>
|
|
||||||
|
|
||||||
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">
|
<% if lecture.start_time.future? %>
|
||||||
<% if lecture.status == 'future' %>
|
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">
|
||||||
<% elsif lecture.status == 'happening_now' && lecture.live_video_url.present? %>
|
</td>
|
||||||
<% link_to "Open live", lecture.live_video_url %>
|
|
||||||
<% elsif lecture.status == 'attended_in_person' %>
|
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">
|
||||||
<% link_to "Open recording", lecture.recording_url %>
|
</td>
|
||||||
<i class="fa fa-chalkboard-user fa-green-700"></i>
|
<% else %>
|
||||||
<% elsif lecture.status == 'watched_recording' %>
|
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">
|
||||||
<i class="fa fa-video fa-green-700"></i>
|
<% if lecture.attendance.nil? %>
|
||||||
<% elsif lecture.status == 'missed' %>
|
<i class="fa fa-times text-red-700"></i>
|
||||||
<button type="button" class="rounded bg-indigo-600 px-2 py-1 font-semibold text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600">
|
<% elsif lecture.attendance.kind == 'concurrent' %>
|
||||||
Start
|
<i class="fa fa-chalkboard-user fa-green-700"></i>
|
||||||
</button>
|
<% elsif lecture.attendance.kind == 'catchup' %>
|
||||||
<% else %>
|
<i class="fa fa-video fa-green-700"></i>
|
||||||
<% lecture.status %>
|
<% else %>
|
||||||
<% end %>
|
<% lecture.attendance.kind %>
|
||||||
</td>
|
<% end %>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">
|
||||||
|
<% if lecture.attendance.nil? %>
|
||||||
|
<button type="button" class="rounded bg-indigo-600 px-2 py-1 font-semibold text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600">
|
||||||
|
Start
|
||||||
|
</button>
|
||||||
|
<% else %>
|
||||||
|
<% link_to "Open recording", lecture.recording_url %>
|
||||||
|
<% end %>
|
||||||
|
</td>
|
||||||
|
<% end %>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user