lecture-attendance-manager/app/controllers/lecture_controller.rb
Joshua Coles 6c8d2544e0
Some checks reported warnings
Build and Publish Docker Container / build (push) Has been cancelled
Add review and prep actions
2023-10-04 15:14:19 +01:00

33 lines
742 B
Ruby

class LectureController < ApplicationController
def start
lecture = Lecture.find(params[:id])
Toggl::start_time_entry(
description: lecture.title,
project_id: lecture.course.toggl_project,
)
if lecture.recording.present?
redirect_to lecture.recording.recording_url, allow_other_host: true
end
end
def start_preparation
lecture = Lecture.find(params[:id])
Toggl::start_time_entry(
description: "#{lecture.title}: Prep",
project_id: lecture.course.toggl_project,
)
end
def start_review
lecture = Lecture.find(params[:id])
Toggl::start_time_entry(
description: "#{lecture.title}: Review",
project_id: lecture.course.toggl_project,
)
end
end