-
Notifications
You must be signed in to change notification settings - Fork 24
Surface hidden (unpublished) sector & category tags to admins #1708
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| <%# Closed-eye icon — the same "hidden" glyph used by the password-visibility | ||
| toggle on the login pages — flagging a tag that's hidden from the public and | ||
| visible only to admins. %> | ||
| <svg class="mr-1 inline-block size-3 align-[-0.125em]" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><title>Hidden from the public</title><path d="M2 10c3 4 6.5 6 10 6s7-2 10-6"/><path d="M7.5 14l-1.5 3"/><path d="M12 16v3"/><path d="M16.5 14l1.5 3"/></svg> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -367,6 +367,48 @@ | |
| end | ||
| puts "Done assigning categories and sectors." | ||
|
|
||
| # A few unpublished (non-canonical) sectors that still carry taggings, so the | ||
| # taggings admin has data exercising the "tagged but hidden" state. The base | ||
| # db/seeds.rb only creates the canonical SECTOR_TYPES; these are dev-only and | ||
| # stay unpublished (they're not on the canonical list). | ||
| puts "Creating unpublished sectors with taggings…" | ||
| workshop_pool = Workshop.all.to_a | ||
| [ "Animal-Assisted Therapy", "School Counseling", "Youth Mentorship" ].each do |sector_name| | ||
| sector = Sector.where("LOWER(name) = LOWER(?)", sector_name).first_or_create!(name: sector_name) | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤖 From Claude: Inline case-insensitive |
||
| sector.update!(published: false) | ||
|
|
||
| workshop_pool.sample(rand(2..4)).each do |workshop| | ||
| SectorableItem.find_or_create_by!( | ||
| sector_id: sector.id, | ||
| sectorable_type: "Workshop", | ||
| sectorable_id: workshop.id | ||
| ) | ||
| end | ||
| end | ||
| puts "Done creating unpublished sectors with taggings." | ||
|
|
||
| # A few unpublished (non-canonical) categories that still carry taggings, so the | ||
| # taggings admin has data exercising the "tagged but hidden" state for categories | ||
| # too. The base db/seeds.rb only creates canonical categories; these are dev-only, | ||
| # attached to an existing type so they group correctly on the tags page, and stay | ||
| # unpublished (they're not on any canonical list). | ||
| puts "Creating unpublished categories with taggings…" | ||
| art_type = CategoryType.where("LOWER(name) = LOWER(?)", "ArtType").first_or_create!(name: "ArtType", published: true) | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤖 From Claude: These names are deliberately non-canonical, so base |
||
| [ "Sand Art", "Found-Object Sculpture", "Shadow Puppetry" ].each do |category_name| | ||
| category = Category.where("LOWER(name) = LOWER(?)", category_name) | ||
| .first_or_create!(name: category_name, category_type: art_type) | ||
| category.update!(published: false) | ||
|
|
||
| workshop_pool.sample(rand(2..4)).each do |workshop| | ||
| CategorizableItem.find_or_create_by!( | ||
| category_id: category.id, | ||
| categorizable_type: "Workshop", | ||
| categorizable_id: workshop.id | ||
| ) | ||
| end | ||
| end | ||
| puts "Done creating unpublished categories with taggings." | ||
|
|
||
| puts "Creating Workshop Variations…" | ||
| # rubocop:disable Style/PercentLiteralDelimiters | ||
| variations = [ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤖 From Claude: The grey hidden treatment intentionally overrides any explicit
bg_color/border passed in (e.g. thebg-whitechips on /tags), so hidden always reads as hidden regardless of caller styling.