-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Marketplace
: Begin distinguishing the Cart
from the Menu
- #2043 - #1326 While we definitely need a `Cart`; treating the `Cart` as the `Menu` is a clunky ducky way of operating. I'm going to start driving towards a more `Menu` centric approach so the Shopping experience looks and feels a bit less nerd-forward. Theoretically, this will entail: - [ ] Sprouting `Product#show` - [ ] Ditching the `Marketplace::Cart` ui almost completely, perhaps? - [ ] Updating `buying_products_system_spec.rb`
- Loading branch information
Showing
11 changed files
with
72 additions
and
17 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
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
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 |
---|---|---|
@@ -1,18 +1,17 @@ | ||
<h2 class="ml-2 my-2"> | ||
<%= t('.header', space: marketplace.space.name, room: marketplace.room.name) %> | ||
</h2> | ||
<div class="grid grid-cols-1 gap-6"> | ||
<%= render onboarding_component %> | ||
|
||
<%= render delivery_area_component %> | ||
|
||
<%= render onboarding_component %> | ||
<%= render Marketplace::MenuComponent.new(marketplace: )%> | ||
|
||
|
||
<%= render delivery_area_component %> | ||
|
||
<%= render cart %> | ||
|
||
<%- if policy(marketplace).edit? %> | ||
<div class="my-2 text-right"> | ||
<%= render ButtonComponent.new(scheme: :secondary, label: t('marketplace.marketplace.edit.link_to'), | ||
href: location(:edit), method: :get) %> | ||
</div> | ||
<%- end %> | ||
<%= render cart %> | ||
<%- if policy(marketplace).edit? %> | ||
<%= render CardComponent.new do %> | ||
<div class="my-2 text-right"> | ||
<%= render ButtonComponent.new(scheme: :secondary, label: t('marketplace.marketplace.edit.link_to'), | ||
href: location(:edit), method: :get) %> | ||
</div> | ||
<%- 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
<%- breadcrumb :marketplace, marketplace %> | ||
|
||
<%= render marketplace %> |
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,10 @@ | ||
<div class="grid grid-cols-3 gap-3"> | ||
<%- marketplace.products.each do |product| %> | ||
<%= link_to(product.location, class: "no-underline") do %> | ||
<%= render CardComponent.new do %> | ||
<h3><%= product.name %></h3> | ||
<p><%= product.description %></p> | ||
<%- 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
class Marketplace | ||
class MenuComponent < ApplicationComponent | ||
attr_accessor :marketplace | ||
|
||
def initialize(marketplace:, **kwargs) | ||
super(**kwargs) | ||
self.marketplace = marketplace | ||
end | ||
|
||
def render? | ||
current_person.operator? | ||
end | ||
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,3 @@ | ||
<%- breadcrumb :marketplace_product, product %> | ||
<h3><%= product.name %></h3> | ||
<p><%= product.description %></p> |
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 |
---|---|---|
|
@@ -31,6 +31,10 @@ def index | |
skip_authorization | ||
end | ||
|
||
def show | ||
authorize(product) | ||
end | ||
|
||
def edit | ||
authorize(product) | ||
end | ||
|
11 changes: 11 additions & 0 deletions
11
app/furniture/marketplace/shopper_frame_component.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,11 @@ | ||
<section class="flex flex-wrap items-baseline"> | ||
<header class="w-full"> | ||
<h2 > | ||
<%= t('.header', space: marketplace.space.name, room: marketplace.room.name) %> | ||
</h2> | ||
</header> | ||
|
||
<div> | ||
<%= content %> | ||
</div> | ||
</section> |
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,11 @@ | ||
class Marketplace | ||
class ShopperFrameComponent < Component | ||
attr_accessor :marketplace | ||
|
||
def initialize(marketplace:, **kwargs) | ||
super(**kwargs) | ||
|
||
self.marketplace = marketplace | ||
end | ||
end | ||
end |
File renamed without changes.