diff --git a/app/assets/stylesheets/binder.css b/app/assets/stylesheets/binder.css index 5428f943..c78d632d 100644 --- a/app/assets/stylesheets/binder.css +++ b/app/assets/stylesheets/binder.css @@ -272,3 +272,34 @@ li.tab { opacity: 0; pointer-events: none; } + +/* store card quantity controls, keep −, count, and + on one line. */ +.content .sidebar .cart-qty { + display: inline-flex; + align-items: center; + gap: 0.2em; + margin: 0; + padding: 0; +} + +/* store: strip the button background for readibility, + using input[type=submit] to overwrite the orig button framework's styling */ +input[type="submit"].cart-qty-btn { + flex: none; + background: none; + border: 0; + margin: 0; + padding: 0.6em; + font-size: 1.3em; + font-weight: 700; + line-height: 1; + color: #6d6e71; + cursor: pointer; + vertical-align: middle; +} + +input[type="submit"].cart-qty-btn:hover, +input[type="submit"].cart-qty-btn:focus { + background: none; + color: #c41230; +} diff --git a/app/views/store/items/_cart.html.erb b/app/views/store/items/_cart.html.erb index 2d06f729..f9ec3dce 100644 --- a/app/views/store/items/_cart.html.erb +++ b/app/views/store/items/_cart.html.erb @@ -3,7 +3,6 @@ Name - Price Quantity Subtotal Actions @@ -20,7 +19,6 @@ <%# Summary row %> Total - <%# Blank cell for Price column %> <%= items.sum(&:quantity_purchased) %> <%= number_to_currency( diff --git a/app/views/store/items/_cart_item.html.erb b/app/views/store/items/_cart_item.html.erb index d0c7a09f..b863ef08 100644 --- a/app/views/store/items/_cart_item.html.erb +++ b/app/views/store/items/_cart_item.html.erb @@ -1,17 +1,18 @@ <%= cart_item.store_item.name %> - <%= number_to_currency cart_item.price_at_purchase %> - <%# TODO: Inline styles & maybe change to best_in_place %> - <%= form_with model: cart_item, html: { style: 'display: inline;' } do |f| %> - <%= f.hidden_field :quantity_purchased, value: cart_item.quantity_purchased - 1 %> - <%= f.submit '-', class: 'btn btn-default btn-xs' %> - <% end %> - <%= cart_item.quantity_purchased %> - <%= form_with model: cart_item, html: { style: 'display: inline;' } do |f| %> - <%= f.hidden_field :quantity_purchased, value: cart_item.quantity_purchased + 1 %> - <%= f.submit '+', class: 'btn btn-default btn-xs' %> - <% end %> + <%# TODO: maybe change to best_in_place %> +
+ <%= form_with model: cart_item do |f| %> + <%= f.hidden_field :quantity_purchased, value: cart_item.quantity_purchased - 1 %> + <%= f.submit '−', class: 'cart-qty-btn', 'aria-label': 'Decrease quantity' %> + <% end %> + <%= cart_item.quantity_purchased %> + <%= form_with model: cart_item do |f| %> + <%= f.hidden_field :quantity_purchased, value: cart_item.quantity_purchased + 1 %> + <%= f.submit '+', class: 'cart-qty-btn', 'aria-label': 'Increase quantity' %> + <% end %> +
<%= number_to_currency(cart_item.quantity_purchased * cart_item.price_at_purchase) %> - <%= link_to item.name, item %> - <%= number_to_currency item.price %> - - <%# if can?(:create, Charge) %> - <%= link_to t('.add_to_cart', default: t('helpers.links.add_to_cart')), - add_to_cart_store_item_path(item), - class: 'btn btn-primary btn-xs', - data: { - turbo_method: :post - } %> - <%# end %> - - + + +
+ <%= image_tag "store_images/#{item.name}.png", + style: 'height: 80px; object-fit: contain;' %> +
<%= link_to item.name, item %>
+
<%= number_to_currency item.price %>
+ <%= link_to t('.add_to_cart', default: t('helpers.links.add_to_cart')), + add_to_cart_store_item_path(item), + class: 'btn small', + data: { + turbo_method: :post + } %> +
diff --git a/app/views/store/items/_items.html.erb b/app/views/store/items/_items.html.erb index 83f1a42a..c9ad8389 100644 --- a/app/views/store/items/_items.html.erb +++ b/app/views/store/items/_items.html.erb @@ -1,11 +1,8 @@ <% page ||= 'default' %> - - - - - - - - - <%= render partial: 'item', collection: items %> -
NamePriceActions
+
+ <%= render partial: 'item', collection: items %> +