mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-19 19:46:51 +00:00
Compare commits
157 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8a5608435c | ||
|
|
d02d0b8847 | ||
|
|
4b6ef7796e | ||
|
|
b60a6fbd05 | ||
|
|
2e267091f6 | ||
|
|
eb3fe1b7a5 | ||
|
|
62c2d9a290 | ||
|
|
a329aab007 | ||
|
|
e24198fe85 | ||
|
|
a9bf7a2498 | ||
|
|
21a0017352 | ||
|
|
d115c4ce2c | ||
|
|
b05d46c3e3 | ||
|
|
aae0fc59fb | ||
|
|
d1f7cc1b2a | ||
|
|
964481f188 | ||
|
|
9bca22ae3b | ||
|
|
064c843c90 | ||
|
|
482d438ec9 | ||
|
|
1176ea2a5f | ||
|
|
f42a9e3a66 | ||
|
|
8d9a8d8db5 | ||
|
|
b9431cd121 | ||
|
|
74d18fb6ff | ||
|
|
5e26e49764 | ||
|
|
c9dada4215 | ||
|
|
630169f8bb | ||
|
|
152af5e105 | ||
|
|
918425fd93 | ||
|
|
a46eef291c | ||
|
|
d2fbb0bde2 | ||
|
|
c42dfdde10 | ||
|
|
959dcb82e1 | ||
|
|
51d5817665 | ||
|
|
a8384b3155 | ||
|
|
394bfd00d8 | ||
|
|
bda1a527d3 | ||
|
|
77bd832dd6 | ||
|
|
b1de28eeea | ||
|
|
679fcc0114 | ||
|
|
35778ecf1d | ||
|
|
70a6e9f44b | ||
|
|
30ba29382a | ||
|
|
9584205a8e | ||
|
|
3644dbc0fd | ||
|
|
05a7276c9c | ||
|
|
1fc60d498a | ||
|
|
dae8703b02 | ||
|
|
3078c599f9 | ||
|
|
5d91ac217d | ||
|
|
f2edb6d404 | ||
|
|
7cd1b5d5db | ||
|
|
ad82f66173 | ||
|
|
62bfa9e04c | ||
|
|
28c9d72342 | ||
|
|
7317d6ca34 | ||
|
|
edb8da4b4d | ||
|
|
00d5bd9165 | ||
|
|
1730c9eb60 | ||
|
|
5b9815f4a3 | ||
|
|
445eb45ad7 | ||
|
|
8770471ada | ||
|
|
6d45940ca4 | ||
|
|
69383ac621 | ||
|
|
945cb84127 | ||
|
|
343a2db1bf | ||
|
|
de8f5e13b3 | ||
|
|
75b5d1fd6f | ||
|
|
0c1606e50c | ||
|
|
fa05554f15 | ||
|
|
2cc509de15 | ||
|
|
41afad73e4 | ||
|
|
b17b25516f | ||
|
|
8444fca19a | ||
|
|
18d90114fe | ||
|
|
2f17a02974 | ||
|
|
135bc7e2f8 | ||
|
|
3810d79cad | ||
|
|
4960402643 | ||
|
|
3557c10cd6 | ||
|
|
45dd421f1f | ||
|
|
81606e841a | ||
|
|
e633670e01 | ||
|
|
11653c9430 | ||
|
|
d068094044 | ||
|
|
b892bf726e | ||
|
|
76357789a3 | ||
|
|
5dd7246b85 | ||
|
|
ba45dd84dd | ||
|
|
92e2a83e0e | ||
|
|
f42f513f8c | ||
|
|
54342254b6 | ||
|
|
470761da86 | ||
|
|
6fdf9fa038 | ||
|
|
bbec01a9cb | ||
|
|
e3001cc8c4 | ||
|
|
ad0d0e393e | ||
|
|
2690ff5eb5 | ||
|
|
2594382488 | ||
|
|
9b3cfe80ff | ||
|
|
04d33adaf2 | ||
|
|
915bd19d7b | ||
|
|
9998025687 | ||
|
|
1955a6719c | ||
|
|
f71e5ee43c | ||
|
|
0ac2358f2c | ||
|
|
946b69242c | ||
|
|
a27b64a66b | ||
|
|
0f54d3950d | ||
|
|
7e306693a8 | ||
|
|
213fb42a05 | ||
|
|
bde46fa1e9 | ||
|
|
dc560d3793 | ||
|
|
52f134fc9e | ||
|
|
c08e264afa | ||
|
|
4e32bfd70b | ||
|
|
722c660697 | ||
|
|
ac666a6fce | ||
|
|
ba1d985932 | ||
|
|
0f28d318ac | ||
|
|
6172d1f2e5 | ||
|
|
05a040b4c3 | ||
|
|
73a81310f8 | ||
|
|
43e51cb592 | ||
|
|
6570891349 | ||
|
|
0f3e2ae572 | ||
|
|
f0110d20a2 | ||
|
|
353acfd6ae | ||
|
|
e43a018dc7 | ||
|
|
f6fac018ea | ||
|
|
ce1bd12760 | ||
|
|
364ccc2146 | ||
|
|
2a7cb50fa9 | ||
|
|
29ddc68d20 | ||
|
|
d40f3414ea | ||
|
|
f5e2edb028 | ||
|
|
7af26e6579 | ||
|
|
824d4adf21 | ||
|
|
00cc8da2fc | ||
|
|
ae5f2cc19d | ||
|
|
41ce4fbc16 | ||
|
|
48753df5f0 | ||
|
|
1f3e66316b | ||
|
|
6b1426d0c6 | ||
|
|
c68987c0f2 | ||
|
|
2cb25e6366 | ||
|
|
073f46e590 | ||
|
|
23beea8a13 | ||
|
|
096e388fdf | ||
|
|
3dfaf882a3 | ||
|
|
7b51f45b4d | ||
|
|
b9b2fa7c94 | ||
|
|
ee30d3d139 | ||
|
|
697f2795d4 | ||
|
|
7d51979c06 | ||
|
|
8c6e0a841c | ||
|
|
9d0a69cceb |
@@ -5,6 +5,8 @@
|
||||
#
|
||||
# cp .env.development .env.local
|
||||
|
||||
VERBOSE_QUERY_LOGS=true
|
||||
|
||||
SECRET_TOKEN="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
||||
|
||||
OFN_REDIS_URL="redis://localhost:6379/1"
|
||||
|
||||
14
.github/workflows/build.yml
vendored
14
.github/workflows/build.yml
vendored
@@ -18,7 +18,7 @@ permissions:
|
||||
|
||||
jobs:
|
||||
knapsack_rspec_controllers:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-22.04
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:10
|
||||
@@ -86,7 +86,7 @@ jobs:
|
||||
bundle exec rake knapsack_pro:rspec
|
||||
|
||||
knapsack_rspec_models:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-22.04
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:10
|
||||
@@ -155,7 +155,7 @@ jobs:
|
||||
bundle exec rake knapsack_pro:rspec
|
||||
|
||||
knapsack_rspec_system_admin:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-22.04
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:10
|
||||
@@ -233,7 +233,7 @@ jobs:
|
||||
if-no-files-found: ignore
|
||||
|
||||
knapsack_rspec_system_consumer:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-22.04
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:10
|
||||
@@ -311,7 +311,7 @@ jobs:
|
||||
if-no-files-found: ignore
|
||||
|
||||
knapsack_rspec_engines:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-22.04
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:10
|
||||
@@ -389,7 +389,7 @@ jobs:
|
||||
if-no-files-found: ignore
|
||||
|
||||
knapsack_rspec_test_the_rest:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-22.04
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:10
|
||||
@@ -459,7 +459,7 @@ jobs:
|
||||
bundle exec rake knapsack_pro:rspec
|
||||
|
||||
non_knapsack_jest_karma:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-22.04
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:10
|
||||
|
||||
@@ -40,6 +40,7 @@ Metrics/BlockLength:
|
||||
"resources",
|
||||
"scenario",
|
||||
"shared_examples",
|
||||
"shared_examples_for",
|
||||
"xdescribe",
|
||||
]
|
||||
|
||||
|
||||
@@ -1,41 +1,11 @@
|
||||
# This configuration was generated by
|
||||
# `rubocop --auto-gen-config --auto-gen-only-exclude --exclude-limit 1400`
|
||||
# on 2023-04-14 06:27:24 UTC using RuboCop version 1.50.1.
|
||||
# `rubocop --auto-gen-config --auto-gen-only-exclude --exclude-limit 1400 --no-auto-gen-timestamp`
|
||||
# using RuboCop version 1.50.2.
|
||||
# The point is for the user to remove these configuration records
|
||||
# one by one as the offenses are removed from the code base.
|
||||
# Note that changes in the inspected code, or installation of new
|
||||
# versions of RuboCop, may require this file to be generated again.
|
||||
|
||||
# Offense count: 4
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
# Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include.
|
||||
# Include: **/*.gemfile, **/Gemfile, **/gems.rb
|
||||
Bundler/OrderedGems:
|
||||
Exclude:
|
||||
- 'Gemfile'
|
||||
|
||||
# Offense count: 4
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
# Configuration parameters: Severity, Include.
|
||||
# Include: **/*.gemspec
|
||||
Gemspec/DeprecatedAttributeAssignment:
|
||||
Exclude:
|
||||
- 'engines/catalog/catalog.gemspec'
|
||||
- 'engines/dfc_provider/dfc_provider.gemspec'
|
||||
- 'engines/order_management/order_management.gemspec'
|
||||
- 'engines/web/web.gemspec'
|
||||
|
||||
# Offense count: 4
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
# Configuration parameters: Severity, Include.
|
||||
# Include: **/*.gemspec
|
||||
Gemspec/RequireMFA:
|
||||
Exclude:
|
||||
- 'engines/catalog/catalog.gemspec'
|
||||
- 'engines/dfc_provider/dfc_provider.gemspec'
|
||||
- 'engines/order_management/order_management.gemspec'
|
||||
- 'engines/web/web.gemspec'
|
||||
|
||||
# Offense count: 4
|
||||
# Configuration parameters: Severity, Include.
|
||||
# Include: **/*.gemspec
|
||||
@@ -114,13 +84,6 @@ Layout/EmptyLinesAroundBlockBody:
|
||||
- 'spec/requests/checkout/concurrency_spec.rb'
|
||||
- 'spec/system/admin/order_cycles/list_spec.rb'
|
||||
|
||||
# Offense count: 1
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
# Configuration parameters: AllowForAlignment, AllowBeforeTrailingComments, ForceEqualSignAlignment.
|
||||
Layout/ExtraSpacing:
|
||||
Exclude:
|
||||
- 'spec/spec_helper.rb'
|
||||
|
||||
# Offense count: 2
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
# Configuration parameters: EnforcedStyle, IndentationWidth.
|
||||
@@ -236,7 +199,7 @@ Layout/LineEndStringConcatenationIndentation:
|
||||
- 'spec/system/consumer/cookies_spec.rb'
|
||||
- 'spec/system/consumer/shopping/cart_spec.rb'
|
||||
|
||||
# Offense count: 605
|
||||
# Offense count: 615
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
# Configuration parameters: Max, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
|
||||
# URISchemes: http, https
|
||||
@@ -449,7 +412,7 @@ Layout/TrailingEmptyLines:
|
||||
Exclude:
|
||||
- 'Rakefile'
|
||||
|
||||
# Offense count: 67
|
||||
# Offense count: 70
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
# Configuration parameters: AllowInHeredoc.
|
||||
Layout/TrailingWhitespace:
|
||||
|
||||
@@ -71,5 +71,5 @@ From here, your pull request will progress through the [Review, Test, Merge & De
|
||||
[slack-dev]: https://openfoodnetwork.slack.com/messages/C2GQ45KNU
|
||||
[ofn-transifex]: https://www.transifex.com/open-food-foundation/open-food-network/
|
||||
[i18n]: https://github.com/openfoodfoundation/openfoodnetwork/wiki/Internationalisation-%28i18n%29
|
||||
[welcome-dev]: https://github.com/orgs/openfoodfoundation/projects/2
|
||||
[welcome-dev]: https://github.com/orgs/openfoodfoundation/projects/5
|
||||
[ci]: https://github.com/openfoodfoundation/openfoodnetwork/wiki/Continuous-Integration
|
||||
|
||||
9
Gemfile
9
Gemfile
@@ -14,11 +14,11 @@ gem "aws-sdk-s3", require: false
|
||||
gem "image_processing"
|
||||
|
||||
gem 'activemerchant', '>= 1.78.0'
|
||||
gem 'rexml'
|
||||
gem 'angular-rails-templates', '>= 0.3.0'
|
||||
gem 'awesome_nested_set'
|
||||
gem 'ransack', '~> 2.6.0'
|
||||
gem 'responders'
|
||||
gem 'rexml'
|
||||
gem 'webpacker', '~> 5'
|
||||
|
||||
gem 'i18n'
|
||||
@@ -70,8 +70,8 @@ gem 'rswag-api'
|
||||
gem 'rswag-ui'
|
||||
|
||||
gem 'omniauth_openid_connect'
|
||||
gem 'openid_connect', '~> 1.3'
|
||||
gem 'omniauth-rails_csrf_protection'
|
||||
gem 'openid_connect', '~> 1.3'
|
||||
|
||||
gem 'angularjs-rails', '1.8.0'
|
||||
gem 'bugsnag'
|
||||
@@ -150,6 +150,7 @@ group :test, :development do
|
||||
gem 'capybara'
|
||||
gem 'cuprite'
|
||||
gem 'database_cleaner', require: false
|
||||
gem 'debug', '>= 1.0.0'
|
||||
gem "factory_bot_rails", '6.2.0', require: false
|
||||
gem 'fuubar', '~> 2.5.1'
|
||||
gem 'json_spec', '~> 1.1.4'
|
||||
@@ -160,7 +161,6 @@ group :test, :development do
|
||||
gem 'rswag-specs'
|
||||
gem 'shoulda-matchers'
|
||||
gem 'timecop'
|
||||
gem 'debug', '>= 1.0.0'
|
||||
end
|
||||
|
||||
group :test do
|
||||
@@ -175,10 +175,11 @@ end
|
||||
|
||||
group :development do
|
||||
gem 'debugger-linecache'
|
||||
gem 'rails-erd'
|
||||
gem 'foreman'
|
||||
gem 'listen'
|
||||
gem 'pry', '~> 0.13.0'
|
||||
gem 'query_count'
|
||||
gem 'rails-erd'
|
||||
gem 'rubocop'
|
||||
gem 'rubocop-rails'
|
||||
gem 'spring'
|
||||
|
||||
42
Gemfile.lock
42
Gemfile.lock
@@ -137,7 +137,7 @@ GEM
|
||||
activerecord (>= 6.0, < 7.1)
|
||||
acts_as_list (1.0.4)
|
||||
activerecord (>= 4.2)
|
||||
addressable (2.8.2)
|
||||
addressable (2.8.4)
|
||||
public_suffix (>= 2.0.2, < 6.0)
|
||||
aes_key_wrap (1.1.0)
|
||||
afm (0.2.2)
|
||||
@@ -157,7 +157,7 @@ GEM
|
||||
awesome_nested_set (3.5.0)
|
||||
activerecord (>= 4.0.0, < 7.1)
|
||||
aws-eventstream (1.2.0)
|
||||
aws-partitions (1.742.0)
|
||||
aws-partitions (1.750.0)
|
||||
aws-sdk-core (3.171.0)
|
||||
aws-eventstream (~> 1, >= 1.0.2)
|
||||
aws-partitions (~> 1, >= 1.651.0)
|
||||
@@ -166,7 +166,7 @@ GEM
|
||||
aws-sdk-kms (1.63.0)
|
||||
aws-sdk-core (~> 3, >= 3.165.0)
|
||||
aws-sigv4 (~> 1.1)
|
||||
aws-sdk-s3 (1.120.1)
|
||||
aws-sdk-s3 (1.121.0)
|
||||
aws-sdk-core (~> 3, >= 3.165.0)
|
||||
aws-sdk-kms (~> 1)
|
||||
aws-sigv4 (~> 1.4)
|
||||
@@ -235,10 +235,10 @@ GEM
|
||||
database_cleaner-core (~> 2.0.0)
|
||||
database_cleaner-core (2.0.1)
|
||||
date (3.3.3)
|
||||
ddtrace (1.10.1)
|
||||
ddtrace (1.11.0)
|
||||
debase-ruby_core_source (>= 0.10.16, <= 3.2.0)
|
||||
libdatadog (~> 2.0.0.1.0)
|
||||
libddwaf (~> 1.6.2.0.0)
|
||||
libddwaf (~> 1.8.2.0.0)
|
||||
msgpack
|
||||
debase-ruby_core_source (3.2.0)
|
||||
debug (1.7.2)
|
||||
@@ -338,7 +338,7 @@ GEM
|
||||
hiredis (0.6.3)
|
||||
htmlentities (4.3.4)
|
||||
httpclient (2.8.3)
|
||||
i18n (1.12.0)
|
||||
i18n (1.13.0)
|
||||
concurrent-ruby (~> 1.0)
|
||||
i18n-js (3.9.2)
|
||||
i18n (>= 0.6.6)
|
||||
@@ -373,14 +373,14 @@ GEM
|
||||
jsonapi-serializer (2.2.0)
|
||||
activesupport (>= 4.2)
|
||||
jwt (2.7.0)
|
||||
knapsack_pro (3.9.0)
|
||||
knapsack_pro (3.10.0)
|
||||
rake
|
||||
launchy (2.5.0)
|
||||
addressable (~> 2.7)
|
||||
letter_opener (1.8.1)
|
||||
launchy (>= 2.2, < 3)
|
||||
libdatadog (2.0.0.1.0)
|
||||
libddwaf (1.6.2.0.0)
|
||||
libddwaf (1.8.2.0.0)
|
||||
ffi (~> 1.0)
|
||||
libv8-node (16.10.0.0)
|
||||
listen (3.8.0)
|
||||
@@ -405,7 +405,7 @@ GEM
|
||||
rake
|
||||
mini_magick (4.11.0)
|
||||
mini_mime (1.1.2)
|
||||
mini_portile2 (2.8.1)
|
||||
mini_portile2 (2.8.2)
|
||||
mini_racer (0.6.3)
|
||||
libv8-node (~> 16.10.0.0)
|
||||
minitest (5.18.0)
|
||||
@@ -413,7 +413,7 @@ GEM
|
||||
money (~> 6.12)
|
||||
money (6.16.0)
|
||||
i18n (>= 0.6.4, <= 2)
|
||||
msgpack (1.6.1)
|
||||
msgpack (1.7.0)
|
||||
multi_json (1.15.0)
|
||||
multi_xml (0.6.0)
|
||||
net-imap (0.3.4)
|
||||
@@ -487,9 +487,12 @@ GEM
|
||||
public_suffix (5.0.1)
|
||||
puma (6.2.2)
|
||||
nio4r (~> 2.0)
|
||||
query_count (1.1.1)
|
||||
activerecord (>= 4.2)
|
||||
railties (>= 4.2)
|
||||
raabro (1.4.0)
|
||||
racc (1.6.2)
|
||||
rack (2.2.6.4)
|
||||
rack (2.2.7)
|
||||
rack-mini-profiler (2.3.4)
|
||||
rack (>= 1.2.0)
|
||||
rack-oauth2 (1.21.3)
|
||||
@@ -583,7 +586,7 @@ GEM
|
||||
rspec-core (~> 3.12.0)
|
||||
rspec-expectations (~> 3.12.0)
|
||||
rspec-mocks (~> 3.12.0)
|
||||
rspec-core (3.12.1)
|
||||
rspec-core (3.12.2)
|
||||
rspec-support (~> 3.12.0)
|
||||
rspec-expectations (3.12.2)
|
||||
diff-lcs (>= 1.2.0, < 2.0)
|
||||
@@ -602,14 +605,14 @@ GEM
|
||||
rspec-retry (0.6.2)
|
||||
rspec-core (> 3.3)
|
||||
rspec-support (3.12.0)
|
||||
rswag-api (2.8.0)
|
||||
rswag-api (2.9.0)
|
||||
railties (>= 3.1, < 7.1)
|
||||
rswag-specs (2.8.0)
|
||||
rswag-specs (2.9.0)
|
||||
activesupport (>= 3.1, < 7.1)
|
||||
json-schema (>= 2.2, < 4.0)
|
||||
railties (>= 3.1, < 7.1)
|
||||
rspec-core (>= 2.14)
|
||||
rswag-ui (2.8.0)
|
||||
rswag-ui (2.9.0)
|
||||
actionpack (>= 3.1, < 7.1)
|
||||
railties (>= 3.1, < 7.1)
|
||||
rubocop (1.50.2)
|
||||
@@ -652,11 +655,11 @@ GEM
|
||||
semantic_range (3.0.0)
|
||||
shoulda-matchers (5.3.0)
|
||||
activesupport (>= 5.2.0)
|
||||
sidekiq (7.0.8)
|
||||
sidekiq (7.1.0)
|
||||
concurrent-ruby (< 2)
|
||||
connection_pool (>= 2.3.0)
|
||||
rack (>= 2.2.4)
|
||||
redis-client (>= 0.11.0)
|
||||
redis-client (>= 0.14.0)
|
||||
sidekiq-scheduler (5.0.2)
|
||||
rufus-scheduler (~> 3.2)
|
||||
sidekiq (>= 6, < 8)
|
||||
@@ -697,7 +700,7 @@ GEM
|
||||
rack (>= 2, < 4)
|
||||
railties (>= 5.2, < 8)
|
||||
redis (>= 4.0, < 6.0)
|
||||
stringex (2.8.5)
|
||||
stringex (2.8.6)
|
||||
stripe (8.5.0)
|
||||
swd (1.3.0)
|
||||
activesupport (>= 3)
|
||||
@@ -726,7 +729,7 @@ GEM
|
||||
activemodel (>= 3.0.0)
|
||||
public_suffix
|
||||
vcr (6.1.0)
|
||||
view_component (2.82.0)
|
||||
view_component (3.0.0)
|
||||
activesupport (>= 5.2.0, < 8.0)
|
||||
concurrent-ruby (~> 1.0)
|
||||
method_source (~> 1.0)
|
||||
@@ -857,6 +860,7 @@ DEPENDENCIES
|
||||
private_address_check
|
||||
pry (~> 0.13.0)
|
||||
puma
|
||||
query_count
|
||||
rack-mini-profiler (< 3.0.0)
|
||||
rack-rewrite
|
||||
rack-timeout
|
||||
|
||||
@@ -12,5 +12,6 @@ angular.module("ofn.admin", [
|
||||
"admin.orders"
|
||||
]).config ($httpProvider, $locationProvider, $qProvider) ->
|
||||
$httpProvider.defaults.headers.common["Accept"] = "application/json, text/javascript, */*"
|
||||
# for the next line, you should also probably check file: app/assets/javascripts/admin/utils/utils.js.coffee
|
||||
$locationProvider.hashPrefix('')
|
||||
$qProvider.errorOnUnhandledRejections(false)
|
||||
|
||||
@@ -15,7 +15,7 @@ $(document).ready(function() {
|
||||
console.log(msg);
|
||||
});
|
||||
}
|
||||
$('[data-hook=admin_order_edit_form] a.ship').click(handle_ship_click);
|
||||
$('.admin-order-edit-form a.ship').click(handle_ship_click);
|
||||
|
||||
//handle shipping method edit click
|
||||
$('a.edit-method').click(toggleMethodEdit);
|
||||
@@ -37,7 +37,7 @@ $(document).ready(function() {
|
||||
console.log(msg);
|
||||
});
|
||||
}
|
||||
$('[data-hook=admin_order_edit_form] a.save-method').click(handle_shipping_method_save);
|
||||
$('.admin-order-edit-form a.save-method').click(handle_shipping_method_save);
|
||||
|
||||
//handle tracking info edit/delete
|
||||
|
||||
@@ -64,8 +64,8 @@ $(document).ready(function() {
|
||||
return Spree.url( Spree.routes.orders_api + "/" + order_number + "/shipments/" + shipmentNumber + ".json");
|
||||
}
|
||||
|
||||
$('[data-hook=admin_order_edit_form] a.save-tracking').click(saveTrackingInfo);
|
||||
$('[data-hook=admin_order_edit_form] a.delete-tracking').click(deleteTrackingInfo);
|
||||
$('.admin-order-edit-form a.save-tracking').click(saveTrackingInfo);
|
||||
$('.admin-order-edit-form a.delete-tracking').click(deleteTrackingInfo);
|
||||
|
||||
// handle note edit/delete
|
||||
|
||||
@@ -96,8 +96,8 @@ $(document).ready(function() {
|
||||
});
|
||||
}
|
||||
|
||||
$('[data-hook=admin_order_edit_form] a.save-note').click(saveNote);
|
||||
$('[data-hook=admin_order_edit_form] a.delete-note').click(deleteNote);
|
||||
$('.admin-order-edit-form a.save-note').click(saveNote);
|
||||
$('.admin-order-edit-form a.delete-note').click(deleteNote);
|
||||
|
||||
// Makes API call for notes/tracking info
|
||||
makeApiCall = function(url, params) {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
angular.module("admin.utils", ["templates", "ngSanitize"]).config ($httpProvider, $locationProvider) ->
|
||||
# for the next line, you should also probably check file: app/assets/javascripts/admin/admin_ofn.js.coffee
|
||||
$locationProvider.hashPrefix('')
|
||||
$httpProvider.defaults.headers.common["Accept"] = "application/json, text/javascript, */*"
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class ConfirmModalComponent < ModalComponent
|
||||
def initialize(id:, confirm_actions: nil, controllers: nil, message: nil)
|
||||
def initialize(id:, confirm_actions: nil, controllers: nil, message: nil, confirm_reflexes: nil)
|
||||
super(id: id, close_button: true)
|
||||
@confirm_actions = confirm_actions
|
||||
@confirm_reflexes = confirm_reflexes
|
||||
@controllers = controllers
|
||||
@message = message
|
||||
end
|
||||
|
||||
@@ -7,4 +7,4 @@
|
||||
|
||||
.modal-actions
|
||||
%input{ class: "button icon-plus #{close_button_class}", type: 'button', value: t('js.admin.modals.cancel'), "data-action": "click->modal#close" }
|
||||
%input{ class: "button icon-plus primary", type: 'button', value: t('js.admin.modals.confirm'), "data-action": @confirm_actions }
|
||||
%input{ class: "button icon-plus primary", type: 'button', value: t('js.admin.modals.confirm'), "data-action": @confirm_actions, "data-reflex": @confirm_reflexes }
|
||||
|
||||
@@ -10,5 +10,12 @@ module WhiteLabel
|
||||
# if the distributor has the hide_ofn_navigation preference set to true
|
||||
# then we should hide the OFN navigation
|
||||
@hide_ofn_navigation = distributor.hide_ofn_navigation
|
||||
|
||||
# if the distributor has the hide_ofn_navigation preference
|
||||
# set to false, there is no need to check the white_label_logo preference
|
||||
return unless @hide_ofn_navigation
|
||||
|
||||
@white_label_logo = distributor.white_label_logo
|
||||
@white_label_distributor = distributor
|
||||
end
|
||||
end
|
||||
|
||||
@@ -9,11 +9,9 @@ module Spree
|
||||
helper CheckoutHelper
|
||||
|
||||
before_action :load_order, only: [:edit, :update, :fire, :resend,
|
||||
:invoice, :print]
|
||||
before_action :load_distribution_choices, only: [:new, :edit, :update]
|
||||
:invoice, :print, :distribution]
|
||||
before_action :load_distribution_choices, only: [:new, :edit, :update, :distribution]
|
||||
|
||||
# Ensure that the distributor is set for an order when
|
||||
before_action :ensure_distribution, only: :new
|
||||
before_action :require_distributor_abn, only: :invoice
|
||||
|
||||
respond_to :html, :json
|
||||
@@ -21,8 +19,20 @@ module Spree
|
||||
def new
|
||||
@order = Order.create
|
||||
@order.created_by = spree_current_user
|
||||
@order.generate_order_number
|
||||
@order.save
|
||||
redirect_to spree.edit_admin_order_url(@order)
|
||||
redirect_to spree.distribution_admin_order_path(@order)
|
||||
end
|
||||
|
||||
def distribution
|
||||
return if order_params.blank?
|
||||
|
||||
on_update
|
||||
|
||||
@order.assign_attributes(order_params)
|
||||
return unless @order.save(context: :set_distribution_step)
|
||||
|
||||
redirect_to spree.admin_order_customer_path(@order)
|
||||
end
|
||||
|
||||
def edit
|
||||
@@ -33,12 +43,7 @@ module Spree
|
||||
end
|
||||
|
||||
def update
|
||||
@order.recreate_all_fees!
|
||||
|
||||
unless @order.cart?
|
||||
@order.create_tax_charge!
|
||||
@order.update_order!
|
||||
end
|
||||
on_update
|
||||
|
||||
if params[:set_distribution_step] && @order.update(order_params)
|
||||
return redirect_to spree.admin_order_customer_path(@order)
|
||||
@@ -105,6 +110,15 @@ module Spree
|
||||
|
||||
private
|
||||
|
||||
def on_update
|
||||
@order.recreate_all_fees!
|
||||
|
||||
return if @order.cart?
|
||||
|
||||
@order.create_tax_charge!
|
||||
@order.update_order!
|
||||
end
|
||||
|
||||
def order_params
|
||||
return params[:order] if params[:order].blank?
|
||||
|
||||
@@ -142,17 +156,6 @@ module Spree
|
||||
ocs.closed +
|
||||
ocs.undated
|
||||
end
|
||||
|
||||
def ensure_distribution
|
||||
unless @order
|
||||
@order = Spree::Order.new
|
||||
@order.generate_order_number
|
||||
@order.save!
|
||||
end
|
||||
return if @order.distribution_set?
|
||||
|
||||
render 'set_distribution', locals: { order: @order }
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -7,7 +7,6 @@ module Spree
|
||||
before_action :load_data
|
||||
before_action :validate_payment_method_provider, only: [:create]
|
||||
before_action :load_hubs, only: [:new, :edit, :update]
|
||||
before_action :validate_calculator_preferred_value, only: [:update]
|
||||
|
||||
respond_to :html
|
||||
|
||||
@@ -17,6 +16,10 @@ module Spree
|
||||
@payment_method = payment_method_class.constantize.new(base_params)
|
||||
@object = @payment_method
|
||||
|
||||
if !base_params["calculator_type"] && gateway_params["calculator_type"]
|
||||
@payment_method.calculator_type = gateway_params["calculator_type"]
|
||||
end
|
||||
|
||||
load_hubs
|
||||
|
||||
if @payment_method.save
|
||||
@@ -44,6 +47,7 @@ module Spree
|
||||
redirect_to spree.edit_admin_payment_method_path(@payment_method)
|
||||
else
|
||||
respond_with(@payment_method)
|
||||
clear_preference_cache
|
||||
end
|
||||
end
|
||||
|
||||
@@ -182,33 +186,23 @@ module Spree
|
||||
end
|
||||
end
|
||||
|
||||
# Ensure the calculator to be updated is the correct type
|
||||
if params_for_update["calculator_type"] && params_for_update["calculator_attributes"]
|
||||
add_type_to_calculator_attributes(params_for_update)
|
||||
end
|
||||
|
||||
params_for_update
|
||||
end
|
||||
end
|
||||
|
||||
def validate_calculator_preferred_value
|
||||
return if calculator_preferred_values.all? do |value|
|
||||
preferred_value_from_params = gateway_params.dig(:calculator_attributes, value)
|
||||
preferred_value_from_params.nil? || Float(preferred_value_from_params,
|
||||
exception: false)
|
||||
def clear_preference_cache
|
||||
@payment_method.calculator.preferences.each_key do |key|
|
||||
Rails.cache.delete(@payment_method.calculator.preference_cache_key(key))
|
||||
end
|
||||
|
||||
flash[:error] = I18n.t(:calculator_preferred_value_error)
|
||||
redirect_to spree.edit_admin_payment_method_path(@payment_method)
|
||||
end
|
||||
|
||||
def calculator_preferred_values
|
||||
[
|
||||
:preferred_amount,
|
||||
:preferred_flat_percent,
|
||||
:preferred_flat_percent,
|
||||
:preferred_first_item,
|
||||
:preferred_additional_item,
|
||||
:preferred_max_items,
|
||||
:preferred_normal_amount,
|
||||
:preferred_discount_amount,
|
||||
:preferred_minimal_amount
|
||||
]
|
||||
def add_type_to_calculator_attributes(hash)
|
||||
hash["calculator_attributes"]["type"] = hash["calculator_type"]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -87,4 +87,10 @@ module EnterprisesHelper
|
||||
main_app.producers_url
|
||||
end
|
||||
end
|
||||
|
||||
def main_logo_link(enterprise)
|
||||
return enterprise.white_label_logo_link if enterprise&.white_label_logo_link.present?
|
||||
|
||||
main_app.root_path
|
||||
end
|
||||
end
|
||||
|
||||
@@ -29,8 +29,8 @@ module Spree
|
||||
|
||||
def preference_field_tag(name, value, options)
|
||||
case options[:type]
|
||||
when :integer
|
||||
text_field_tag(name, value, preference_field_options(options))
|
||||
when :integer, :decimal
|
||||
number_field_tag(name, value, preference_field_options(options))
|
||||
when :boolean
|
||||
hidden_field_tag(name, 0) +
|
||||
check_box_tag(name, 1, value, preference_field_options(options))
|
||||
@@ -49,8 +49,8 @@ module Spree
|
||||
|
||||
def preference_field_for(form, field, options, object)
|
||||
case options[:type]
|
||||
when :integer
|
||||
form.text_field(field, preference_field_options(options))
|
||||
when :integer, :decimal
|
||||
form.number_field(field, preference_field_options(options))
|
||||
when :boolean
|
||||
form.check_box(field, preference_field_options(options))
|
||||
when :string
|
||||
@@ -80,26 +80,24 @@ module Spree
|
||||
end
|
||||
|
||||
def preference_field_options(options)
|
||||
field_options = case options[:type]
|
||||
when :integer
|
||||
{ size: 10,
|
||||
class: 'input_integer' }
|
||||
when :boolean
|
||||
{}
|
||||
when :string
|
||||
{ size: 10,
|
||||
class: 'input_string fullwidth' }
|
||||
when :password
|
||||
{ size: 10,
|
||||
class: 'password_string fullwidth' }
|
||||
when :text
|
||||
{ rows: 15,
|
||||
cols: 85,
|
||||
class: 'fullwidth' }
|
||||
else
|
||||
{ size: 10,
|
||||
class: 'input_string fullwidth' }
|
||||
end
|
||||
field_options =
|
||||
case options[:type]
|
||||
when :integer
|
||||
{ size: 10, class: 'input_integer', step: 1 }
|
||||
when :decimal
|
||||
# Allow any number of decimal places
|
||||
{ size: 10, class: 'input_integer', step: :any }
|
||||
when :boolean
|
||||
{}
|
||||
when :string
|
||||
{ size: 10, class: 'input_string fullwidth' }
|
||||
when :password
|
||||
{ size: 10, class: 'password_string fullwidth' }
|
||||
when :text
|
||||
{ rows: 15, cols: 85, class: 'fullwidth' }
|
||||
else
|
||||
{ size: 10, class: 'input_string fullwidth' }
|
||||
end
|
||||
|
||||
field_options.merge!(
|
||||
readonly: options[:readonly],
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
# frozen_string_literal: false
|
||||
|
||||
require 'spree/localized_number'
|
||||
|
||||
module Calculator
|
||||
class FlatPercentItemTotal < Spree::Calculator
|
||||
extend Spree::LocalizedNumber
|
||||
|
||||
preference :flat_percent, :decimal, default: 0
|
||||
|
||||
localize_number :preferred_flat_percent
|
||||
validates :preferred_flat_percent,
|
||||
numericality: true
|
||||
|
||||
def self.description
|
||||
Spree.t(:flat_percent)
|
||||
|
||||
@@ -1,18 +1,15 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'spree/localized_number'
|
||||
|
||||
class Calculator::FlatPercentPerItem < Spree::Calculator
|
||||
# Spree's FlatPercentItemTotal calculator sums all amounts, and then calculates a percentage
|
||||
# on them.
|
||||
# In the cart, we display line item individual amounts rounded, so to have consistent
|
||||
# calculations we do the same internally. Here, we round adjustments at the individual
|
||||
# item level first, then multiply by the item quantity.
|
||||
extend Spree::LocalizedNumber
|
||||
|
||||
preference :flat_percent, :decimal, default: 0
|
||||
|
||||
localize_number :preferred_flat_percent
|
||||
validates :preferred_flat_percent,
|
||||
numericality: true
|
||||
|
||||
def self.description
|
||||
I18n.t(:flat_percent_per_item)
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
# frozen_string_literal: false
|
||||
|
||||
require 'spree/localized_number'
|
||||
|
||||
module Calculator
|
||||
class FlatRate < Spree::Calculator
|
||||
extend Spree::LocalizedNumber
|
||||
|
||||
preference :amount, :decimal, default: 0
|
||||
|
||||
localize_number :preferred_amount
|
||||
validates :preferred_amount,
|
||||
numericality: true
|
||||
|
||||
def self.description
|
||||
I18n.t(:flat_rate_per_order)
|
||||
|
||||
@@ -1,17 +1,14 @@
|
||||
# frozen_string_literal: false
|
||||
|
||||
require 'spree/localized_number'
|
||||
|
||||
module Calculator
|
||||
class FlexiRate < Spree::Calculator
|
||||
extend Spree::LocalizedNumber
|
||||
|
||||
preference :first_item, :decimal, default: 0.0
|
||||
preference :additional_item, :decimal, default: 0.0
|
||||
preference :max_items, :integer, default: 0
|
||||
|
||||
localize_number :preferred_first_item,
|
||||
:preferred_additional_item
|
||||
validates :preferred_first_item,
|
||||
:preferred_additional_item,
|
||||
numericality: true
|
||||
|
||||
def self.description
|
||||
I18n.t(:flexible_rate)
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
# frozen_string_literal: false
|
||||
|
||||
require 'spree/localized_number'
|
||||
|
||||
module Calculator
|
||||
class PerItem < Spree::Calculator
|
||||
extend Spree::LocalizedNumber
|
||||
|
||||
preference :amount, :decimal, default: 0
|
||||
|
||||
localize_number :preferred_amount
|
||||
validates :preferred_amount,
|
||||
numericality: true
|
||||
|
||||
def self.description
|
||||
I18n.t(:flat_rate_per_item)
|
||||
|
||||
@@ -1,18 +1,15 @@
|
||||
# frozen_string_literal: false
|
||||
|
||||
require 'spree/localized_number'
|
||||
|
||||
module Calculator
|
||||
class PriceSack < Spree::Calculator
|
||||
extend Spree::LocalizedNumber
|
||||
|
||||
preference :minimal_amount, :decimal, default: 0
|
||||
preference :normal_amount, :decimal, default: 0
|
||||
preference :discount_amount, :decimal, default: 0
|
||||
|
||||
localize_number :preferred_minimal_amount,
|
||||
:preferred_normal_amount,
|
||||
:preferred_discount_amount
|
||||
validates :preferred_minimal_amount,
|
||||
:preferred_normal_amount,
|
||||
:preferred_discount_amount,
|
||||
numericality: true
|
||||
|
||||
def self.description
|
||||
I18n.t(:price_sack)
|
||||
|
||||
@@ -15,6 +15,10 @@ class Enterprise < ApplicationRecord
|
||||
medium: { resize_to_fill: [720, 156] },
|
||||
large: { resize_to_fill: [1200, 260] },
|
||||
}.freeze
|
||||
WHITE_LABEL_LOGO_SIZES = {
|
||||
default: { gravity: "Center", resize_to_fill: [217, 44] },
|
||||
mobile: { gravity: "Center", resize_to_fill: [75, 26] },
|
||||
}.freeze
|
||||
VALID_INSTAGRAM_REGEX = %r{\A[a-zA-Z0-9._]{1,30}([^/-]*)\z}
|
||||
|
||||
searchable_attributes :sells, :is_primary_producer, :name
|
||||
@@ -84,6 +88,7 @@ class Enterprise < ApplicationRecord
|
||||
has_one_attached :logo
|
||||
has_one_attached :promo_image
|
||||
has_one_attached :terms_and_conditions
|
||||
has_one_attached :white_label_logo
|
||||
|
||||
validates :logo,
|
||||
processable_image: true,
|
||||
@@ -302,6 +307,14 @@ class Enterprise < ApplicationRecord
|
||||
)
|
||||
end
|
||||
|
||||
def white_label_logo_url(name = :default)
|
||||
return unless white_label_logo.variable?
|
||||
|
||||
Rails.application.routes.url_helpers.url_for(
|
||||
white_label_logo.variant(WHITE_LABEL_LOGO_SIZES[name])
|
||||
)
|
||||
end
|
||||
|
||||
def website
|
||||
strip_url self[:website]
|
||||
end
|
||||
|
||||
@@ -31,6 +31,6 @@ class ReportBlob < ActiveStorage::Blob
|
||||
end
|
||||
|
||||
def result
|
||||
@result ||= download
|
||||
@result ||= download.force_encoding(Encoding::UTF_8)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -274,7 +274,7 @@ module Spree
|
||||
# Enterprise User can access orders that are placed inside a OC they coordinate
|
||||
order.order_cycle&.coordinated_by?(user)
|
||||
end
|
||||
can [:admin, :bulk_management, :managed], Spree::Order do
|
||||
can [:admin, :bulk_management, :managed, :distribution], Spree::Order do
|
||||
user.admin? || user.enterprises.any?(&:is_distributor)
|
||||
end
|
||||
can [:admin, :create, :show, :poll], :invoice
|
||||
|
||||
@@ -88,7 +88,6 @@ module Spree
|
||||
# Default mail headers settings
|
||||
preference :mails_from, :string, default: 'ofn@example.com'
|
||||
preference :mail_bcc, :string, default: 'ofn@example.com'
|
||||
preference :intercept_email, :string, default: nil
|
||||
|
||||
# Default smtp settings
|
||||
preference :mail_host, :string, default: 'localhost'
|
||||
|
||||
@@ -97,6 +97,8 @@ module Spree
|
||||
validates :email, presence: true,
|
||||
format: /\A([\w.%+\-']+)@([\w\-]+\.)+(\w{2,})\z/i,
|
||||
if: :require_email
|
||||
validates :order_cycle, presence: true, on: :set_distribution_step
|
||||
validates :distributor, presence: true, on: :set_distribution_step
|
||||
|
||||
make_permalink field: :number
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ module Spree
|
||||
# first unshipped that's leaving from a stock_location that stocks this variant
|
||||
def determine_target_shipment(variant)
|
||||
target_shipment = order.shipments.detect do |shipment|
|
||||
(shipment.ready? || shipment.pending?) && shipment.include?(variant)
|
||||
(shipment.ready? || shipment.pending?) && shipment.contains?(variant)
|
||||
end
|
||||
|
||||
target_shipment || order.shipments.detect do |shipment|
|
||||
|
||||
@@ -17,6 +17,7 @@ module Spree
|
||||
|
||||
validates :name, presence: true
|
||||
validate :distributor_validation
|
||||
validates_associated :calculator
|
||||
|
||||
after_initialize :init
|
||||
|
||||
@@ -40,9 +41,8 @@ module Spree
|
||||
where(id: non_unique_matches.map(&:id))
|
||||
}
|
||||
|
||||
scope :for_distributor, lambda { |distributor|
|
||||
joins(:distributors).
|
||||
where('enterprises.id = ?', distributor)
|
||||
scope :for_distributor, ->(distributor) {
|
||||
joins(:distributors).where('enterprises.id = ?', distributor)
|
||||
}
|
||||
|
||||
scope :for_subscriptions, -> { where(type: Subscription::ALLOWED_PAYMENT_METHOD_TYPES) }
|
||||
|
||||
@@ -22,7 +22,8 @@ module Spree
|
||||
when :password
|
||||
self[:value].to_s
|
||||
when :decimal
|
||||
BigDecimal(self[:value].to_s).round(2, BigDecimal::ROUND_HALF_UP)
|
||||
BigDecimal(self[:value].to_s, exception: false)&.round(2, BigDecimal::ROUND_HALF_UP) ||
|
||||
self[:value]
|
||||
when :integer
|
||||
self[:value].to_i
|
||||
when :boolean
|
||||
|
||||
@@ -117,7 +117,7 @@ module Spree
|
||||
value.to_s
|
||||
when :decimal
|
||||
value = 0 if value.blank?
|
||||
BigDecimal(value.to_s).round(2, BigDecimal::ROUND_HALF_UP)
|
||||
BigDecimal(value.to_s, exception: false)&.round(2, BigDecimal::ROUND_HALF_UP) || value
|
||||
when :integer
|
||||
value.to_i
|
||||
when :boolean
|
||||
|
||||
@@ -246,7 +246,7 @@ module Spree
|
||||
@tracking_url ||= shipping_method.build_tracking_url(tracking)
|
||||
end
|
||||
|
||||
def include?(variant)
|
||||
def contains?(variant)
|
||||
inventory_units_for(variant).present?
|
||||
end
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ module Spree
|
||||
# Here we allow checkout with shipping methods without zones (see issue #3928 for details)
|
||||
# and also checkout with addresses outside of the zones of the selected shipping method
|
||||
# This method could be used, like in Spree, to validate shipping method zones on checkout.
|
||||
def include?(address)
|
||||
def delivers_to?(address)
|
||||
address.present?
|
||||
end
|
||||
|
||||
|
||||
@@ -69,7 +69,8 @@ module Spree
|
||||
return 0 unless category
|
||||
|
||||
address ||= Address.new(country_id: DefaultCountry.id)
|
||||
rate = category.tax_rates.detect { |tax_rate| tax_rate.zone.include? address }.try(:amount)
|
||||
rate = category.tax_rates
|
||||
.detect { |tax_rate| tax_rate.zone.contains_address? address }.try(:amount)
|
||||
|
||||
rate || 0
|
||||
end
|
||||
|
||||
@@ -24,7 +24,7 @@ module Spree
|
||||
# do nothing - just here to satisfy the form
|
||||
end
|
||||
|
||||
def include?(address)
|
||||
def contains_address?(address)
|
||||
return false unless address
|
||||
|
||||
members.any? do |zone_member|
|
||||
@@ -44,7 +44,7 @@ module Spree
|
||||
def self.match(address)
|
||||
return unless matches = includes(:zone_members).
|
||||
order('zone_members_count', 'created_at').
|
||||
select { |zone| zone.include? address }
|
||||
select { |zone| zone.contains_address? address }
|
||||
|
||||
['state', 'country'].each do |zone_kind|
|
||||
if match = matches.detect { |zone| zone_kind == zone.kind }
|
||||
|
||||
12
app/reflexes/concerns/enterprise_concern.rb
Normal file
12
app/reflexes/concerns/enterprise_concern.rb
Normal file
@@ -0,0 +1,12 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module EnterpriseConcern
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
included do
|
||||
before_reflex do
|
||||
@enterprise = Enterprise.find_by(permalink: params[:id])
|
||||
authorize! :update, @enterprise
|
||||
end
|
||||
end
|
||||
end
|
||||
26
app/reflexes/white_label_reflex.rb
Normal file
26
app/reflexes/white_label_reflex.rb
Normal file
@@ -0,0 +1,26 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class WhiteLabelReflex < ApplicationReflex
|
||||
include EnterpriseConcern
|
||||
delegate :view_context, to: :controller
|
||||
|
||||
def remove_logo
|
||||
@enterprise.update!(white_label_logo: nil)
|
||||
# delete the white_label_logo_link attribute as well since it has no meaning without the logo
|
||||
@enterprise.update!(white_label_logo_link: "")
|
||||
|
||||
f = ActionView::Helpers::FormBuilder.new(:enterprise, @enterprise, view_context, {})
|
||||
|
||||
html = with_locale {
|
||||
render(partial: "admin/enterprises/form/white_label",
|
||||
locals: { f: f, enterprise: @enterprise })
|
||||
}
|
||||
morph "#white_label_panel", html
|
||||
|
||||
flash[:success] = with_locale {
|
||||
I18n.t("admin.enterprises.form.white_label.remove_logo_success")
|
||||
}
|
||||
cable_ready.dispatch_event(name: "modal:close")
|
||||
morph "#flashes", render(partial: "shared/flashes", locals: { flashes: flash })
|
||||
end
|
||||
end
|
||||
@@ -14,7 +14,8 @@ module Api
|
||||
:logo, :promo_image, :terms_and_conditions,
|
||||
:terms_and_conditions_file_name, :terms_and_conditions_updated_at,
|
||||
:preferred_invoice_order_by_supplier, :preferred_product_low_stock_display,
|
||||
:visible, :hide_ofn_navigation
|
||||
:visible, :hide_ofn_navigation, :white_label_logo,
|
||||
:white_label_logo_link
|
||||
|
||||
has_one :owner, serializer: Api::Admin::UserSerializer
|
||||
has_many :users, serializer: Api::Admin::UserSerializer
|
||||
@@ -29,6 +30,10 @@ module Api
|
||||
attachment_urls(object.promo_image, Enterprise::PROMO_IMAGE_SIZES)
|
||||
end
|
||||
|
||||
def white_label_logo
|
||||
attachment_urls(object.white_label_logo, Enterprise::WHITE_LABEL_LOGO_SIZES)
|
||||
end
|
||||
|
||||
def terms_and_conditions
|
||||
return unless object.terms_and_conditions.attached?
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ module Api
|
||||
:phone, :whatsapp_phone, :whatsapp_url, :visible, :email_address, :hash, :logo,
|
||||
:promo_image, :path, :category, :active, :producers, :orders_close_at, :hubs,
|
||||
:taxons, :supplied_taxons, :pickup, :delivery, :preferred_product_low_stock_display,
|
||||
:hide_ofn_navigation
|
||||
:hide_ofn_navigation, :white_label_logo, :white_label_logo_link
|
||||
|
||||
has_one :address, serializer: Api::AddressSerializer
|
||||
has_many :supplied_properties, serializer: Api::PropertySerializer
|
||||
@@ -49,6 +49,10 @@ module Api
|
||||
enterprise.promo_image_url(:large)
|
||||
end
|
||||
|
||||
def white_label_logo
|
||||
enterprise.white_label_logo_url
|
||||
end
|
||||
|
||||
def path
|
||||
enterprise_shop_path(enterprise)
|
||||
end
|
||||
|
||||
@@ -22,7 +22,6 @@ class MailConfiguration
|
||||
secure_connection_type: ENV.fetch('MAIL_SECURE_CONNECTION', 'None'),
|
||||
mails_from: ENV.fetch('MAILS_FROM', "no-reply@#{ENV.fetch('MAIL_DOMAIN')}"),
|
||||
mail_bcc: ENV.fetch('MAIL_BCC', ''),
|
||||
intercept_email: ''
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ module PermittedAttributes
|
||||
:show_customer_names_to_suppliers, :preferred_shopfront_product_sorting_method,
|
||||
:preferred_invoice_order_by_supplier,
|
||||
:preferred_product_low_stock_display,
|
||||
:hide_ofn_navigation
|
||||
:hide_ofn_navigation, :white_label_logo, :white_label_logo_link
|
||||
]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -8,6 +8,6 @@
|
||||
- @preference_sections.each do |preference_section|
|
||||
= render 'fieldset', name: preference_section[:name], preferences: preference_section[:preferences]
|
||||
|
||||
.form-buttons.filter-actions.actions{"data-hook" => "buttons"}
|
||||
.form-buttons.filter-actions.actions
|
||||
= button t(:update), 'icon-refresh'
|
||||
= link_to_with_icon 'icon-remove', t(:cancel), main_app.edit_admin_contents_path, class: 'button'
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
%col{style: "width: 18%;"}/
|
||||
%col{style: "width: 25%;"}/
|
||||
%thead
|
||||
%tr{"data-hook" => "enterprises_header"}
|
||||
%tr
|
||||
%th= t('.name')
|
||||
%th= t('.role')
|
||||
- if spree_current_user.admin?
|
||||
@@ -32,7 +32,7 @@
|
||||
%td= enterprise_form.check_box :visible, {}, 'public', 'hidden'
|
||||
- if spree_current_user.admin?
|
||||
%td= enterprise_form.select :owner_id, enterprise.users.map{ |e| [ e.email, e.id ] }, {}, class: "select2 fullwidth"
|
||||
%td{"data-hook" => "admin_users_index_row_actions"}
|
||||
%td
|
||||
= render 'actions', enterprise: enterprise
|
||||
- if @enterprises.empty?
|
||||
%tr
|
||||
|
||||
@@ -1,22 +1,21 @@
|
||||
%div#add_manager_modal
|
||||
%form{ "data-reflex": "submit->InviteManager#invite", "data-reflex-serialize-form": true }
|
||||
.margin-bottom-30.text-center
|
||||
.text-big
|
||||
= t('js.admin.modals.invite_title')
|
||||
%form#add_manager_modal{ 'data-reflex': 'submit->InviteManager#invite', 'data-reflex-serialize-form': true }
|
||||
.margin-bottom-30.text-center
|
||||
.text-big
|
||||
= t('js.admin.modals.invite_title')
|
||||
|
||||
- if success
|
||||
%p.alert-box.ok= t('user_invited', email: email)
|
||||
|
||||
- if error
|
||||
%p.alert-box.error= error
|
||||
|
||||
= text_field_tag :email, nil, class: 'fullwidth margin-bottom-20'
|
||||
= hidden_field_tag :enterprise_id, @enterprise&.id || enterprise.id
|
||||
|
||||
.modal-actions
|
||||
- if success
|
||||
%p.alert-box.ok= t('user_invited', email: email)
|
||||
|
||||
- if error
|
||||
%p.alert-box.error= error
|
||||
|
||||
= text_field_tag :email, nil, class: 'fullwidth margin-bottom-20'
|
||||
= hidden_field_tag :enterprise_id, @enterprise&.id || enterprise.id
|
||||
|
||||
.modal-actions
|
||||
- if success
|
||||
%input{ class: "button icon-plus secondary", type: 'button', value: t('js.admin.modals.close'), "data-action": "click->help-modal#close" }
|
||||
- else
|
||||
%input{ class: "button icon-plus secondary", type: 'button', value: t('js.admin.modals.cancel'), "data-action": "click->help-modal#close" }
|
||||
= submit_tag "#{t('js.admin.modals.invite')}"
|
||||
|
||||
%input{ class: "button icon-plus secondary", type: 'button', value: t('js.admin.modals.close'), "data-action": "click->help-modal#close" }
|
||||
- else
|
||||
%input{ class: "button icon-plus secondary", type: 'button', value: t('js.admin.modals.cancel'), "data-action": "click->help-modal#close" }
|
||||
= submit_tag "#{t('js.admin.modals.invite')}"
|
||||
|
||||
|
||||
@@ -1,6 +1,31 @@
|
||||
- @object ||= enterprise
|
||||
|
||||
.row
|
||||
.three.columns.alpha
|
||||
= f.label :hide_ofn_navigation, t('.hide_ofn_navigation')
|
||||
.three.columns
|
||||
= f.check_box :hide_ofn_navigation
|
||||
= f.check_box :hide_ofn_navigation, { "data-controller": "checkbox-display", "data-checkbox-display-target-id-value": "white_label_logo" }
|
||||
|
||||
%div{id: "white_label_logo"}
|
||||
.row
|
||||
.three.columns.alpha
|
||||
= f.label :white_label_logo, t('.upload_logo')
|
||||
.three.columns
|
||||
= image_tag @object.white_label_logo_url if @object.white_label_logo.present?
|
||||
= f.file_field :white_label_logo, accept: "image/*"
|
||||
- if @object.white_label_logo.present?
|
||||
%button.button.small{ type: "button", "data-controller": "modal-link", "data-action": "click->modal-link#open", "data-modal-link-target-value": "remove_logo" }
|
||||
= t('.remove_logo')
|
||||
|
||||
- if @object.white_label_logo.present?
|
||||
.row
|
||||
.three.columns.alpha
|
||||
= f.label :white_label_logo_link, t('.white_label_logo_link_label')
|
||||
.three.columns
|
||||
= f.text_field :white_label_logo_link
|
||||
|
||||
|
||||
- if @object.white_label_logo.present?
|
||||
= render ConfirmModalComponent.new(id: "remove_logo", confirm_reflexes: "click->WhiteLabel#remove_logo" ) do
|
||||
.margin-bottom-30
|
||||
= t('.remove_logo_confirm')
|
||||
|
||||
@@ -20,5 +20,5 @@
|
||||
= check_box_tag 'preferences[enterprise_number_required_on_invoices?]', '1', Spree::Config[:enterprise_number_required_on_invoices?]
|
||||
= label_tag nil, t('.enterprise_number_required_on_invoices?')
|
||||
|
||||
.form-buttons{"data-hook" => "buttons"}
|
||||
.form-buttons
|
||||
= button t(:update), 'icon-refresh'
|
||||
|
||||
@@ -23,5 +23,5 @@
|
||||
= preference_field_tag("preferences[#{:matomo_tag_manager_url}]", Spree::Config[:matomo_tag_manager_url], type: Spree::Config.preference_type(:matomo_tag_manager_url))
|
||||
.warning.note= t('.config_instructions_tag_manager_html')
|
||||
|
||||
.form-buttons{"data-hook" => "buttons"}
|
||||
.form-buttons
|
||||
= button t(:update), 'icon-refresh'
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
%fieldset.no-border-top
|
||||
.add_producer_properties{"data-hook" => "add_producer_properties"}
|
||||
.add_producer_properties
|
||||
= image_pack_tag 'spinner.gif', :plugin => 'spree', :style => 'display:none;', :id => 'busy_indicator'
|
||||
%table.index.sortable{"data-hook" => "", "data-sortable-link" => main_app.update_positions_admin_enterprise_producer_properties_url(@enterprise)}
|
||||
%table.index.sortable{"data-sortable-link" => main_app.update_positions_admin_enterprise_producer_properties_url(@enterprise)}
|
||||
%thead
|
||||
%tr{"data-hook" => "producer_properties_header"}
|
||||
%tr
|
||||
%th{colspan: "2"}= t('admin.products.properties.property_name')
|
||||
%th= t('admin.description')
|
||||
%th.actions
|
||||
%tbody#producer_properties{"data-hook" => ""}
|
||||
%tbody#producer_properties
|
||||
= f.fields_for :producer_properties do |pp_form|
|
||||
= render 'admin/producer_properties/producer_property_fields', f: pp_form
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
-# admin/admin.js.erb in spree requires id to start with "spree_" for sortable tables
|
||||
%tr.product_property.fields{"data-hook" => "producer_property", id: "spree_#{dom_id(f.object)}"}
|
||||
%tr.product_property.fields{id: "spree_#{dom_id(f.object)}"}
|
||||
%td.no-border
|
||||
%span.handle
|
||||
= f.hidden_field :id
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
- content_for :sub_menu do
|
||||
%ul#sub_nav.inline-menu{"data-hook" => "admin_enterprise_sub_tabs"}
|
||||
%ul#sub_nav.inline-menu
|
||||
= tab :enterprises, url: main_app.admin_enterprises_path
|
||||
= tab :enterprise_relationships, url: main_app.admin_enterprise_relationships_path
|
||||
- if ENV["OPENID_APP_ID"].present? && ENV["OPENID_APP_SECRET"].present?
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
- content_for :sub_menu do
|
||||
%ul#sub_nav.inline-menu{"data-hook" => "admin_user_sub_tabs"}
|
||||
%ul#sub_nav.inline-menu
|
||||
= tab :users, url: spree.admin_users_path
|
||||
= tab :roles, url: main_app.admin_enterprise_roles_path, match_path: '/enterprise_roles'
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
= f.label :stripe_connect_enabled, t('.stripe_connect_enabled')
|
||||
= f.check_box :stripe_connect_enabled, disabled: disabled
|
||||
.row
|
||||
.twelve.columns.alpha.omega.form-buttons{"data-hook" => "buttons"}
|
||||
.twelve.columns.alpha.omega.form-buttons
|
||||
= button t(:update), 'icon-refresh', value: "update"
|
||||
|
||||
%fieldset.no-border-bottom
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
%td.price.align-center {{ item.price_estimate | localizeCurrency }}
|
||||
%td.quantity {{ item.quantity }}
|
||||
%td.total.align-center {{ (item.price_estimate * item.quantity) | localizeCurrency }}
|
||||
%tbody#subtotal.no-border-top{"data-hook" => "admin_order_form_subtotal"}
|
||||
%tbody#subtotal.no-border-top
|
||||
%tr#subtotal-row
|
||||
%td{:colspan => "3"}
|
||||
%b
|
||||
@@ -85,7 +85,7 @@
|
||||
\:
|
||||
%td.total.align-center
|
||||
%span {{ subscription.estimatedSubtotal() | localizeCurrency }}
|
||||
%tbody#order-total.grand-total.no-border-top{"data-hook" => "admin_order_form_total"}
|
||||
%tbody#order-total.grand-total.no-border-top
|
||||
%tr
|
||||
%td{:colspan => "3"}
|
||||
%b
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
%td.total.align-center {{ (item.price_estimate * item.quantity) | localizeCurrency }}
|
||||
%td.actions
|
||||
%a.delete-item.icon-trash.no-text{ ng: { click: 'removeSubscriptionLineItem(item)'}, :href => "javascript:void(0)" }
|
||||
%tbody#subtotal.no-border-top{"data-hook" => "admin_order_form_subtotal"}
|
||||
%tbody#subtotal.no-border-top
|
||||
%tr#subtotal-row
|
||||
%td{:colspan => "3"}
|
||||
%b
|
||||
@@ -43,7 +43,7 @@
|
||||
%td.total.align-center
|
||||
%span#order_fees {{ subscription.estimatedFees() | localizeCurrency }}
|
||||
%td.actions
|
||||
%tbody#order-total.grand-total.no-border-top{"data-hook" => "admin_order_form_total"}
|
||||
%tbody#order-total.grand-total.no-border-top
|
||||
%tr
|
||||
%td{:colspan => "3"}
|
||||
%b
|
||||
|
||||
@@ -2,8 +2,11 @@
|
||||
%section.top-bar-section
|
||||
%ul.nav-logo
|
||||
%li.ofn-logo
|
||||
%a{href: main_app.root_path}
|
||||
%img{src: ContentConfig.url_for(:logo)}
|
||||
%a{href: main_logo_link(@white_label_distributor)}
|
||||
- if @white_label_logo&.variable?
|
||||
= image_tag @white_label_distributor.white_label_logo_url(:default)
|
||||
- else
|
||||
%img{src: ContentConfig.url_for(:logo)}
|
||||
%li.powered-by
|
||||
%img{src: '/favicon.ico'}
|
||||
%span
|
||||
|
||||
@@ -6,7 +6,10 @@
|
||||
%section.left
|
||||
.ofn-logo
|
||||
%a{href: main_app.root_path}
|
||||
%img{src: ContentConfig.url_for(:logo_mobile), srcset: ContentConfig.url_for(:logo_mobile_svg), width: "75", height: "26"}
|
||||
- if @white_label_logo&.variable?
|
||||
= image_tag @white_label_distributor.white_label_logo_url(:mobile)
|
||||
- else
|
||||
%img{src: ContentConfig.url_for(:logo_mobile), srcset: ContentConfig.url_for(:logo_mobile_svg), width: "75", height: "26"}
|
||||
|
||||
%section.right{"ng-cloak" => true}
|
||||
%span.cart-span{"ng-class" => "{ dirty: Cart.dirty || Cart.empty(), 'pure-dirty': Cart.dirty }"}
|
||||
|
||||
@@ -5,42 +5,42 @@
|
||||
%span.margin-top.hub-name-listing{"ng-bind" => "::hub.name | truncate:40"}
|
||||
|
||||
.columns.small-4.medium-2.large-2
|
||||
%span.margin-top{"ng-bind" => "::hub.address.city"}
|
||||
.columns.small-2.medium-1.large-1
|
||||
%span.margin-top{"ng-bind" => "::hub.address.state_name"}
|
||||
%span.margin-top.ellipsed{"ng-bind" => "::hub.address.city"}
|
||||
.columns.small-3.medium-2.large-2
|
||||
%span.margin-top.ellipsed{"ng-bind" => "::hub.address.state_name"}
|
||||
%span.margin-top{"ng-if" => "hub.distance != null && hub.distance > 0"} ({{ hub.distance / 1000 | number:0 }} km)
|
||||
|
||||
.columns.small-5.medium-3.large-3.text-right{"ng-if" => "::hub.active"}
|
||||
%a.hub.open_closed{"ng-href" => "{{::hub.path}}", "ng-attr-target" => "{{ embedded_layout ? '_blank' : undefined}}", "ng-class" => "{primary: hub.active, secondary: !hub.active}", "ofn-change-hub" => "hub"}
|
||||
%i.ofn-i_068-shop-reversed.show-for-medium-up
|
||||
%span.margin-top{ ng: { if: "::current()" } }
|
||||
.columns.small-5.medium-3.large-3.text-right.no-wrap.flex.flex-align-center.flex-justify-end{"ng-if" => "::hub.active"}
|
||||
%a.hub.open_closed.flex.flex-align-center{"ng-href" => "{{::hub.path}}", "ng-attr-target" => "{{ embedded_layout ? '_blank' : undefined}}", "ng-class" => "{primary: hub.active, secondary: !hub.active}", "ofn-change-hub" => "hub"}
|
||||
%span{ ng: { if: "::current()" } }
|
||||
%em= t :hubs_shopping_here
|
||||
%span.margin-top{ ng: { if: "::!current()" } }
|
||||
%span{ ng: { if: "::!current()" } }
|
||||
%span{"ng-bind" => "::hub.orders_close_at | sensible_timeframe"}
|
||||
%i.ofn-i_068-shop-reversed.show-for-medium-up
|
||||
%span{style: "margin-left: 0.5rem;"}
|
||||
%i{"ng-class" => "{'ofn-i_005-caret-down' : !open(), 'ofn-i_006-caret-up' : open()}"}
|
||||
|
||||
.columns.small-5.medium-3.large-3.text-right{"ng-if" => "::!hub.active"}
|
||||
%a.hub.open_closed{"ng-href" => "{{::hub.path}}", "ng-attr-target" => "{{ embedded_layout ? '_blank' : undefined}}", "ng-class" => "{primary: hub.active, secondary: !hub.active}", "ofn-change-hub" => "hub"}
|
||||
%span.margin-top{ ng: { if: "::current()" } }
|
||||
.columns.small-5.medium-3.large-3.text-right.no-wrap.flex.flex-align-center.flex-justify-end{"ng-if" => "::!hub.active"}
|
||||
%a.hub.open_closed.flex{"ng-href" => "{{::hub.path}}", "ng-attr-target" => "{{ embedded_layout ? '_blank' : undefined}}", "ng-class" => "{primary: hub.active, secondary: !hub.active}", "ofn-change-hub" => "hub"}
|
||||
%span{ ng: { if: "::current()" } }
|
||||
%em= t :hubs_shopping_here
|
||||
%span.margin-top{ ng: { if: "::!current()" } }
|
||||
%span{ ng: { if: "::!current()" } }
|
||||
= t :hubs_orders_closed
|
||||
%i.ofn-i_068-shop-reversed.show-for-medium-up
|
||||
|
||||
.columns.small-1.medium-1.large-1.text-right
|
||||
%span.margin-top
|
||||
%span{style: "margin-left: 0.5rem;"}
|
||||
%i{"ng-class" => "{'ofn-i_005-caret-down' : !open(), 'ofn-i_006-caret-up' : open()}"}
|
||||
|
||||
.row.active_table_row{"ng-if" => "!hub.is_distributor", "ng-class" => "closed"}
|
||||
.columns.small-12.medium-6.large-5.skinny-head
|
||||
%a.hub{"ng-click" => "openModal(hub)", "ng-class" => "{primary: hub.active, secondary: !hub.active}"}
|
||||
%i{ng: {class: "hub.icon_font"}}
|
||||
%span.margin-top.hub-name-listing{"ng-bind" => "::hub.name | truncate:40"}
|
||||
%span.hub-name-listing{"ng-bind" => "::hub.name | truncate:40"}
|
||||
|
||||
.columns.small-4.medium-2.large-2
|
||||
%span.margin-top{"ng-bind" => "::hub.address.city"}
|
||||
%span.ellipsed{"ng-bind" => "::hub.address.city"}
|
||||
.columns.small-2.medium-1.large-1
|
||||
%span.margin-top{"ng-bind" => "::hub.address.state_name"}
|
||||
%span.ellipsed{"ng-bind" => "::hub.address.state_name"}
|
||||
|
||||
.columns.small-6.medium-3.large-4.text-right
|
||||
%span.margin-top{ ng: { if: "::!current()" } }
|
||||
.columns.small-6.medium-3.large-4.text-right.no-wrap.flex.flex-align-center.flex-justify-end
|
||||
%span{ ng: { if: "::!current()" } }
|
||||
%em= t :hubs_profile_only
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
%table.index{"data-hook" => "adjustments"}
|
||||
%thead{"data-hook" => "adjustmment_head"}
|
||||
%table.index
|
||||
%thead
|
||||
%tr
|
||||
%th= "#{t('spree.date')}/#{t('spree.time')}"
|
||||
%th= t(:description)
|
||||
@@ -15,7 +15,7 @@
|
||||
- taxable = adjustment.adjustable_type == "Spree::Shipment" ? adjustment.adjustable : adjustment
|
||||
- tr_class = cycle('odd', 'even')
|
||||
- tr_id = spree_dom_id(adjustment)
|
||||
%tr{:class => tr_class, "data-hook" => "adjustment_row", :id => tr_id}
|
||||
%tr{:class => tr_class, :id => tr_id}
|
||||
%td.align-center.created_at
|
||||
= pretty_time(adjustment.created_at)
|
||||
%td.align-center.label
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.row{"data-hook" => "admin_adjustment_form_fields"}
|
||||
.row
|
||||
- if @adjustment.new_record?
|
||||
= render 'new_form', f: f
|
||||
- else
|
||||
|
||||
@@ -14,6 +14,6 @@
|
||||
= form_for @adjustment, :url => admin_order_adjustment_path(@order, @adjustment), :method => :put do |f|
|
||||
%fieldset.no-border-top
|
||||
= render :partial => 'form', :locals => { :f => f }
|
||||
.filter-actions.actions{"data-hook" => "buttons"}
|
||||
.filter-actions.actions
|
||||
= button Spree.t(:continue), 'icon-arrow-right'
|
||||
= link_to_with_icon 'icon-remove', Spree.t('actions.cancel'), admin_order_adjustments_url(@order), :class => 'button'
|
||||
|
||||
@@ -13,6 +13,6 @@
|
||||
= form_for @adjustment, :url => admin_order_adjustments_path do |f|
|
||||
%fieldset.no-border-top
|
||||
= render :partial => 'form', :locals => { :f => f }
|
||||
.filter-actions.actions{"data-hook" => "buttons"}
|
||||
.filter-actions.actions
|
||||
= button Spree.t(:continue), 'icon-arrow-right'
|
||||
= button_link_to Spree.t('actions.cancel'), admin_order_adjustments_url(@order), :icon => 'icon-remove'
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
= Spree.t(:general_settings)
|
||||
|
||||
= form_tag admin_general_settings_path, :method => :put do
|
||||
#preferences{"data-hook" => ""}
|
||||
#preferences
|
||||
|
||||
%fieldset.general.no-border-top
|
||||
- @preferences_general.each do |key|
|
||||
@@ -85,6 +85,6 @@
|
||||
= preference_field_tag("available_units[#{unit}]", selected, { type: :boolean, selected: selected })
|
||||
= label_tag(unit, unit.downcase) + tag(:br)
|
||||
|
||||
.form-buttons.filter-actions.actions{"data-hook" => "buttons"}
|
||||
.form-buttons.filter-actions.actions
|
||||
= button Spree.t('actions.update'), 'icon-refresh'
|
||||
= link_to_with_icon 'icon-remove', Spree.t('actions.cancel'), edit_admin_general_settings_url, :class => 'button'
|
||||
|
||||
@@ -18,10 +18,3 @@
|
||||
%br/
|
||||
%span.info
|
||||
= t("spree.smtp_send_copy_to_this_addresses")
|
||||
.field
|
||||
= label_tag :intercept_email, t("spree.intercept_email_address")
|
||||
%br/
|
||||
= text_field_tag :intercept_email, Spree::Config[:intercept_email], disabled: true, class: 'fullwidth'
|
||||
%br/
|
||||
%span.info
|
||||
= t("spree.intercept_email_instructions")
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
= render :partial => "spree/admin/variants/autocomplete", :formats => :js
|
||||
|
||||
#add-line-item{"data-hook" => ""}
|
||||
#add-line-item
|
||||
%fieldset.no-border-bottom
|
||||
%legend{:align => "center"}= Spree.t(:add_product)
|
||||
|
||||
- if @order.canceled?
|
||||
= t(".cannot_add_item_to_canceled_order")
|
||||
- else
|
||||
.field.nine.columns.alpha{"data-hook" => "add_product_name"}
|
||||
.field.nine.columns.alpha
|
||||
= label_tag :add_variant_id, Spree.t(:name_or_sku)
|
||||
= hidden_field_tag :add_variant_id, "", :class => "variant_autocomplete fullwidth"
|
||||
.five.columns.omega
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
%div{"data-hook" => "admin_orders_index_search"}
|
||||
%div.admin-orders-index-search
|
||||
= form_tag spree.admin_orders_url, {name: "orders_form", "ng-submit" => "fetchResults()"} do
|
||||
.field-block.alpha.four.columns
|
||||
.date-range-filter.field
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
%div{"data-hook" => "admin_order_form_fields"}
|
||||
%div.admin-order-form-fields
|
||||
- if @line_item.try(:errors).present?
|
||||
= render :partial => 'spree/shared/error_messages', :locals => { :target => @line_item }
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
= render :partial => "spree/admin/orders/_form/adjustments", :locals => { :adjustments => order_adjustments_for_display(@order), :title => t(".order_adjustments")}
|
||||
|
||||
- if order.line_items.exists?
|
||||
%fieldset#order-total.no-border-bottom{"data-hook" => "order_details_total"}
|
||||
%fieldset#order-total.no-border-bottom.order-details-total
|
||||
%legend{ align: 'center' }= t(".order_total")
|
||||
%span.order-total= order.display_total
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
%div{ :id => "shipment_#{shipment.id}" }
|
||||
%fieldset.no-border-bottom
|
||||
%legend.stock-location{ :align => "center", "data-hook" => "stock-location" }
|
||||
%legend.stock-location{ :align => "center" }
|
||||
%span.shipment-number
|
||||
= shipment.number
|
||||
= "-"
|
||||
@@ -10,7 +10,7 @@
|
||||
= "-"
|
||||
= link_to t(:ship), '#', :class => 'ship button icon-arrow-right', :data => { 'shipment-number' => shipment.number }
|
||||
|
||||
%table.stock-contents.index{ "data-hook" => "stock-contents" }
|
||||
%table.stock-contents.index
|
||||
%colgroup
|
||||
%col{ :style => "width: 10%;" }
|
||||
%col{ :style => "width: 30%;" }
|
||||
@@ -28,7 +28,7 @@
|
||||
= Spree.t(:quantity)
|
||||
%th.force-rounded-right
|
||||
= Spree.t(:total)
|
||||
%th.orders-actions.actions{ "data-hook" => "admin_order_form_line_items_header_actions" }
|
||||
%th.orders-actions.actions
|
||||
|
||||
%tbody{ "data-shipment-number" => "#{shipment.number}", "data-order-number" => "#{order.number}" }
|
||||
= render 'spree/admin/orders/shipment_manifest', order: order, shipment: shipment
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
%td.item-total.align-center
|
||||
= line_item_shipment_price(line_item, item.quantity)
|
||||
|
||||
%td.cart-item-delete.actions{ "data-hook" => "cart_item_delete" }
|
||||
%td.cart-item-delete.actions
|
||||
- if shipment.can_modify? && can?(:update, shipment)
|
||||
.flex
|
||||
= link_to '', '#', :class => 'save-item icon_link icon-ok no-text with-tip', :data => {'shipment-number' => shipment.number, 'variant-id' => item.variant.id, :action => 'save'}, :title => t('actions.save'), :style => 'display: none'
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
%fieldset.no-border-top{"data-hook" => "admin_customer_detail_form_fields"}
|
||||
%fieldset.index.no-border-bottom{"data-hook" => "customer_guest"}
|
||||
%fieldset.no-border-top
|
||||
%fieldset.index.no-border-bottom
|
||||
%legend{:align => "center"}= Spree.t(:account)
|
||||
.row{"data-hook" => "customer_fields"}
|
||||
.row
|
||||
.alpha.eight.columns.fullwidth
|
||||
.field
|
||||
= f.label :email, Spree.t(:email) + ':'
|
||||
= f.email_field :email, :class => 'fullwidth'
|
||||
|
||||
.alpha.eight.columns{"data-hook" => "bill_address_wrapper"}
|
||||
.alpha.eight.columns
|
||||
%fieldset.no-border-bottom
|
||||
%legend{:align => "center"}= Spree.t(:billing_address)
|
||||
= f.fields_for :bill_address do |ba_form|
|
||||
= render :partial => 'address_form', :locals => { :f => ba_form, :name => Spree.t(:billing_address), :use_billing => false }
|
||||
|
||||
.omega.eight.columns{"data-hook" => "ship_address_wrapper"}
|
||||
.omega.eight.columns
|
||||
%fieldset.no-border-bottom
|
||||
%legend{:align => "center"}= Spree.t(:shipping_address)
|
||||
= f.fields_for :ship_address do |sa_form|
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
.clear
|
||||
|
||||
.form-buttons.filter-actions.actions{"data-hook" => "buttons"}
|
||||
.form-buttons.filter-actions.actions
|
||||
= button Spree.t('actions.update'), 'icon-refresh'
|
||||
|
||||
- content_for :head do
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
%li= button_link_to Spree.t(:back_to_orders_list), admin_orders_path, :icon => 'icon-arrow-left'
|
||||
|
||||
- if @order.cart? || @order.address?
|
||||
#select-customer{"data-hook" => ""}
|
||||
#select-customer
|
||||
%fieldset.no-border-bottom
|
||||
%legend{:align => "center"}= Spree.t(:customer_search)
|
||||
- content_for :main_ng_app_name do
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
= render 'spree/shared/error_messages', :target => @order
|
||||
|
||||
%div{"ng-app" => "admin.orders", "ng-controller" => "orderCtrl"}
|
||||
= form_for @order, url: admin_order_url(@order), method: :put do |f|
|
||||
= form_for @order, url: distribution_admin_order_path(@order), method: :put do |f|
|
||||
= render 'spree/admin/orders/_form/distribution_fields'
|
||||
-# This param passed to stop validation error in next page due to no line items in order yet:
|
||||
= hidden_field_tag 'suppress_error_msg', "true"
|
||||
@@ -15,7 +15,7 @@
|
||||
= render partial: "spree/admin/shared/order_page_title"
|
||||
= render partial: "spree/admin/shared/order_tabs", locals: { current: 'Order Details' }
|
||||
|
||||
%div{"data-hook" => "admin_order_edit_header"}
|
||||
%div
|
||||
-# Suppress errors when manually creating a new order - needs to proceed to edit page
|
||||
-# without having line items (which otherwise gives a validation error)
|
||||
- unless params["suppress_error_msg"]
|
||||
@@ -31,5 +31,5 @@
|
||||
.no-objects-found
|
||||
= Spree.t(:your_order_is_empty_add_product)
|
||||
|
||||
%div{"data-hook" => "admin_order_edit_form"}
|
||||
%div.admin-order-edit-form
|
||||
= render :partial => 'form', :locals => { :order => @order }
|
||||
|
||||
@@ -3,6 +3,6 @@
|
||||
.alpha.four.columns
|
||||
= label :payment_method, :type, t('.provider')
|
||||
.omega.twelve.columns
|
||||
= collection_select(:payment_method, :type, @providers, :to_s, :clean_name, (!@object.persisted? ? { :selected => "Spree::PaymentMethod::Check"} : {}), { class: 'select2 fullwidth', 'provider-prefs-for' => "#{@object.id}"})
|
||||
= collection_select(:payment_method, :type, @providers, :to_s, :clean_name, {}, { class: 'select2 fullwidth', 'provider-prefs-for' => "#{@object.id}"})
|
||||
|
||||
%div{"ng-include" => "include_html" }
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
%tr.product_property.fields{"data-hook" => "product_property", id: "spree_#{dom_id(f.object)}"}
|
||||
%tr.product_property.fields{id: "spree_#{dom_id(f.object)}"}
|
||||
%td.no-border
|
||||
%span.handle
|
||||
= f.hidden_field :id
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
%div{"data-hook" => "admin_product_form_fields"}
|
||||
%div.admin-product-form-fields
|
||||
.left.twelve.columns.alpha
|
||||
= f.field_container :name do
|
||||
= f.label :name, raw(t(:name) + content_tag(:span, ' *', :class => 'required'))
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.row{"data-hook" => "admin_product_meta_form"}
|
||||
.row
|
||||
.alpha.eleven.columns
|
||||
= f.field_container :meta_keywords do
|
||||
= f.label :meta_keywords, t('admin.products.seo.product_search_keywords')
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
= t('.title')
|
||||
|
||||
- content_for :page_actions do
|
||||
%div{ :class => "toolbar", 'data-hook' => "toolbar" }
|
||||
%div{ :class => "toolbar" }
|
||||
%ul{ :class => "actions header-action-links inline-menu" }
|
||||
%li#new_product_link
|
||||
= button_link_to t(:new_product), new_object_url, { :icon => 'icon-plus', :id => 'admin_new_product' }
|
||||
|
||||
@@ -42,25 +42,26 @@
|
||||
%dd#date_complete
|
||||
= pretty_time(@order.completed_at)
|
||||
|
||||
%nav.menu
|
||||
%ul
|
||||
- customer_details_classes = "active" if current == "Customer Details"
|
||||
%li{ class: customer_details_classes }
|
||||
= link_to_with_icon 'icon-user', t(:customer_details), spree.admin_order_customer_url(@order)
|
||||
- if @order.distribution_set?
|
||||
%nav.menu
|
||||
%ul
|
||||
- customer_details_classes = "active" if current == "Customer Details"
|
||||
%li{ class: customer_details_classes }
|
||||
= link_to_with_icon 'icon-user', t(:customer_details), spree.admin_order_customer_url(@order)
|
||||
|
||||
- order_details_classes = "active" if current == "Order Details"
|
||||
%li{ class: order_details_classes }
|
||||
= link_to_with_icon 'icon-edit', t(:order_details), spree.edit_admin_order_url(@order)
|
||||
- order_details_classes = "active" if current == "Order Details"
|
||||
%li{ class: order_details_classes }
|
||||
= link_to_with_icon 'icon-edit', t(:order_details), spree.edit_admin_order_url(@order)
|
||||
|
||||
- payments_classes = "active" if current == "Payments"
|
||||
%li{ class: payments_classes }
|
||||
= link_to_with_icon 'icon-credit-card', t(:payments), spree.admin_order_payments_url(@order)
|
||||
- payments_classes = "active" if current == "Payments"
|
||||
%li{ class: payments_classes }
|
||||
= link_to_with_icon 'icon-credit-card', t(:payments), spree.admin_order_payments_url(@order)
|
||||
|
||||
- adjustments_classes = "active" if current == "Adjustments"
|
||||
%li{ class: adjustments_classes }
|
||||
= link_to_with_icon 'icon-cogs', t(:adjustments), spree.admin_order_adjustments_url(@order)
|
||||
- adjustments_classes = "active" if current == "Adjustments"
|
||||
%li{ class: adjustments_classes }
|
||||
= link_to_with_icon 'icon-cogs', t(:adjustments), spree.admin_order_adjustments_url(@order)
|
||||
|
||||
- if @order.completed?
|
||||
- authorizations_classes = "active" if current == "Return Authorizations"
|
||||
%li{ class: authorizations_classes }
|
||||
= link_to_with_icon 'icon-share-alt', t(:return_authorizations), spree.admin_order_return_authorizations_url(@order)
|
||||
- if @order.completed?
|
||||
- authorizations_classes = "active" if current == "Return Authorizations"
|
||||
%li{ class: authorizations_classes }
|
||||
= link_to_with_icon 'icon-share-alt', t(:return_authorizations), spree.admin_order_return_authorizations_url(@order)
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
%div{"data-hook" => "admin_shipping_category_form_fields"}
|
||||
.field.align-center{"data-hook" => "name"}
|
||||
%div
|
||||
.field.align-center
|
||||
= label_tag Spree.t(:name)
|
||||
%br/
|
||||
= f.text_field :name
|
||||
|
||||
.field.align-center{"data-hook" => "name"}
|
||||
.field.align-center
|
||||
= f.label :temperature_controlled, t(:temperature_controlled)
|
||||
= f.check_box :temperature_controlled
|
||||
|
||||
@@ -12,14 +12,14 @@
|
||||
%col{:style => "width: 85%"}/
|
||||
%col{:style => "width: 15%"}/
|
||||
%thead
|
||||
%tr{"data-hook" => "categories_header"}
|
||||
%tr
|
||||
%th= Spree.t(:name)
|
||||
%th
|
||||
= t(:temperature_controlled)
|
||||
%th.actions
|
||||
%tbody
|
||||
- @shipping_categories.each do |shipping_category|
|
||||
%tr{:class => "#{cycle('odd', 'even')}", "data-hook" => "category_row", :id => "#{spree_dom_id shipping_category}"}
|
||||
%tr{:class => "#{cycle('odd', 'even')}", :id => "#{spree_dom_id shipping_category}"}
|
||||
%td{:style => "width:350px;"}= shipping_category.name
|
||||
%td.align-center
|
||||
= shipping_category.temperature_controlled ? t(:yes) : t(:no)
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
%col{style: "width: 15%"}/
|
||||
%col{style: "width: 15%"}/
|
||||
%thead
|
||||
%tr{"data-hook" => "tax_header"}
|
||||
%tr
|
||||
%th= t("spree.name")
|
||||
%th= t("spree.description")
|
||||
%th= t("spree.default")
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
|
||||
= form_tag admin_tax_settings_path, :method => :put do
|
||||
|
||||
.field.align-center{ "data-hook" => "products_require_tax_category" }
|
||||
.field.align-center
|
||||
= hidden_field_tag 'preferences[products_require_tax_category]', '0'
|
||||
= check_box_tag 'preferences[products_require_tax_category]', '1', Spree::Config[:products_require_tax_category]
|
||||
= label_tag nil, t(:products_require_tax_category)
|
||||
|
||||
.form-buttons{"data-hook" => "buttons"}
|
||||
.form-buttons
|
||||
= button t(:update), 'icon-refresh'
|
||||
|
||||
@@ -3,15 +3,15 @@
|
||||
- content_for :page_actions do
|
||||
%li
|
||||
= button_link_to t(".back_to_users_list"), spree.admin_users_path, icon: "icon-arrow-left"
|
||||
%fieldset.alpha.ten.columns{"data-hook" => "admin_user_edit_general_settings"}
|
||||
%fieldset.alpha.ten.columns
|
||||
%legend= t(".general_settings")
|
||||
%div{"data-hook" => "admin_user_edit_form_header"}
|
||||
%div
|
||||
= render partial: "spree/shared/error_messages", locals: { target: @user }
|
||||
%div{"data-hook" => "admin_user_edit_form"}
|
||||
%div
|
||||
= form_for [:admin, @user] do |f|
|
||||
= render "email_confirmation" unless @user.confirmed?
|
||||
= render partial: "form", locals: { f: f }
|
||||
%div{"data-hook" => "admin_user_edit_form_button"}
|
||||
%div
|
||||
= render partial: "spree/admin/shared/edit_resource_links"
|
||||
|
||||
= render partial: 'spree/admin/users/api_fields'
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<script type='text/template' id='variant_autocomplete_stock_template'>
|
||||
<fieldset>
|
||||
<legend align="center"><%= Spree.t(:select_stock) %></legend>
|
||||
<table class="stock-levels" data-hook="stock-levels">
|
||||
<table class="stock-levels">
|
||||
<colgroup>
|
||||
<col style="width: 60%;" />
|
||||
<col style="width: 30%;" />
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
.field
|
||||
= label_tag :unit_value_human, "#{t('admin.'+@product.variant_unit)} ({{unitName(#{@product.variant_unit_scale}, '#{@product.variant_unit}')}})"
|
||||
= hidden_field_tag 'product_variant_unit_scale', @product.variant_unit_scale
|
||||
= text_field_tag :unit_value_human, nil, {class: "fullwidth", 'ng-model' => 'unit_value_human', 'ng-change' => 'updateValue()'}
|
||||
= f.text_field :unit_value, {hidden: true, 'ng-value' => 'unit_value'}
|
||||
= number_field_tag :unit_value_human, nil, {class: "fullwidth", step: 0.01, 'ng-model' => 'unit_value_human', 'ng-change' => 'updateValue()'}
|
||||
= f.number_field :unit_value, {hidden: true, 'ng-value' => 'unit_value'}
|
||||
|
||||
.field
|
||||
= f.label :unit_description, t(:spree_admin_unit_description)
|
||||
@@ -65,8 +65,8 @@
|
||||
- if @product.variant_unit != 'weight'
|
||||
.field
|
||||
= f.label 'weight', t(:weight)+' (kg)'
|
||||
- value = number_with_precision(@variant.weight, precision: 2)
|
||||
= f.number_field 'weight', value: value, class: 'fullwidth', step: 0.01
|
||||
- value = number_with_precision(@variant.weight, precision: 3)
|
||||
= f.number_field 'weight', value: value, class: 'fullwidth', step: 0.001
|
||||
|
||||
- [:height, :width, :depth].each do |field|
|
||||
.field
|
||||
@@ -74,4 +74,4 @@
|
||||
- value = number_with_precision(@variant.send(field), precision: 2)
|
||||
= f.number_field field, value: value, class: 'fullwidth', step: 0.01
|
||||
|
||||
.clear
|
||||
.clear
|
||||
@@ -3,7 +3,7 @@
|
||||
= admin_inject_available_units
|
||||
|
||||
= form_for [:admin, @product, @variant], :url => admin_product_variants_path(@product, @url_filters) do |f|
|
||||
%fieldset{'data-hook' => "admin_variant_new_form"}
|
||||
%fieldset
|
||||
%legend{align: "center"}= t('.new_variant')
|
||||
= render partial: 'form', locals: { f: f }
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
= render "layouts/i18n_script"
|
||||
= yield :stripe_js
|
||||
|
||||
#wrapper{ data: { hook: '' } }
|
||||
#wrapper
|
||||
.flash-container
|
||||
- if flash[:error]
|
||||
.flash.error= flash[:error]
|
||||
@@ -15,27 +15,27 @@
|
||||
|
||||
= render partial: "spree/layouts/admin/progress_spinner"
|
||||
|
||||
%header#header{"data-hook" => ""}
|
||||
%header#header
|
||||
.container
|
||||
%figure.columns.five{"data-hook" => "logo-wrapper"}
|
||||
%figure.columns.five
|
||||
= link_to image_tag(Spree::Config[:admin_interface_logo], :id => 'logo'), spree.admin_dashboard_path
|
||||
%nav.columns.eleven{"data-hook" => "admin_login_navigation_bar"}
|
||||
%nav.columns.eleven.admin-login-navigation-bar
|
||||
= render :partial => 'spree/layouts/admin/login_nav'
|
||||
|
||||
%nav#admin-menu{ data: { hook: '' }}
|
||||
%nav#admin-menu
|
||||
.container.no-gutter
|
||||
.sixteen.columns.main-menu-wrapper
|
||||
%ul.inline-menu{"data-hook" => "admin_tabs"}
|
||||
%ul.inline-menu
|
||||
= render :partial => 'spree/admin/shared/tabs'
|
||||
|
||||
- if content_for?(:sub_menu)
|
||||
%nav#sub-menu{ data: { hook: ''} }
|
||||
%nav#sub-menu
|
||||
.container
|
||||
.sixteen.columns
|
||||
= yield :sub_menu
|
||||
|
||||
- if content_for?(:page_title) || content_for?(:page_actions)
|
||||
.js-admin-section-header.admin__section-header{ data: { hook: '' } }
|
||||
.js-admin-section-header.admin__section-header
|
||||
.container
|
||||
.sixteen.columns
|
||||
.admin__section-header__content
|
||||
@@ -44,16 +44,16 @@
|
||||
%h1.js-admin-page-title= yield :page_title
|
||||
|
||||
- if content_for?(:page_actions)
|
||||
%ul.admin__section-header__actions{ data: { hook: 'toolbar' } }
|
||||
%ul.admin__section-header__actions
|
||||
= yield :page_actions
|
||||
|
||||
.container
|
||||
.row
|
||||
- content_class = content_for?(:sidebar) ? "with-sidebar" : ""
|
||||
#content{:class => content_class, "data-hook" => ""}
|
||||
#content{:class => content_class}
|
||||
- if content_for?(:table_filter)
|
||||
- table_filter_class = content_for?(:sidebar) ? 'twelve columns' : 'sixteen columns'
|
||||
#table-filter{:class => table_filter_class, "data-hook" => ""}
|
||||
#table-filter{:class => table_filter_class}
|
||||
%fieldset
|
||||
%legend{:align => "center"}= yield :table_filter_title
|
||||
= yield :table_filter
|
||||
@@ -61,14 +61,12 @@
|
||||
%div{:class => div_class}
|
||||
= yield
|
||||
- if content_for?(:sidebar)
|
||||
%aside#sidebar.four.columns{"data-hook" => ""}
|
||||
%aside#sidebar.four.columns
|
||||
- if content_for?(:sidebar_title)
|
||||
%h5.sidebar-title
|
||||
%span= yield :sidebar_title
|
||||
= yield :sidebar
|
||||
|
||||
%div{"data-hook" => "admin_footer_scripts"}
|
||||
|
||||
%script
|
||||
= raw "Spree.api_key = \"#{spree_current_user.try(:spree_api_key).to_s}\";"
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
!!!
|
||||
%html{:lang => "en", "ng-csp": "no-unsafe-eval" }
|
||||
%head{"data-hook" => "admin_inside_head"}
|
||||
%head
|
||||
= render :partial => 'spree/admin/shared/head'
|
||||
|
||||
%body.admin{ "class": ("admin-v2" if feature?(:admin_style_v2, spree_current_user)) }
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
- if spree_current_user
|
||||
%ul#login-nav.inline-menu
|
||||
%li{"data-hook" => "user-logged-in-as"}
|
||||
%li.user-logged-in-as
|
||||
= t(:logged_in_as)
|
||||
\: #{spree_current_user.email}
|
||||
%li{"data-hook" => "user-account-link"}
|
||||
%li
|
||||
%i.icon-user
|
||||
= link_to t(:account), account_path
|
||||
%li{"data-hook" => "user-logout-link"}
|
||||
%li
|
||||
%i.icon-signout
|
||||
= link_to t(:logout), logout_path
|
||||
%li{"data-hook" => "store-frontend-link"}
|
||||
%li
|
||||
%i.icon-external-link
|
||||
= link_to t(".header.store"), main_app.root_path, target: "_blank"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
%html{ lang: "en", "ng-csp": "no-unsafe-eval" }
|
||||
%head{"data-hook" => "admin_inside_head"}= render :partial => 'spree/admin/shared/head'
|
||||
%head= render :partial => 'spree/admin/shared/head'
|
||||
%body.admin{"data-ajax-root-path" => main_app.root_path}
|
||||
#wrapper{"data-hook" => ""}
|
||||
#wrapper
|
||||
- if flash[:error]
|
||||
.flash.error= flash[:error]
|
||||
- if notice
|
||||
@@ -10,16 +10,16 @@
|
||||
.flash.success= flash[:success]
|
||||
= render partial: "spree/layouts/admin/progress_spinner"
|
||||
|
||||
%header#header{"data-hook" => ""}
|
||||
%header#header
|
||||
.container
|
||||
%figure.columns.five{"data-hook" => "logo-wrapper"}
|
||||
%figure.columns.five
|
||||
= link_to image_tag(Spree::Config[:admin_interface_logo], id: 'logo'), spree.admin_dashboard_path
|
||||
%nav.columns.eleven{"data-hook" => "admin_login_navigation_bar"}
|
||||
%nav.columns.eleven.admin-login-navigation-bar
|
||||
= render partial: "spree/layouts/admin/login_nav"
|
||||
|
||||
.container
|
||||
.row
|
||||
#content{"data-hook" => ""}
|
||||
#content
|
||||
%div{:class => "sixteen columns"}
|
||||
= yield
|
||||
%div{"data-hook" => "admin_footer_scripts"}
|
||||
%div
|
||||
@@ -2,21 +2,21 @@
|
||||
|
||||
.row
|
||||
.columns.large-12
|
||||
%table#cart-detail{"data-hook" => ""}
|
||||
%table#cart-detail
|
||||
%col{halign: "left", valign: "middle", width: "60%"}/
|
||||
%col{halign: "left", valign: "middle", width: "15%"}/
|
||||
%col{halign: "center", valign: "middle", width: "10%"}/
|
||||
%col{halign: "center", valign: "middle", width: "10%"}/
|
||||
%col{halign: "center", valign: "middle", width: "5%"}/
|
||||
%thead
|
||||
%tr{"data-hook" => "cart_items_headers"}
|
||||
%tr
|
||||
%th.cart-item-description-header= t(:item)
|
||||
%th.cart-item-price-header.text-right= t(:price)
|
||||
%th.text-center.cart-item-quantity-header= t(:qty)
|
||||
%th.cart-item-total-header.text-right= t(:total)
|
||||
%th.cart-item-delete-header
|
||||
|
||||
%tbody#line_items{"data-hook" => ""}
|
||||
%tbody#line_items
|
||||
= render partial: 'line_item', collection: order_form.object.line_items, locals: {order_form: order_form}
|
||||
|
||||
= render 'bought' if show_bought_items? && !@order.complete?
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
- variant = line_item.variant
|
||||
= order_form.fields_for :line_items, line_item do |item_form|
|
||||
%tr.line-item{class: "variant-#{variant.id}"}
|
||||
%td.cart-item-description{'data-hook' => "cart_item_description"}
|
||||
%td.cart-item-description
|
||||
|
||||
%div.item-thumb-image{"data-hook" => "cart_item_image"}
|
||||
%div.item-thumb-image
|
||||
= render 'spree/shared/variant_thumbnail', variant: variant
|
||||
|
||||
= render 'spree/shared/line_item_name', line_item: line_item
|
||||
@@ -18,21 +18,21 @@
|
||||
= t(".unavailable_item")
|
||||
%br/
|
||||
|
||||
%td.text-right.cart-item-price{"data-hook" => "cart_item_price"}
|
||||
%td.text-right.cart-item-price
|
||||
= line_item.single_display_amount_with_adjustments.to_html
|
||||
%br
|
||||
%span.unit-price
|
||||
= line_item.unit_price_price_and_unit
|
||||
%td.text-center.cart-item-quantity{"data-hook" => "cart_item_quantity"}
|
||||
%td.text-center.cart-item-quantity
|
||||
- finalized_quantity = @order.completed? ? line_item.quantity : 0
|
||||
= item_form.number_field :quantity,
|
||||
:min => 0, "ofn-on-hand" => "#{variant.on_demand && 9999 || variant.on_hand}",
|
||||
"finalizedquantity" => finalized_quantity, :class => "line_item_quantity", :size => 5,
|
||||
"ng-model" => "line_item_#{line_item.id}",
|
||||
"validate-stock-quantity" => true
|
||||
%td.cart-item-total.text-right{"data-hook" => "cart_item_total"}
|
||||
%td.cart-item-total.text-right
|
||||
= line_item.display_amount_with_adjustments.to_html unless line_item.quantity.nil?
|
||||
|
||||
%td.cart-item-delete.text-center{"data-hook" => "cart_item_delete"}
|
||||
%td.cart-item-delete.text-center
|
||||
%a.delete{href: "#", id: "delete_#{dom_id(line_item)}"}
|
||||
%i.delete.ofn-i_026-trash
|
||||
|
||||
@@ -1,31 +1,30 @@
|
||||
- display_footer = true if display_footer.nil?
|
||||
|
||||
%table#line-items{"data-hook" => "order_details"}
|
||||
%table#line-items
|
||||
%col{valign: "middle"}/
|
||||
%col{halign: "center", valign: "middle", width: "5%"}/
|
||||
%col{halign: "center", valign: "middle", width: "5%"}/
|
||||
%col{halign: "center", valign: "middle", width: "5%"}/
|
||||
%thead{"data-hook" => ""}
|
||||
%tr{"data-hook" => "order_details_line_items_headers"}
|
||||
%thead
|
||||
%tr
|
||||
%th= t(:item)
|
||||
%th.price= t(:price)
|
||||
%th.text-center.qty= t(:qty)
|
||||
%th.text-right.total
|
||||
%span= t(:total)
|
||||
%tbody{"data-hook" => ""}
|
||||
%tbody
|
||||
- order.line_items.sorted_by_name_and_unit_value.each do |item|
|
||||
%tr.line_item{"data-hook" => "order_details_line_item_row", class: "variant-#{item.variant.id}" }
|
||||
%td(data-hook = "order_item_description")
|
||||
|
||||
%div.item-thumb-image{"data-hook" => "order_item_image"}
|
||||
%tr.line_item{ class: "variant-#{item.variant.id}" }
|
||||
%td
|
||||
%div.item-thumb-image
|
||||
= render 'spree/shared/variant_thumbnail', variant: item.variant
|
||||
|
||||
= render 'spree/shared/line_item_name', line_item: item
|
||||
|
||||
%td.text-right.price{"data-hook" => "order_item_price"}
|
||||
%td.text-right.price
|
||||
%span= item.single_display_amount_with_adjustments.to_html
|
||||
%td.text-center{"data-hook" => "order_item_qty"}= item.quantity
|
||||
%td.text-right.total{"data-hook" => "order_item_total"}
|
||||
%td.text-center= item.quantity
|
||||
%td.text-right.total
|
||||
%span= item.display_amount_with_adjustments.to_html
|
||||
|
||||
= render partial: "spree/orders/totals_footer", locals: { order: order } if display_footer
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
%tfoot
|
||||
#subtotal{"data-hook" => "order_details_subtotal"}
|
||||
#subtotal
|
||||
%tr#subtotal-row.total
|
||||
%td.text-right{colspan: "3"}
|
||||
%strong
|
||||
@@ -7,7 +7,7 @@
|
||||
%td.text-right.total
|
||||
%span= display_checkout_subtotal(order)
|
||||
|
||||
#order-charges{"data-hook" => "order_details_adjustments"}
|
||||
#order-charges
|
||||
- checkout_adjustments_for(order, exclude: [:line_item]).reverse_each do |adjustment|
|
||||
%tr.total
|
||||
%td.text-right{:colspan => "3"}
|
||||
@@ -16,7 +16,7 @@
|
||||
%td.text-right.total
|
||||
%span= adjustment.display_amount.to_html
|
||||
|
||||
#order-total{"data-hook" => "order_details_total"}
|
||||
#order-total.order-details-total
|
||||
%tr.total
|
||||
%td.text-right{colspan: "3"}
|
||||
%h5
|
||||
@@ -25,7 +25,7 @@
|
||||
%h5#order_total= order.display_total.to_html
|
||||
|
||||
- if order.total_tax > 0
|
||||
#tax{"data-hook" => "order_details_tax"}
|
||||
#tax
|
||||
%tr#tax-row.total
|
||||
%td.text-right{colspan: "3"}
|
||||
= t :order_includes_tax
|
||||
|
||||
@@ -27,16 +27,16 @@
|
||||
|
||||
#cart-container
|
||||
- if @order.line_items.empty?
|
||||
%div.row{"data-hook" => "empty_cart"}
|
||||
%div.row
|
||||
%p= t(:your_cart_is_empty)
|
||||
%p= link_to t(:continue_shopping), current_shop_products_path, :class => 'button continue'
|
||||
|
||||
- else
|
||||
%div{"data-hook" => "outside_cart_form"}
|
||||
%div
|
||||
= form_for @order, :url => main_app.update_cart_path,
|
||||
:html => {id: 'update-cart', name: "form", "ng-controller"=> 'CartFormCtrl'} do |order_form|
|
||||
%div{"data-hook" => "inside_cart_form"}
|
||||
%div{"data-hook" => "cart_items"}
|
||||
%div
|
||||
%div
|
||||
.row
|
||||
= render :partial => 'form', :locals => { :order_form => order_form }
|
||||
|
||||
|
||||
@@ -6,5 +6,5 @@
|
||||
= t(:orders_form_update_cart)
|
||||
%td
|
||||
%td#empty-cart.text-center
|
||||
%span#clear_cart_link{"data-hook" => ""}
|
||||
%span#clear_cart_link
|
||||
= link_to t(:orders_form_empty_cart), main_app.empty_cart_path, method: :put, :class => 'not-bold small'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.row.links{'data-hook' => "cart_buttons"}
|
||||
.row.links
|
||||
%a.continue-shopping.button.secondary{href: current_shop_products_path, "ng-disabled" => "#{@insufficient_stock_lines.any?}", "disable-dynamically" => true}
|
||||
= t :orders_edit_continue
|
||||
%a#checkout-link.button.primary.right{href: main_app.checkout_path, "ng-disabled" => "#{@insufficient_stock_lines.any?}", "disable-dynamically" => true}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
.darkswarm
|
||||
= render "shopping_shared/header" if current_distributor.present?
|
||||
|
||||
%fieldset#order_summary.footer-pad{"data-hook" => ""}
|
||||
%fieldset#order_summary.footer-pad
|
||||
.row
|
||||
.columns.large-12.text-center
|
||||
%h2
|
||||
@@ -21,7 +21,7 @@
|
||||
= t(:orders_show_confirmed)
|
||||
%i.ofn-i_051-check-big
|
||||
|
||||
#order{"data-hook" => ""}
|
||||
#order
|
||||
- if params.has_key? :checkout_complete
|
||||
%h1= t(:thank_you_for_your_order)
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
.small-12.columns.pad-top
|
||||
%h2
|
||||
= accurate_title
|
||||
%span.account-summary{"data-hook" => "account_summary"}
|
||||
%span.account-summary
|
||||
= @user.email
|
||||
|
||||
= render 'orders'
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user