Skip to content
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

🌸 Vertically center section card ">" button with respect to section title #2284

Merged
merged 3 commits into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<div class="grid grid-cols-1 gap-5 sm:gap-6 sm:grid-cols-2 lg:grid-cols-4">
<% policy_scope(section_navigation.rooms).each do |room| %>
<%= link_to polymorphic_path(room.location), id: dom_id(room, :link_to), class: "group no-underline" do %>
<%= render CardComponent.new(media: room.hero_image, classes: "flex flex-col justify-between") do |card| %>
<%= render CardComponent.new(media: room.hero_image, classes: "flex flex-col justify-between h-full") do |card| %>
<p><%= room.description %></p>
<footer class="text-2xl text-justify font-semibold flex justify-between items-baseline">
<footer class="text-2xl text-justify font-semibold flex justify-between items-center">
<h3>
<%= room.name %>
</h3>
Expand Down
13 changes: 11 additions & 2 deletions db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,18 @@

SectionNavigation::SectionNavigation.create!(space:, room: space.entrance)

marketplace_section = FactoryBot.create(:room, space: space, name: "Magnificent Marketplace")
marketplace_section = FactoryBot.create(
:room, space: space, name: "Magnificent Marketplace",
description: "A marvelous marketplace for magic merchandise.",
hero_image: FactoryBot.create(:media)
)
FactoryBot.create(:marketplace, :full, room: marketplace_section)

journal_section = FactoryBot.create(:room, space:, name: "Jazzy Journal")
journal_section = FactoryBot.create(
:room, space:, name: "Jazzy Journal",
description: "Here is where I jive and jam in my journal. " \
"Jump in and join me as I joyfully jot down whatever I'm jazzed about just now.",
hero_image: FactoryBot.create(:media, :journal)
)
journal = FactoryBot.create(:journal, room: journal_section)
FactoryBot.create_list(:journal_entry, 7, :with_keywords, :published, journal:)
4 changes: 4 additions & 0 deletions spec/factories/media.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
FactoryBot.define do
factory :media do
upload { Rack::Test::UploadedFile.new("spec/fixtures/files/cc-kitten.jpg", "image/jpeg") }

trait :journal do
upload { Rack::Test::UploadedFile.new("spec/fixtures/files/cc-journal.jpg", "image/jpeg") }
end
end
end
Binary file added spec/fixtures/files/cc-journal.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading