From 0cb56424a1dbcefc2df2b73947aa43eb5d25ae2c Mon Sep 17 00:00:00 2001 From: Joshua Coles Date: Thu, 12 Oct 2023 09:40:59 +0100 Subject: [PATCH] Add a 5 minute period before a lecture where you can join --- app/views/lectures/_lecture.html.erb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/views/lectures/_lecture.html.erb b/app/views/lectures/_lecture.html.erb index 3b00d81..67b1597 100644 --- a/app/views/lectures/_lecture.html.erb +++ b/app/views/lectures/_lecture.html.erb @@ -60,12 +60,13 @@ - <% if lecture.start_time.future? %> + <% joinable_time = lecture.start_time - 5.minutes %> + <% if joinable_time.future? %> <%= button_to "Prepare", lecture_start_preparation_path(id: lecture.id), class: 'action-button' %> - <% elsif lecture.start_time.past? && !lecture.attended? %> + <% elsif joinable_time.past? && !lecture.attended? %> <% start_label = if lecture.is_live? then "Join" else