Skip to content

HOLD: Add display_in_video_gallery flag to split Tutorials and Video Gallery#1228

Open
maebeale wants to merge 3 commits intomainfrom
maebeale/video-gallery-flag
Open

HOLD: Add display_in_video_gallery flag to split Tutorials and Video Gallery#1228
maebeale wants to merge 3 commits intomainfrom
maebeale/video-gallery-flag

Conversation

@maebeale
Copy link
Collaborator

Summary

  • Adds display_in_video_gallery boolean flag to tutorials (default: false)
  • Splits tutorials into two paths: Help menu shows "Tutorials" (non-flagged), Community menu shows "Video Gallery" (flagged)
  • Uses URL param on existing tutorials#index controller — no new controller needed
  • Home page video embed now only shows flagged videos

Changes

  • Database: Migration adds display_in_video_gallery column with index
  • Model: Two scopes — video_gallery and not_video_gallery
  • Routes: /video_gallery route points to tutorials#index?video_gallery=true
  • Controller: Filters by scope based on param; added to strong params
  • i18n: Plural changed from "Video Gallery" to "Tutorials"
  • Views: Index shows different title/description; form has checkbox; home has title
  • Navigation: "Video Gallery" link added to Community menu; Help shows "Tutorials"
  • Home: Video gallery controller filters to flagged videos only
  • Factory: Added :video_gallery trait

Test plan

  • Run migration: bundle exec rails db:migrate
  • Create a tutorial without flag → should appear in Help → Tutorials
  • Create a tutorial with flag + YouTube URL → should appear in Community → Video Gallery
  • Verify home page embed shows only flagged videos
  • Check form has new checkbox in admin section
  • Test Help menu shows "Tutorials" label
  • Test Community menu shows "Video Gallery" label

🤖 Generated with Claude Code

@maebeale maebeale force-pushed the maebeale/video-gallery-flag branch from d1cbee0 to ee7b6f3 Compare February 26, 2026 17:18
@maebeale maebeale changed the title Add display_in_video_gallery flag to split Tutorials and Video Gallery HOLD: Add display_in_video_gallery flag to split Tutorials and Video Gallery Feb 27, 2026
maebeale and others added 3 commits February 28, 2026 17:50
- Add type column to tutorials table for STI (Single Table Inheritance)
- Rename Tutorial to VideoLibrary base class, keeping table_name as 'tutorials'
- Create Tutorial, Podcast, Intro subclasses
- Add scopes: :tutorials, :podcasts, :intros to VideoLibrary
- Update tutorials controller:
  - Index action shows Tutorial type only
  - Add video_library action shows all types
- Add /video_library route
- Update navigation menus:
  - Help → "Tutorials" (Tutorial type only) → tutorials_path
  - Community → "Video Library" (all types) → video_library_path
- Add type selector dropdown in form (admin-only)
- Create video_library and video_library_lazy views
- Update home video gallery controller to use VideoLibrary
- Update factory with :video_library base, :tutorial/:podcast/:intro subclasses

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Rename Home::VideoGalleryController to Home::VideoLibraryController
- Rename home/video_gallery views directory to home/video_library
- Update home namespace routes: video_gallery → video_library
- Update controller to render home/video_library/index

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Add model specs for .tutorials, .podcasts, .intros scopes
- Add request specs for tutorials#index (Tutorial type only) and tutorials#video_library (all types)
- Add routing specs for /video_library route
- Add home video library controller specs:
  - All content types displayed with youtube_url
  - Excludes records without youtube_url
  - Correct ordering by position then created_at

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@maebeale maebeale force-pushed the maebeale/video-gallery-flag branch from ee7b6f3 to feb2e00 Compare February 28, 2026 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant