diff --git a/app/views/lectures/_lecture.html.erb b/app/views/lectures/_lecture.html.erb index a9fcbf1..b4926ed 100644 --- a/app/views/lectures/_lecture.html.erb +++ b/app/views/lectures/_lecture.html.erb @@ -9,82 +9,74 @@ <%= 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 %> - + +
+ <% 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 %> - -
- - - - - - <% 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' - %> + <% if lecture.attended? %> + + <% elsif lecture.start_time.past? %> + <% else %> -
- <%= button_to "Review", - lecture_start_review_path(id: lecture.id), - class: 'action-button' - %> +
+ <% end %> + + <% reviewed_icon_class = if lecture.start_time.future? + 'invisible' + elsif lecture.reviewed? + 'text-green-700' + else + 'text-slate-300' + end %> + +
+ + + - - <% if lecture.recording %> - <%= link_to "Open recording", lecture.recording&.recording_url %> - <% end %> - - <% end %> + + <% 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 %> +