42 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			42 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| <div class="divide-y divide-gray-300 w-full">
 | |
|   <div class="py-3.5 justify-between bg-gray-50 text-left text-sm font-semibold text-gray-900 px-6 grid grid-cols-4">
 | |
|     <div>Lecture</div>
 | |
|     <div>Status</div>
 | |
|     <div>Action</div>
 | |
|     <div>Recording</div>
 | |
|   </div>
 | |
| 
 | |
|   <% course.lectures.sort_by(&:start_time).group_by(&:week_number).each do |(week_number, lectures)| %>
 | |
|     <div class="py-3.5 bg-gray-50 text-left text-sm font-semibold text-gray-900 px-6 grid grid-cols-4">
 | |
|       Week <%= week_number %>
 | |
|     </div>
 | |
| 
 | |
|     <% lectures.each do |lecture| %>
 | |
|       <% status_classes = class_names({
 | |
|                                         'lecture-future': lecture.start_time.future?,
 | |
|                                         'bg-purple-100': lecture == @current_lecture,
 | |
|                                         'bg-green-100': lecture.attended?,
 | |
|                                       }) %>
 | |
| 
 | |
|       <div class="<%= status_classes %> px-6 py-4 flex justify-between items-center grid grid-cols-4">
 | |
|         <div class="whitespace-nowrap text-sm font-medium text-gray-900">
 | |
|           <%= lecture.title %>
 | |
|         </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: 'lecture_status_icons', locals: { lecture: } %>
 | |
|         </div>
 | |
| 
 | |
|         <div class="whitespace-nowrap text-sm font-medium text-gray-900">
 | |
|           <%= render partial: '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>
 | |
|     <% end %>
 | |
|   <% end %>
 | |
| </div> |