workarea-margin 1.0.0.pre → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +43 -99
- data/app/views/workarea/admin/pricing_skus/{_card_cost_and_margin.html.haml → _pricing_sku_attributes_card.html.haml} +4 -4
- data/app/views/workarea/admin/pricing_skus/{_add_cost.html.haml → _pricing_sku_fields.html.haml} +0 -0
- data/app/views/workarea/admin/pricing_skus/{_additional_fields_labels.html.haml → _pricing_skus_additional_field_labels.html.haml} +0 -0
- data/app/views/workarea/admin/pricing_skus/{_additional_fields.html.haml → _pricing_skus_additional_fields.html.haml} +0 -0
- data/config/initializers/append_points.rb +9 -9
- data/lib/workarea/margin/version.rb +1 -1
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed8da484fc860126426bb9d106e69fcec63c777b3ce355ce9b3720ecce415bfa
|
4
|
+
data.tar.gz: 3d25c9740522e3d3e7664fd3605f76398b1989df7b3f1663ea452f92a620d773
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 81fc03fa919eac068bc49bf5b6233a134ca2a7c4a8c2cd72ef639a7e5b4422c05452a5a625430ecfd9cb46ab9e1d4a0d8676c8329268cd51b1d413e9d3bef5de
|
7
|
+
data.tar.gz: ecbd637b4e9f74c14e3a75275be2ab1c579b81efdb7ac582ba7953d4a98524f9e6be4bf52a804575fba545c07653216ebcb94e8c2fc81c053e12bfcaca1620c4
|
data/README.md
CHANGED
@@ -9,22 +9,14 @@ A Workarea Commerce plugin that enables product reviews.
|
|
9
9
|
- Allows adding cost to pricing skus
|
10
10
|
- Pricing admin view will show margin based on regular price or sale price depending on the sale flag
|
11
11
|
|
12
|
-
![Pricing List Preview](app/assets/images/pricing_list.png)
|
13
|
-
|
14
|
-
![Add Cost Preview](app/assets/images/add_cost.png)
|
15
|
-
|
16
12
|
## Getting Started
|
17
13
|
|
18
|
-
While in Development use the Github path in your Gemfile:
|
19
|
-
|
20
|
-
```ruby
|
21
|
-
gem 'workarea-margin', git: 'https://github.com/Brandongoodman615/workarea-margin'
|
22
|
-
```
|
23
|
-
|
24
14
|
Add the gem to your application's Gemfile:
|
25
15
|
|
26
16
|
```ruby
|
27
|
-
|
17
|
+
# ...
|
18
|
+
gem 'workarea-margin', git: 'https://github.com/Brandongoodman615/workarea-margin'
|
19
|
+
# ...
|
28
20
|
```
|
29
21
|
|
30
22
|
Update your application's bundle.
|
@@ -34,6 +26,12 @@ cd path/to/application
|
|
34
26
|
bundle
|
35
27
|
```
|
36
28
|
|
29
|
+
## Screenshots
|
30
|
+
|
31
|
+
![Pricing List Preview](app/assets/images/pricing_list.png)
|
32
|
+
|
33
|
+
![Add Cost Preview](app/assets/images/add_cost.png)
|
34
|
+
|
37
35
|
## Append Points
|
38
36
|
|
39
37
|
Append partials need to be added to your platform to work:
|
@@ -41,97 +39,43 @@ Append partials need to be added to your platform to work:
|
|
41
39
|
These append points can be added between any column on the pricing table, they will be in order of cost then margin. The default location is before MSRP, but it could go after and make sense as well.
|
42
40
|
|
43
41
|
```haml
|
42
|
+
This should be updated in the Workarea codebase soon.
|
43
|
+
|
44
44
|
admin/app/views/workarea/admin/pricing_skus/index.html.haml
|
45
45
|
|
46
46
|
- if @search.results.any?
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
```
|
80
|
-
|
81
|
-
```haml
|
82
|
-
admin/app/views/workarea/admin/pricing_skus/new.html.haml
|
83
|
-
|
84
|
-
.property
|
85
|
-
%span.property__name= t('workarea.admin.fields.discountable')
|
86
|
-
= toggle_button_for 'sku[discountable]', @sku.discountable?, title_true: t('workarea.admin.pricing_skus.allow_discounting'), title_false: t('workarea.admin.pricing_skus.disallow_discounting')
|
87
|
-
|
88
|
-
= append_partials('admin.add_cost', sku: @sku) # <---- Add Cost Box
|
89
|
-
|
90
|
-
.property
|
91
|
-
= label_tag 'sku_msrp', t('workarea.admin.fields.msrp'), class: 'property__name'
|
92
|
-
= currency_symbol
|
93
|
-
= text_field_tag 'sku[msrp]', @sku.msrp, class: 'text-box text-box--small', placeholder: t('workarea.admin.pricing_skus.msrp_placeholder')
|
94
|
-
```
|
95
|
-
|
96
|
-
```haml
|
97
|
-
admin/app/views/workarea/admin/pricing_skus/edit.html.haml
|
98
|
-
|
99
|
-
.property
|
100
|
-
= label_tag 'sku[tax_code]', t('workarea.admin.fields.tax_code'), class: 'property__name'
|
101
|
-
= text_field_tag 'sku[tax_code]', @sku.tax_code, class: 'text-box'
|
102
|
-
|
103
|
-
= append_partials('admin.add_cost', sku: @sku) # <---- Add Cost Box
|
104
|
-
|
105
|
-
.property
|
106
|
-
= label_tag 'sku_msrp', t('workarea.admin.fields.msrp'), class: 'property__name'
|
107
|
-
= currency_symbol
|
108
|
-
= text_field_tag 'sku[msrp]', @sku.msrp, class: 'text-box text-box--small'
|
109
|
-
```
|
110
|
-
|
111
|
-
```haml
|
112
|
-
admin/app/views/workarea/admin/pricing_skus/_cards.html.haml
|
113
|
-
|
114
|
-
.card__body
|
115
|
-
%ul.list-reset
|
116
|
-
%li
|
117
|
-
%strong #{t('workarea.admin.fields.active')}?
|
118
|
-
= check_box_tag 'sku', 'active', model.active, disabled: true
|
119
|
-
%li
|
120
|
-
%strong #{t('workarea.admin.fields.tax_code')}:
|
121
|
-
= model.tax_code.presence || '(none)'
|
122
|
-
= append_partials('admin.card_cost_and_margin', model: model) # <---- Card Data
|
123
|
-
%li
|
124
|
-
%strong #{t('workarea.admin.fields.msrp')}:
|
125
|
-
- if model.msrp.blank?
|
126
|
-
= t('workarea.admin.cards.attributes.no_value')
|
127
|
-
- else
|
128
|
-
= number_to_currency model.msrp
|
129
|
-
%li
|
130
|
-
%strong #{t('workarea.admin.fields.on_sale')}:
|
131
|
-
= model.on_sale?.to_s.titleize
|
132
|
-
%li
|
133
|
-
%strong #{t('workarea.admin.fields.discountable')}:
|
134
|
-
= model.discountable?.to_s.titleize
|
47
|
+
%table.index-table
|
48
|
+
%thead
|
49
|
+
%tr
|
50
|
+
%th.index-table__control-cell
|
51
|
+
.checkbox
|
52
|
+
= check_box_tag 'select_all', nil, false, id: 'select_all', class: 'checkbox__input', data: { bulk_action_select_all: '' }
|
53
|
+
= label_tag 'select_all', t('workarea.admin.bulk_actions.select_all'), class: 'checkbox__label'
|
54
|
+
%th= t('workarea.admin.fields.sku')
|
55
|
+
**** = append_partials('admin.pricing_skus_additional_field_labels') **** LABELS
|
56
|
+
%th.align-right= t('workarea.admin.fields.msrp')
|
57
|
+
%th.align-right= t('workarea.admin.fields.regular')
|
58
|
+
%th.align-right= t('workarea.admin.fields.sale_price')
|
59
|
+
%th.align-center= t('workarea.admin.fields.on_sale')
|
60
|
+
%th.align-center= t('workarea.admin.fields.allow_discounting')
|
61
|
+
%th= t('workarea.admin.fields.updated_at')
|
62
|
+
%tbody
|
63
|
+
- @search.results.each do |result|
|
64
|
+
%tr.index-table__row{ class: ('index-table__row--inactive' unless result.active) }
|
65
|
+
%td.index-table__control-cell
|
66
|
+
.checkbox
|
67
|
+
= check_box_tag 'global_id', result.to_gid_param, false, class: 'checkbox__input', id: dom_id(result), data: { bulk_action_item: '' }
|
68
|
+
= label_tag dom_id(result), '', class: 'checkbox__label', title: t('workarea.admin.bulk_actions.add_summary_button')
|
69
|
+
%td
|
70
|
+
= link_to result.id, pricing_sku_path(result)
|
71
|
+
= upcoming_changesets_icon_for(result)
|
72
|
+
**** = append_partials('admin.pricing_skus_additional_fields', result: result) **** FIELDS
|
73
|
+
%td.align-right= number_to_currency result.msrp
|
74
|
+
%td.align-right= number_to_currency result.regular_price
|
75
|
+
%td.align-right= number_to_currency result.sale_price
|
76
|
+
%td.align-center= t("workarea.admin.#{result.on_sale?}")
|
77
|
+
%td.align-center= t("workarea.admin.#{result.discountable?}")
|
78
|
+
%td= local_time_ago(result.updated_at)
|
135
79
|
```
|
136
80
|
|
137
81
|
## Workarea Commerce Documentation
|
@@ -1,12 +1,12 @@
|
|
1
1
|
%li
|
2
2
|
%strong #{t('workarea.admin.fields.cost')}:
|
3
|
-
- if
|
3
|
+
- if @sku.cost.blank?
|
4
4
|
= t('workarea.admin.cards.attributes.no_value')
|
5
5
|
- else
|
6
|
-
= number_to_currency
|
6
|
+
= number_to_currency @sku.cost
|
7
7
|
%li
|
8
8
|
%strong #{t('workarea.admin.fields.margin')}:
|
9
|
-
- if
|
9
|
+
- if @sku.cost.blank?
|
10
10
|
= t('workarea.admin.cards.attributes.no_value')
|
11
11
|
- else
|
12
|
-
= number_to_percentage
|
12
|
+
= number_to_percentage @sku.margin, precision: 2
|
data/app/views/workarea/admin/pricing_skus/{_add_cost.html.haml → _pricing_sku_fields.html.haml}
RENAMED
File without changes
|
File without changes
|
File without changes
|
@@ -1,21 +1,21 @@
|
|
1
1
|
module Workarea
|
2
2
|
Workarea.append_partials(
|
3
|
-
'admin.
|
4
|
-
'workarea/admin/pricing_skus/
|
3
|
+
'admin.pricing_skus_additional_field_labels',
|
4
|
+
'workarea/admin/pricing_skus/pricing_skus_additional_field_labels'
|
5
5
|
)
|
6
6
|
|
7
7
|
Workarea.append_partials(
|
8
|
-
'admin.
|
9
|
-
'workarea/admin/pricing_skus/
|
8
|
+
'admin.pricing_skus_additional_fields',
|
9
|
+
'workarea/admin/pricing_skus/pricing_skus_additional_fields'
|
10
10
|
)
|
11
|
-
|
11
|
+
|
12
12
|
Workarea.append_partials(
|
13
|
-
'admin.
|
14
|
-
'workarea/admin/pricing_skus/
|
13
|
+
'admin.pricing_sku_attributes_card',
|
14
|
+
'workarea/admin/pricing_skus/pricing_sku_attributes_card'
|
15
15
|
)
|
16
16
|
|
17
17
|
Workarea.append_partials(
|
18
|
-
'admin.
|
19
|
-
'workarea/admin/pricing_skus/
|
18
|
+
'admin.pricing_sku_fields',
|
19
|
+
'workarea/admin/pricing_skus/pricing_sku_fields'
|
20
20
|
)
|
21
21
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: workarea-margin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Goodman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-03-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: workarea
|
@@ -52,10 +52,10 @@ files:
|
|
52
52
|
- app/models/workarea/pricing/sku.decorator
|
53
53
|
- app/view_models/workarea/admin/pricing_sku_view_model.decorator
|
54
54
|
- app/views/.keep
|
55
|
-
- app/views/workarea/admin/pricing_skus/
|
56
|
-
- app/views/workarea/admin/pricing_skus/
|
57
|
-
- app/views/workarea/admin/pricing_skus/
|
58
|
-
- app/views/workarea/admin/pricing_skus/
|
55
|
+
- app/views/workarea/admin/pricing_skus/_pricing_sku_attributes_card.html.haml
|
56
|
+
- app/views/workarea/admin/pricing_skus/_pricing_sku_fields.html.haml
|
57
|
+
- app/views/workarea/admin/pricing_skus/_pricing_skus_additional_field_labels.html.haml
|
58
|
+
- app/views/workarea/admin/pricing_skus/_pricing_skus_additional_fields.html.haml
|
59
59
|
- bin/rails
|
60
60
|
- config/initializers/append_points.rb
|
61
61
|
- config/initializers/workarea.rb
|
@@ -130,12 +130,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
130
130
|
version: '0'
|
131
131
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
132
132
|
requirements:
|
133
|
-
- - "
|
133
|
+
- - ">="
|
134
134
|
- !ruby/object:Gem::Version
|
135
|
-
version:
|
135
|
+
version: '0'
|
136
136
|
requirements: []
|
137
137
|
rubyforge_project:
|
138
|
-
rubygems_version: 2.7.
|
138
|
+
rubygems_version: 2.7.5
|
139
139
|
signing_key:
|
140
140
|
specification_version: 4
|
141
141
|
summary: Margin plugin for the Workarea ecommerce platform
|