diff --git a/app/views/work_items/_work_item.html.erb b/app/views/work_items/_work_item.html.erb
index 79897a4..237c7de 100644
--- a/app/views/work_items/_work_item.html.erb
+++ b/app/views/work_items/_work_item.html.erb
@@ -8,6 +8,12 @@
+ <% if work_item.started? && !work_item.completed? %>
+ <%= button_to "Complete",
+ work_item_complete_path(work_item),
+ class: 'action-button'
+ %>
+ <% end %>
|
@@ -48,11 +54,8 @@
|
- <% if work_item.started? && !work_item.completed? %>
- <%= button_to "Complete",
- work_item_complete_path(work_item),
- class: 'action-button'
- %>
+ <% if work_item.document_link.present? %>
+ <%= link_to "Open recording", work_item.document_link %>
<% end %>
|
diff --git a/db/migrate/20231008153855_add_document_link_to_work_items.rb b/db/migrate/20231008153855_add_document_link_to_work_items.rb
new file mode 100644
index 0000000..397dc68
--- /dev/null
+++ b/db/migrate/20231008153855_add_document_link_to_work_items.rb
@@ -0,0 +1,5 @@
+class AddDocumentLinkToWorkItems < ActiveRecord::Migration[7.1]
+ def change
+ add_column :work_items, :document_link, :string
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 2463b9e..09cac86 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema[7.1].define(version: 2023_10_08_152722) do
+ActiveRecord::Schema[7.1].define(version: 2023_10_08_153855) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -70,6 +70,7 @@ ActiveRecord::Schema[7.1].define(version: 2023_10_08_152722) do
t.datetime "updated_at", null: false
t.datetime "available_from"
t.datetime "completed_at"
+ t.string "document_link"
t.index ["course_id"], name: "index_work_items_on_course_id"
end