From b0d1fa3c7508fc6490fd31521e836806ee15dabc Mon Sep 17 00:00:00 2001 From: maebeale Date: Sun, 8 Mar 2026 14:04:51 -0400 Subject: [PATCH 001/102] Rename Tutorial to Recording with is_tutorial and is_podcast booleans MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Rename tutorials table to recordings via migration - Add is_tutorial (default: true) and is_podcast (default: false) columns - Rename Tutorial model to Recording with backwards-compatibility alias - Add scopes: .tutorials (is_tutorial: true), .podcasts (is_podcast: true) - Rename TutorialsController to RecordingsController - Add video_library action for all recordings - Index action filters to is_tutorial: true only - Update routes: resources :recordings, /tutorials redirects to index, /video_library route - Rename home VideoGalleryController to VideoLibraryController, update to use Recording - Rename and update views: tutorials → recordings, video_gallery → video_library - Rename and update policy: TutorialPolicy → RecordingPolicy - Rename and update factory: tutorial → recording, add :tutorial/:podcast/:both traits - Help menu shows Tutorials (is_tutorial: true) - Community menu shows Video Library (all recordings) Co-Authored-By: Claude Haiku 4.5 --- .../home/video_gallery_controller.rb | 13 -- .../home/video_library_controller.rb | 13 ++ app/controllers/recordings_controller.rb | 149 ++++++++++++++++++ app/controllers/tutorials_controller.rb | 130 --------------- app/models/{tutorial.rb => recording.rb} | 11 +- ...tutorial_policy.rb => recording_policy.rb} | 2 +- .../index.html.erb | 0 .../{tutorials => recordings}/_form.html.erb | 0 .../_search_boxes.html.erb | 0 .../_tutorial.html.erb | 0 .../_video_card.html.erb | 0 .../{tutorials => recordings}/edit.html.erb | 0 .../{tutorials => recordings}/index.html.erb | 0 .../index_lazy.html.erb | 0 .../{tutorials => recordings}/new.html.erb | 0 .../{tutorials => recordings}/show.html.erb | 0 config/routes.rb | 6 +- ...08140252_rename_tutorials_to_recordings.rb | 10 ++ .../factories/{tutorials.rb => recordings.rb} | 25 ++- 19 files changed, 209 insertions(+), 150 deletions(-) delete mode 100644 app/controllers/home/video_gallery_controller.rb create mode 100644 app/controllers/home/video_library_controller.rb create mode 100644 app/controllers/recordings_controller.rb delete mode 100644 app/controllers/tutorials_controller.rb rename app/models/{tutorial.rb => recording.rb} (91%) rename app/policies/{tutorial_policy.rb => recording_policy.rb} (91%) rename app/views/home/{video_gallery => video_library}/index.html.erb (100%) rename app/views/{tutorials => recordings}/_form.html.erb (100%) rename app/views/{tutorials => recordings}/_search_boxes.html.erb (100%) rename app/views/{tutorials => recordings}/_tutorial.html.erb (100%) rename app/views/{tutorials => recordings}/_video_card.html.erb (100%) rename app/views/{tutorials => recordings}/edit.html.erb (100%) rename app/views/{tutorials => recordings}/index.html.erb (100%) rename app/views/{tutorials => recordings}/index_lazy.html.erb (100%) rename app/views/{tutorials => recordings}/new.html.erb (100%) rename app/views/{tutorials => recordings}/show.html.erb (100%) create mode 100644 db/migrate/20260308140252_rename_tutorials_to_recordings.rb rename spec/factories/{tutorials.rb => recordings.rb} (51%) diff --git a/app/controllers/home/video_gallery_controller.rb b/app/controllers/home/video_gallery_controller.rb deleted file mode 100644 index 8357fc504..000000000 --- a/app/controllers/home/video_gallery_controller.rb +++ /dev/null @@ -1,13 +0,0 @@ -module Home - class VideoGalleryController < ApplicationController - skip_before_action :authenticate_user! - - def index - authorize! :home - base = Tutorial.where.not(youtube_url: [ nil, "" ]).order(position: :asc, created_at: :desc) - @tutorials = authorized_scope(base, with: HomePolicy).decorate - - render "home/video_gallery/index" - end - end -end diff --git a/app/controllers/home/video_library_controller.rb b/app/controllers/home/video_library_controller.rb new file mode 100644 index 000000000..8fed7ff76 --- /dev/null +++ b/app/controllers/home/video_library_controller.rb @@ -0,0 +1,13 @@ +module Home + class VideoLibraryController < ApplicationController + skip_before_action :authenticate_user! + + def index + authorize! :home + base = Recording.where.not(youtube_url: [ nil, "" ]).order(position: :asc, created_at: :desc) + @recordings = authorized_scope(base, with: HomePolicy).decorate + + render "home/video_library/index" + end + end +end diff --git a/app/controllers/recordings_controller.rb b/app/controllers/recordings_controller.rb new file mode 100644 index 000000000..4d4066a24 --- /dev/null +++ b/app/controllers/recordings_controller.rb @@ -0,0 +1,149 @@ +class RecordingsController < ApplicationController + include AhoyTracking, TagAssignable + skip_before_action :authenticate_user!, only: [ :index, :show ] + before_action :set_recording, only: [ :show, :edit, :update, :destroy ] + + def index + authorize! + if turbo_frame_request? + per_page = params[:number_of_items_per_page].presence || 6 + base_scope = authorized_scope(Recording.tutorials) + filtered = base_scope.search_by_params(params) + + @count_display = filtered.size == base_scope.size ? base_scope.size : "#{filtered.count}/#{base_scope.count}" + @recordings = filtered.order(:position).paginate(page: params[:page], per_page: per_page).decorate + + render :index_lazy + else + @sectors = Sector.published.order(:name) + @category_types = CategoryType.published.general.order(:name).decorate + + render :index + end + end + + def video_library + authorize! + if turbo_frame_request? + per_page = params[:number_of_items_per_page].presence || 6 + base_scope = authorized_scope(Recording.all) + filtered = base_scope.search_by_params(params) + + @count_display = filtered.size == base_scope.size ? base_scope.size : "#{filtered.count}/#{base_scope.count}" + @video_library = filtered.order(:position).paginate(page: params[:page], per_page: per_page).decorate + + render :video_library_lazy + else + @sectors = Sector.published.order(:name) + @category_types = CategoryType.published.general.order(:name).decorate + + render :video_library + end + end + + def show + @recording = @recording.decorate + authorize! @recording + track_view(@recording) + end + + def new + @recording = Tutorial.new.decorate + authorize! @recording + set_form_variables + end + + def edit + @recording = @recording.decorate + authorize! @recording + set_form_variables + end + + def create + @recording = Tutorial.new(recording_params) + authorize! @recording + + success = false + + Recording.transaction do + if @recording.save + assign_associations(@recording) + success = true + end + rescue ActiveRecord::RecordInvalid, ActiveRecord::RecordNotSaved => e + Rails.logger.error "Tutorial create failed: #{e.class} - #{e.message}" + raise ActiveRecord::Rollback + end + + if success + redirect_to @recording, notice: "Recording was successfully created." + else + @recording = @recording.decorate + set_form_variables + render :new, status: :unprocessable_content + end + end + + def update + authorize! @recording + + success = false + + Recording.transaction do + if @recording.update(recording_params) + assign_associations(@recording) + success = true + end + rescue ActiveRecord::RecordInvalid, ActiveRecord::RecordNotSaved => e + Rails.logger.error "Tutorial update failed: #{e.class} - #{e.message}" + raise ActiveRecord::Rollback + end + + if success + redirect_to @recording, notice: "Recording was successfully updated.", status: :see_other + else + @recording = @recording.decorate + set_form_variables + render :edit, status: :unprocessable_content + end + end + + def destroy + authorize! @recording + @recording.destroy! + redirect_to tutorials_path, notice: "Recording was successfully destroyed." + end + + # Optional hooks for setting variables for forms or index + def set_form_variables + @recording.build_primary_asset if @recording.primary_asset.blank? + @recording.gallery_assets.build + @categories_grouped = + Category + .includes(:category_type) + .published + .order(:position, :name) + .group_by(&:category_type) + .select { |type, _| type.nil? || type.published? } + .sort_by { |type, _| type&.name.to_s.downcase } + @sectors = Sector.published.order(:name) + end + + private + + def set_recording + @recording = Recording.find(params[:id]) + end + + # Strong parameters + def recording_params + params.require(:recording).permit( + :title, :body, :rhino_body, :position, :youtube_url, :is_tutorial, :is_podcast, + :featured, :published, :publicly_visible, :publicly_featured, + category_ids: [], + sector_ids: [], + primary_asset_attributes: [ :id, :file, :_destroy ], + gallery_assets_attributes: [ :id, :file, :_destroy ], + ) + end +end diff --git a/app/controllers/tutorials_controller.rb b/app/controllers/tutorials_controller.rb deleted file mode 100644 index b6e2ddd15..000000000 --- a/app/controllers/tutorials_controller.rb +++ /dev/null @@ -1,130 +0,0 @@ -class TutorialsController < ApplicationController - include AhoyTracking, TagAssignable - skip_before_action :authenticate_user!, only: [ :index, :show ] - before_action :set_tutorial, only: [ :show, :edit, :update, :destroy ] - - def index - authorize! - if turbo_frame_request? - per_page = params[:number_of_items_per_page].presence || 6 - base_scope = authorized_scope(Tutorial.includes(:bookmarks)) - filtered = base_scope.search_by_params(params) - - @count_display = filtered.size == base_scope.size ? base_scope.size : "#{filtered.count}/#{base_scope.count}" - @tutorials = filtered.order(:position).paginate(page: params[:page], per_page: per_page).decorate - - render :index_lazy - else - @sectors = Sector.published.order(:name) - @category_types = CategoryType.published.general.order(:name).decorate - - render :index - end - end - - def show - @tutorial = @tutorial.decorate - authorize! @tutorial - track_view(@tutorial) - end - - def new - @tutorial = Tutorial.new.decorate - authorize! @tutorial - set_form_variables - end - - def edit - @tutorial = @tutorial.decorate - authorize! @tutorial - set_form_variables - end - - def create - @tutorial = Tutorial.new(tutorial_params) - authorize! @tutorial - - success = false - - Tutorial.transaction do - if @tutorial.save - assign_associations(@tutorial) - success = true - end - rescue ActiveRecord::RecordInvalid, ActiveRecord::RecordNotSaved, ActiveRecord::RecordNotUnique => e - Rails.logger.error "Tutorial create failed: #{e.class} - #{e.message}" - raise ActiveRecord::Rollback - end - - if success - redirect_to @tutorial, notice: "Video was successfully created." - else - @tutorial = @tutorial.decorate - set_form_variables - render :new, status: :unprocessable_content - end - end - - def update - authorize! @tutorial - - success = false - - Tutorial.transaction do - if @tutorial.update(tutorial_params) - assign_associations(@tutorial) - success = true - end - rescue ActiveRecord::RecordInvalid, ActiveRecord::RecordNotSaved, ActiveRecord::RecordNotUnique => e - Rails.logger.error "Tutorial update failed: #{e.class} - #{e.message}" - raise ActiveRecord::Rollback - end - - if success - redirect_to @tutorial, notice: "Video was successfully updated.", status: :see_other - else - @tutorial = @tutorial.decorate - set_form_variables - render :edit, status: :unprocessable_content - end - end - - def destroy - authorize! @tutorial - @tutorial.destroy! - redirect_to tutorials_path, notice: "Video was successfully destroyed." - end - - # Optional hooks for setting variables for forms or index - def set_form_variables - @tutorial.build_primary_asset if @tutorial.primary_asset.blank? - @tutorial.gallery_assets.build - @categories_grouped = - Category - .includes(:category_type) - .published - .order(:position, :name) - .group_by(&:category_type) - .select { |type, _| type.nil? || type.published? } - .sort_by { |type, _| type&.name.to_s.downcase } - @sectors = Sector.published.order(:name) - end - - private - - def set_tutorial - @tutorial = Tutorial.find(params[:id]) - end - - # Strong parameters - def tutorial_params - params.require(:tutorial).permit( - :title, :body, :rhino_body, :position, :youtube_url, - :featured, :published, :publicly_visible, :publicly_featured, - category_ids: [], - sector_ids: [], - primary_asset_attributes: [ :id, :file, :_destroy ], - gallery_assets_attributes: [ :id, :file, :_destroy ], - ) - end -end diff --git a/app/models/tutorial.rb b/app/models/recording.rb similarity index 91% rename from app/models/tutorial.rb rename to app/models/recording.rb index 9697ceca5..2c4b085e4 100644 --- a/app/models/tutorial.rb +++ b/app/models/recording.rb @@ -1,4 +1,6 @@ -class Tutorial < ApplicationRecord +class Recording < ApplicationRecord + self.table_name = 'recordings' + include Featureable, Publishable, TagFilterable, Trendable, RichTextSearchable has_rich_text :rhino_body @@ -42,7 +44,7 @@ class Tutorial < ApplicationRecord ids = Array(sector_ids).reject(&:blank?).map(&:to_i) return all if ids.empty? joins(:sectorable_items) - .where(sectorable_items: { sectorable_type: "Tutorial", sector_id: ids }) + .where(sectorable_items: { sectorable_type: "Recording", sector_id: ids }) .distinct } @@ -50,7 +52,7 @@ class Tutorial < ApplicationRecord ids = Array(category_ids).reject(&:blank?).map(&:to_i) return all if ids.empty? joins(:categorizable_items) - .where(categorizable_items: { categorizable_type: "Tutorial", category_id: ids }) + .where(categorizable_items: { categorizable_type: "Recording", category_id: ids }) .distinct } @@ -80,3 +82,6 @@ def self.search_by_params(params) resources end end + +# Backwards compatibility alias +Tutorial = Recording diff --git a/app/policies/tutorial_policy.rb b/app/policies/recording_policy.rb similarity index 91% rename from app/policies/tutorial_policy.rb rename to app/policies/recording_policy.rb index c42ab17c9..913a5423a 100644 --- a/app/policies/tutorial_policy.rb +++ b/app/policies/recording_policy.rb @@ -1,4 +1,4 @@ -class TutorialPolicy < ApplicationPolicy +class RecordingPolicy < ApplicationPolicy # See https://actionpolicy.evilmartians.io/#/writing_policies # def index? diff --git a/app/views/home/video_gallery/index.html.erb b/app/views/home/video_library/index.html.erb similarity index 100% rename from app/views/home/video_gallery/index.html.erb rename to app/views/home/video_library/index.html.erb diff --git a/app/views/tutorials/_form.html.erb b/app/views/recordings/_form.html.erb similarity index 100% rename from app/views/tutorials/_form.html.erb rename to app/views/recordings/_form.html.erb diff --git a/app/views/tutorials/_search_boxes.html.erb b/app/views/recordings/_search_boxes.html.erb similarity index 100% rename from app/views/tutorials/_search_boxes.html.erb rename to app/views/recordings/_search_boxes.html.erb diff --git a/app/views/tutorials/_tutorial.html.erb b/app/views/recordings/_tutorial.html.erb similarity index 100% rename from app/views/tutorials/_tutorial.html.erb rename to app/views/recordings/_tutorial.html.erb diff --git a/app/views/tutorials/_video_card.html.erb b/app/views/recordings/_video_card.html.erb similarity index 100% rename from app/views/tutorials/_video_card.html.erb rename to app/views/recordings/_video_card.html.erb diff --git a/app/views/tutorials/edit.html.erb b/app/views/recordings/edit.html.erb similarity index 100% rename from app/views/tutorials/edit.html.erb rename to app/views/recordings/edit.html.erb diff --git a/app/views/tutorials/index.html.erb b/app/views/recordings/index.html.erb similarity index 100% rename from app/views/tutorials/index.html.erb rename to app/views/recordings/index.html.erb diff --git a/app/views/tutorials/index_lazy.html.erb b/app/views/recordings/index_lazy.html.erb similarity index 100% rename from app/views/tutorials/index_lazy.html.erb rename to app/views/recordings/index_lazy.html.erb diff --git a/app/views/tutorials/new.html.erb b/app/views/recordings/new.html.erb similarity index 100% rename from app/views/tutorials/new.html.erb rename to app/views/recordings/new.html.erb diff --git a/app/views/tutorials/show.html.erb b/app/views/recordings/show.html.erb similarity index 100% rename from app/views/tutorials/show.html.erb rename to app/views/recordings/show.html.erb diff --git a/config/routes.rb b/config/routes.rb index fab3611f8..6992f4375 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -159,7 +159,9 @@ resources :story_ideas resources :stories resources :story_shares, only: [ :index, :show ] - resources :tutorials + resources :recordings + resources :tutorials, to: 'recordings#index' + get "video_library", to: "recordings#video_library", as: :video_library resources :user_forms resources :windows_types resources :workshop_ideas @@ -182,7 +184,7 @@ resources :stories, only: :index resources :community_news, only: :index resources :events, only: :index - resources :video_gallery, only: :index + resources :video_library, only: :index end root to: "home#index" diff --git a/db/migrate/20260308140252_rename_tutorials_to_recordings.rb b/db/migrate/20260308140252_rename_tutorials_to_recordings.rb new file mode 100644 index 000000000..17adc3371 --- /dev/null +++ b/db/migrate/20260308140252_rename_tutorials_to_recordings.rb @@ -0,0 +1,10 @@ +class RenameRecordings < ActiveRecord::Migration[8.0] + def change + rename_table :tutorials, :recordings + + add_column :recordings, :is_tutorial, :boolean, default: true, null: false + add_column :recordings, :is_podcast, :boolean, default: false, null: false + add_index :recordings, :is_tutorial + add_index :recordings, :is_podcast + end +end diff --git a/spec/factories/tutorials.rb b/spec/factories/recordings.rb similarity index 51% rename from spec/factories/tutorials.rb rename to spec/factories/recordings.rb index 87c630367..1db036306 100644 --- a/spec/factories/tutorials.rb +++ b/spec/factories/recordings.rb @@ -1,11 +1,13 @@ FactoryBot.define do - factory :tutorial do + factory :recording do title { "MyString" } body { "MyText" } featured { false } published { false } position { 1 } youtube_url { "MyString" } + is_tutorial { true } + is_podcast { false } trait :featured do featured { true } @@ -26,5 +28,26 @@ trait :publicly_featured do publicly_featured { true } end + + trait :tutorial do + is_tutorial { true } + is_podcast { false } + end + + trait :podcast do + is_tutorial { false } + is_podcast { true } + end + + trait :both do + is_tutorial { true } + is_podcast { true } + end + end + + # Backwards compatibility + factory :tutorial, class: 'Recording', parent: :recording do + is_tutorial { true } + is_podcast { false } end end From ca54c034205b534f3d88fe61fd3b1feae9ab212b Mon Sep 17 00:00:00 2001 From: maebeale Date: Sun, 8 Mar 2026 14:05:57 -0400 Subject: [PATCH 002/102] Update views, nav, i18n, and form for Recording model - Update all views: recordings/_form, _search_boxes, _tutorial, _video_card, edit, index, index_lazy, new, show - Replace @tutorial with @recording, tutorial[...] with recording[...], edit_tutorial_path with edit_recording_path - Add is_tutorial and is_podcast checkboxes to form (admin section) - Update navigation menus: - Help: Tutorials link uses Recording model name (Tutorials) - Community: Add "Video Library" link pointing to video_library_path - Update both desktop and mobile navbars - Update i18n: add Recording model names, keep Tutorial alias - Fix Cancel link to use recordings_path Co-Authored-By: Claude Haiku 4.5 --- app/views/recordings/_form.html.erb | 22 ++++++++++--------- app/views/recordings/_search_boxes.html.erb | 2 +- app/views/recordings/_tutorial.html.erb | 2 +- app/views/recordings/edit.html.erb | 8 +++---- app/views/recordings/index.html.erb | 2 +- app/views/recordings/index_lazy.html.erb | 6 ++--- app/views/recordings/new.html.erb | 4 ++-- app/views/recordings/show.html.erb | 18 +++++++-------- app/views/shared/_navbar_menu.html.erb | 10 +++++++-- app/views/shared/_navbar_menu_mobile.html.erb | 10 +++++++-- config/locales/en.yml | 5 ++++- 11 files changed, 53 insertions(+), 36 deletions(-) diff --git a/app/views/recordings/_form.html.erb b/app/views/recordings/_form.html.erb index 4714e96da..944362836 100644 --- a/app/views/recordings/_form.html.erb +++ b/app/views/recordings/_form.html.erb @@ -1,5 +1,5 @@ -<%= simple_form_for(@tutorial, html: { multipart: true }) do |f| %> - <%= render 'shared/errors', resource: @tutorial if @tutorial.errors.any? %> +<%= simple_form_for(@recording, html: { multipart: true }) do |f| %> + <%= render 'shared/errors', resource: @recording if @recording.errors.any? %>
@@ -9,6 +9,8 @@ value: f.object.title } %>
+ <%= f.input :is_tutorial, as: :boolean %> + <%= f.input :is_podcast, as: :boolean %> <%= f.input :published, as: :boolean %> <%= f.input :featured, as: :boolean %> <%= f.input :publicly_visible, as: :boolean %> @@ -82,10 +84,10 @@ class=" flex items-center gap-2 p-3 cursor-pointer w-auto min-w-[180px] bg-white border border-gray-200 rounded-lg shadow-sm hover:bg-gray-100 transition"> - <%= hidden_field_tag "tutorial[sector_ids][]", "" %> - <%= check_box_tag "tutorial[sector_ids][]", + <%= hidden_field_tag "recording[sector_ids][]", "" %> + <%= check_box_tag "recording[sector_ids][]", sector.id, - @tutorial.sector_ids.include?(sector.id), + @recording.sector_ids.include?(sector.id), id: id, class: "h-4 w-4 text-blue-600 rounded" %> @@ -110,10 +112,10 @@ class=" flex items-center gap-2 p-3 cursor-pointer w-auto min-w-[180px] bg-white border border-gray-200 rounded-lg shadow-sm hover:bg-gray-100 transition"> - <%= hidden_field_tag "tutorial[category_ids][]", "" %> - <%= check_box_tag "tutorial[category_ids][]", + <%= hidden_field_tag "recording[category_ids][]", "" %> + <%= check_box_tag "recording[category_ids][]", category.id, - @tutorial.category_ids.include?(category.id), + @recording.category_ids.include?(category.id), id: id, class: "h-4 w-4 text-blue-600 rounded" %> @@ -130,10 +132,10 @@
<% if allowed_to?(:destroy?, f.object) %> - <%= link_to "Delete", @tutorial, class: "btn btn-danger-outline", + <%= link_to "Delete", @recording, class: "btn btn-danger-outline", data: { turbo_method: :delete, turbo_confirm: "Are you sure you want to delete?" } %> <% end %> - <%= link_to "Cancel", tutorials_path, class: "btn btn-secondary-outline ms-2" %> + <%= link_to "Cancel", recordings_path, class: "btn btn-secondary-outline ms-2" %> <%= f.button :submit, class: "btn btn-primary" %>
diff --git a/app/views/recordings/_search_boxes.html.erb b/app/views/recordings/_search_boxes.html.erb index 90d45022e..1332d9fd0 100644 --- a/app/views/recordings/_search_boxes.html.erb +++ b/app/views/recordings/_search_boxes.html.erb @@ -25,7 +25,7 @@ authenticated: user_signed_in?, button_text: "All" %>
<%= link_to "Clear filters", - tutorials_path, + recordings_path, class: "btn btn-utility-outline whitespace-nowrap", data: { action: "searchable-checkbox#clear collection#clearAndSubmit" } %>
diff --git a/app/views/recordings/_tutorial.html.erb b/app/views/recordings/_tutorial.html.erb index f220a8b4f..102dce070 100644 --- a/app/views/recordings/_tutorial.html.erb +++ b/app/views/recordings/_tutorial.html.erb @@ -10,7 +10,7 @@ <% if allowed_to?(:edit?, tutorial) %> <%= link_to "Edit", - edit_tutorial_path(tutorial), + edit_recording_path(tutorial), data: {turbo_frame: "_top"}, class: "admin-only bg-blue-100 btn btn-secondary-outline" %> <% end %> diff --git a/app/views/recordings/edit.html.erb b/app/views/recordings/edit.html.erb index 05cdcc053..152d87238 100644 --- a/app/views/recordings/edit.html.erb +++ b/app/views/recordings/edit.html.erb @@ -2,17 +2,17 @@
<%= link_to "Home", root_path, class: "text-sm text-gray-500 hover:text-gray-700 px-2 py-1" %> - <%= link_to Tutorial.model_name.human(count: 2), tutorials_path, class: "text-sm text-gray-500 hover:text-gray-700 px-2 py-1" %> - <%= link_to "View", tutorial_path(@tutorial), class: "text-sm text-gray-500 hover:text-gray-700 px-2 py-1" %> + <%= link_to Tutorial.model_name.human(count: 2), recordings_path, class: "text-sm text-gray-500 hover:text-gray-700 px-2 py-1" %> + <%= link_to "View", tutorial_path(@recording), class: "text-sm text-gray-500 hover:text-gray-700 px-2 py-1" %>

- Edit <%= @tutorial.class.model_name.human.downcase %> + Edit <%= @recording.class.model_name.human.downcase %>

<%= render "form" %> - <%= render "shared/audit_info", resource: @tutorial %> + <%= render "shared/audit_info", resource: @recording %>
diff --git a/app/views/recordings/index.html.erb b/app/views/recordings/index.html.erb index 184871bcb..041f1702e 100644 --- a/app/views/recordings/index.html.erb +++ b/app/views/recordings/index.html.erb @@ -29,7 +29,7 @@ <%= render "search_boxes" %> - <% result_src = tutorials_path + "?" + request.query_string %> + <% result_src = recordings_path + "?" + request.query_string %> <%= turbo_frame_tag "tutorials_results", src: result_src do %>
diff --git a/app/views/recordings/index_lazy.html.erb b/app/views/recordings/index_lazy.html.erb index b0da51f69..2b4a4ad3f 100644 --- a/app/views/recordings/index_lazy.html.erb +++ b/app/views/recordings/index_lazy.html.erb @@ -1,9 +1,9 @@ <%= turbo_frame_tag "tutorials_results" do %>
- <% if @tutorials.any? %> + <% if @recordings.any? %> <%= tag.div class: "grid grid-cols-1 lg:grid-cols-2 gap-4" do %> - <% @tutorials.each_with_index do |tutorial, idx| %> + <% @recordings.each_with_index do |tutorial, idx| %> <%= tag.div class: "bg-white shadow-md rounded-md pt-6 px-2 pb-2" do %> <%= render "tutorial", tutorial: tutorial %> <% end %> @@ -12,7 +12,7 @@ <% else %>
diff --git a/app/views/recordings/new.html.erb b/app/views/recordings/new.html.erb index 009b2eeab..0d7fd2071 100644 --- a/app/views/recordings/new.html.erb +++ b/app/views/recordings/new.html.erb @@ -1,12 +1,12 @@ <% content_for(:page_bg_class, "admin-only bg-blue-100") %>
-

New <%= @tutorial.class.model_name.human.downcase %>

+

New <%= @recording.class.model_name.human.downcase %>

- <%= render "form", tutorial: @tutorial %> + <%= render "form", tutorial: @recording %>
\ No newline at end of file diff --git a/app/views/recordings/show.html.erb b/app/views/recordings/show.html.erb index 4b51de37b..670c8c564 100644 --- a/app/views/recordings/show.html.erb +++ b/app/views/recordings/show.html.erb @@ -3,13 +3,13 @@
<%= link_to "Home", root_path, class: "text-sm text-gray-500 hover:text-gray-700 px-2 py-1" %> - <%= link_to Tutorial.model_name.human(count: 2), tutorials_path, class: "text-sm text-gray-500 hover:text-gray-700 px-2 py-1" %> - <% if allowed_to?(:edit?, @tutorial) %> - <%= link_to "Edit", edit_tutorial_path(@tutorial), + <%= link_to Tutorial.model_name.human(count: 2), recordings_path, class: "text-sm text-gray-500 hover:text-gray-700 px-2 py-1" %> + <% if allowed_to?(:edit?, @recording) %> + <%= link_to "Edit", edit_recording_path(@recording), class: "admin-only bg-blue-100 text-sm text-gray-500 hover:text-gray-700 px-2 py-1" %> <% end %> - <%= render "bookmarks/editable_bookmark_button", resource: @tutorial.object %> + <%= render "bookmarks/editable_bookmark_button", resource: @recording.object %>
@@ -18,16 +18,16 @@
- <%= title_with_badges(@tutorial, font_size: "text-3xl") %> + <%= title_with_badges(@recording, font_size: "text-3xl") %>
- <% if @tutorial.youtube_url.present? %> + <% if @recording.youtube_url.present? %>