workarea-registries 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 598e99cfdaf45678767ef50031e9b69bfdcc018e
|
|
4
|
+
data.tar.gz: 14736e4dae16179bb78179bfa546ee80e9b7ca13
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3d913f8391d851f02109034c06a63a12c5ea8229b90b66b25d60fa7c2e00b91c30511da53a190b7ab9e02f256b6962d4c184688e29be35f9e417d913780b04b8
|
|
7
|
+
data.tar.gz: 618affe7ce5279dd4541eb4f7c11e72c2549b58b20e9b6557523ec759433c7adc3218e90afce88fa0180d91bfc56404b1876ec26c17c4e2e1aeec629ad5b41b5
|
|
@@ -61,6 +61,18 @@ module Workarea
|
|
|
61
61
|
items.reject(&:purchased_by?).select(&:available?)
|
|
62
62
|
end
|
|
63
63
|
|
|
64
|
+
def total_items
|
|
65
|
+
unpurchased_items.pluck('quantity').sum
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
def total_items_received
|
|
69
|
+
unpurchased_items.pluck('received').sum
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
def total_products
|
|
73
|
+
model.unpurchased_items.size
|
|
74
|
+
end
|
|
75
|
+
|
|
64
76
|
def add_item(params)
|
|
65
77
|
quantity = params.fetch(:quantity, 1).to_i
|
|
66
78
|
existing_item = find_existing_item(sku: params[:sku])
|
|
@@ -56,13 +56,21 @@
|
|
|
56
56
|
|
|
57
57
|
%h2= t('workarea.storefront.registries.items')
|
|
58
58
|
|
|
59
|
-
.
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
59
|
+
.grid.grid--auto.grid--middle
|
|
60
|
+
- if @registry.purchased_items.any?
|
|
61
|
+
.grid__cell
|
|
62
|
+
.browsing-controls
|
|
63
|
+
= form_tag users_registry_path, method: 'get', class: 'browsing-controls__form' do
|
|
64
|
+
%p.browsing-controls__form-item.property
|
|
65
|
+
= label_tag :state, nil, class: 'property__name' do
|
|
66
|
+
%span.property__text= t('workarea.storefront.registries.filter')
|
|
67
|
+
%span.value= select_tag :state, options_for_select(@registry.state_options, params[:state]), data: { form_submitting_control: '' }
|
|
68
|
+
%p.browsing-controls__form-item.hidden-if-js-enabled= button_tag t('workarea.storefront.forms.go'), class: 'button'
|
|
69
|
+
- if @registry.unpurchased_items.any?
|
|
70
|
+
.grid__cell
|
|
71
|
+
= t('workarea.storefront.registries.total_products', count: @registry.total_products)
|
|
72
|
+
|
|
|
73
|
+
= t('workarea.storefront.registries.total_items_received', count: @registry.total_items_received)
|
|
66
74
|
|
|
67
75
|
.grid
|
|
68
76
|
.grid__cell
|
data/config/locales/en.yml
CHANGED
|
@@ -94,6 +94,15 @@ en:
|
|
|
94
94
|
heading: Search Registries
|
|
95
95
|
search_title: Registry Search
|
|
96
96
|
title: Registries
|
|
97
|
+
total_items:
|
|
98
|
+
one: '%{count} Item'
|
|
99
|
+
other: '%{count} Items'
|
|
100
|
+
total_items_received:
|
|
101
|
+
one: '%{count} Item Purchased'
|
|
102
|
+
other: '%{count} Items Purchased'
|
|
103
|
+
total_products:
|
|
104
|
+
one: '%{count} Product'
|
|
105
|
+
other: '%{count} Products'
|
|
97
106
|
quantity_purchased: '%{quantity} purchased'
|
|
98
107
|
unpurchased_items: Unpurchased Items
|
|
99
108
|
view: View
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: workarea-registries
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jurgen Hahn
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-
|
|
11
|
+
date: 2021-03-03 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: workarea
|