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
|
def week_number
|
||||||
((start_time.beginning_of_week - Time.new('2023-10-02')) / 1.week).floor
|
((start_time.beginning_of_week - Time.new('2023-10-02')) / 1.week).floor
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def live_video_url
|
||||||
|
nil
|
||||||
|
end
|
||||||
|
|
||||||
|
def recording_url
|
||||||
|
"https://google.com"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -33,21 +33,36 @@
|
|||||||
</td>
|
</td>
|
||||||
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">
|
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">
|
||||||
<% if lecture.status == 'future' %>
|
<% if lecture.status == 'future' %>
|
||||||
<i class="fa fa-clock"></i>
|
Future
|
||||||
<% elsif lecture.status == 'happening_now' %>
|
<% elsif lecture.status == 'happening_now' %>
|
||||||
<i class="fa fa-hourglass-start"></i>
|
Happening Now
|
||||||
<% elsif lecture.status == 'attended_in_person' %>
|
<% 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' %>
|
<% 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 %>
|
<% else %>
|
||||||
<% lecture.status %>
|
<% lecture.status %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">
|
<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">
|
<% if lecture.status == 'future' %>
|
||||||
Start
|
<% elsif lecture.status == 'happening_now' && lecture.live_video_url.present? %>
|
||||||
</button>
|
<% 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>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user