- |
- <%= lecture.title %>
- |
-
- <%= lecture.start_time.to_fs(:dmy) %>
- |
-
- <% if lecture.status == 'future' %>
- Future
- <% elsif lecture.status == 'happening_now' %>
- Happening Now
- <% elsif lecture.status == 'attended_in_person' %>
-
- <% elsif lecture.status == 'watched_recording' %>
-
- <% elsif lecture.status == 'missed' %>
-
- <% else %>
- <% lecture.status %>
- <% end %>
- |
-
-
- <% if lecture.status == 'future' %>
- <% elsif lecture.status == 'happening_now' && lecture.live_video_url.present? %>
- <% link_to "Open live", lecture.live_video_url %>
- <% elsif lecture.status == 'attended_in_person' %>
- <% link_to "Open recording", lecture.recording_url %>
-
- <% elsif lecture.status == 'watched_recording' %>
-
- <% elsif lecture.status == 'missed' %>
-
- <% else %>
- <% lecture.status %>
- <% end %>
- |
+ <% course.lectures.group_by { |lecture| lecture.week_number }.each do |(week_number, lectures)| %>
+
+ |
+ <%= lecture.title %>
+ |
+
+ <%= lecture.start_time.to_fs(:dmy) %>
+ |
+
+ <% if lecture.status == 'future' %>
+ Future
+ <% elsif lecture.status == 'happening_now' %>
+ Happening Now
+ <% elsif lecture.status == 'attended_in_person' %>
+
+ <% elsif lecture.status == 'watched_recording' %>
+
+ <% elsif lecture.status == 'missed' %>
+
+ <% else %>
+ <% lecture.status %>
+ <% end %>
+ |
+
+
+ <% if lecture.status == 'future' %>
+ <% elsif lecture.status == 'happening_now' && lecture.live_video_url.present? %>
+ <% link_to "Open live", lecture.live_video_url %>
+ <% elsif lecture.status == 'attended_in_person' %>
+ <% link_to "Open recording", lecture.recording_url %>
+
+ <% elsif lecture.status == 'watched_recording' %>
+
+ <% elsif lecture.status == 'missed' %>
+
+ <% else %>
+ <% lecture.status %>
+ <% end %>
+ |
+
+ <% end %>
<% end %>
- <% end %>
-