Make the UI a little more complete
This commit is contained in:
parent
d14903fcb4
commit
a36284b73e
@ -12,4 +12,12 @@ class Lecture < ApplicationRecord
|
||||
def week_number
|
||||
((start_time.beginning_of_week - Time.new('2023-10-02')) / 1.week).floor
|
||||
end
|
||||
|
||||
def live_video_url
|
||||
nil
|
||||
end
|
||||
|
||||
def recording_url
|
||||
"https://google.com"
|
||||
end
|
||||
end
|
||||
|
||||
@ -33,21 +33,36 @@
|
||||
</td>
|
||||
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">
|
||||
<% if lecture.status == 'future' %>
|
||||
<i class="fa fa-clock"></i>
|
||||
Future
|
||||
<% elsif lecture.status == 'happening_now' %>
|
||||
<i class="fa fa-hourglass-start"></i>
|
||||
Happening Now
|
||||
<% elsif lecture.status == 'attended_in_person' %>
|
||||
<i class="fa fa-chalkboard-user"></i>
|
||||
<i class="fa fa-chalkboard-user fa-green-700"></i>
|
||||
<% elsif lecture.status == 'watched_recording' %>
|
||||
<i class="fa fa-video"></i>
|
||||
<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">
|
||||
<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>
|
||||
<% 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 %>
|
||||
<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' %>
|
||||
<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 %>
|
||||
<% lecture.status %>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user