-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- #709 Sprouts a tiny Gizmo for linking to Sections. At some point, we'll want to add a UI for picking which `Sections` to include, preferably an `AllowList` so that adding a `Section` doesn't immediately publish it.
- Loading branch information
Showing
5 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# frozen_string_literal: true | ||
|
||
class SectionNavigation | ||
def self.router | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# SectionNavigation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
class SectionNavigation | ||
class SectionNavigation < Furniture | ||
location(parent: :room) | ||
|
||
def rooms | ||
space.rooms.where.not(id: space.entrance_id) | ||
end | ||
end | ||
end |
22 changes: 22 additions & 0 deletions
22
app/furniture/section_navigation/section_navigations/_section_navigation.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<div class="mt-3 grid grid-cols-1 gap-5 sm:gap-6 sm:grid-cols-2 lg:grid-cols-4 items-center"> | ||
<% policy_scope(section_navigation.rooms).each do |room| %> | ||
<%= link_to [room.space, room], class: "no-underline" do %> | ||
<%= render CardComponent.new( | ||
data: { access_level: room.access_level, slug: room.slug, model: "room", id: room.id }, | ||
classes: "group self-stretch hover:bg-orange-50" | ||
) do %> | ||
<div class="px-4 py-5 flex items-center justify-between"> | ||
<h3 class="text-base font-semibold text-orange-500 group-hover:text-orange-400"> | ||
<%= room.name %> | ||
</h3> | ||
|
||
<button class="rounded-full bg-orange-500 p-1 ml-2 text-white shadow-sm group-hover:bg-orange-400" data-role="enter"> | ||
<%= render SvgComponent.new(classes: "h-5 w-5") do %> | ||
<path stroke-linecap="round" stroke-linejoin="round" d="M8.25 4.5l7.5 7.5-7.5 7.5" /> | ||
<% end %> | ||
</button> | ||
</div> | ||
<%- end %> | ||
<%- end %> | ||
<% end %> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters