Add review and prep actions
Some checks reported warnings
Build and Publish Docker Container / build (push) Has been cancelled
Some checks reported warnings
Build and Publish Docker Container / build (push) Has been cancelled
This commit is contained in:
parent
9621f6fa24
commit
6c8d2544e0
@ -11,4 +11,22 @@ class LectureController < ApplicationController
|
|||||||
redirect_to lecture.recording.recording_url, allow_other_host: true
|
redirect_to lecture.recording.recording_url, allow_other_host: true
|
||||||
end
|
end
|
||||||
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
|
end
|
||||||
|
|||||||
@ -17,6 +17,7 @@ module Toggl
|
|||||||
body: {
|
body: {
|
||||||
"created_with": "Attendance Tracker",
|
"created_with": "Attendance Tracker",
|
||||||
"description": description,
|
"description": description,
|
||||||
|
"start": Time.now.utc.iso8601,
|
||||||
"duration": -1,
|
"duration": -1,
|
||||||
"project_id": project_id,
|
"project_id": project_id,
|
||||||
}.to_json,
|
}.to_json,
|
||||||
|
|||||||
@ -48,6 +48,12 @@
|
|||||||
</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">
|
||||||
|
<div class="flex justify-center">
|
||||||
|
<%= button_to "Prepare",
|
||||||
|
lecture_start_preparation_path(id: lecture.id),
|
||||||
|
class: 'action-button'
|
||||||
|
%>
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<% else %>
|
<% else %>
|
||||||
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500 flex justify-center">
|
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500 flex justify-center">
|
||||||
@ -71,6 +77,13 @@
|
|||||||
class: 'action-button'
|
class: 'action-button'
|
||||||
%>
|
%>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
<div class="flex justify-center">
|
||||||
|
<%= button_to "Review",
|
||||||
|
lecture_start_review_path(id: lecture.id),
|
||||||
|
class: 'action-button'
|
||||||
|
%>
|
||||||
|
</div>
|
||||||
|
|
||||||
<% if lecture.recording %>
|
<% if lecture.recording %>
|
||||||
<%= link_to "Open recording", lecture.recording&.recording_url %>
|
<%= link_to "Open recording", lecture.recording&.recording_url %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@ -11,4 +11,6 @@ Rails.application.routes.draw do
|
|||||||
root controller: :attendance_tracker, action: :index
|
root controller: :attendance_tracker, action: :index
|
||||||
|
|
||||||
post '/lectures/:id/start', to: 'lecture#start', as: :lectures_start
|
post '/lectures/:id/start', to: 'lecture#start', as: :lectures_start
|
||||||
|
post '/lectures/:id/start_preparation', to: 'lecture#start_preparation', as: :lecture_start_preparation
|
||||||
|
post '/lectures/:id/start_review', to: 'lecture#start_review', as: :lecture_start_review
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user