Move calendar scraping to a model method

This commit is contained in:
2023-10-04 14:41:15 +01:00
parent ef3642678d
commit 0e0d26d06d
5 changed files with 67 additions and 82 deletions
+1 -2
View File
@@ -24,10 +24,9 @@
<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>
</tr>
<% lectures.each do |lecture| %>
<% lectures.reject(&:cancelled).each do |lecture| %>
<tr class="<%= class_names({
'lecture-future': lecture.start_time.future?,
'bg-slate-200': lecture.cancelled,
'bg-green-100': lecture.attendance.present?,
}) %>">
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm font-medium text-gray-900 sm:pl-6">