-
-
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.
🌸
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
4 changed files
with
31 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,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 | ||
|