workarea-margin 1.0.0.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +23 -0
  3. data/Gemfile +17 -0
  4. data/LICENSE +29 -0
  5. data/README.md +143 -0
  6. data/Rakefile +47 -0
  7. data/app/assets/images/add_cost.png +0 -0
  8. data/app/assets/images/pricing_list.png +0 -0
  9. data/app/assets/images/workarea/admin/margin/.keep +0 -0
  10. data/app/assets/images/workarea/storefront/margin/.keep +0 -0
  11. data/app/assets/javascripts/workarea/admin/margin/.keep +0 -0
  12. data/app/assets/javascripts/workarea/storefront/margin/.keep +0 -0
  13. data/app/assets/stylesheets/workarea/admin/margin/.keep +0 -0
  14. data/app/assets/stylesheets/workarea/storefront/margin/.keep +0 -0
  15. data/app/controllers/.keep +0 -0
  16. data/app/helpers/.keep +0 -0
  17. data/app/mailers/.keep +0 -0
  18. data/app/models/.keep +0 -0
  19. data/app/models/workarea/pricing/sku.decorator +9 -0
  20. data/app/view_models/workarea/admin/pricing_sku_view_model.decorator +19 -0
  21. data/app/views/.keep +0 -0
  22. data/app/views/workarea/admin/pricing_skus/_add_cost.html.haml +4 -0
  23. data/app/views/workarea/admin/pricing_skus/_additional_fields.html.haml +2 -0
  24. data/app/views/workarea/admin/pricing_skus/_additional_fields_labels.html.haml +2 -0
  25. data/app/views/workarea/admin/pricing_skus/_card_cost_and_margin.html.haml +12 -0
  26. data/bin/rails +25 -0
  27. data/config/initializers/append_points.rb +21 -0
  28. data/config/initializers/workarea.rb +3 -0
  29. data/config/locales/en.yml +6 -0
  30. data/config/routes.rb +2 -0
  31. data/lib/workarea/margin/engine.rb +9 -0
  32. data/lib/workarea/margin/version.rb +5 -0
  33. data/lib/workarea/margin.rb +7 -0
  34. data/test/dummy/.ruby-version +1 -0
  35. data/test/dummy/Rakefile +6 -0
  36. data/test/dummy/app/assets/config/manifest.js +3 -0
  37. data/test/dummy/app/assets/images/.keep +0 -0
  38. data/test/dummy/app/assets/javascripts/application.js +14 -0
  39. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  40. data/test/dummy/app/controllers/application_controller.rb +2 -0
  41. data/test/dummy/app/controllers/concerns/.keep +0 -0
  42. data/test/dummy/app/helpers/application_helper.rb +2 -0
  43. data/test/dummy/app/jobs/application_job.rb +2 -0
  44. data/test/dummy/app/mailers/application_mailer.rb +4 -0
  45. data/test/dummy/app/models/concerns/.keep +0 -0
  46. data/test/dummy/app/views/layouts/application.html.erb +15 -0
  47. data/test/dummy/app/views/layouts/mailer.html.erb +13 -0
  48. data/test/dummy/app/views/layouts/mailer.text.erb +1 -0
  49. data/test/dummy/bin/bundle +3 -0
  50. data/test/dummy/bin/rails +4 -0
  51. data/test/dummy/bin/rake +4 -0
  52. data/test/dummy/bin/setup +28 -0
  53. data/test/dummy/bin/update +28 -0
  54. data/test/dummy/bin/yarn +11 -0
  55. data/test/dummy/config/application.rb +33 -0
  56. data/test/dummy/config/boot.rb +5 -0
  57. data/test/dummy/config/environment.rb +5 -0
  58. data/test/dummy/config/environments/development.rb +52 -0
  59. data/test/dummy/config/environments/production.rb +83 -0
  60. data/test/dummy/config/environments/test.rb +45 -0
  61. data/test/dummy/config/initializers/application_controller_renderer.rb +8 -0
  62. data/test/dummy/config/initializers/assets.rb +14 -0
  63. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  64. data/test/dummy/config/initializers/content_security_policy.rb +25 -0
  65. data/test/dummy/config/initializers/cookies_serializer.rb +5 -0
  66. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  67. data/test/dummy/config/initializers/inflections.rb +16 -0
  68. data/test/dummy/config/initializers/mime_types.rb +4 -0
  69. data/test/dummy/config/initializers/workarea.rb +5 -0
  70. data/test/dummy/config/initializers/wrap_parameters.rb +9 -0
  71. data/test/dummy/config/locales/en.yml +33 -0
  72. data/test/dummy/config/puma.rb +37 -0
  73. data/test/dummy/config/routes.rb +5 -0
  74. data/test/dummy/config/spring.rb +6 -0
  75. data/test/dummy/config.ru +5 -0
  76. data/test/dummy/db/seeds.rb +2 -0
  77. data/test/dummy/lib/assets/.keep +0 -0
  78. data/test/dummy/log/.keep +0 -0
  79. data/test/dummy/package.json +5 -0
  80. data/test/teaspoon_env.rb +5 -0
  81. data/test/test_helper.rb +8 -0
  82. data/test/view_models/workarea/admin/pricing_sku_view_model_test.rb +23 -0
  83. data/workarea-margin.gemspec +29 -0
  84. metadata +142 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 0a53a0fdf5a6bfa21624fddbd5ffdf36658fb4834e4c86cdb77050319fd67132
4
+ data.tar.gz: 6799cd42e8ca298a7df475a585bf8b199c254621d07289176caaa64dbbd685b8
5
+ SHA512:
6
+ metadata.gz: a62489273b82dd8d1cefbc79eb268b253eb94f79dc6fa8119a73749016b014ece56d8e9583aa07632f1126d62b82252977eb2bb94f71b2e4291134228d8f81cd
7
+ data.tar.gz: 3cdc912c36ed71f19ac7b0d74c76bcafc29f5d02886c4f96dae3b0679f4a37efbdd506460d6af7551a40574745ed990d8633f9ec04bc0cf8d79e69713d9df4fd
data/.gitignore ADDED
@@ -0,0 +1,23 @@
1
+ .bundle/
2
+ log/*.log
3
+ pkg/
4
+ test/dummy/log/*.log
5
+ test/dummy/node_modules/
6
+ test/dummy/yarn-error.log
7
+ test/dummy/tmp/
8
+ .DS_Store
9
+ .byebug_history
10
+ .bundle/
11
+ .sass-cache/
12
+ Gemfile.lock
13
+ pkg/
14
+ test/dummy/tmp/
15
+ test/dummy/public/
16
+ log/*.log
17
+ test/dummy/log/*.log
18
+ test/dummy/db/*.sqlite3
19
+ test/dummy/db/*.sqlite3-journal
20
+ node_modules
21
+ yarn.lock
22
+ yarn-error.log
23
+ package-lock.json
data/Gemfile ADDED
@@ -0,0 +1,17 @@
1
+ source 'https://rubygems.org'
2
+ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
3
+
4
+ # Declare your gem's dependencies in margin.gemspec.
5
+ # Bundler will treat runtime dependencies like base dependencies, and
6
+ # development dependencies will be added by default to the :development group.
7
+ gemspec
8
+
9
+ # Declare any dependencies that are still in development here instead of in
10
+ # your gemspec. These might include edge Rails or gems from your path or
11
+ # Git. Remember to move these dependencies to your gemspec before releasing
12
+ # your gem to rubygems.org.
13
+
14
+ # To use a debugger
15
+ # gem 'byebug', group: [:development, :test]
16
+
17
+ gem 'workarea', github: 'workarea-commerce/workarea'
data/LICENSE ADDED
@@ -0,0 +1,29 @@
1
+ WebLinc
2
+ Business Source License
3
+ Licensor: WebLinc Corporation, 22 S. 3rd Street, 2nd Floor, Philadelphia PA 19106
4
+ Licensed Work: Workarea Commerce Platform
5
+ The Licensed Work is (c) 2019 WebLinc Corporation
6
+ Additional Use Grant:
7
+ You may make production use of the Licensed Work without an additional license agreement with WebLinc so long as you do not use the Licensed Work for a Commerce Service.
8
+ A "Commerce Service" is a commercial offering that allows third parties (other than your employees and contractors) to access the functionality of the Licensed Work by creating or managing commerce functionality, the products, taxonomy, assets and/or content of which are controlled by such third parties.
9
+ For information about obtaining an additional license agreement with WebLinc, contact licensing@workarea.com.
10
+ Change Date: 2019-08-20
11
+ Change License: Version 2.0 or later of the GNU General Public License as published by the Free Software Foundation
12
+ Terms
13
+ The Licensor hereby grants you the right to copy, modify, create derivative works, redistribute, and make non-production use of the Licensed Work. The Licensor may make an Additional Use Grant, above, permitting limited production use.
14
+ Effective on the Change Date, or the fourth anniversary of the first publicly available distribution of a specific version of the Licensed Work under this License, whichever comes first, the Licensor hereby grants you rights under the terms of the Change License, and the rights granted in the paragraph above terminate.
15
+ If your use of the Licensed Work does not comply with the requirements currently in effect as described in this License, you must purchase a commercial license from the Licensor, its affiliated entities, or authorized resellers, or you must refrain from using the Licensed Work.
16
+ All copies of the original and modified Licensed Work, and derivative works of the Licensed Work, are subject to this License. This License applies separately for each version of the Licensed Work and the Change Date may vary for each version of the Licensed Work released by Licensor.
17
+ You must conspicuously display this License on each original or modified copy of the Licensed Work. If you receive the Licensed Work in original or modified form from a third party, the terms and conditions set forth in this License apply to your use of that work.
18
+ Any use of the Licensed Work in violation of this License will automatically terminate your rights under this License for the current and all other versions of the Licensed Work.
19
+ This License does not grant you any right in any trademark or logo of Licensor or its affiliates (provided that you may use a trademark or logo of Licensor as expressly required by this License). TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND TITLE. MariaDB hereby grants you permission to use this License’s text to license your works and to refer to it using the trademark "Business Source License" as long as you comply with the Covenants of Licensor below.
20
+ Covenants of Licensor
21
+ In consideration of the right to use this License’s text and the "Business Source License" name and trademark, Licensor covenants to MariaDB, and to all other recipients of the licensed work to be provided by Licensor:
22
+ To specify as the Change License the GPL Version 2.0 or any later version, or a license that is compatible with GPL Version 2.0 or a later version, where "compatible" means that software provided under the Change License can be included in a program with software provided under GPL Version 2.0 or a later version. Licensor may specify additional Change Licenses without limitation.
23
+ To either: (a) specify an additional grant of rights to use that does not impose any additional restriction on the right granted in this License, as the Additional Use Grant; or (b) insert the text "None."
24
+ To specify a Change Date.
25
+ Not to modify this License in any other way.
26
+ Notice
27
+ The Business Source License (this document, or the "License") is not an Open Source license. However, the Licensed Work will eventually be made available under an Open Source License, as stated in this License.
28
+ For more information on the use of the Business Source License generally, please visit the Adopting and Developing Business Source License FAQ.
29
+ License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved. "Business Source License" is a trademark of MariaDB Corporation Ab.
data/README.md ADDED
@@ -0,0 +1,143 @@
1
+ # Workarea Margin
2
+
3
+ Currently in Development.
4
+
5
+ A Workarea Commerce plugin that enables product reviews.
6
+
7
+ ## Overview
8
+
9
+ - Allows adding cost to pricing skus
10
+ - Pricing admin view will show margin based on regular price or sale price depending on the sale flag
11
+
12
+ ![Pricing List Preview](app/assets/images/pricing_list.png)
13
+
14
+ ![Add Cost Preview](app/assets/images/add_cost.png)
15
+
16
+ ## Getting Started
17
+
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
+ Add the gem to your application's Gemfile:
25
+
26
+ ```ruby
27
+ gem 'workarea-margin'
28
+ ```
29
+
30
+ Update your application's bundle.
31
+
32
+ ```bash
33
+ cd path/to/application
34
+ bundle
35
+ ```
36
+
37
+ ## Append Points
38
+
39
+ Append partials need to be added to your platform to work:
40
+
41
+ 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
+
43
+ ```haml
44
+ admin/app/views/workarea/admin/pricing_skus/index.html.haml
45
+
46
+ - if @search.results.any?
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.additional_fields_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.additional_fields', result: result) # <---- Data
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)
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
135
+ ```
136
+
137
+ ## Workarea Commerce Documentation
138
+
139
+ See [https://developer.workarea.com](https://developer.workarea.com) for Workarea Commerce documentation.
140
+
141
+ ## License
142
+
143
+ Workarea Reviews is released under the [Business Software License](LICENSE)
data/Rakefile ADDED
@@ -0,0 +1,47 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+ require 'rdoc/task'
7
+ RDoc::Task.new(:rdoc) do |rdoc|
8
+ rdoc.rdoc_dir = 'rdoc'
9
+ rdoc.title = 'Margin'
10
+ rdoc.options << '--line-numbers'
11
+ rdoc.rdoc_files.include('README.md')
12
+ rdoc.rdoc_files.include('lib/**/*.rb')
13
+ end
14
+ APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
15
+ load 'rails/tasks/engine.rake'
16
+ load 'rails/tasks/statistics.rake'
17
+ load 'workarea/changelog.rake'
18
+ require 'rake/testtask'
19
+ Rake::TestTask.new(:test) do |t|
20
+ t.libs << 'lib'
21
+ t.libs << 'test'
22
+ t.pattern = 'test/**/*_test.rb'
23
+ t.verbose = false
24
+ end
25
+ task default: :test
26
+ $LOAD_PATH.unshift File.expand_path('../lib', __FILE__)
27
+ require 'workarea/margin/version'
28
+ desc "Release version #{Workarea::Margin::VERSION} of the gem"
29
+ task :release do
30
+ Rake::Task['workarea:changelog'].execute
31
+ system 'git add CHANGELOG.md'
32
+ system 'git commit -m "Update CHANGELOG"'
33
+ system "git tag -a v#{Workarea::Margin::VERSION} -m 'Tagging #{Workarea::Margin::VERSION}'"
34
+ system 'git push origin HEAD --follow-tags'
35
+ system "gem build workarea-margin.gemspec"
36
+ system "gem push workarea-margin-#{Workarea::Margin::VERSION}.gem"
37
+ system "rm workarea-margin-#{Workarea::Margin::VERSION}.gem"
38
+ end
39
+ desc 'Run the JavaScript tests'
40
+ ENV['TEASPOON_RAILS_ENV'] = File.expand_path('../test/dummy/config/environment', __FILE__)
41
+ task teaspoon: 'app:teaspoon'
42
+ desc 'Start a server at http://localhost:3000/teaspoon for JavaScript tests'
43
+ task :teaspoon_server do
44
+ Dir.chdir("test/dummy")
45
+ teaspoon_env = File.expand_path('../test/teaspoon_env.rb', __FILE__)
46
+ system "RAILS_ENV=test TEASPOON_ENV=#{teaspoon_env} rails s"
47
+ end
Binary file
Binary file
File without changes
File without changes
data/app/helpers/.keep ADDED
File without changes
data/app/mailers/.keep ADDED
File without changes
data/app/models/.keep ADDED
File without changes
@@ -0,0 +1,9 @@
1
+ module Workarea
2
+ module Pricing
3
+ decorate Sku, with: :margin do
4
+ decorated do
5
+ field :cost, type: Money, default: 0
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,19 @@
1
+ module Workarea
2
+ module Admin
3
+ decorate PricingSkuViewModel, with: :margin do
4
+ def show_cost
5
+ return if cost == 0
6
+ cost
7
+ end
8
+
9
+ def margin
10
+ return if cost == 0
11
+ on_sale ? find_margin(sale_price) : find_margin(regular_price)
12
+ end
13
+
14
+ def find_margin(price)
15
+ ((price - cost) / price) * 100
16
+ end
17
+ end
18
+ end
19
+ end
data/app/views/.keep ADDED
File without changes
@@ -0,0 +1,4 @@
1
+ .property
2
+ = label_tag 'sku_cost', t('workarea.admin.fields.cost'), class: 'property__name'
3
+ = currency_symbol
4
+ = text_field_tag 'sku[cost]', @sku.cost, class: 'text-box text-box--small'
@@ -0,0 +1,2 @@
1
+ %td.align-center= number_to_currency result.show_cost
2
+ %td.align-center= number_to_percentage result.margin, precision: 2
@@ -0,0 +1,2 @@
1
+ %th.align-center= t('workarea.admin.fields.cost')
2
+ %th.align-center= t('workarea.admin.fields.margin')
@@ -0,0 +1,12 @@
1
+ %li
2
+ %strong #{t('workarea.admin.fields.cost')}:
3
+ - if model.cost.blank?
4
+ = t('workarea.admin.cards.attributes.no_value')
5
+ - else
6
+ = number_to_currency model.cost
7
+ %li
8
+ %strong #{t('workarea.admin.fields.margin')}:
9
+ - if model.cost.blank?
10
+ = t('workarea.admin.cards.attributes.no_value')
11
+ - else
12
+ = number_to_percentage model.margin, precision: 2
data/bin/rails ADDED
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/env ruby
2
+ # This command will automatically be run when you run "rails" with Rails gems
3
+ # installed from the root of your application.
4
+
5
+ ENGINE_ROOT = File.expand_path('..', __dir__)
6
+ ENGINE_PATH = File.expand_path('../lib/workarea/margin/engine', __dir__)
7
+ APP_PATH = File.expand_path('../test/dummy/config/application', __dir__)
8
+
9
+ # Set up gems listed in the Gemfile.
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
11
+ require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
12
+
13
+ require "rails"
14
+ # Pick the frameworks you want:
15
+ require "active_model/railtie"
16
+ require "active_job/railtie"
17
+ # require "active_record/railtie"
18
+ # require "active_storage/engine"
19
+ require "action_controller/railtie"
20
+ require "action_mailer/railtie"
21
+ require "action_view/railtie"
22
+ # require "action_cable/engine"
23
+ require "sprockets/railtie"
24
+ require "rails/test_unit/railtie"
25
+ require 'rails/engine/commands'
@@ -0,0 +1,21 @@
1
+ module Workarea
2
+ Workarea.append_partials(
3
+ 'admin.additional_fields_labels',
4
+ 'workarea/admin/pricing_skus/additional_fields_labels'
5
+ )
6
+
7
+ Workarea.append_partials(
8
+ 'admin.additional_fields',
9
+ 'workarea/admin/pricing_skus/additional_fields'
10
+ )
11
+
12
+ Workarea.append_partials(
13
+ 'admin.add_cost',
14
+ 'workarea/admin/pricing_skus/add_cost'
15
+ )
16
+
17
+ Workarea.append_partials(
18
+ 'admin.card_cost_and_margin',
19
+ 'workarea/admin/pricing_skus/card_cost_and_margin'
20
+ )
21
+ end
@@ -0,0 +1,3 @@
1
+ Workarea.configure do |config|
2
+ # Add custom configuration here
3
+ end
@@ -0,0 +1,6 @@
1
+ en:
2
+ workarea:
3
+ admin:
4
+ fields:
5
+ cost: Cost
6
+ margin: Margin
data/config/routes.rb ADDED
@@ -0,0 +1,2 @@
1
+ Rails.application.routes.draw do
2
+ end
@@ -0,0 +1,9 @@
1
+ require 'workarea/margin'
2
+ module Workarea
3
+ module Margin
4
+ class Engine < ::Rails::Engine
5
+ include Workarea::Plugin
6
+ isolate_namespace Workarea::Margin
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,5 @@
1
+ module Workarea
2
+ module Margin
3
+ VERSION = "1.0.0.pre".freeze
4
+ end
5
+ end
@@ -0,0 +1,7 @@
1
+ require 'workarea'
2
+ require 'workarea/margin/engine'
3
+ require 'workarea/margin/version'
4
+ module Workarea
5
+ module Margin
6
+ end
7
+ end
@@ -0,0 +1 @@
1
+ ruby-2.5.1
@@ -0,0 +1,6 @@
1
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
2
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
+
4
+ require_relative 'config/application'
5
+
6
+ Rails.application.load_tasks
@@ -0,0 +1,3 @@
1
+ //= link_tree ../images
2
+ //= link_directory ../javascripts .js
3
+ //= link_directory ../stylesheets .css
File without changes
@@ -0,0 +1,14 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // compiled file. JavaScript code in this file should be added after the last require_* statement.
9
+ //
10
+ // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
+ //
13
+ //= require rails-ujs
14
+ //= require_tree .
@@ -0,0 +1,15 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
10
+ * files in this directory. Styles in this file should be added after the last require_* statement.
11
+ * It is generally better to create a new file per style scope.
12
+ *
13
+ *= require_tree .
14
+ *= require_self
15
+ */
@@ -0,0 +1,2 @@
1
+ class ApplicationController < ActionController::Base
2
+ end
File without changes
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,2 @@
1
+ class ApplicationJob < ActiveJob::Base
2
+ end
@@ -0,0 +1,4 @@
1
+ class ApplicationMailer < ActionMailer::Base
2
+ default from: 'from@example.com'
3
+ layout 'mailer'
4
+ end
File without changes
@@ -0,0 +1,15 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Dummy</title>
5
+ <%= csrf_meta_tags %>
6
+ <%= csp_meta_tag %>
7
+
8
+ <%= stylesheet_link_tag 'application', media: 'all' %>
9
+ <%= javascript_include_tag 'application' %>
10
+ </head>
11
+
12
+ <body>
13
+ <%= yield %>
14
+ </body>
15
+ </html>
@@ -0,0 +1,13 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
+ <style>
6
+ /* Email styles need to be inline */
7
+ </style>
8
+ </head>
9
+
10
+ <body>
11
+ <%= yield %>
12
+ </body>
13
+ </html>
@@ -0,0 +1 @@
1
+ <%= yield %>
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
3
+ load Gem.bin_path('bundler', 'bundle')
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ APP_PATH = File.expand_path('../config/application', __dir__)
3
+ require_relative '../config/boot'
4
+ require 'rails/commands'
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require_relative '../config/boot'
3
+ require 'rake'
4
+ Rake.application.run
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env ruby
2
+ require 'fileutils'
3
+ include FileUtils
4
+
5
+ # path to your application root.
6
+ APP_ROOT = File.expand_path('..', __dir__)
7
+
8
+ def system!(*args)
9
+ system(*args) || abort("\n== Command #{args} failed ==")
10
+ end
11
+
12
+ chdir APP_ROOT do
13
+ # This script is a starting point to setup your application.
14
+ # Add necessary setup steps to this file.
15
+
16
+ puts '== Installing dependencies =='
17
+ system! 'gem install bundler --conservative'
18
+ system('bundle check') || system!('bundle install')
19
+
20
+ # Install JavaScript dependencies if using Yarn
21
+ # system('bin/yarn')
22
+
23
+ puts "\n== Removing old logs and tempfiles =="
24
+ system! 'bin/rails log:clear tmp:clear'
25
+
26
+ puts "\n== Restarting application server =="
27
+ system! 'bin/rails restart'
28
+ end
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env ruby
2
+ require 'fileutils'
3
+ include FileUtils
4
+
5
+ # path to your application root.
6
+ APP_ROOT = File.expand_path('..', __dir__)
7
+
8
+ def system!(*args)
9
+ system(*args) || abort("\n== Command #{args} failed ==")
10
+ end
11
+
12
+ chdir APP_ROOT do
13
+ # This script is a way to update your development environment automatically.
14
+ # Add necessary update steps to this file.
15
+
16
+ puts '== Installing dependencies =='
17
+ system! 'gem install bundler --conservative'
18
+ system('bundle check') || system!('bundle install')
19
+
20
+ # Install JavaScript dependencies if using Yarn
21
+ # system('bin/yarn')
22
+
23
+ puts "\n== Removing old logs and tempfiles =="
24
+ system! 'bin/rails log:clear tmp:clear'
25
+
26
+ puts "\n== Restarting application server =="
27
+ system! 'bin/rails restart'
28
+ end