Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Extract backend into a separate repo (#11360)

Damian Legawiecf5ca46c389ce
diff --git a/.circleci/config.yml b/.circleci/config.yml
index 32fcd5a1f1..6b3be75cb7 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -20,7 +20,7 @@ defaults_3_0: &defaults_3_0
run_tests: &run_tests
<<: *defaults
- parallelism: 4
+ parallelism: 2
steps:
- checkout
- restore_cache:
@@ -41,7 +41,7 @@ run_tests: &run_tests
run_tests_3_0: &run_tests_3_0
<<: *defaults_3_0
- parallelism: 4
+ parallelism: 2
steps:
- checkout
- restore_cache:
@@ -243,13 +243,12 @@ jobs:
name: Format test coverage
command: |
./tmp/cc-test-reporter format-coverage -t simplecov -o tmp/codeclimate.api.json /tmp/workspace/simplecov/api/.resultset.json
- ./tmp/cc-test-reporter format-coverage -t simplecov -o tmp/codeclimate.backend.json /tmp/workspace/simplecov/backend/.resultset.json
./tmp/cc-test-reporter format-coverage -t simplecov -o tmp/codeclimate.core.json /tmp/workspace/simplecov/core/.resultset.json
./tmp/cc-test-reporter format-coverage -t simplecov -o tmp/codeclimate.emails.json /tmp/workspace/simplecov/emails/.resultset.json
- run:
name: Upload coverage results to Code Climate
command: |
- ./tmp/cc-test-reporter sum-coverage tmp/codeclimate.*.json -p 4 -o tmp/codeclimate.total.json
+ ./tmp/cc-test-reporter sum-coverage tmp/codeclimate.*.json -p 3 -o tmp/codeclimate.total.json
./tmp/cc-test-reporter upload-coverage -i tmp/codeclimate.total.json
update_staging_repository:
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
index 13c702cd83..687a775959 100644
--- a/.github/dependabot.yml
+++ b/.github/dependabot.yml
@@ -1,10 +1,5 @@
version: 2
updates:
-- package-ecosystem: bundler
- directory: "/backend"
- schedule:
- interval: daily
- open-pull-requests-limit: 10
- package-ecosystem: bundler
directory: "/core"
schedule:
diff --git a/backend/Gemfile b/backend/Gemfile
deleted file mode 100644
index fa9303ad14..0000000000
--- a/backend/Gemfile
+++ /dev/null
@@ -1,6 +0,0 @@
-eval_gemfile('../common_spree_dependencies.rb')
-
-gem 'spree_core', path: '../core'
-gem 'spree_api', path: '../api'
-
-gemspec
diff --git a/backend/Rakefile b/backend/Rakefile
deleted file mode 100644
index d236bf438f..0000000000
--- a/backend/Rakefile
+++ /dev/null
@@ -1,15 +0,0 @@
-require 'rubygems'
-require 'rake'
-require 'rake/testtask'
-require 'rspec/core/rake_task'
-require 'spree/testing_support/common_rake'
-
-RSpec::Core::RakeTask.new
-
-task default: :spec
-
-desc "Generates a dummy app for testing"
-task :test_app do
- ENV['LIB_NAME'] = 'spree/backend'
- Rake::Task['common:test_app'].execute( { install_admin: true, install_storefront: false } )
-end
diff --git a/backend/app/assets/config/spree_backend_manifest.js b/backend/app/assets/config/spree_backend_manifest.js
deleted file mode 100644
index 1ae0d19263..0000000000
--- a/backend/app/assets/config/spree_backend_manifest.js
+++ /dev/null
@@ -1,129 +0,0 @@
-//= link_tree ../images
-
-//= link spree/backend/all.js
-//= link spree/backend/all.css
-//= link jquery.jstree/themes/spree/style.css
-
-//= link select2_locale_af.js
-//= link select2_locale_ar.js
-//= link select2_locale_az.js
-//= link select2_locale_bg.js
-//= link select2_locale_bn.js
-//= link select2_locale_bs.js
-//= link select2_locale_ca.js
-//= link select2_locale_cs.js
-//= link select2_locale_da.js
-//= link select2_locale_de.js
-//= link select2_locale_dsb.js
-//= link select2_locale_el.js
-//= link select2_locale_en.js
-//= link select2_locale_es.js
-//= link select2_locale_et.js
-//= link select2_locale_eu.js
-//= link select2_locale_fa.js
-//= link select2_locale_fi.js
-//= link select2_locale_fr.js
-//= link select2_locale_gl.js
-//= link select2_locale_he.js
-//= link select2_locale_hi.js
-//= link select2_locale_hr.js
-//= link select2_locale_hsb.js
-//= link select2_locale_hu.js
-//= link select2_locale_hy.js
-//= link select2_locale_id.js
-//= link select2_locale_is.js
-//= link select2_locale_it.js
-//= link select2_locale_ja.js
-//= link select2_locale_ka.js
-//= link select2_locale_km.js
-//= link select2_locale_ko.js
-//= link select2_locale_lt.js
-//= link select2_locale_lv.js
-//= link select2_locale_mk.js
-//= link select2_locale_ms.js
-//= link select2_locale_nb.js
-//= link select2_locale_ne.js
-//= link select2_locale_nl.js
-//= link select2_locale_pl.js
-//= link select2_locale_ps.js
-//= link select2_locale_pt.js
-//= link select2_locale_pt-BR.js
-//= link select2_locale_ro.js
-//= link select2_locale_ru.js
-//= link select2_locale_sk.js
-//= link select2_locale_sl.js
-//= link select2_locale_sq.js
-//= link select2_locale_sr.js
-//= link select2_locale_sr-Cyrl.js
-//= link select2_locale_sv.js
-//= link select2_locale_th.js
-//= link select2_locale_tk.js
-//= link select2_locale_tr.js
-//= link select2_locale_uk.js
-//= link select2_locale_vi.js
-//= link select2_locale_zh-CN.js
-//= link select2_locale_zh-TW.js
-
-//= link flatpickr/l10n/ar.js
-//= link flatpickr/l10n/bs.js
-//= link flatpickr/l10n/default.js
-//= link flatpickr/l10n/fo.js
-//= link flatpickr/l10n/hr.js
-//= link flatpickr/l10n/ja.js
-//= link flatpickr/l10n/lv.js
-//= link flatpickr/l10n/no.js
-//= link flatpickr/l10n/si.js
-//= link flatpickr/l10n/sv.js
-//= link flatpickr/l10n/vn.js
-//= link flatpickr/l10n/at.js
-//= link flatpickr/l10n/cat.js
-//= link flatpickr/l10n/eo.js
-//= link flatpickr/l10n/fr.js
-//= link flatpickr/l10n/hu.js
-//= link flatpickr/l10n/ka.js
-//= link flatpickr/l10n/mk.js
-//= link flatpickr/l10n/pa.js
-//= link flatpickr/l10n/sk.js
-//= link flatpickr/l10n/th.js
-//= link flatpickr/l10n/zh-tw.js
-//= link flatpickr/l10n/az.js
-//= link flatpickr/l10n/cs.js
-//= link flatpickr/l10n/es.js
-//= link flatpickr/l10n/ga.js
-//= link flatpickr/l10n/id.js
-//= link flatpickr/l10n/km.js
-//= link flatpickr/l10n/mn.js
-//= link flatpickr/l10n/pl.js
-//= link flatpickr/l10n/sl.js
-//= link flatpickr/l10n/tr.js
-//= link flatpickr/l10n/zh.js
-//= link flatpickr/l10n/be.js
-//= link flatpickr/l10n/cy.js
-//= link flatpickr/l10n/et.js
-//= link flatpickr/l10n/gr.js
-//= link flatpickr/l10n/index.js
-//= link flatpickr/l10n/ko.js
-//= link flatpickr/l10n/ms.js
-//= link flatpickr/l10n/pt.js
-//= link flatpickr/l10n/sq.js
-//= link flatpickr/l10n/uk.js
-//= link flatpickr/l10n/bg.js
-//= link flatpickr/l10n/da.js
-//= link flatpickr/l10n/fa.js
-//= link flatpickr/l10n/he.js
-//= link flatpickr/l10n/is.js
-//= link flatpickr/l10n/kz.js
-//= link flatpickr/l10n/my.js
-//= link flatpickr/l10n/ro.js
-//= link flatpickr/l10n/sr-cyr.js
-//= link flatpickr/l10n/uz.js
-//= link flatpickr/l10n/bn.js
-//= link flatpickr/l10n/de.js
-//= link flatpickr/l10n/fi.js
-//= link flatpickr/l10n/hi.js
-//= link flatpickr/l10n/it.js
-//= link flatpickr/l10n/lt.js
-//= link flatpickr/l10n/nl.js
-//= link flatpickr/l10n/ru.js
-//= link flatpickr/l10n/sr.js
-//= link flatpickr/l10n/uz_latn.js
diff --git a/backend/app/assets/images/admin/logo.png b/backend/app/assets/images/admin/logo.png
deleted file mode 100644
index 65d37c85a2..0000000000
Binary files a/backend/app/assets/images/admin/logo.png and /dev/null differ
diff --git a/backend/app/assets/images/backend-add.svg b/backend/app/assets/images/backend-add.svg
deleted file mode 100644
index bb5405d558..0000000000
--- a/backend/app/assets/images/backend-add.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-<svg width="100%" height="100%" viewBox="0 0 512 512" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
- <g transform="matrix(-8.69966,-8.69966,-8.69966,8.69966,481.449,256.527)">
- <path d="M14.061,12.927L24.78,23.646C25.073,23.939 25.073,24.414 24.78,24.707C24.487,25 24.013,25 23.72,24.707L13,13.987L2.28,24.707C1.987,25 1.513,25 1.22,24.707C0.927,24.414 0.927,23.939 1.22,23.646L11.939,12.927L1.22,2.207C0.927,1.914 0.927,1.439 1.22,1.146C1.366,1 1.558,0.927 1.75,0.927C1.942,0.927 2.134,1 2.28,1.146L13,11.866L23.72,1.146C23.866,1 24.058,0.927 24.25,0.927C24.442,0.927 24.634,1 24.78,1.146C25.073,1.439 25.073,1.914 24.78,2.207L14.061,12.927Z" style="fill-rule:nonzero;stroke:currentColor;stroke-width:2.76px;"/>
- </g>
-</svg>
diff --git a/backend/app/assets/images/backend-adjust.svg b/backend/app/assets/images/backend-adjust.svg
deleted file mode 100644
index 815d1b20e2..0000000000
--- a/backend/app/assets/images/backend-adjust.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2">
- <g fill-rule="nonzero" stroke="currentColor">
- <path fill="currentColor" d="M122.615 477.538V345.987c25.506-6.608 44.481-29.616 44.481-57.16 0-27.545-18.975-50.552-44.481-57.16V34.462c0-8.154-6.615-14.77-14.769-14.77s-14.769 6.616-14.769 14.77v197.205c-25.506 6.608-44.481 29.615-44.481 57.16 0 27.544 18.975 50.552 44.481 57.16v131.551c0 8.154 6.615 14.77 14.769 14.77s14.769-6.616 14.769-14.77zm-44.48-188.711c0-16.385 13.327-29.712 29.711-29.712 16.385 0 29.712 13.327 29.712 29.712 0 16.385-13.327 29.711-29.712 29.711-16.384 0-29.711-13.326-29.711-29.711zM241.231 34.462V66.09c-25.506 6.608-44.481 29.616-44.481 57.16 0 27.544 18.975 50.552 44.481 57.16v297.128c0 8.154 6.615 14.77 14.769 14.77s14.769-6.616 14.769-14.77V180.41c25.506-6.608 44.481-29.616 44.481-57.16 0-27.544-18.975-50.552-44.481-57.16V34.462c0-8.154-6.615-14.77-14.769-14.77s-14.769 6.616-14.769 14.77zm44.481 88.788c0 16.385-13.327 29.712-29.712 29.712-16.385 0-29.712-13.327-29.712-29.712 0-16.385 13.327-29.712 29.712-29.712 16.385 0 29.712 13.327 29.712 29.712zM389.385 34.462v286.165c-25.506 6.607-44.481 29.613-44.481 57.142 0 27.545 18.975 50.552 44.481 57.16v42.609c0 8.154 6.615 14.77 14.769 14.77s14.769-6.616 14.769-14.77v-42.609c25.506-6.608 44.481-29.615 44.481-57.16 0-27.529-18.975-50.535-44.481-57.142V34.462c0-8.154-6.615-14.77-14.769-14.77s-14.769 6.616-14.769 14.77zm44.48 343.307c0 16.385-13.327 29.712-29.711 29.712-16.385 0-29.712-13.327-29.712-29.712 0-16.365 13.327-29.692 29.712-29.692 16.384 0 29.711 13.327 29.711 29.692z"/>
- </g>
-</svg>
diff --git a/backend/app/assets/images/backend-approve.svg b/backend/app/assets/images/backend-approve.svg
deleted file mode 100644
index 1ae274e546..0000000000
--- a/backend/app/assets/images/backend-approve.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2">
- <path fill="currentColor" d="M474.975 82.072c-5.79-5.77-15.123-5.77-20.874 0L173.92 362.589 58.76 247.27c-5.75-5.75-15.085-5.79-20.874 0-5.77 5.75-5.77 15.104 0 20.874l125.597 125.774c2.875 2.895 6.656 4.333 10.437 4.333 3.8 0 7.562-1.438 10.437-4.333l290.62-290.953c5.769-5.77 5.769-15.144 0-20.894z" fill-rule="nonzero" stroke="currentColor" stroke-width="24.024606"/>
-</svg>
diff --git a/backend/app/assets/images/backend-arrow-down.svg b/backend/app/assets/images/backend-arrow-down.svg
deleted file mode 100644
index 53219c6982..0000000000
--- a/backend/app/assets/images/backend-arrow-down.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg width="100%" height="100%" viewBox="0 0 2134 2134" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"><path fill="currentColor" d="M1110.18,1571.72l923.077,-923.077c24.039,-24.039 24.039,-62.981 0,-87.019c-24.038,-24.039 -62.98,-24.039 -87.019,0l-879.567,879.567l-879.568,-879.567c-24.038,-24.039 -62.98,-24.039 -87.019,0c-12.019,12.019 -18.029,27.724 -18.029,43.509c0,15.785 6.01,31.491 18.029,43.51l923.077,923.077c24.039,24.038 62.981,24.038 87.019,0Z" style="fill-rule:nonzero;stroke:currentColor;stroke-width:75px;"/></svg>
diff --git a/backend/app/assets/images/backend-arrow-left.svg b/backend/app/assets/images/backend-arrow-left.svg
deleted file mode 100644
index 975f90250e..0000000000
--- a/backend/app/assets/images/backend-arrow-left.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg width="100%" height="100%" viewBox="0 0 2134 2134" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"><path fill="currentColor" d="M561.619,1110.18l923.077,923.077c24.038,24.039 62.98,24.039 87.019,0c24.038,-24.038 24.038,-62.98 0,-87.019l-879.568,-879.567l879.568,-879.568c24.038,-24.038 24.038,-62.98 0,-87.019c-12.019,-12.019 -27.725,-18.029 -43.51,-18.029c-15.785,0 -31.49,6.01 -43.509,18.029l-923.077,923.077c-24.039,24.039 -24.039,62.981 0,87.019Z" style="fill-rule:nonzero;stroke:currentColor;stroke-width:75px;"/></svg>
diff --git a/backend/app/assets/images/backend-arrow-right.svg b/backend/app/assets/images/backend-arrow-right.svg
deleted file mode 100644
index 830aaa43ec..0000000000
--- a/backend/app/assets/images/backend-arrow-right.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg width="100%" height="100%" viewBox="0 0 2134 2134" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"><path fill="currentColor" d="M1571.72,1023.16l-923.077,-923.077c-24.039,-24.038 -62.981,-24.038 -87.019,0c-24.039,24.039 -24.039,62.981 0,87.019l879.567,879.568l-879.567,879.567c-24.039,24.039 -24.039,62.981 0,87.019c12.019,12.02 27.724,18.029 43.509,18.029c15.785,0 31.491,-6.009 43.51,-18.029l923.077,-923.077c24.038,-24.038 24.038,-62.98 0,-87.019Z" style="fill-rule:nonzero;stroke:currentColor;stroke-width:75px;"/></svg>
diff --git a/backend/app/assets/images/backend-arrow-up.svg b/backend/app/assets/images/backend-arrow-up.svg
deleted file mode 100644
index 11f2f6acf2..0000000000
--- a/backend/app/assets/images/backend-arrow-up.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg width="100%" height="100%" viewBox="0 0 2134 2134" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"><path fill="currentColor" d="M1023.16,561.619l-923.077,923.077c-24.038,24.038 -24.038,62.98 0,87.019c24.039,24.038 62.981,24.038 87.019,0l879.568,-879.568l879.567,879.568c24.039,24.038 62.981,24.038 87.019,0c12.02,-12.019 18.029,-27.725 18.029,-43.51c0,-15.785 -6.009,-31.49 -18.029,-43.509l-923.077,-923.077c-24.038,-24.039 -62.98,-24.039 -87.019,0Z" style="fill-rule:nonzero;stroke:currentColor;stroke-width:75px;"/></svg>
diff --git a/backend/app/assets/images/backend-arrows-fullscreen.svg b/backend/app/assets/images/backend-arrows-fullscreen.svg
deleted file mode 100644
index dc0acc3ca1..0000000000
--- a/backend/app/assets/images/backend-arrows-fullscreen.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-arrows-fullscreen" viewBox="0 0 16 16">
- <path fill-rule="evenodd" d="M5.828 10.172a.5.5 0 0 0-.707 0l-4.096 4.096V11.5a.5.5 0 0 0-1 0v3.975a.5.5 0 0 0 .5.5H4.5a.5.5 0 0 0 0-1H1.732l4.096-4.096a.5.5 0 0 0 0-.707zm4.344 0a.5.5 0 0 1 .707 0l4.096 4.096V11.5a.5.5 0 1 1 1 0v3.975a.5.5 0 0 1-.5.5H11.5a.5.5 0 0 1 0-1h2.768l-4.096-4.096a.5.5 0 0 1 0-.707zm0-4.344a.5.5 0 0 0 .707 0l4.096-4.096V4.5a.5.5 0 1 0 1 0V.525a.5.5 0 0 0-.5-.5H11.5a.5.5 0 0 0 0 1h2.768l-4.096 4.096a.5.5 0 0 0 0 .707zm-4.344 0a.5.5 0 0 1-.707 0L1.025 1.732V4.5a.5.5 0 0 1-1 0V.525a.5.5 0 0 1 .5-.5H4.5a.5.5 0 0 1 0 1H1.732l4.096 4.096a.5.5 0 0 1 0 .707z"/>
-</svg>
\ No newline at end of file
diff --git a/backend/app/assets/images/backend-box.svg b/backend/app/assets/images/backend-box.svg
deleted file mode 100644
index e1506b8385..0000000000
--- a/backend/app/assets/images/backend-box.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-box-seam" viewBox="0 0 16 16">
- <path d="M8.186 1.113a.5.5 0 0 0-.372 0L1.846 3.5l2.404.961L10.404 2l-2.218-.887zm3.564 1.426L5.596 5 8 5.961 14.154 3.5l-2.404-.961zm3.25 1.7-6.5 2.6v7.922l6.5-2.6V4.24zM7.5 14.762V6.838L1 4.239v7.923l6.5 2.6zM7.443.184a1.5 1.5 0 0 1 1.114 0l7.129 2.852A.5.5 0 0 1 16 3.5v8.662a1 1 0 0 1-.629.928l-7.185 2.874a.5.5 0 0 1-.372 0L.63 13.09a1 1 0 0 1-.63-.928V3.5a.5.5 0 0 1 .314-.464L7.443.184z"/>
-</svg>
\ No newline at end of file
diff --git a/backend/app/assets/images/backend-calendar.svg b/backend/app/assets/images/backend-calendar.svg
deleted file mode 100644
index c07f7e6d4c..0000000000
--- a/backend/app/assets/images/backend-calendar.svg
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<svg width="469px" height="504px" viewBox="0 0 469 504" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
- <title>Untitled</title>
- <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
- <g fill="currentColor" fill-rule="nonzero">
- <path d="M36.275,467.857 L117.25,467.857 L117.25,386.881 L36.275,386.881 L36.275,467.857 Z M135.244,467.857 L225.217,467.857 L225.217,386.881 L135.244,386.881 L135.244,467.857 L135.244,467.857 Z M36.275,368.887 L117.25,368.887 L117.25,278.914 L36.275,278.914 L36.275,368.887 Z M135.244,368.887 L225.217,368.887 L225.217,278.914 L135.244,278.914 L135.244,368.887 L135.244,368.887 Z M36.275,260.92 L117.25,260.92 L117.25,179.945 L36.275,179.945 L36.275,260.92 Z M243.211,467.857 L333.184,467.857 L333.184,386.881 L243.211,386.881 L243.211,467.857 Z M135.244,260.92 L225.217,260.92 L225.217,179.945 L135.244,179.945 L135.244,260.92 L135.244,260.92 Z M351.178,467.857 L432.153,467.857 L432.153,386.881 L351.178,386.881 L351.178,467.857 Z M243.211,368.887 L333.184,368.887 L333.184,278.914 L243.211,278.914 L243.211,368.887 Z M144.242,125.961 L144.242,44.986 C144.242,41.331 141.571,38.66 141.571,38.66 C138.899,35.989 135.244,35.989 135.244,35.989 L117.25,35.989 C113.595,35.989 110.924,38.66 110.924,38.66 C108.253,41.331 108.253,44.986 108.253,44.986 L108.253,125.961 C108.253,129.617 110.924,132.288 110.924,132.288 C113.595,134.959 117.25,134.959 117.25,134.959 L135.244,134.959 C138.899,134.959 141.571,132.288 141.571,132.288 C144.242,129.617 144.242,125.961 144.242,125.961 L144.242,125.961 Z M351.178,368.887 L432.153,368.887 L432.153,278.914 L351.178,278.914 L351.178,368.887 Z M243.211,260.92 L333.184,260.92 L333.184,179.945 L243.211,179.945 L243.211,260.92 Z M351.178,260.92 L432.153,260.92 L432.153,179.945 L351.178,179.945 L351.178,260.92 Z M360.175,125.961 L360.175,44.986 C360.175,41.331 357.504,38.66 357.504,38.66 C354.833,35.989 351.178,35.989 351.178,35.989 L333.184,35.989 C329.529,35.989 326.857,38.66 326.857,38.66 C324.186,41.331 324.186,44.986 324.186,44.986 L324.186,125.961 C324.186,129.617 326.857,132.288 326.857,132.288 C329.529,134.959 333.184,134.959 333.184,134.959 L351.178,134.959 C354.833,134.959 357.504,132.288 357.504,132.288 C360.175,129.617 360.175,125.961 360.175,125.961 L360.175,125.961 Z M468.142,107.967 L468.142,467.857 C468.142,482.477 457.458,493.161 457.458,493.161 C446.774,503.846 432.153,503.846 432.153,503.846 L36.275,503.846 C21.654,503.846 10.97,493.161 10.97,493.161 C0.286,482.477 0.286,467.857 0.286,467.857 L0.286,107.967 C0.286,93.346 10.97,82.662 10.97,82.662 C21.654,71.978 36.275,71.978 36.275,71.978 L72.264,71.978 L72.264,44.986 C72.264,26.429 85.478,13.215 85.478,13.215 C98.693,0 117.25,0 117.25,0 L135.244,0 C153.801,0 167.016,13.215 167.016,13.215 C180.231,26.429 180.231,44.986 180.231,44.986 L180.231,71.978 L288.197,71.978 L288.197,44.986 C288.197,26.429 301.412,13.215 301.412,13.215 C314.627,0 333.184,0 333.184,0 L351.178,0 C369.735,0 382.95,13.215 382.95,13.215 C396.164,26.429 396.164,44.986 396.164,44.986 L396.164,71.978 L432.153,71.978 C446.774,71.978 457.458,82.662 457.458,82.662 C468.142,93.346 468.142,107.967 468.142,107.967 Z"></path>
- </g>
- </g>
-</svg>
diff --git a/backend/app/assets/images/backend-cancel.svg b/backend/app/assets/images/backend-cancel.svg
deleted file mode 100644
index 58e7937096..0000000000
--- a/backend/app/assets/images/backend-cancel.svg
+++ /dev/null
@@ -1,7 +0,0 @@
-<svg width="100%" height="100%" viewBox="0 0 512 512" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
- <g transform="matrix(5.37908e-15,-16.6134,-16.6134,-5.37908e-15,470.536,472.199)">
- <path d="M14.061,12.927L24.78,23.646C25.073,23.939 25.073,24.414 24.78,24.707C24.487,25 24.013,25 23.72,24.707L13,13.987L2.28,24.707C1.987,25 1.513,25 1.22,24.707C0.927,24.414 0.927,23.939 1.22,23.646L11.939,12.927L1.22,2.207C0.927,1.914 0.927,1.439 1.22,1.146C1.366,1 1.558,0.927 1.75,0.927C1.942,0.927 2.134,1 2.28,1.146L13,11.866L23.72,1.146C23.866,1 24.058,0.927 24.25,0.927C24.442,0.927 24.634,1 24.78,1.146C25.073,1.439 25.073,1.914 24.78,2.207L14.061,12.927Z" style="fill-rule:nonzero;stroke:currentColor;stroke-width:2.05px;"/>
- </g>
-</svg>
-
-<!-- CANCEL CLOSE VOID-->
diff --git a/backend/app/assets/images/backend-capture.svg b/backend/app/assets/images/backend-capture.svg
deleted file mode 100644
index 1ae274e546..0000000000
--- a/backend/app/assets/images/backend-capture.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2">
- <path fill="currentColor" d="M474.975 82.072c-5.79-5.77-15.123-5.77-20.874 0L173.92 362.589 58.76 247.27c-5.75-5.75-15.085-5.79-20.874 0-5.77 5.75-5.77 15.104 0 20.874l125.597 125.774c2.875 2.895 6.656 4.333 10.437 4.333 3.8 0 7.562-1.438 10.437-4.333l290.62-290.953c5.769-5.77 5.769-15.144 0-20.894z" fill-rule="nonzero" stroke="currentColor" stroke-width="24.024606"/>
-</svg>
diff --git a/backend/app/assets/images/backend-cart.svg b/backend/app/assets/images/backend-cart.svg
deleted file mode 100644
index 6737b4a84e..0000000000
--- a/backend/app/assets/images/backend-cart.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" height="92" viewBox="0 0 82.6 91.7" width="83"><g fill="currentColor"><path d="M33.6 73.3c0 0 0 0 0 0 -5 0-9.2 4.1-9.2 9.2 0 5 4.1 9.2 9.2 9.2 5 0 9.2-4.1 9.2-9.2 0 0 0 0 0 0 0-5-4.2-9.2-9.2-9.2Zm0 12.4c0 0 0 0 0 0 -1.8 0-3.3-1.5-3.3-3.3 0-1.8 1.5-3.3 3.3-3.3 1.8 0 3.3 1.5 3.3 3.3 0 1.8-1.5 3.3-3.3 3.3Z"/><path d="M64.3 73.3c-5 0-9.2 4.1-9.2 9.2 0 5 4.1 9.2 9.2 9.2 5 0 9.2-4.1 9.2-9.2 0 0 0 0 0 0 0-5-4.2-9.2-9.2-9.2Zm0 12.4c-1.8 0-3.3-1.5-3.3-3.3 0-1.8 1.5-3.3 3.3-3.3 1.8 0 3.3 1.5 3.3 3.3 0 1.8-1.5 3.3-3.3 3.3Z"/><path d="M82 31.3c-0.6-0.7-1.4-1.2-2.3-1.2l-59.2 0 -2.5-9.6c-0.3-1.3-1.5-2.2-2.9-2.2l-12.2 0c-1.6 0-3 1.3-3 3 0 1.6 1.3 3 3 3l9.9 0 2.5 9.5c0 0.1 0 0.1 0 0.2l9.2 35.3c0.3 1.3 1.5 2.2 2.9 2.2l43.1 0c1.3 0 2.5-0.9 2.9-2.2l9.2-35.3c0.2-0.9 0-1.8-0.5-2.6Zm-13.8 34.2l-38.5 0 -7.6-29.4 53.8 0 -7.6 29.4Z"/></g></svg>
diff --git a/backend/app/assets/images/backend-chevron-down.svg b/backend/app/assets/images/backend-chevron-down.svg
deleted file mode 100644
index 53219c6982..0000000000
--- a/backend/app/assets/images/backend-chevron-down.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg width="100%" height="100%" viewBox="0 0 2134 2134" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"><path fill="currentColor" d="M1110.18,1571.72l923.077,-923.077c24.039,-24.039 24.039,-62.981 0,-87.019c-24.038,-24.039 -62.98,-24.039 -87.019,0l-879.567,879.567l-879.568,-879.567c-24.038,-24.039 -62.98,-24.039 -87.019,0c-12.019,12.019 -18.029,27.724 -18.029,43.509c0,15.785 6.01,31.491 18.029,43.51l923.077,923.077c24.039,24.038 62.981,24.038 87.019,0Z" style="fill-rule:nonzero;stroke:currentColor;stroke-width:75px;"/></svg>
diff --git a/backend/app/assets/images/backend-chevron-left.svg b/backend/app/assets/images/backend-chevron-left.svg
deleted file mode 100644
index 975f90250e..0000000000
--- a/backend/app/assets/images/backend-chevron-left.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg width="100%" height="100%" viewBox="0 0 2134 2134" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"><path fill="currentColor" d="M561.619,1110.18l923.077,923.077c24.038,24.039 62.98,24.039 87.019,0c24.038,-24.038 24.038,-62.98 0,-87.019l-879.568,-879.567l879.568,-879.568c24.038,-24.038 24.038,-62.98 0,-87.019c-12.019,-12.019 -27.725,-18.029 -43.51,-18.029c-15.785,0 -31.49,6.01 -43.509,18.029l-923.077,923.077c-24.039,24.039 -24.039,62.981 0,87.019Z" style="fill-rule:nonzero;stroke:currentColor;stroke-width:75px;"/></svg>
diff --git a/backend/app/assets/images/backend-chevron-right.svg b/backend/app/assets/images/backend-chevron-right.svg
deleted file mode 100644
index 830aaa43ec..0000000000
--- a/backend/app/assets/images/backend-chevron-right.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg width="100%" height="100%" viewBox="0 0 2134 2134" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"><path fill="currentColor" d="M1571.72,1023.16l-923.077,-923.077c-24.039,-24.038 -62.981,-24.038 -87.019,0c-24.039,24.039 -24.039,62.981 0,87.019l879.567,879.568l-879.567,879.567c-24.039,24.039 -24.039,62.981 0,87.019c12.019,12.02 27.724,18.029 43.509,18.029c15.785,0 31.491,-6.009 43.51,-18.029l923.077,-923.077c24.038,-24.038 24.038,-62.98 0,-87.019Z" style="fill-rule:nonzero;stroke:currentColor;stroke-width:75px;"/></svg>
diff --git a/backend/app/assets/images/backend-chevron-up.svg b/backend/app/assets/images/backend-chevron-up.svg
deleted file mode 100644
index 11f2f6acf2..0000000000
--- a/backend/app/assets/images/backend-chevron-up.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg width="100%" height="100%" viewBox="0 0 2134 2134" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"><path fill="currentColor" d="M1023.16,561.619l-923.077,923.077c-24.038,24.038 -24.038,62.98 0,87.019c24.039,24.038 62.981,24.038 87.019,0l879.568,-879.568l879.567,879.568c24.039,24.038 62.981,24.038 87.019,0c12.02,-12.019 18.029,-27.725 18.029,-43.51c0,-15.785 -6.009,-31.49 -18.029,-43.509l-923.077,-923.077c-24.038,-24.039 -62.98,-24.039 -87.019,0Z" style="fill-rule:nonzero;stroke:currentColor;stroke-width:75px;"/></svg>
diff --git a/backend/app/assets/images/backend-circle-fill.svg b/backend/app/assets/images/backend-circle-fill.svg
deleted file mode 100644
index e0d1b51579..0000000000
--- a/backend/app/assets/images/backend-circle-fill.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-circle-fill" viewBox="0 0 16 16">
- <circle cx="8" cy="8" r="8"/>
-</svg>
\ No newline at end of file
diff --git a/backend/app/assets/images/backend-circle.svg b/backend/app/assets/images/backend-circle.svg
deleted file mode 100644
index dc57919b37..0000000000
--- a/backend/app/assets/images/backend-circle.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-circle" viewBox="0 0 16 16">
- <path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"/>
-</svg>
\ No newline at end of file
diff --git a/backend/app/assets/images/backend-clone.svg b/backend/app/assets/images/backend-clone.svg
deleted file mode 100644
index 571529572f..0000000000
--- a/backend/app/assets/images/backend-clone.svg
+++ /dev/null
@@ -1,7 +0,0 @@
-<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2">
- <g fill-rule="nonzero" stroke="currentColor" stroke-width="4.5">
- <path fill="currentColor" d="M323.875 484.003H111.146c-27.408-.062-49.601-22.281-49.632-49.688V153.829c.031-27.429 22.259-49.658 49.688-49.689h139.516a17.052 17.052 0 0112.052 4.992l105.745 105.847a17.056 17.056 0 015.003 12.064v207.272c-.031 27.411-22.231 49.632-49.643 49.688zM111.146 138.251c-8.579.038-15.515 6.999-15.521 15.578v280.486c.012 8.575 6.945 15.533 15.521 15.577h212.729c8.598-.013 15.565-6.979 15.577-15.577V234.104L243.6 138.251H111.146z"/>
- <path fill="currentColor" d="M400.057 407.821h-43.549c-9.39-.042-16.98-7.665-16.98-17.055s7.59-17.014 16.98-17.056h43.549c8.598-.012 15.565-6.979 15.577-15.577V77.647c-.012-8.598-6.979-15.565-15.577-15.577h-212.73c-8.575.043-15.508 7.001-15.52 15.577v43.549c-.042 9.39-7.666 16.979-17.056 16.979s-17.013-7.589-17.055-16.979V77.647c.025-27.432 22.256-49.664 49.688-49.689h212.673c27.432.025 49.663 22.257 49.689 49.689v280.486c-.026 27.432-22.257 49.663-49.689 49.688z"/>
- <path fill="currentColor" d="M356.508 244.087h-73.214c-27.429-.031-49.658-22.259-49.689-49.688v-73.203c.042-9.39 7.666-16.98 17.056-16.98s17.013 7.59 17.055 16.98v73.214c.007 8.601 6.977 15.571 15.578 15.577h73.214a17.055 17.055 0 110 34.112v-.012z"/>
- </g>
-</svg>
diff --git a/backend/app/assets/images/backend-close.svg b/backend/app/assets/images/backend-close.svg
deleted file mode 100644
index 58e7937096..0000000000
--- a/backend/app/assets/images/backend-close.svg
+++ /dev/null
@@ -1,7 +0,0 @@
-<svg width="100%" height="100%" viewBox="0 0 512 512" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
- <g transform="matrix(5.37908e-15,-16.6134,-16.6134,-5.37908e-15,470.536,472.199)">
- <path d="M14.061,12.927L24.78,23.646C25.073,23.939 25.073,24.414 24.78,24.707C24.487,25 24.013,25 23.72,24.707L13,13.987L2.28,24.707C1.987,25 1.513,25 1.22,24.707C0.927,24.414 0.927,23.939 1.22,23.646L11.939,12.927L1.22,2.207C0.927,1.914 0.927,1.439 1.22,1.146C1.366,1 1.558,0.927 1.75,0.927C1.942,0.927 2.134,1 2.28,1.146L13,11.866L23.72,1.146C23.866,1 24.058,0.927 24.25,0.927C24.442,0.927 24.634,1 24.78,1.146C25.073,1.439 25.073,1.914 24.78,2.207L14.061,12.927Z" style="fill-rule:nonzero;stroke:currentColor;stroke-width:2.05px;"/>
- </g>
-</svg>
-
-<!-- CANCEL CLOSE VOID-->
diff --git a/backend/app/assets/images/backend-default-layout.svg b/backend/app/assets/images/backend-default-layout.svg
deleted file mode 100644
index 3420ecc3b7..0000000000
--- a/backend/app/assets/images/backend-default-layout.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-<svg viewBox="0 0 1000 1000" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="1.5">
- <path d="M959.135 94.233c0-34.377-27.91-62.287-62.287-62.287H605.892c-34.377 0-62.287 27.91-62.287 62.287v808.965c0 34.377 27.91 62.287 62.287 62.287h290.956c34.377 0 62.287-27.91 62.287-62.287V94.233zM456.186 94.097c0-34.447-27.967-62.414-62.414-62.414H103.07c-34.447 0-62.414 27.967-62.414 62.414v304.939c0 34.447 27.967 62.414 62.414 62.414h290.702c34.447 0 62.414-27.967 62.414-62.414V94.097zM456.214 598.525c0-34.868-28.309-63.177-63.177-63.177H103.861c-34.869 0-63.177 28.309-63.177 63.177v303.413c0 34.868 28.308 63.177 63.177 63.177h289.176c34.868 0 63.177-28.309 63.177-63.177V598.525z" fill="none" stroke="currentColor" stroke-width="41.67"/>
- <text x="141.599" y="355.618" font-family="Helvetica" font-size="300">A</text>
- <text x="140.455" y="860.271" font-family="Helvetica" font-size="300">C</text>
- <text x="653.924" y="607.221" font-family="Helvetica" font-size="300">B</text>
-</svg>
diff --git a/backend/app/assets/images/backend-delete.svg b/backend/app/assets/images/backend-delete.svg
deleted file mode 100644
index c32b1da0ed..0000000000
--- a/backend/app/assets/images/backend-delete.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2">
- <g fill-rule="nonzero" stroke="currentColor" stroke-width="5">
- <path fill="currentColor" d="M379.692 486.413H133.071c-25.538 0-46.241-20.703-46.241-46.241V147.31c.038-8.486 6.928-15.345 15.414-15.345s15.376 6.859 15.414 15.345v292.862c0 8.513 6.901 15.414 15.413 15.414h246.621c8.513 0 15.414-6.901 15.414-15.414V147.31c.038-8.486 6.927-15.345 15.413-15.345s15.376 6.859 15.414 15.345v292.862c0 25.538-20.703 46.241-46.241 46.241zM441.347 116.483H71.416c-8.485-.038-15.345-6.928-15.345-15.414s6.86-15.376 15.345-15.414h369.931c8.486.038 15.345 6.928 15.345 15.414s-6.859 15.376-15.345 15.414z"/>
- <path fill="currentColor" d="M318.037 116.483c-8.513 0-15.414-6.901-15.414-15.414V54.828H210.14v46.241c-.038 8.486-6.927 15.345-15.413 15.345s-15.376-6.859-15.414-15.345V39.414c0-8.513 6.901-15.414 15.414-15.414h123.31c8.513 0 15.414 6.901 15.414 15.414v61.655c0 8.513-6.901 15.414-15.414 15.414zM256.382 409.344c-8.513 0-15.414-6.901-15.414-15.413V178.138c.038-8.486 6.928-15.345 15.414-15.345s15.375 6.859 15.413 15.345v215.793c0 8.512-6.901 15.413-15.413 15.413zM333.451 378.517c-8.513 0-15.414-6.901-15.414-15.414V208.965c.038-8.486 6.928-15.345 15.414-15.345s15.375 6.859 15.413 15.345v154.138c0 8.513-6.901 15.414-15.413 15.414zM179.313 378.517c-8.513 0-15.414-6.901-15.414-15.414V208.965c.038-8.486 6.928-15.345 15.414-15.345s15.376 6.859 15.414 15.345v154.138c0 8.513-6.901 15.414-15.414 15.414z"/>
- </g>
-</svg>
diff --git a/backend/app/assets/images/backend-double-chevron-left.svg b/backend/app/assets/images/backend-double-chevron-left.svg
deleted file mode 100644
index baf63f4d71..0000000000
--- a/backend/app/assets/images/backend-double-chevron-left.svg
+++ /dev/null
@@ -1,15 +0,0 @@
-<svg
- fill="currentColor"
- width="100%"
- height="100%"
- viewBox="0 0 2134 2134"
- version="1.1"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xml:space="preserve"
-
- style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"><path
- d="M936.585,1110.18l923.077,923.077c24.039,24.039 62.981,24.039 87.02,0c24.038,-24.038 24.038,-62.98 0,-87.019l-879.568,-879.567l879.568,-879.568c24.038,-24.038 24.038,-62.98 0,-87.019c-12.02,-12.019 -27.725,-18.029 -43.51,-18.029c-15.785,0 -31.49,6.01 -43.51,18.029l-923.077,923.077c-24.038,24.039 -24.038,62.981 0,87.019Z"
- style="fill-rule:nonzero;stroke:currentColor;stroke-width:75px;"/><path
- d="M177.698,1110.18l923.077,923.077c24.038,24.039 62.98,24.039 87.019,0c24.038,-24.038 24.038,-62.98 0,-87.019l-879.568,-879.567l879.568,-879.568c24.038,-24.038 24.038,-62.98 0,-87.019c-12.019,-12.019 -27.725,-18.029 -43.51,-18.029c-15.785,0 -31.49,6.01 -43.509,18.029l-923.077,923.077c-24.039,24.039 -24.039,62.981 0,87.019Z"
- style="fill-rule:nonzero;stroke:currentColor;stroke-width:75px;"/></svg>
diff --git a/backend/app/assets/images/backend-double-chevron-right.svg b/backend/app/assets/images/backend-double-chevron-right.svg
deleted file mode 100644
index 40dfb5bf2e..0000000000
--- a/backend/app/assets/images/backend-double-chevron-right.svg
+++ /dev/null
@@ -1,17 +0,0 @@
-<svg
- fill="currentColor"
- width="100%"
- height="100%"
- viewBox="0 0 2134 2134"
- version="1.1"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xml:space="preserve"
-
- style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
- <g><path
- d="M1187.79,1023.16l-923.077,-923.077c-24.039,-24.038 -62.981,-24.038 -87.019,0c-24.039,24.039 -24.039,62.981 0,87.019l879.567,879.568l-879.567,879.567c-24.039,24.039 -24.039,62.981 0,87.019c12.019,12.02 27.724,18.029 43.509,18.029c15.785,0 31.491,-6.009 43.51,-18.029l923.077,-923.077c24.038,-24.038 24.038,-62.98 0,-87.019Z"
- style="fill-rule:nonzero;stroke:currentColor;stroke-width:75px;"/><path
- d="M1946.68,1023.16l-923.077,-923.077c-24.039,-24.038 -62.981,-24.038 -87.02,0c-24.038,24.039 -24.038,62.981 0,87.019l879.568,879.568l-879.568,879.567c-24.038,24.039 -24.038,62.981 0,87.019c12.02,12.02 27.725,18.029 43.51,18.029c15.785,0 31.49,-6.009 43.51,-18.029l923.077,-923.077c24.038,-24.038 24.038,-62.98 0,-87.019Z"
- style="fill-rule:nonzero;stroke:currentColor;stroke-width:75px;"/></g>
-</svg>
diff --git a/backend/app/assets/images/backend-edit.svg b/backend/app/assets/images/backend-edit.svg
deleted file mode 100644
index c4377bee5e..0000000000
--- a/backend/app/assets/images/backend-edit.svg
+++ /dev/null
@@ -1,14 +0,0 @@
-<svg width="100%" height="100%" viewBox="0 0 512 512" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
- <g transform="matrix(18.3151,0,0,-18.3533,-16.8313,533.62)" fill="currentColor">
- <path d="M2,3.002C1.715,3 1.442,3.121 1.251,3.333C1.06,3.545 0.969,3.829 1,4.112L1.77,11.112C1.797,11.336 1.9,11.544 2.06,11.702L18.42,28.062C19.02,28.664 19.835,29.002 20.685,29.002C21.535,29.002 22.35,28.664 22.95,28.062L26.06,24.952C26.662,24.352 27,23.537 27,22.687C27,21.837 26.662,21.023 26.06,20.422L9.71,4.072C9.552,3.912 9.344,3.81 9.12,3.782L2.12,3.012L2,3.002ZM3.73,10.552L3.13,5.132L8.55,5.732L24.65,21.832C24.876,22.057 25.003,22.363 25.003,22.682C25.003,23.001 24.876,23.307 24.65,23.532L21.53,26.652C21.305,26.878 20.999,27.005 20.68,27.005C20.361,27.005 20.055,26.878 19.83,26.652L3.73,10.552Z" style="fill-rule:nonzero;"/>
- </g>
- <g transform="matrix(18.3151,0,0,-18.3533,-16.8313,315.135)" fill="currentColor">
- <path d="M23,5.888C22.734,5.886 22.479,5.991 22.29,6.178L16.08,12.408C15.691,12.8 15.692,13.434 16.083,13.825C16.474,14.216 17.107,14.217 17.5,13.828L23.73,7.598C23.919,7.41 24.026,7.154 24.026,6.888C24.026,6.621 23.919,6.366 23.73,6.178C23.536,5.986 23.273,5.881 23,5.888Z" style="fill-rule:nonzero;"/>
- </g>
- <g transform="matrix(12.9508,-12.9778,-12.9508,-12.9778,273.886,649.445)" fill="currentColor">
- <rect x="7.39" y="16.1" width="11.01" height="2"/>
- </g>
- <g transform="matrix(17.7456,2.1377e-16,-2.1377e-16,-16,-40.1047,943)" fill="currentColor">
- <path d="M30,27L14.188,27C13.637,27.002 13.192,27.449 13.192,28C13.192,28.551 13.637,28.998 14.188,29L30,29C30.551,28.998 30.996,28.551 30.996,28C30.996,27.449 30.551,27.002 30,27Z" style="fill-rule:nonzero;"/>
- </g>
-</svg>
diff --git a/backend/app/assets/images/backend-enter.svg b/backend/app/assets/images/backend-enter.svg
deleted file mode 100644
index 6a95c1c7b3..0000000000
--- a/backend/app/assets/images/backend-enter.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2">
- <g fill-rule="nonzero" stroke="currentColor" stroke-width="10">
- <path fill="currentColor" d="M420.084 27.085H242.411v32.74h177.673c10.83 0 19.742 7.39 19.742 16.37v360.14c0 8.98-8.912 16.37-19.742 16.37H242.411v32.74h177.673c32.49 0 59.225-22.169 59.225-49.11V76.195c0-26.941-26.735-49.11-59.225-49.11z"/>
- <path fill="currentColor" d="M38.175 244.711v35.993h262.387l-71.985 71.986 25.555 26.095 89.982-89.983a36.003 36.003 0 0010.556-25.464c0-9.55-3.8-18.717-10.556-25.465l-89.982-89.982-25.555 24.835 71.985 71.985H38.175z"/>
- </g>
-</svg>
diff --git a/backend/app/assets/images/backend-envelope.svg b/backend/app/assets/images/backend-envelope.svg
deleted file mode 100644
index 6818ab715c..0000000000
--- a/backend/app/assets/images/backend-envelope.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2">
- <path fill="currentColor" d="M467.684 67.368H43.42c-20.261 0-36.728 17.504-36.728 39.01v295.271c0 21.506 16.467 39.009 36.728 39.009h424.264c20.261 0 36.727-17.503 36.727-39.009V106.377c0-21.505-16.466-39.009-36.727-39.009zM310.861 254.013L473.304 136.78v234.468L310.861 254.013zM467.684 98.476c1.12 0 2.24.663 3.214 1.68L255.552 255.568 40.205 100.156c.975-1.017 2.095-1.68 3.215-1.68h424.264zM37.8 371.246V136.78l162.443 117.234L37.8 371.247zm5.62 38.304c-1.12 0-2.24-.663-3.215-1.68L226.81 273.197l19.66 14.164c.456.353.995.477 1.493.768.477.27.912.497 1.43.725 1.992.85 4.045 1.452 6.14 1.452h.04c2.095 0 4.148-.601 6.14-1.452.518-.228.953-.456 1.43-.725.498-.29 1.037-.415 1.493-.768l19.64-14.164 186.623 134.675c-.974 1.016-2.094 1.68-3.214 1.68H43.42z" fill-rule="nonzero" stroke="currentColor" stroke-width="12.028213999999998"/>
-</svg>
diff --git a/backend/app/assets/images/backend-exit.svg b/backend/app/assets/images/backend-exit.svg
deleted file mode 100644
index b84ba37d59..0000000000
--- a/backend/app/assets/images/backend-exit.svg
+++ /dev/null
@@ -1,13 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 512 512" style="clip-rule:evenodd;fill-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;version:1">
-<style>
- .exit-svg {
- fill:currentColor;
- stroke-width:10px;
- stroke:currentColor;
- }
-</style>
- <g>
- <path d="M97.4 485.4l177.7 0 0-32.7 -177.7 0c-10.8 0-19.7-7.4-19.7-16.4l0-360.1c0-9 8.9-16.4 19.7-16.4l177.7 0 0-32.7 -177.7 0c-32.5 0-59.2 22.2-59.2 49.1l0 360.1c0 26.9 26.7 49.1 59.2 49.1Z" class="exit-svg"/>
- <path d="M162.8 230.6l0 36 262.4 0 -72 72 25.6 26.1 90-90c6.8-6.7 10.6-15.9 10.6-25.5 0-9.5-3.8-18.7-10.6-25.5l-90-90 -25.6 24.8 72 72 -262.4 0Z" class="exit-svg"/>
- </g>
-</svg>
diff --git a/backend/app/assets/images/backend-extensions.svg b/backend/app/assets/images/backend-extensions.svg
deleted file mode 100644
index 7d744ec918..0000000000
--- a/backend/app/assets/images/backend-extensions.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2">
- <path fill="currentColor" d="M393.125 111.801V33.08a3.896 3.896 0 00-3.896-3.896 3.89 3.89 0 00-3.893 3.892v78.73h-78.729a3.89 3.89 0 00-3.892 3.892 3.896 3.896 0 003.896 3.896h78.722l.003 78.726a3.896 3.896 0 003.897 3.896 3.88 3.88 0 002.75-1.142 3.88 3.88 0 001.142-2.75v-78.73h78.73a3.88 3.88 0 002.75-1.142 3.88 3.88 0 001.142-2.75 3.896 3.896 0 00-3.896-3.896l-78.726-.004z" fill-rule="nonzero" stroke="currentColor" stroke-width="49.022864"/>
- <path fill="currentColor" d="M32.262 225.097h167.202c14.366 0 26.001-11.635 26.001-26V31.893c0-14.366-11.635-26.001-26-26.001H32.261c-14.365 0-26 11.635-26 26v167.203c0 14.366 11.635 26.001 26 26.001zM58.263 57.895h115.2v115.2h-115.2v-115.2zM6.261 480.053c0 14.365 11.636 26 26.001 26h167.202c14.366 0 26.001-11.635 26.001-26V312.85c0-14.365-11.635-26-26-26H32.261c-14.365 0-26 11.635-26 26v167.203zM58.263 338.85h115.2v115.2h-115.2v-115.2zM287.218 480.053c0 14.365 11.635 26 26 26h167.203c14.365 0 26-11.635 26-26V312.85c0-14.365-11.635-26-26-26H313.219c-14.366 0-26.001 11.635-26.001 26v167.203zm52.001-141.202h115.2v115.2h-115.2v-115.2z" fill-rule="nonzero" stroke="currentColor" stroke-width="1.0075372"/>
-</svg>
diff --git a/backend/app/assets/images/backend-eye-open.svg b/backend/app/assets/images/backend-eye-open.svg
deleted file mode 100644
index 15777d07d6..0000000000
--- a/backend/app/assets/images/backend-eye-open.svg
+++ /dev/null
@@ -1,8 +0,0 @@
-<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2">
- <path fill="currentColor" d="M256 192c0 35.328-28.672 64-64 64 0 35.328 28.672 64 64 64s64-28.672 64-64-28.672-64-64-64zm0-128C124.736 64 0 212.736 0 256c0 43.264 124.736 192 256 192s256-148.736 256-192c0-43.264-124.736-192-256-192zm0 320c-70.688 0-128-57.312-128-128s57.312-128 128-128 128 57.312 128 128-57.312 128-128 128z" fill-rule="nonzero"/>
-</svg>
-
-
-<!-- To give Spree backwards compatability this file is duplicated in the following SVG files -->
- <!-- VIEW EYE-OPEN -->
-<!-- If you update this file, be sure to make the same changes in all of the files above -->
diff --git a/backend/app/assets/images/backend-eye-slash-fill.svg b/backend/app/assets/images/backend-eye-slash-fill.svg
deleted file mode 100644
index 9339262877..0000000000
--- a/backend/app/assets/images/backend-eye-slash-fill.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eye-slash-fill" viewBox="0 0 16 16">
- <path d="m10.79 12.912-1.614-1.615a3.5 3.5 0 0 1-4.474-4.474l-2.06-2.06C.938 6.278 0 8 0 8s3 5.5 8 5.5a7.029 7.029 0 0 0 2.79-.588zM5.21 3.088A7.028 7.028 0 0 1 8 2.5c5 0 8 5.5 8 5.5s-.939 1.721-2.641 3.238l-2.062-2.062a3.5 3.5 0 0 0-4.474-4.474L5.21 3.089z"/>
- <path d="M5.525 7.646a2.5 2.5 0 0 0 2.829 2.829l-2.83-2.829zm4.95.708-2.829-2.83a2.5 2.5 0 0 1 2.829 2.829zm3.171 6-12-12 .708-.708 12 12-.708.708z"/>
-</svg>
\ No newline at end of file
diff --git a/backend/app/assets/images/backend-file-richtext.svg b/backend/app/assets/images/backend-file-richtext.svg
deleted file mode 100644
index 22edf68c14..0000000000
--- a/backend/app/assets/images/backend-file-richtext.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-file-richtext" viewBox="0 0 16 16">
- <path d="M7 4.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0zm-.861 1.542 1.33.886 1.854-1.855a.25.25 0 0 1 .289-.047l1.888.974V7.5a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V7s1.54-1.274 1.639-1.208zM5 9a.5.5 0 0 0 0 1h6a.5.5 0 0 0 0-1H5zm0 2a.5.5 0 0 0 0 1h3a.5.5 0 0 0 0-1H5z"/>
- <path d="M2 2a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2zm10-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1z"/>
-</svg>
\ No newline at end of file
diff --git a/backend/app/assets/images/backend-file.svg b/backend/app/assets/images/backend-file.svg
deleted file mode 100644
index 55d8386c91..0000000000
--- a/backend/app/assets/images/backend-file.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2">
- <g fill-rule="nonzero">
- <path fill="currentColor" d="M433.231 19.692H78.769C70.615 19.692 64 26.308 64 34.462v362.365c0 1.923.393 3.839 1.141 5.644a14.762 14.762 0 003.186 4.798l80.711 80.712a14.798 14.798 0 004.799 3.186 14.754 14.754 0 005.644 1.141h273.75c8.154 0 14.769-6.616 14.769-14.77V34.462c0-8.154-6.615-14.77-14.769-14.77zM144.712 441.885l-30.289-30.289h30.289v30.289zm273.75 20.884H174.25v-65.942c0-8.154-6.615-14.769-14.769-14.769H93.538V49.231h324.924v413.538z" stroke="currentColor" stroke-width="5"/>
- <path fill="currentColor" d="M138.817 108.308h106.106a9.84 9.84 0 009.846-9.846 9.84 9.84 0 00-9.846-9.847H138.817a9.84 9.84 0 00-9.846 9.847 9.84 9.84 0 009.846 9.846zM138.817 147.692h53.048a9.84 9.84 0 009.847-9.846 9.84 9.84 0 00-9.847-9.846h-53.048a9.84 9.84 0 00-9.846 9.846 9.84 9.84 0 009.846 9.846zM278.85 364.676h53.048a9.84 9.84 0 009.846-9.846 9.84 9.84 0 00-9.846-9.846H278.85a9.84 9.84 0 00-9.847 9.846 9.84 9.84 0 009.847 9.846zM214.154 137.846a9.84 9.84 0 009.846 9.846h64a9.84 9.84 0 009.846-9.846A9.84 9.84 0 00288 128h-64a9.84 9.84 0 00-9.846 9.846zM137.846 310.154h236.308a9.84 9.84 0 009.846-9.846V182.154a9.84 9.84 0 00-9.846-9.846H137.846a9.84 9.84 0 00-9.846 9.846v118.154a9.84 9.84 0 009.846 9.846zm187.077-92.923v19.692h-32v-19.692h32zm-32-9.846V192h32v15.385h-32zm0 59.077v-19.693h32v19.693h-32zm32 9.846v14.154h-32v-14.154h32zm-177.231-29.539h135.385v19.693H147.692v-19.693zm187.077 0h29.539v19.693h-29.539v-19.693zm29.539-9.846h-29.539v-19.692h29.539v19.692zm-81.231 0H147.692v-19.692h135.385v19.692zm-135.385 39.385h135.385v14.154H147.692v-14.154zm187.077 14.154v-14.154h29.539v14.154h-29.539zm29.539-83.077h-29.539V192h29.539v15.385zM283.077 192v15.385H147.692V192h135.385zM244.923 344.615H138.817a9.84 9.84 0 00-9.846 9.847 9.84 9.84 0 009.846 9.846h106.106a9.84 9.84 0 009.846-9.846 9.84 9.84 0 00-9.846-9.847zM333.805 383.007H227.699a9.84 9.84 0 00-9.846 9.846 9.84 9.84 0 009.846 9.846h106.106a9.84 9.84 0 009.846-9.846 9.84 9.84 0 00-9.846-9.846z"/>
- </g>
-</svg>
diff --git a/backend/app/assets/images/backend-filter.svg b/backend/app/assets/images/backend-filter.svg
deleted file mode 100644
index fce8ff5409..0000000000
--- a/backend/app/assets/images/backend-filter.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10">
- <path fill="none" d="M51.856 81.336L208 263v201.872l96-60V263L460.144 81.336C469.04 70.936 461.568 55 447.776 55H64.224C50.432 55 42.96 70.936 51.856 81.336z" stroke="currentColor" stroke-width="41"/>
-</svg>
diff --git a/backend/app/assets/images/backend-folder.svg b/backend/app/assets/images/backend-folder.svg
deleted file mode 100644
index e03f026bd6..0000000000
--- a/backend/app/assets/images/backend-folder.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2">
- <path fill="currentColor" d="M64 448c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h112a15.998 15.998 0 0112.32 5.76L236.8 128H432c8.809.039 15.929 7.191 15.929 16 0 8.809-7.12 15.961-15.929 16H229.28a16.001 16.001 0 01-12.16-5.76L168.48 96H64c-8.837 0-16 7.163-16 16v288c0 8.837 7.163 16 16 16 8.809.039 15.929 7.191 15.929 16 0 8.809-7.12 15.961-15.929 16z" fill-rule="nonzero" stroke="currentColor"/>
- <path fill="currentColor" d="M406.08 448H64a16 16 0 01-16-19.36l48-224A16 16 0 01112 192h368a16 16 0 0116 19.36l-42.88 198.72c-4.76 22.161-24.373 37.972-47.04 37.92zM83.84 416h322.24a16 16 0 0016-12.64L460.16 224h-336L83.84 416z" fill-rule="nonzero" stroke="currentColor"/>
-</svg>
diff --git a/backend/app/assets/images/backend-fullscreen-exit.svg b/backend/app/assets/images/backend-fullscreen-exit.svg
deleted file mode 100644
index b9bdb1b166..0000000000
--- a/backend/app/assets/images/backend-fullscreen-exit.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-fullscreen-exit" viewBox="0 0 16 16">
- <path d="M5.5 0a.5.5 0 0 1 .5.5v4A1.5 1.5 0 0 1 4.5 6h-4a.5.5 0 0 1 0-1h4a.5.5 0 0 0 .5-.5v-4a.5.5 0 0 1 .5-.5zm5 0a.5.5 0 0 1 .5.5v4a.5.5 0 0 0 .5.5h4a.5.5 0 0 1 0 1h-4A1.5 1.5 0 0 1 10 4.5v-4a.5.5 0 0 1 .5-.5zM0 10.5a.5.5 0 0 1 .5-.5h4A1.5 1.5 0 0 1 6 11.5v4a.5.5 0 0 1-1 0v-4a.5.5 0 0 0-.5-.5h-4a.5.5 0 0 1-.5-.5zm10 1a1.5 1.5 0 0 1 1.5-1.5h4a.5.5 0 0 1 0 1h-4a.5.5 0 0 0-.5.5v4a.5.5 0 0 1-1 0v-4z"/>
-</svg>
\ No newline at end of file
diff --git a/backend/app/assets/images/backend-fullscreen.svg b/backend/app/assets/images/backend-fullscreen.svg
deleted file mode 100644
index 7789d36bd1..0000000000
--- a/backend/app/assets/images/backend-fullscreen.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-fullscreen" viewBox="0 0 16 16">
- <path d="M1.5 1a.5.5 0 0 0-.5.5v4a.5.5 0 0 1-1 0v-4A1.5 1.5 0 0 1 1.5 0h4a.5.5 0 0 1 0 1h-4zM10 .5a.5.5 0 0 1 .5-.5h4A1.5 1.5 0 0 1 16 1.5v4a.5.5 0 0 1-1 0v-4a.5.5 0 0 0-.5-.5h-4a.5.5 0 0 1-.5-.5zM.5 10a.5.5 0 0 1 .5.5v4a.5.5 0 0 0 .5.5h4a.5.5 0 0 1 0 1h-4A1.5 1.5 0 0 1 0 14.5v-4a.5.5 0 0 1 .5-.5zm15 0a.5.5 0 0 1 .5.5v4a1.5 1.5 0 0 1-1.5 1.5h-4a.5.5 0 0 1 0-1h4a.5.5 0 0 0 .5-.5v-4a.5.5 0 0 1 .5-.5z"/>
-</svg>
\ No newline at end of file
diff --git a/backend/app/assets/images/backend-images.svg b/backend/app/assets/images/backend-images.svg
deleted file mode 100644
index 7eecf46e59..0000000000
--- a/backend/app/assets/images/backend-images.svg
+++ /dev/null
@@ -1,7 +0,0 @@
-<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2">
- <g fill-rule="nonzero" stroke="currentColor" stroke-width="5">
- <path fill="currentColor" d="M385.755 426.767H48.337c-8.47 0-15.337-6.867-15.337-15.338V43.337C33 34.867 39.867 28 48.337 28h337.418c8.47 0 15.337 6.867 15.337 15.337v368.092c0 8.471-6.867 15.338-15.337 15.338zM63.674 396.092h306.744V58.674H63.674v337.418z"/>
- <path fill="currentColor" d="M464.778 483.115H127.36c-8.443-.038-15.269-6.893-15.269-15.337 0-8.444 6.826-15.299 15.269-15.337h322.081V115.023h-15.337c-8.444-.038-15.269-6.893-15.269-15.337 0-8.444 6.825-15.3 15.269-15.337h30.674c8.471 0 15.337 6.866 15.337 15.337v368.092c0 8.471-6.866 15.337-15.337 15.337z"/>
- <path fill="currentColor" d="M48.337 347.933a15.336 15.336 0 01-10.736-4.447c-5.946-5.982-5.946-15.644 0-21.626l62.116-63.802c14.221-14.524 36.944-16.418 53.373-4.448l55.061 39.876a10.428 10.428 0 0013.496-1.226l56.748-57.055c16.343-15.777 42.245-15.777 58.588 0l59.508 60.275c5.171 6.122 4.758 15.193-.949 20.819-5.706 5.626-14.782 5.911-20.83.653l-59.508-60.275a10.586 10.586 0 00-15.337 0l-56.901 57.515c-14.211 14.509-36.889 16.464-53.373 4.601l-55.061-39.877a10.277 10.277 0 00-13.497 1.074l-61.808 63.342a15.336 15.336 0 01-10.89 4.601zM162 210.279c-33.882 0-61.348-27.466-61.348-61.348S128.118 87.582 162 87.582s61.349 27.467 61.349 61.349-27.467 61.348-61.349 61.348zm0-92.023c-16.941 0-30.674 13.734-30.674 30.675 0 16.941 13.733 30.674 30.674 30.674s30.675-13.733 30.675-30.674-13.734-30.675-30.675-30.675h0z"/>
- </g>
-</svg>
diff --git a/backend/app/assets/images/backend-info.svg b/backend/app/assets/images/backend-info.svg
deleted file mode 100644
index 59cc4b1d69..0000000000
--- a/backend/app/assets/images/backend-info.svg
+++ /dev/null
@@ -1,7 +0,0 @@
-<svg width="100%" height="100%" viewBox="0 0 100 100" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
- <g>
- <g fill="currentColor">
- <path d="M50,94C74.301,94 94,74.301 94,50C94,25.699 74.301,6 50,6C25.699,6 6,25.699 6,50C6,74.301 25.699,94 50,94ZM50,86C69.882,86 86,69.882 86,50C86,30.118 69.882,14 50,14C30.118,14 14,30.118 14,50C14,69.882 30.118,86 50,86ZM57,31.013C57,32.671 56.431,34.085 55.286,35.248C54.145,36.417 52.769,37 51.161,37C49.547,37 48.168,36.417 47.013,35.248C45.861,34.085 45.283,32.671 45.283,31.013C45.283,29.359 45.861,27.942 47.013,26.764C48.165,25.586 49.547,25 51.161,25C52.769,25 54.145,25.589 55.286,26.764C56.431,27.942 57,29.359 57,31.013ZM56.427,70.466C54.71,71.292 53.336,71.919 52.314,72.352C51.291,72.785 50.101,73 48.746,73C46.666,73 45.047,72.381 43.892,71.149C42.738,69.913 42.161,68.345 42.161,66.445C42.161,65.709 42.203,64.952 42.29,64.181C42.377,63.41 42.516,62.539 42.707,61.567L44.856,52.321C45.047,51.436 45.21,50.596 45.339,49.802C45.471,49.014 45.535,48.289 45.535,47.635C45.535,46.454 45.334,45.629 44.934,45.165C44.533,44.7 43.77,44.465 42.637,44.465C42.081,44.465 41.51,44.574 40.928,44.783C40.344,44.993 40,42.534 40,42.534C41.407,41.837 42.752,41.241 44.039,40.745C45.325,40.249 46.541,40 47.691,40C49.757,40 51.352,40.608 52.471,41.823C53.591,43.038 54.151,44.614 54.151,46.558C54.151,46.959 54.114,47.667 54.036,48.678C53.958,49.693 53.814,50.622 53.605,51.467L51.465,60.679C51.291,61.418 51.133,62.264 50.996,63.215C50.855,64.161 50.787,64.883 50.787,65.368C50.787,66.591 51.011,67.425 51.461,67.87C51.913,68.314 52.693,68.535 53.8,68.535C54.321,68.535 54.912,68.423 55.57,68.202C56.227,67.982 56.427,70.466 56.427,70.466Z"/>
- </g>
- </g>
-</svg>
diff --git a/backend/app/assets/images/backend-items.svg b/backend/app/assets/images/backend-items.svg
deleted file mode 100644
index a13cf103ef..0000000000
--- a/backend/app/assets/images/backend-items.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2">
- <g fill-rule="nonzero" stroke="currentColor">
- <path fill="currentColor" d="M77.188 231.177h133.099c11.436 0 20.698-9.262 20.698-20.697V77.381c0-11.436-9.262-20.698-20.698-20.698H77.188c-11.435 0-20.697 9.262-20.697 20.698V210.48c0 11.435 9.262 20.697 20.697 20.697zM97.886 98.079h91.704v91.703H97.886V98.079zM300.84 231.177h133.098c11.436 0 20.698-9.262 20.698-20.697V77.381c0-11.436-9.262-20.698-20.698-20.698H300.84c-11.436 0-20.698 9.262-20.698 20.698V210.48c0 11.435 9.262 20.697 20.698 20.697zm20.697-133.098h91.704v91.703h-91.704V98.079zM56.491 434.131c0 11.436 9.262 20.698 20.697 20.698h133.099c11.436 0 20.698-9.262 20.698-20.698V301.032c0-11.435-9.262-20.698-20.698-20.698H77.188c-11.435 0-20.697 9.263-20.697 20.698v133.099zM97.886 321.73h91.704v91.703H97.886V321.73zM280.142 434.131c0 11.436 9.262 20.698 20.698 20.698h133.098c11.436 0 20.698-9.262 20.698-20.698V301.032c0-11.435-9.262-20.698-20.698-20.698H300.84c-11.436 0-20.698 9.263-20.698 20.698v133.099zm41.395-112.401h91.704v91.703h-91.704V321.73z"/>
- </g>
-</svg>
diff --git a/backend/app/assets/images/backend-leaf.svg b/backend/app/assets/images/backend-leaf.svg
deleted file mode 100644
index 571529572f..0000000000
--- a/backend/app/assets/images/backend-leaf.svg
+++ /dev/null
@@ -1,7 +0,0 @@
-<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2">
- <g fill-rule="nonzero" stroke="currentColor" stroke-width="4.5">
- <path fill="currentColor" d="M323.875 484.003H111.146c-27.408-.062-49.601-22.281-49.632-49.688V153.829c.031-27.429 22.259-49.658 49.688-49.689h139.516a17.052 17.052 0 0112.052 4.992l105.745 105.847a17.056 17.056 0 015.003 12.064v207.272c-.031 27.411-22.231 49.632-49.643 49.688zM111.146 138.251c-8.579.038-15.515 6.999-15.521 15.578v280.486c.012 8.575 6.945 15.533 15.521 15.577h212.729c8.598-.013 15.565-6.979 15.577-15.577V234.104L243.6 138.251H111.146z"/>
- <path fill="currentColor" d="M400.057 407.821h-43.549c-9.39-.042-16.98-7.665-16.98-17.055s7.59-17.014 16.98-17.056h43.549c8.598-.012 15.565-6.979 15.577-15.577V77.647c-.012-8.598-6.979-15.565-15.577-15.577h-212.73c-8.575.043-15.508 7.001-15.52 15.577v43.549c-.042 9.39-7.666 16.979-17.056 16.979s-17.013-7.589-17.055-16.979V77.647c.025-27.432 22.256-49.664 49.688-49.689h212.673c27.432.025 49.663 22.257 49.689 49.689v280.486c-.026 27.432-22.257 49.663-49.689 49.688z"/>
- <path fill="currentColor" d="M356.508 244.087h-73.214c-27.429-.031-49.658-22.259-49.689-49.688v-73.203c.042-9.39 7.666-16.98 17.056-16.98s17.013 7.59 17.055 16.98v73.214c.007 8.601 6.977 15.571 15.578 15.577h73.214a17.055 17.055 0 110 34.112v-.012z"/>
- </g>
-</svg>
diff --git a/backend/app/assets/images/backend-list.svg b/backend/app/assets/images/backend-list.svg
deleted file mode 100644
index a7b0a7480d..0000000000
--- a/backend/app/assets/images/backend-list.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2">
- <g fill-rule="nonzero" stroke="currentColor" fill="currentColor">
- <path fill="currentColor" d="M56.25 167.83h95.01c8.84 0 16-7.16 16-16V79.61c0-8.84-7.16-16-16-16H56.25c-8.84 0-16 7.16-16 16v72.22c0 8.84 7.16 16 16 16zm16-72.22h63.01v40.22H72.25V95.61zM471.75 79.61c0-8.84-7.16-16-16-16H219.21c-8.84 0-16 7.16-16 16v72.22c0 8.84 7.16 16 16 16h236.54c8.84 0 16-7.16 16-16V79.61zm-32 56.22H235.21V95.61h204.54v40.22zM40.25 292.11c0 8.84 7.16 16 16 16h95.01c8.84 0 16-7.16 16-16v-72.22c0-8.84-7.16-16-16-16H56.25c-8.84 0-16 7.16-16 16v72.22zm32-56.22h63.01v40.22H72.25v-40.22zM471.75 219.89c0-8.84-7.16-16-16-16H219.21c-8.84 0-16 7.16-16 16v72.22c0 8.84 7.16 16 16 16h236.54c8.84 0 16-7.16 16-16v-72.22zm-32 56.22H235.21v-40.22h204.54v40.22zM40.25 432.39c0 8.84 7.16 16 16 16h95.01c8.84 0 16-7.16 16-16v-72.22c0-8.84-7.16-16-16-16H56.25c-8.84 0-16 7.16-16 16v72.22zm32-56.22h63.01v40.22H72.25v-40.22zM455.75 448.39c8.84 0 16-7.16 16-16v-72.22c0-8.84-7.16-16-16-16H219.21c-8.84 0-16 7.16-16 16v72.22c0 8.84 7.16 16 16 16h236.54zm-220.54-72.22h204.54v40.22H235.21v-40.22z"/>
- </g>
-</svg>
diff --git a/backend/app/assets/images/backend-location.svg b/backend/app/assets/images/backend-location.svg
deleted file mode 100644
index 4ed78250d0..0000000000
--- a/backend/app/assets/images/backend-location.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2">
- <path fill="currentColor" d="M256.24 283.815c51.348 0 93.105-41.773 93.105-93.105s-41.757-93.105-93.105-93.105c-51.347 0-93.104 41.758-93.104 93.105s41.757 93.105 93.104 93.105zm0-170.692c42.797 0 77.588 34.79 77.588 77.587 0 42.797-34.79 77.587-77.588 77.587-42.797 0-77.587-34.79-77.587-77.587 0-42.797 34.79-77.587 77.587-77.587z" stroke="currentColor" stroke-width="9.4656384"/>
- <path fill="currentColor" d="M256.21 8.442C153.514 8.442 70 90.932 70 194.667c0 108.622 93.12 219.742 161.009 297.842.248.31 11.141 12.491 24.61 12.491h1.195c13.454 0 24.363-12.181 24.611-12.491 67.92-78.1 161.025-189.205 161.025-297.842 0-103.734-83.53-186.225-186.24-186.225zm1.815 463.708c-.326.31-1.273.993-2.095 1.52-.155-.419-1.303-1.334-2.002-2.063-56.871-65.437-152.893-175.875-152.893-276.94 0-85.563 69.627-155.19 155.174-155.19 85.594 0 155.206 69.627 155.206 155.205 0 101.05-96.022 211.488-153.39 277.468z" stroke="currentColor" stroke-width="11.0173824"/>
-</svg>
diff --git a/backend/app/assets/images/backend-menu.svg b/backend/app/assets/images/backend-menu.svg
deleted file mode 100644
index a03013cb54..0000000000
--- a/backend/app/assets/images/backend-menu.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2">
- <g fill-rule="nonzero" stroke="currentColor" fill="currentColor" stroke-width="10">
- <path d="M477.538 241.231H34.462c-8.154 0-14.77 6.615-14.77 14.769s6.616 14.769 14.77 14.769h443.076c8.154 0 14.77-6.615 14.77-14.769s-6.616-14.769-14.77-14.769zM34.462 121.615h443.076c8.154 0 14.77-6.615 14.77-14.769s-6.616-14.769-14.77-14.769H34.462c-8.154 0-14.77 6.615-14.77 14.769s6.616 14.769 14.77 14.769zM477.538 391.385H34.462c-8.154 0-14.77 6.615-14.77 14.769s6.616 14.769 14.77 14.769h443.076c8.154 0 14.77-6.615 14.77-14.769s-6.616-14.769-14.77-14.769z"/>
- </g>
-</svg>
diff --git a/backend/app/assets/images/backend-mobile.svg b/backend/app/assets/images/backend-mobile.svg
deleted file mode 100644
index 11a2a2f896..0000000000
--- a/backend/app/assets/images/backend-mobile.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
- <path d="M298.667 25.6h-85.333c-4.71 0-8.533 3.823-8.533 8.533 0 4.71 3.823 8.533 8.533 8.533h85.333c4.71 0 8.533-3.823 8.533-8.533 0-4.71-3.823-8.533-8.533-8.533zM358.4 25.6h-8.533c-4.71 0-8.533 3.823-8.533 8.533 0 4.71 3.823 8.533 8.533 8.533h8.533c4.71 0 8.533-3.823 8.533-8.533 0-4.71-3.823-8.533-8.533-8.533zM266.598 435.2H245.41c-12.979 0-23.543 10.564-23.543 23.543v4.122c0 12.979 10.564 23.535 23.535 23.535h21.188c12.979 0 23.543-10.556 23.543-23.535v-4.122c0-12.979-10.564-23.543-23.535-23.543zm6.469 27.665c0 3.567-2.901 6.468-6.468 6.468H245.41c-3.575 0-6.477-2.901-6.477-6.468v-4.122c0-3.575 2.901-6.477 6.477-6.477h21.18c3.576 0 6.477 2.901 6.477 6.477v4.122z"/>
- <path d="M370.227 0H141.781c-17.007 0-30.848 13.841-30.848 30.848v450.304c0 17.007 13.841 30.848 30.848 30.848h228.437c17.007 0 30.848-13.841 30.848-30.839V30.848C401.067 13.841 387.226 0 370.227 0zM384 481.152c0 7.595-6.178 13.781-13.773 13.781H141.781c-7.603 0-13.781-6.187-13.781-13.773V30.848c0-7.595 6.178-13.781 13.781-13.781h228.437c7.603 0 13.781 6.187 13.781 13.781v450.304z"/>
- <path d="M392.533 51.2H119.467c-4.71 0-8.533 3.823-8.533 8.533v358.4c0 4.71 3.823 8.533 8.533 8.533h273.067c4.71 0 8.533-3.823 8.533-8.533v-358.4c0-4.71-3.823-8.533-8.534-8.533zM384 409.6H128V68.267h256V409.6z"/>
-</svg>
diff --git a/backend/app/assets/images/backend-money.svg b/backend/app/assets/images/backend-money.svg
deleted file mode 100644
index a96c64fd90..0000000000
--- a/backend/app/assets/images/backend-money.svg
+++ /dev/null
@@ -1 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="100%" height="100%" viewBox="0 0 2134 2134" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"><g><path d="M1066.67,133.333c-515.496,0 -933.334,417.838 -933.334,933.334c0,515.429 417.838,933.333 933.334,933.333c515.429,0 933.333,-417.904 933.333,-933.333c0,-515.496 -417.904,-933.334 -933.333,-933.334Zm0,1666.67c-404.429,0 -733.334,-328.971 -733.334,-733.333c0,-404.363 328.909,-733.334 733.334,-733.334c404.296,0 733.333,328.971 733.333,733.334c0,404.362 -329.037,733.333 -733.333,733.333Zm333.333,-527.279c0,123.046 -84.375,245.9 -266.667,282.225l0,83.596c0,15.558 -12.629,28.125 -28.125,28.125l-77.083,0c-15.558,0 -28.125,-12.567 -28.125,-28.125l0,-72.525c-92.708,-3.321 -193.554,-28.517 -251.433,-63.804c-12.763,-7.813 -18.229,-22.267 -13.671,-35.68l36.783,-107.091c2.538,-7.167 8.529,-12.954 16.275,-15.625c7.879,-2.538 16.538,-1.692 23.567,2.475l8.4,5.012c58.725,34.442 134.896,54.234 209.246,54.234c108.204,0 172.916,-46.159 172.916,-123.371c0,-57.617 -27.604,-102.734 -164.325,-149.609c-190.95,-63.666 -283.854,-157.937 -283.854,-288.02c0,-133.138 97.525,-232.421 246.096,-265.234l0,-84.512c0,-15.559 12.567,-28.125 28.125,-28.125l77.083,0c15.496,0 28.125,12.566 28.125,28.125l0,73.046c81.9,2.995 157.617,19.466 210.025,47.462c14.063,7.554 20.38,23.113 15.171,37.304l-38.346,104.038c-2.67,6.966 -8.595,12.5 -16.27,15.104c-7.688,2.475 -16.146,1.629 -23.046,-2.279l-8.209,-4.559c-32.683,-18.62 -94.2,-38.412 -168.62,-38.412c-112.371,0 -152.28,56.317 -152.28,104.492c0,64.129 40.888,98.241 175.067,145.766c135.154,48.896 273.175,122.334 273.175,295.967Z" style="fill:currentColor;fill-rule:nonzero;"/></g></svg>
diff --git a/backend/app/assets/images/backend-move.svg b/backend/app/assets/images/backend-move.svg
deleted file mode 100644
index 8e3034e5f3..0000000000
--- a/backend/app/assets/images/backend-move.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2">
- <g fill-rule="nonzero" stroke="currentColor">
- <path fill="currentColor" d="M248.888 337.427c3.915 3.915 10.261 3.915 14.176 0l13.573-13.573a5.177 5.177 0 018.836 3.66v75.995h34.809a10.017 10.017 0 017.084 17.101l-64.306 64.306c-3.913 3.913-10.255 3.913-14.168 0l-64.306-64.306a10.017 10.017 0 017.084-17.101h34.809v-75.995a5.175 5.175 0 018.836-3.66l13.573 13.573zM262.952 175.207a10.025 10.025 0 00-13.952 0l-13.743 13.317a5.176 5.176 0 01-8.778-3.717v-76.268H191.67a10.017 10.017 0 01-7.084-17.101l64.306-64.306c3.913-3.912 10.255-3.912 14.168 0l64.306 64.306a10.017 10.017 0 01-7.084 17.101h-34.809v76.268a5.178 5.178 0 01-8.778 3.717l-13.743-13.317zM174.573 248.936c-3.915 3.915-3.915 10.261 0 14.176l13.573 13.573a5.178 5.178 0 01-3.66 8.836h-75.995v34.809a10.017 10.017 0 01-17.101 7.084l-64.306-64.306c-3.913-3.913-3.913-10.255 0-14.168l64.306-64.306a10.017 10.017 0 0117.101 7.084v34.809h75.995a5.175 5.175 0 013.66 8.836l-13.573 13.573zM336.793 263a10.025 10.025 0 000-13.952l-13.317-13.743a5.176 5.176 0 013.717-8.778h76.268v-34.809a10.017 10.017 0 0117.101-7.084l64.306 64.306c3.912 3.913 3.912 10.255 0 14.168l-64.306 64.306a10.017 10.017 0 01-17.101-7.084v-34.809h-76.268a5.176 5.176 0 01-3.717-8.778L336.793 263z"/>
- </g>
-</svg>
diff --git a/backend/app/assets/images/backend-ok.svg b/backend/app/assets/images/backend-ok.svg
deleted file mode 100644
index 1ae274e546..0000000000
--- a/backend/app/assets/images/backend-ok.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2">
- <path fill="currentColor" d="M474.975 82.072c-5.79-5.77-15.123-5.77-20.874 0L173.92 362.589 58.76 247.27c-5.75-5.75-15.085-5.79-20.874 0-5.77 5.75-5.77 15.104 0 20.874l125.597 125.774c2.875 2.895 6.656 4.333 10.437 4.333 3.8 0 7.562-1.438 10.437-4.333l290.62-290.953c5.769-5.77 5.769-15.144 0-20.894z" fill-rule="nonzero" stroke="currentColor" stroke-width="24.024606"/>
-</svg>
diff --git a/backend/app/assets/images/backend-pages.svg b/backend/app/assets/images/backend-pages.svg
deleted file mode 100644
index 5373e2541c..0000000000
--- a/backend/app/assets/images/backend-pages.svg
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
-<svg width="100%" height="100%" viewBox="0 0 512 512" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
- <g id="_1" transform="matrix(1.19789,0,0,1.19789,-79.2207,-40.1571)">
- <g transform="matrix(1,0,0,1,2.50441,-1.66961)">
- <path d="M391.89,450L163,450C135.523,449.967 112.923,427.367 112.89,399.89L112.89,98.11C112.923,70.633 135.523,48.033 163,48L313.1,48C317.077,47.998 320.897,49.578 323.71,52.39L437.61,166.27C440.422,169.083 442.002,172.903 442,176.88L442,399.88C441.973,427.361 419.371,449.967 391.89,450ZM163,78C151.972,78.011 142.901,87.082 142.89,98.11L142.89,399.89C142.901,410.918 151.972,419.989 163,420L391.89,420C402.918,419.989 411.989,410.918 412,399.89L412,183.09L306.91,78L163,78Z" style="fill:currentColor;"/>
- </g>
- <path d="M427,191.88L348.23,191.88C320.753,191.847 298.153,169.247 298.12,141.77L298.12,63C298.12,54.771 304.891,48 313.12,48C321.349,48 328.12,54.771 328.12,63L328.12,141.77C328.131,152.798 337.202,161.869 348.23,161.88L427,161.88C435.229,161.88 442,168.651 442,176.88C442,185.109 435.229,191.88 427,191.88Z" style="fill:currentColor;"/>
- </g>
-</svg>
diff --git a/backend/app/assets/images/backend-pagination-double-arrow-right.svg b/backend/app/assets/images/backend-pagination-double-arrow-right.svg
deleted file mode 100644
index 70705cb704..0000000000
--- a/backend/app/assets/images/backend-pagination-double-arrow-right.svg
+++ /dev/null
@@ -1,8 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="13.636" height="13.937">
- <g transform="rotate(180 4.318 6.968)" clip-path="url(#clip-path)">
- <path d="M6.873 12.809a.436.436 0 00.617 0 .438.438 0 000-.618L2.064 6.757 7.49 1.323a.437.437 0 00-.617-.618L1.128 6.448a.438.438 0 000 .618z" fill="#232323" stroke="#232323" stroke-width=".5"/>
- </g>
- <g data-name="left-arrow" transform="rotate(180 6.818 6.968)" clip-path="url(#clip-path)">
- <path d="M6.873 12.809a.436.436 0 00.617 0 .438.438 0 000-.618L2.064 6.757 7.49 1.323a.437.437 0 00-.617-.618L1.128 6.448a.438.438 0 000 .618z" fill="#232323" stroke="#232323" stroke-width=".5"/>
- </g>
-</svg>
diff --git a/backend/app/assets/images/backend-payments.svg b/backend/app/assets/images/backend-payments.svg
deleted file mode 100644
index 2e0c826b88..0000000000
--- a/backend/app/assets/images/backend-payments.svg
+++ /dev/null
@@ -1,8 +0,0 @@
-<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2">
- <g fill-rule="nonzero">
- <path fill="currentColor" d="M461.462 174.846h-44.383l-12.714-72.038c-2.923-16.731-19.057-27.904-35.673-25.02L45.173 134.846c-16.711 2.942-27.923 18.962-24.961 35.692l34.5 195.616c1.423 8.096 5.903 15.173 12.634 19.904 5.25 3.673 11.346 5.596 17.616 5.596 1.807 0 3.615-.154 5.423-.481l11.788-2.082v14.794c0 16.98 13.808 30.788 30.789 30.788h328.5c16.98 0 30.807-13.808 30.807-30.788v-198.25c0-16.981-13.827-30.789-30.807-30.789zm-86.174-66.923l5.646 32-198.097 34.923h-49.875c-10.458 0-19.683 5.261-25.25 13.253l-52.783 9.302-.064-.363-4.557-33.115 324.98-56zm-291.5 253.115l-19.861-112.62 38.246-6.745v116.91l-18.385 2.455zm378.943 42.847c0 .692-.577 1.25-1.269 1.25l-329.75-1.25V237.692l1.25-33.307 329.769 1.25v198.25z" stroke="currentColor" stroke-width="3"/>
- <path fill="currentColor" d="M177.885 332.442h24.327c14.634 0 26.538-11.904 26.538-26.538v-24.327c0-14.615-11.904-26.519-26.538-26.519h-24.327c-14.616 0-26.52 11.904-26.52 26.519v24.327c0 14.634 11.904 26.538 26.52 26.538zm-6.827-50.865a6.828 6.828 0 016.827-6.827h24.327c3.769 0 6.846 3.058 6.846 6.827v24.327c0 3.769-3.077 6.846-6.846 6.846h-24.327c-3.77 0-6.827-3.077-6.827-6.846v-24.327zM369.962 344.596a9.84 9.84 0 000 13.923 9.814 9.814 0 006.961 2.885 9.816 9.816 0 006.962-2.885c29.653-29.634 29.653-77.884 0-107.519a9.843 9.843 0 00-13.923 0 9.84 9.84 0 000 13.923c21.961 21.962 21.961 57.712 0 79.673z"/>
- <path fill="currentColor" d="M346.558 332.904a9.843 9.843 0 000 13.923 9.814 9.814 0 006.961 2.885 9.816 9.816 0 006.962-2.885c23.192-23.192 23.192-60.942 0-84.135a9.843 9.843 0 00-13.923 0 9.843 9.843 0 000 13.923c15.519 15.52 15.519 40.77 0 56.289z"/>
- <path fill="currentColor" d="M323.154 335.135a9.813 9.813 0 006.961 2.884c2.52 0 5.039-.961 6.962-2.884 16.731-16.75 16.731-44 0-60.731a9.843 9.843 0 00-13.923 0 9.843 9.843 0 000 13.923c9.058 9.058 9.058 23.808 0 32.885-3.846 3.846-3.846 10.096 0 13.923zM414.712 304.769c0 19.443-7.577 37.75-21.366 51.539a9.843 9.843 0 000 13.923 9.814 9.814 0 006.962 2.884 9.813 9.813 0 006.961-2.884c17.5-17.5 27.135-40.75 27.135-65.462 0-24.731-9.635-47.961-27.135-65.461a9.843 9.843 0 00-13.923 0 9.843 9.843 0 000 13.923c13.789 13.769 21.366 32.077 21.366 51.538zM161.212 386.712h43.519a9.84 9.84 0 009.846-9.847 9.84 9.84 0 00-9.846-9.846h-43.519a9.84 9.84 0 00-9.847 9.846 9.841 9.841 0 009.847 9.847zM236.019 386.712h58.289a9.84 9.84 0 009.846-9.847 9.84 9.84 0 00-9.846-9.846h-58.289a9.84 9.84 0 00-9.846 9.846 9.84 9.84 0 009.846 9.847z"/>
- </g>
-</svg>
diff --git a/backend/app/assets/images/backend-pencil.svg b/backend/app/assets/images/backend-pencil.svg
deleted file mode 100644
index d7e3333b0b..0000000000
--- a/backend/app/assets/images/backend-pencil.svg
+++ /dev/null
@@ -1 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="100%" height="100%" viewBox="0 0 512 512" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"><g><path d="M32,496c-4.567,0.028 -8.928,-1.897 -11.985,-5.29c-3.056,-3.393 -4.517,-7.931 -4.015,-12.47l14.4,-130.72c0.404,-3.636 2.041,-7.025 4.64,-9.6l305.28,-305.12c10.692,-10.758 25.233,-16.807 40.4,-16.807c15.167,0 29.708,6.049 40.4,16.807l58.88,58.08c10.758,10.692 16.807,25.233 16.807,40.4c0,15.167 -6.049,29.708 -16.807,40.4l-305.92,305.12c-2.575,2.599 -5.964,4.236 -9.6,4.64l-130.72,14.56l-1.76,0Zm29.76,-139.52l-11.68,105.44l105.44,-11.68l301.12,-301.28c9.719,-9.845 9.719,-25.675 0,-35.52l-58.08,-58.08c-9.845,-9.719 -25.675,-9.719 -35.52,0l-301.28,301.12Z" style="fill-rule:nonzero;"/><path d="M424.32,219.84c-4.197,-0.018 -8.22,-1.684 -11.2,-4.64l-116.32,-116.32c-6.182,-6.414 -6.016,-16.618 0.37,-22.828c6.387,-6.21 16.591,-6.09 22.83,0.268l115.68,115.68c6.204,6.241 6.204,16.319 0,22.56c-2.912,3.231 -7.013,5.137 -11.36,5.28Z" style="fill-rule:nonzero;"/><path d="M319.313,215.276l-145.268,145.268l-22.627,-22.627l145.268,-145.268l22.627,22.627Z"/></g></svg>
diff --git a/backend/app/assets/images/backend-phone.svg b/backend/app/assets/images/backend-phone.svg
deleted file mode 100644
index 3f3fd74c11..0000000000
--- a/backend/app/assets/images/backend-phone.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-phone" viewBox="0 0 16 16">
- <path d="M11 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h6zM5 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H5z"/>
- <path d="M8 14a1 1 0 1 0 0-2 1 1 0 0 0 0 2z"/>
-</svg>
\ No newline at end of file
diff --git a/backend/app/assets/images/backend-products.svg b/backend/app/assets/images/backend-products.svg
deleted file mode 100644
index ebc258a01a..0000000000
--- a/backend/app/assets/images/backend-products.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2">
- <g fill-rule="nonzero" stroke="currentColor" stroke-width=".5">
- <path fill="currentColor" d="M132.923 364.308H34.462c-8.154 0-14.77 6.615-14.77 14.769v98.461c0 8.154 6.616 14.77 14.77 14.77h98.461c8.154 0 14.769-6.616 14.769-14.77v-98.461c0-8.154-6.615-14.769-14.769-14.769zm-14.769 98.461H49.231v-68.923h68.923v68.923zM477.538 364.308h-98.461c-8.154 0-14.769 6.615-14.769 14.769v98.461c0 8.154 6.615 14.77 14.769 14.77h98.461c8.154 0 14.77-6.616 14.77-14.77v-98.461c0-8.154-6.616-14.769-14.77-14.769zm-14.769 98.461h-68.923v-68.923h68.923v68.923zM305.231 364.308h-98.462c-8.154 0-14.769 6.615-14.769 14.769v98.461c0 8.154 6.615 14.77 14.769 14.77h98.462c8.154 0 14.769-6.616 14.769-14.77v-98.461c0-8.154-6.615-14.769-14.769-14.769zm-14.769 98.461h-68.924v-68.923h68.924v68.923zM132.923 192H34.462c-8.154 0-14.77 6.615-14.77 14.769v98.462c0 8.154 6.616 14.769 14.77 14.769h98.461c8.154 0 14.769-6.615 14.769-14.769v-98.462c0-8.154-6.615-14.769-14.769-14.769zm-14.769 98.462H49.231v-68.924h68.923v68.924zM477.538 192h-98.461c-8.154 0-14.769 6.615-14.769 14.769v98.462c0 8.154 6.615 14.769 14.769 14.769h98.461c8.154 0 14.77-6.615 14.77-14.769v-98.462c0-8.154-6.616-14.769-14.77-14.769zm-14.769 98.462h-68.923v-68.924h68.923v68.924zM305.231 192h-98.462c-8.154 0-14.769 6.615-14.769 14.769v98.462c0 8.154 6.615 14.769 14.769 14.769h98.462c8.154 0 14.769-6.615 14.769-14.769v-98.462c0-8.154-6.615-14.769-14.769-14.769zm-14.769 98.462h-68.924v-68.924h68.924v68.924zM132.923 19.692H34.462c-8.154 0-14.77 6.616-14.77 14.77v98.461c0 8.154 6.616 14.769 14.77 14.769h98.461c8.154 0 14.769-6.615 14.769-14.769V34.462c0-8.154-6.615-14.77-14.769-14.77zm-14.769 98.462H49.231V49.231h68.923v68.923zM477.538 19.692h-98.461c-8.154 0-14.769 6.616-14.769 14.77v98.461c0 8.154 6.615 14.769 14.769 14.769h98.461c8.154 0 14.77-6.615 14.77-14.769V34.462c0-8.154-6.616-14.77-14.77-14.77zm-14.769 98.462h-68.923V49.231h68.923v68.923zM305.231 19.692h-98.462c-8.154 0-14.769 6.616-14.769 14.77v98.461c0 8.154 6.615 14.769 14.769 14.769h98.462c8.154 0 14.769-6.615 14.769-14.769V34.462c0-8.154-6.615-14.77-14.769-14.77zm-14.769 98.462h-68.924V49.231h68.924v68.923z"/>
- </g>
-</svg>
diff --git a/backend/app/assets/images/backend-promotion.svg b/backend/app/assets/images/backend-promotion.svg
deleted file mode 100644
index 305280a0cb..0000000000
--- a/backend/app/assets/images/backend-promotion.svg
+++ /dev/null
@@ -1,8 +0,0 @@
-<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2">
- <g fill-rule="nonzero" stroke="currentColor">
- <path fill="currentColor" d="M201.062 248.841c-10.941 0-21.163 4.319-28.937 11.949-15.98 15.98-15.98 41.893 0 57.873 7.774 7.774 17.996 11.949 28.937 11.949 10.941 0 21.162-4.319 28.936-11.949 15.98-15.98 15.98-41.893 0-57.873-7.774-7.63-17.995-11.949-28.936-11.949zm13.676 54.706c-3.599 3.599-8.494 5.615-13.676 5.615-5.183 0-10.078-2.016-13.677-5.615-7.486-7.486-7.486-19.867 0-27.353 3.599-3.599 8.494-5.615 13.677-5.615 5.182 0 10.077 2.016 13.676 5.615 7.63 7.486 7.63 19.723 0 27.353zM373.961 248.841c-10.941 0-21.162 4.319-28.936 11.949-15.98 15.98-15.98 41.893 0 57.873 7.774 7.774 17.995 11.949 28.936 11.949 10.941 0 21.163-4.319 28.937-11.949 15.98-15.98 15.98-41.893 0-57.873-7.774-7.63-17.996-11.949-28.937-11.949zm13.677 54.706c-3.599 3.599-8.494 5.615-13.677 5.615s-10.077-2.016-13.676-5.615c-7.486-7.486-7.486-19.867 0-27.353 3.599-3.599 8.493-5.615 13.676-5.615s10.078 2.016 13.677 5.615c7.486 7.486 7.486 19.723 0 27.353z" stroke-width=".2"/>
- <path fill="currentColor" d="M287.583 161.312c-5.902 0-10.797 4.894-10.797 10.797v235.235c0 5.903 4.895 10.797 10.797 10.797 5.903 0 10.798-4.894 10.798-10.797V172.109c0-5.903-4.895-10.797-10.798-10.797z" stroke-width="8"/>
- <path fill="currentColor" d="M257.164 43.242c-1.584-1.584-3.743-2.735-6.047-3.023L118.096 19.776c-3.455-.576-6.91.576-9.214 3.023l-85.37 85.37c-2.447 2.448-3.599 5.903-3.023 9.214l20.443 133.022c.288 2.303 1.439 4.318 3.023 6.046l222.422 222.423c7.199 7.198 16.844 11.229 27.209 11.229 10.222 0 19.867-4.031 27.209-11.229L479.73 319.939c7.199-7.199 11.23-16.844 11.23-27.209 0-10.222-4.031-19.867-11.23-27.209L257.164 43.242zm207.162 261.437L305.391 463.614c-3.167 3.167-7.342 4.894-11.948 4.894-4.463 0-8.782-1.727-11.949-4.894L61.662 243.782 42.659 119.686l77.74-77.74 124.096 19.003 219.831 219.832c3.168 3.167 4.895 7.342 4.895 11.949 0 4.462-1.727 8.637-4.895 11.949z" stroke-width="9.5"/>
- <path fill="currentColor" d="M152.359 94.637c-7.63-7.63-17.708-11.805-28.505-11.805S102.98 87.007 95.35 94.637c-15.692 15.692-15.692 41.317 0 57.009 7.63 7.63 17.707 11.805 28.504 11.805s20.875-4.175 28.505-11.805c15.692-15.692 15.692-41.317 0-57.009zm-15.26 41.749c-3.599 3.599-8.206 5.471-13.245 5.471-5.038 0-9.645-2.016-13.244-5.471a18.681 18.681 0 010-26.489c3.599-3.599 8.206-5.471 13.244-5.471 5.039 0 9.646 2.016 13.245 5.471a18.681 18.681 0 010 26.489z" stroke-width="4"/>
- </g>
-</svg>
diff --git a/backend/app/assets/images/backend-recycle.svg b/backend/app/assets/images/backend-recycle.svg
deleted file mode 100644
index bf43bdf11b..0000000000
--- a/backend/app/assets/images/backend-recycle.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2">
- <g fill-rule="nonzero" stroke="currentColor" stroke-width="12">
- <path fill="currentColor" d="M457.762 266.084c0-66.339-35.773-128.09-93.363-161.144-8.008-4.6-18.231-1.84-22.831 6.178-4.6 8.007-1.829 18.231 6.178 22.831 47.23 27.117 76.564 77.745 76.564 132.135 0 80.38-62.619 146.406-141.628 151.873l27.744-27.744c6.534-6.534 6.534-17.124 0-23.657-6.533-6.534-17.123-6.534-23.657 0l-53.074 53.073a16.73 16.73 0 00-4.902 11.824c0 4.432 1.766 8.687 4.902 11.823l53.074 53.084a16.688 16.688 0 0011.823 4.903c4.276 0 8.562-1.631 11.824-4.903 6.533-6.533 6.533-17.123 0-23.657l-21.681-21.681c94.617-8.457 169.027-88.167 169.027-184.938zM201.695 146.007a16.693 16.693 0 0011.824 4.903c4.275 0 8.561-1.631 11.823-4.903l53.074-53.074a16.73 16.73 0 004.903-11.823c0-4.433-1.767-8.687-4.903-11.823l-53.064-53.074c-6.533-6.534-17.123-6.534-23.657 0-6.533 6.533-6.533 17.123 0 23.657l25.006 25.005c-96.185 6.868-172.341 87.31-172.341 185.22 0 66.381 35.804 128.153 93.457 161.208a16.649 16.649 0 008.3 2.216c5.802 0 11.436-3.021 14.52-8.405 4.6-8.018 1.819-18.231-6.188-22.831-47.272-27.107-76.637-77.755-76.637-132.188 0-79.041 60.548-144.21 137.708-151.548l-23.825 23.824c-6.533 6.512-6.533 17.102 0 23.636z"/>
- </g>
-</svg>
diff --git a/backend/app/assets/images/backend-remove.svg b/backend/app/assets/images/backend-remove.svg
deleted file mode 100644
index c32b1da0ed..0000000000
--- a/backend/app/assets/images/backend-remove.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2">
- <g fill-rule="nonzero" stroke="currentColor" stroke-width="5">
- <path fill="currentColor" d="M379.692 486.413H133.071c-25.538 0-46.241-20.703-46.241-46.241V147.31c.038-8.486 6.928-15.345 15.414-15.345s15.376 6.859 15.414 15.345v292.862c0 8.513 6.901 15.414 15.413 15.414h246.621c8.513 0 15.414-6.901 15.414-15.414V147.31c.038-8.486 6.927-15.345 15.413-15.345s15.376 6.859 15.414 15.345v292.862c0 25.538-20.703 46.241-46.241 46.241zM441.347 116.483H71.416c-8.485-.038-15.345-6.928-15.345-15.414s6.86-15.376 15.345-15.414h369.931c8.486.038 15.345 6.928 15.345 15.414s-6.859 15.376-15.345 15.414z"/>
- <path fill="currentColor" d="M318.037 116.483c-8.513 0-15.414-6.901-15.414-15.414V54.828H210.14v46.241c-.038 8.486-6.927 15.345-15.413 15.345s-15.376-6.859-15.414-15.345V39.414c0-8.513 6.901-15.414 15.414-15.414h123.31c8.513 0 15.414 6.901 15.414 15.414v61.655c0 8.513-6.901 15.414-15.414 15.414zM256.382 409.344c-8.513 0-15.414-6.901-15.414-15.413V178.138c.038-8.486 6.928-15.345 15.414-15.345s15.375 6.859 15.413 15.345v215.793c0 8.512-6.901 15.413-15.413 15.413zM333.451 378.517c-8.513 0-15.414-6.901-15.414-15.414V208.965c.038-8.486 6.928-15.345 15.414-15.345s15.375 6.859 15.413 15.345v154.138c0 8.513-6.901 15.414-15.413 15.414zM179.313 378.517c-8.513 0-15.414-6.901-15.414-15.414V208.965c.038-8.486 6.928-15.345 15.414-15.345s15.376 6.859 15.414 15.345v154.138c0 8.513-6.901 15.414-15.414 15.414z"/>
- </g>
-</svg>
diff --git a/backend/app/assets/images/backend-report.svg b/backend/app/assets/images/backend-report.svg
deleted file mode 100644
index 55d8386c91..0000000000
--- a/backend/app/assets/images/backend-report.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2">
- <g fill-rule="nonzero">
- <path fill="currentColor" d="M433.231 19.692H78.769C70.615 19.692 64 26.308 64 34.462v362.365c0 1.923.393 3.839 1.141 5.644a14.762 14.762 0 003.186 4.798l80.711 80.712a14.798 14.798 0 004.799 3.186 14.754 14.754 0 005.644 1.141h273.75c8.154 0 14.769-6.616 14.769-14.77V34.462c0-8.154-6.615-14.77-14.769-14.77zM144.712 441.885l-30.289-30.289h30.289v30.289zm273.75 20.884H174.25v-65.942c0-8.154-6.615-14.769-14.769-14.769H93.538V49.231h324.924v413.538z" stroke="currentColor" stroke-width="5"/>
- <path fill="currentColor" d="M138.817 108.308h106.106a9.84 9.84 0 009.846-9.846 9.84 9.84 0 00-9.846-9.847H138.817a9.84 9.84 0 00-9.846 9.847 9.84 9.84 0 009.846 9.846zM138.817 147.692h53.048a9.84 9.84 0 009.847-9.846 9.84 9.84 0 00-9.847-9.846h-53.048a9.84 9.84 0 00-9.846 9.846 9.84 9.84 0 009.846 9.846zM278.85 364.676h53.048a9.84 9.84 0 009.846-9.846 9.84 9.84 0 00-9.846-9.846H278.85a9.84 9.84 0 00-9.847 9.846 9.84 9.84 0 009.847 9.846zM214.154 137.846a9.84 9.84 0 009.846 9.846h64a9.84 9.84 0 009.846-9.846A9.84 9.84 0 00288 128h-64a9.84 9.84 0 00-9.846 9.846zM137.846 310.154h236.308a9.84 9.84 0 009.846-9.846V182.154a9.84 9.84 0 00-9.846-9.846H137.846a9.84 9.84 0 00-9.846 9.846v118.154a9.84 9.84 0 009.846 9.846zm187.077-92.923v19.692h-32v-19.692h32zm-32-9.846V192h32v15.385h-32zm0 59.077v-19.693h32v19.693h-32zm32 9.846v14.154h-32v-14.154h32zm-177.231-29.539h135.385v19.693H147.692v-19.693zm187.077 0h29.539v19.693h-29.539v-19.693zm29.539-9.846h-29.539v-19.692h29.539v19.692zm-81.231 0H147.692v-19.692h135.385v19.692zm-135.385 39.385h135.385v14.154H147.692v-14.154zm187.077 14.154v-14.154h29.539v14.154h-29.539zm29.539-83.077h-29.539V192h29.539v15.385zM283.077 192v15.385H147.692V192h135.385zM244.923 344.615H138.817a9.84 9.84 0 00-9.846 9.847 9.84 9.84 0 009.846 9.846h106.106a9.84 9.84 0 009.846-9.846 9.84 9.84 0 00-9.846-9.847zM333.805 383.007H227.699a9.84 9.84 0 00-9.846 9.846 9.84 9.84 0 009.846 9.846h106.106a9.84 9.84 0 009.846-9.846 9.84 9.84 0 00-9.846-9.846z"/>
- </g>
-</svg>
diff --git a/backend/app/assets/images/backend-resume.svg b/backend/app/assets/images/backend-resume.svg
deleted file mode 100644
index bf43bdf11b..0000000000
--- a/backend/app/assets/images/backend-resume.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2">
- <g fill-rule="nonzero" stroke="currentColor" stroke-width="12">
- <path fill="currentColor" d="M457.762 266.084c0-66.339-35.773-128.09-93.363-161.144-8.008-4.6-18.231-1.84-22.831 6.178-4.6 8.007-1.829 18.231 6.178 22.831 47.23 27.117 76.564 77.745 76.564 132.135 0 80.38-62.619 146.406-141.628 151.873l27.744-27.744c6.534-6.534 6.534-17.124 0-23.657-6.533-6.534-17.123-6.534-23.657 0l-53.074 53.073a16.73 16.73 0 00-4.902 11.824c0 4.432 1.766 8.687 4.902 11.823l53.074 53.084a16.688 16.688 0 0011.823 4.903c4.276 0 8.562-1.631 11.824-4.903 6.533-6.533 6.533-17.123 0-23.657l-21.681-21.681c94.617-8.457 169.027-88.167 169.027-184.938zM201.695 146.007a16.693 16.693 0 0011.824 4.903c4.275 0 8.561-1.631 11.823-4.903l53.074-53.074a16.73 16.73 0 004.903-11.823c0-4.433-1.767-8.687-4.903-11.823l-53.064-53.074c-6.533-6.534-17.123-6.534-23.657 0-6.533 6.533-6.533 17.123 0 23.657l25.006 25.005c-96.185 6.868-172.341 87.31-172.341 185.22 0 66.381 35.804 128.153 93.457 161.208a16.649 16.649 0 008.3 2.216c5.802 0 11.436-3.021 14.52-8.405 4.6-8.018 1.819-18.231-6.188-22.831-47.272-27.107-76.637-77.755-76.637-132.188 0-79.041 60.548-144.21 137.708-151.548l-23.825 23.824c-6.533 6.512-6.533 17.102 0 23.636z"/>
- </g>
-</svg>
diff --git a/backend/app/assets/images/backend-returns.svg b/backend/app/assets/images/backend-returns.svg
deleted file mode 100644
index 64d3234b5e..0000000000
--- a/backend/app/assets/images/backend-returns.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2">
- <path fill="currentColor" d="M477.538 19.692h-241.23c-8.154 0-14.77 6.616-14.77 14.77v80H34.462c-8.154 0-14.77 6.615-14.77 14.769v348.307c0 8.154 6.616 14.77 14.77 14.77h241.134c8.154 0 14.769-6.616 14.769-14.77v-79.865h187.173c8.154 0 14.77-6.615 14.77-14.769V34.462c0-8.154-6.616-14.77-14.77-14.77zM260.827 462.769H49.231V313.231H163.37l-47.408 47.423a9.84 9.84 0 000 13.923 9.814 9.814 0 006.961 2.885 9.816 9.816 0 006.962-2.885l64.199-64.219a9.845 9.845 0 002.14-3.214 9.843 9.843 0 000-7.519 9.845 9.845 0 00-2.14-3.214l-64.199-64.219a9.843 9.843 0 00-13.923 0 9.84 9.84 0 000 13.923l47.408 47.423H49.231V144h186.982c.033 0 .061.019.095.019.033 0 .061-.019.095-.019h24.424v318.769zm29.538-94.634V129.231c0-8.154-6.615-14.769-14.769-14.769h-24.519V49.231h211.692v149.615H348.572L396 151.404a9.843 9.843 0 000-13.923 9.843 9.843 0 00-13.923 0l-64.219 64.238a9.842 9.842 0 00-2.139 3.214 9.843 9.843 0 000 7.519 9.853 9.853 0 002.139 3.214l64.219 64.238a9.813 9.813 0 006.961 2.884c2.52 0 5.039-.961 6.962-2.884a9.843 9.843 0 000-13.923l-47.428-47.443h114.197v149.597H290.365z" fill-rule="nonzero" stroke="currentColor" stroke-width="9.5"/>
-</svg>
diff --git a/backend/app/assets/images/backend-reversed-layout.svg b/backend/app/assets/images/backend-reversed-layout.svg
deleted file mode 100644
index 5b5427d8c2..0000000000
--- a/backend/app/assets/images/backend-reversed-layout.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-<svg viewBox="0 0 1000 1000" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="1.5">
- <path d="M452.624 94.233c0-34.377-27.91-62.287-62.288-62.287H99.381c-34.377 0-62.287 27.91-62.287 62.287v808.965c0 34.377 27.91 62.287 62.287 62.287h290.955c34.378 0 62.288-27.91 62.288-62.287V94.233zM958.245 94.097c0-34.447-27.967-62.414-62.414-62.414H605.129c-34.447 0-62.414 27.967-62.414 62.414v304.939c0 34.447 27.967 62.414 62.414 62.414h290.702c34.447 0 62.414-27.967 62.414-62.414V94.097zM958.245 598.525c0-34.868-28.309-63.177-63.177-63.177H605.892c-34.868 0-63.177 28.309-63.177 63.177v303.413c0 34.868 28.309 63.177 63.177 63.177h289.176c34.868 0 63.177-28.309 63.177-63.177V598.525z" fill="none" stroke="currentColor" stroke-width="41.67"/>
- <text x="652.782" y="355.618" font-family="Helvetica" font-size="300">A</text>
- <text x="637.342" y="859.271" font-family="Helvetica" font-size="300">C</text>
- <text x="139.772" y="607.221" font-family="Helvetica" font-size="300">B</text>
-</svg>
diff --git a/backend/app/assets/images/backend-save.svg b/backend/app/assets/images/backend-save.svg
deleted file mode 100644
index 1ae274e546..0000000000
--- a/backend/app/assets/images/backend-save.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2">
- <path fill="currentColor" d="M474.975 82.072c-5.79-5.77-15.123-5.77-20.874 0L173.92 362.589 58.76 247.27c-5.75-5.75-15.085-5.79-20.874 0-5.77 5.75-5.77 15.104 0 20.874l125.597 125.774c2.875 2.895 6.656 4.333 10.437 4.333 3.8 0 7.562-1.438 10.437-4.333l290.62-290.953c5.769-5.77 5.769-15.144 0-20.894z" fill-rule="nonzero" stroke="currentColor" stroke-width="24.024606"/>
-</svg>
diff --git a/backend/app/assets/images/backend-search.svg b/backend/app/assets/images/backend-search.svg
deleted file mode 100644
index 0fd9ff6ad6..0000000000
--- a/backend/app/assets/images/backend-search.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg height="20.291" viewBox="0 0 20.286 20.291" width="20.286" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="m20.161 19.256-4.931-4.931a8.659 8.659 0 1 0 -.855.855l4.931 4.931a.611.611 0 0 0 .427.18.593.593 0 0 0 .427-.18.608.608 0 0 0 .001-.855zm-18.901-10.604a7.437 7.437 0 1 1 7.44 7.441 7.445 7.445 0 0 1 -7.44-7.441z" transform="translate(-.05)"/></svg>
diff --git a/backend/app/assets/images/backend-settings.svg b/backend/app/assets/images/backend-settings.svg
deleted file mode 100644
index 7551cdd46e..0000000000
--- a/backend/app/assets/images/backend-settings.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2">
- <g fill-rule="nonzero">
- <path fill="currentColor" d="M471.46 212.99l-42.07-7.92c-3.63-12.37-8.58-24.3-14.79-35.64l24.16-35.37c4.34-6.35 3.54-14.9-1.9-20.34l-38.58-38.58c-5.44-5.44-13.99-6.24-20.34-1.9L342.57 97.4a178.57 178.57 0 00-35.64-14.78l-7.92-42.07a16 16 0 00-15.72-13.04h-54.57A16 16 0 00213 40.55l-7.92 42.07c-12.37 3.63-24.3 8.58-35.64 14.78l-35.37-24.16c-6.35-4.34-14.9-3.54-20.34 1.9l-38.58 38.58a16.003 16.003 0 00-1.9 20.34l24.16 35.37a179.197 179.197 0 00-14.79 35.64l-42.07 7.92a16 16 0 00-13.04 15.72v54.57A16 16 0 0040.55 299l42.07 7.92c3.63 12.37 8.58 24.3 14.79 35.64l-24.16 35.37c-4.34 6.35-3.54 14.9 1.9 20.34l38.58 38.58c5.44 5.44 13.99 6.24 20.34 1.9l35.37-24.16a179.197 179.197 0 0035.64 14.79l7.92 42.07a16 16 0 0015.72 13.04h54.57a16 16 0 0015.72-13.04l7.92-42.07c12.37-3.63 24.3-8.58 35.64-14.79l35.37 24.16c6.35 4.34 14.9 3.54 20.34-1.9l38.58-38.58a16.003 16.003 0 001.9-20.34l-24.16-35.37a179.197 179.197 0 0014.79-35.64l42.07-7.92a16 16 0 0013.04-15.72v-54.57c0-7.69-5.48-14.29-13.04-15.72zm-18.96 57.02l-38.98 7.34a15.991 15.991 0 00-12.63 12.14c-3.69 16.02-10 31.25-18.77 45.25a15.992 15.992 0 00.35 17.51l22.39 32.78-19.82 19.82-32.78-22.39a15.973 15.973 0 00-17.51-.35 147.573 147.573 0 01-45.25 18.77 16.004 16.004 0 00-12.14 12.63l-7.34 38.98h-28.03l-7.34-38.98a15.991 15.991 0 00-12.14-12.63c-16.02-3.69-31.24-10-45.25-18.77a15.992 15.992 0 00-17.51.35l-32.78 22.39-19.82-19.82 22.39-32.78c3.59-5.25 3.72-12.12.35-17.51a147.573 147.573 0 01-18.77-45.25 16.004 16.004 0 00-12.63-12.14l-38.98-7.34v-28.03l38.98-7.34a15.991 15.991 0 0012.63-12.14c3.69-16.02 10-31.25 18.77-45.25a15.992 15.992 0 00-.35-17.51l-22.39-32.78 19.82-19.82 32.78 22.39a16.011 16.011 0 0017.51.35 147.573 147.573 0 0145.25-18.77c6.2-1.43 10.96-6.38 12.14-12.63l7.34-38.98h28.03l7.34 38.98a15.991 15.991 0 0012.14 12.63c16.02 3.69 31.24 10 45.25 18.77a15.992 15.992 0 0017.51-.35l32.78-22.39 19.82 19.82-22.39 32.78a15.992 15.992 0 00-.35 17.51 147.573 147.573 0 0118.77 45.25c1.43 6.2 6.38 10.96 12.63 12.14l38.98 7.34v28.03z"/>
- <path fill="currentColor" d="M256 148.26c-59.41 0-107.74 48.33-107.74 107.74S196.59 363.74 256 363.74 363.74 315.41 363.74 256 315.41 148.26 256 148.26zm0 183.48c-41.76 0-75.74-33.98-75.74-75.74s33.98-75.74 75.74-75.74 75.74 33.98 75.74 75.74-33.98 75.74-75.74 75.74z"/>
- </g>
-</svg>
diff --git a/backend/app/assets/images/backend-shipping.svg b/backend/app/assets/images/backend-shipping.svg
deleted file mode 100644
index dfddb47b8c..0000000000
--- a/backend/app/assets/images/backend-shipping.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2">
- <path fill="currentColor" d="M340.885 108.212v-5.597c0-8.153-6.616-14.769-14.77-14.769H34.442c-8.154 0-14.769 6.616-14.769 14.769V370c0 8.154 6.615 14.769 14.769 14.769h60.94c6.476 22.659 27.137 39.385 51.849 39.385 24.711 0 45.372-16.726 51.848-39.385h151.784c6.476 22.659 27.137 39.385 51.849 39.385 24.711 0 45.372-16.726 51.848-39.385h19.575c.607 0 1.123-.275 1.711-.346.588.071 1.105.346 1.712.346 8.154 0 14.769-6.615 14.769-14.769V256.971c0-77.912-66.695-142.007-151.442-148.759zM462.22 247.125h-55.47c-14.154-3.875-17.019-29.221-17.019-68.692v-27.489c40.252 18.661 68.591 54.411 72.489 96.181zm-92.182-103.579v34.887c0 42.807 2.558 81.759 33.558 88.182a9.913 9.913 0 002 .202h57.192v88.414h-8.228c-6.476-22.659-27.137-39.385-51.848-39.385-24.712 0-45.373 16.726-51.849 39.385H199.079a53.769 53.769 0 00-11.057-20.462h138.093c3.966 0 7.331-2.369 8.892-5.743 3.487-2.703 5.878-6.738 5.878-11.488V137.806c10.101.957 19.83 2.952 29.153 5.74zm-58.692 171.531H49.212V117.385h262.134v197.692zM49.212 334.769h57.228a53.757 53.757 0 00-11.058 20.462h-46.17v-20.462zm98.019 59.846c-13.577 0-24.616-11.038-24.616-24.615 0-13.577 11.039-24.615 24.616-24.615 13.56 0 24.579 11.014 24.606 24.567 0 .017-.01.031-.01.048s.01.031.01.048c-.027 13.553-11.046 24.567-24.606 24.567zm255.481 0c-13.577 0-24.616-11.038-24.616-24.615 0-13.577 11.039-24.615 24.616-24.615 13.576 0 24.615 11.038 24.615 24.615 0 13.577-11.039 24.615-24.615 24.615z" fill-rule="nonzero" stroke="currentColor"/>
-</svg>
diff --git a/backend/app/assets/images/backend-slack.svg b/backend/app/assets/images/backend-slack.svg
deleted file mode 100644
index a7d512c53d..0000000000
--- a/backend/app/assets/images/backend-slack.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2">
- <path fill="currentColor" d="M111.173 321.331c-.063 28.828-23.738 52.545-52.566 52.628C29.76 373.897 6.063 350.18 6 321.331c.083-28.827 23.78-52.503 52.607-52.565h52.566v52.565zm26.512 0c.083-28.806 23.78-52.503 52.586-52.565 28.807.062 52.503 23.759 52.586 52.565v131.685c-.062 28.828-23.758 52.524-52.586 52.607-28.827-.083-52.524-23.78-52.586-52.607V321.331zm52.586-211.158c-28.807-.084-52.503-23.76-52.586-52.566C137.747 28.78 161.444 5.083 190.27 5c28.828.083 52.524 23.78 52.586 52.607v52.566h-52.586zm0 26.512c28.828.083 52.503 23.759 52.586 52.586-.083 28.828-23.758 52.503-52.586 52.586H58.607C29.78 241.795 6.083 218.1 6 189.271c.083-28.827 23.78-52.524 52.607-52.586h131.664zM401.41 189.27c.083-28.827 23.78-52.524 52.607-52.586 28.828.062 52.524 23.759 52.607 52.586-.083 28.828-23.78 52.524-52.607 52.586h-52.607v-52.586zm-26.45 0c-.083 28.828-23.8 52.524-52.628 52.586-28.806-.083-52.503-23.78-52.565-52.586V57.607C269.828 28.78 293.504 5.083 322.33 5c28.849.063 52.566 23.759 52.628 52.607v131.664zM322.331 400.41c28.849.062 52.566 23.759 52.628 52.607-.062 28.848-23.78 52.545-52.628 52.607-28.827-.083-52.503-23.78-52.565-52.607v-52.607h52.565zm0-26.45c-28.827-.083-52.523-23.8-52.565-52.628.062-28.806 23.759-52.503 52.565-52.565h131.685c28.828.062 52.524 23.738 52.607 52.565-.062 28.849-23.759 52.566-52.607 52.628H322.331z" fill-rule="nonzero"/>
-</svg>
diff --git a/backend/app/assets/images/backend-sort.svg b/backend/app/assets/images/backend-sort.svg
deleted file mode 100644
index 25f137a05d..0000000000
--- a/backend/app/assets/images/backend-sort.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2">
- <g fill-rule="nonzero" stroke="currentColor" fill="currentColor">
- <path fill="currentColor" d="M272.238 93.53c0 36.41 29.62 66.03 66.03 66.03s66.03-29.62 66.03-66.03-29.62-66.03-66.03-66.03-66.03 29.62-66.03 66.03zm100.06 0c0 18.76-15.26 34.03-34.03 34.03-18.77 0-34.03-15.26-34.03-34.03 0-18.77 15.27-34.03 34.03-34.03s34.03 15.26 34.03 34.03zM338.268 322.03c36.41 0 66.03-29.62 66.03-66.03s-29.62-66.03-66.03-66.03-66.03 29.62-66.03 66.03 29.62 66.03 66.03 66.03zm0-100.06c18.76 0 34.03 15.26 34.03 34.03 0 18.77-15.26 34.03-34.03 34.03-18.77 0-34.03-15.26-34.03-34.03 0-18.77 15.27-34.03 34.03-34.03zM404.298 418.47c0-36.41-29.62-66.03-66.03-66.03s-66.03 29.62-66.03 66.03 29.62 66.03 66.03 66.03 66.03-29.62 66.03-66.03zm-100.06 0c0-18.76 15.26-34.03 34.03-34.03 18.77 0 34.03 15.26 34.03 34.03 0 18.77-15.27 34.03-34.03 34.03s-34.03-15.26-34.03-34.03zM106.174 93.53c0 36.41 29.62 66.03 66.03 66.03s66.03-29.62 66.03-66.03-29.62-66.03-66.03-66.03-66.03 29.62-66.03 66.03zm100.06 0c0 18.76-15.26 34.03-34.03 34.03-18.77 0-34.03-15.26-34.03-34.03 0-18.77 15.27-34.03 34.03-34.03s34.03 15.26 34.03 34.03zM172.204 322.03c36.41 0 66.03-29.62 66.03-66.03s-29.62-66.03-66.03-66.03-66.03 29.62-66.03 66.03 29.62 66.03 66.03 66.03zm0-100.06c18.76 0 34.03 15.26 34.03 34.03 0 18.77-15.26 34.03-34.03 34.03-18.77 0-34.03-15.26-34.03-34.03 0-18.77 15.27-34.03 34.03-34.03zM238.234 418.47c0-36.41-29.62-66.03-66.03-66.03s-66.03 29.62-66.03 66.03 29.62 66.03 66.03 66.03 66.03-29.62 66.03-66.03zm-100.06 0c0-18.76 15.26-34.03 34.03-34.03 18.77 0 34.03 15.26 34.03 34.03 0 18.77-15.27 34.03-34.03 34.03s-34.03-15.26-34.03-34.03z"/>
- </g>
-</svg>
diff --git a/backend/app/assets/images/backend-split.svg b/backend/app/assets/images/backend-split.svg
deleted file mode 100644
index 7b3ac38d13..0000000000
--- a/backend/app/assets/images/backend-split.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2">
- <path fill="currentColor" d="M342.635 23.189a10 10 0 00-7.071 17.071l43.495 43.495a9.999 9.999 0 010 14.142l-71.139 71.139a10.001 10.001 0 000 14.142l27.028 27.028a9.997 9.997 0 0014.142 0l71.139-71.139a10.003 10.003 0 0114.143 0l43.494 43.495a10.002 10.002 0 0017.072-7.071V33.189c0-5.523-4.478-10-10-10H342.635zM183.803 40.25a9.995 9.995 0 00-7.067-17.061H34.414c-5.52 0-9.994 4.474-9.994 9.994v142.322a9.993 9.993 0 0017.06 7.067l43.51-43.509a9.994 9.994 0 0114.133 0l128.221 128.22a9.998 9.998 0 012.927 7.067v209.363a9.994 9.994 0 009.994 9.994h38.827a9.994 9.994 0 009.994-9.994V250.824a9.994 9.994 0 00-2.927-7.066L140.294 97.892a9.99 9.99 0 010-14.133l43.509-43.509z"/>
-</svg>
diff --git a/backend/app/assets/images/backend-spree-icon.svg b/backend/app/assets/images/backend-spree-icon.svg
deleted file mode 100644
index 118bccc457..0000000000
--- a/backend/app/assets/images/backend-spree-icon.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg viewBox="0 0 500 500" xmlns="http://www.w3.org/2000/svg" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2"><path d="M219.139 381.189c0 13.505-10.945 24.451-24.45 24.451-13.502 0-24.448-10.946-24.448-24.451s10.946-24.451 24.448-24.451c13.505 0 24.45 10.946 24.45 24.451M321.928 381.189c0 13.505-10.948 24.451-24.45 24.451-13.503 0-24.448-10.946-24.448-24.451s10.945-24.451 24.448-24.451c13.502 0 24.45 10.946 24.45 24.451M306.461 332.291H185.71a23.944 23.944 0 01-22.136-14.808l-31.807-77.004h-24.896c-13.227 0-23.951-10.724-23.951-23.951s10.724-23.951 23.951-23.951h40.916a23.95 23.95 0 0122.137 14.808l31.806 77.004h88.869l32.729-77.208c5.164-12.182 19.22-17.858 31.402-12.705 12.176 5.164 17.864 19.22 12.703 31.399l-38.92 91.812a23.953 23.953 0 01-22.052 14.604" fill-rule="nonzero"/><path d="M333.217 113.118c-9.165-9.545-24.325-9.85-33.867-.686l-29.815 28.627V26.919c0-13.23-10.721-23.95-23.951-23.95-13.227 0-23.951 10.72-23.951 23.95v113.58l-28.693-27.95c-9.475-9.227-24.639-9.032-33.869.446-9.23 9.475-9.032 24.639.443 33.869l69.358 67.556c.318.309.659.581.988.868.174.153.342.312.521.461a24.027 24.027 0 002.539 1.83c.123.074.255.143.38.221a24.01 24.01 0 002.656 1.371c.084.036.156.087.239.123.057.024.114.042.168.063.545.228 1.096.422 1.653.605.203.069.404.149.607.212.545.162 1.099.294 1.65.419.222.051.44.117.662.159.553.111 1.11.183 1.667.252.222.027.437.074.659.092.748.075 1.497.111 2.245.111.024 0 .048.006.075.006h.003c.063 0 .129-.009.192-.009.7-.006 1.401-.036 2.095-.102.413-.039.824-.116 1.231-.176.344-.051.688-.087 1.03-.153.488-.093.97-.224 1.452-.347.254-.069.515-.117.766-.192.497-.147.979-.326 1.467-.506.234-.084.473-.155.707-.251.464-.186.916-.404 1.371-.623.248-.117.5-.225.742-.35.413-.216.815-.458 1.219-.701.275-.164.557-.32.826-.497.353-.23.695-.488 1.039-.739.305-.225.614-.446.91-.686.299-.242.587-.506.877-.763.222-.198.452-.375.668-.581l70.355-67.553c9.541-9.164 9.847-24.325.686-33.866M249.284 497.033c-23.996 0-49.024-9.035-75.93-27.103-10.981-7.374-13.906-22.253-6.532-33.234 7.373-10.979 22.253-13.904 33.237-6.533 41.938 28.163 65.634 21.379 90.282 1.311 10.26-8.349 25.346-6.808 33.696 3.452 8.35 10.26 6.805 25.346-3.455 33.696-23.268 18.942-46.74 28.411-71.298 28.411" fill-rule="nonzero"/></svg>
diff --git a/backend/app/assets/images/backend-spree-logo.svg b/backend/app/assets/images/backend-spree-logo.svg
deleted file mode 100644
index 1d28c040b2..0000000000
--- a/backend/app/assets/images/backend-spree-logo.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-<svg viewBox="0 0 2075 892" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2">
- <g fill-rule="nonzero" fill="currentColor">
- <path d="M774.897 704.867c-37.553 0-81.661-17.277-100.736-45.895-4.166-5.366-5.958-11.32-5.958-17.88 0-16.089 14.903-29.803 30.991-29.803 8.348 0 16.099 4.167 23.844 13.117 11.922 14.894 29.21 22.052 51.859 22.052 39.937 0 63.184-23.247 63.184-47.688 0-26.223-26.229-44.108-59.008-56.03-32.783-11.917-67.957-23.246-91.198-52.451-11.325-14.904-17.288-32.779-17.288-54.836 0-61.396 51.261-97.162 108.486-97.162 38.145 0 79.87 20.862 100.732 52.456 2.981 4.769 4.768 10.13 4.768 16.686 0 16.691-14.306 29.807-30.997 29.807-8.94 0-16.685-4.774-23.838-14.306-12.52-17.288-29.21-26.228-50.665-26.228-31.001 0-48.882 17.288-48.882 38.747 0 22.057 26.228 36.955 59.012 48.877 32.784 12.519 67.953 25.039 91.199 56.623 11.324 16.098 17.283 35.168 17.283 57.817 0 63.781-56.623 106.097-122.788 106.097zm226.342 84.294c0 18.518-13.734 29.863-29.858 29.863-16.123 0-29.857-11.345-29.857-29.863V466.683c0-71.064 57.325-128.389 128.39-128.389 71.069 0 128.395 57.325 128.395 128.389v110.485c0 71.059-57.326 128.39-128.395 128.39-26.871 0-49.565-8.363-68.675-25.676v109.279zm0-211.993c0 38.215 30.454 68.675 68.675 68.675 38.22 0 68.675-30.46 68.675-68.675V466.683c0-38.22-30.455-68.675-68.675-68.675-38.221 0-68.675 30.455-68.675 68.675v110.485zm426.266-153.928c-7.841 0-15.064-3.017-21.696-9.643l-1.204-1.205c-11.445-9.035-24.09-13.854-39.154-13.854-35.545 0-57.235 24.702-57.235 73.499v200.619c0 18.678-13.855 30.123-30.124 30.123s-30.123-11.445-30.123-30.123V472.037c0-75.306 42.773-133.746 117.482-133.746 28.908 0 63.851 13.252 83.739 33.135 6.024 6.626 9.036 13.257 9.036 21.083 0 16.269-14.457 30.731-30.721 30.731zm310.885 84.928c0 16.099-13.709 29.803-29.802 29.803h-166.901v38.747c0 35.761 34.576 68.545 74.513 68.545 23.839 0 42.914-7.746 57.817-22.649 6.551-8.946 14.301-13.709 23.839-13.709 16.098 0 31.002 13.709 31.002 29.797 0 11.927-6.561 19.672-13.714 26.825-24.436 26.228-57.818 39.34-98.944 39.34-69.739 0-134.123-57.215-134.123-128.149V466.444c0-70.928 57.23-128.154 128.159-128.154s128.154 57.226 128.154 128.154v41.724zm-59.604-29.802v-11.922c0-38.15-30.405-68.544-68.55-68.544-38.15 0-68.549 30.394-68.549 68.544v11.922h137.099zm357.283 29.802c0 16.099-13.709 29.803-29.802 29.803h-166.896v38.747c0 35.761 34.571 68.545 74.508 68.545 23.839 0 42.919-7.746 57.817-22.649 6.556-8.946 14.301-13.709 23.844-13.709 16.093 0 30.997 13.709 30.997 29.797 0 11.927-6.556 19.672-13.714 26.825-24.436 26.228-57.812 39.34-98.944 39.34-69.739 0-134.123-57.215-134.123-128.149V466.444c0-70.928 57.23-128.154 128.159-128.154 70.934 0 128.154 57.226 128.154 128.154v41.724zm-59.604-29.802v-11.922c0-38.15-30.405-68.544-68.55-68.544-38.15 0-68.544 30.394-68.544 68.544v11.922h137.094zM241.964 660.886c0 22.644-18.352 40.996-40.996 40.996-22.64 0-40.992-18.352-40.992-40.996 0-22.644 18.352-40.996 40.992-40.996 22.644 0 40.996 18.352 40.996 40.996M414.309 660.886c0 22.644-18.357 40.996-40.996 40.996-22.639 0-40.991-18.352-40.991-40.996 0-22.644 18.352-40.996 40.991-40.996s40.996 18.352 40.996 40.996M388.374 578.898H185.913a40.149 40.149 0 01-37.116-24.827L95.468 424.958H53.724c-22.178 0-40.158-17.981-40.158-40.158s17.98-40.158 40.158-40.158h68.604a40.156 40.156 0 0137.116 24.828l53.33 129.113H361.78l54.876-129.454c8.659-20.426 32.226-29.943 52.652-21.304 20.415 8.659 29.952 32.226 21.298 52.647l-65.256 153.94a40.164 40.164 0 01-36.976 24.486"/>
- <path d="M433.236 211.413c-15.366-16.003-40.786-16.515-56.783-1.15l-49.992 47.999V66.885c0-22.183-17.976-40.158-40.158-40.158-22.177 0-40.158 17.975-40.158 40.158v190.438l-48.109-46.864c-15.887-15.471-41.312-15.144-56.788.748-15.476 15.888-15.145 41.313.743 56.788l116.292 113.271c.532.517 1.104.974 1.656 1.455.292.256.573.523.874.774a40.237 40.237 0 004.257 3.067c.205.125.426.241.637.371a40.349 40.349 0 004.453 2.299c.14.06.261.146.401.206.096.04.191.07.281.105.914.382 1.837.708 2.771 1.014.342.116.678.251 1.019.357.914.271 1.842.492 2.766.702.372.086.738.196 1.109.267.929.185 1.863.306 2.796.421.372.045.733.126 1.105.156 1.255.125 2.51.186 3.765.186.04 0 .08.01.125.01h.005c.105 0 .216-.016.321-.016 1.175-.01 2.35-.06 3.514-.17.693-.065 1.381-.196 2.063-.296.578-.086 1.155-.146 1.727-.256.818-.156 1.626-.377 2.435-.583.426-.115.863-.195 1.285-.321.833-.246 1.641-.547 2.459-.848.392-.141.793-.261 1.185-.422.778-.311 1.536-.678 2.299-1.044.417-.196.838-.376 1.245-.587.693-.362 1.365-.768 2.043-1.175.462-.276.934-.537 1.385-.833.593-.387 1.165-.818 1.742-1.24.512-.377 1.029-.748 1.526-1.15.502-.406.984-.848 1.471-1.28.372-.331.758-.627 1.119-.973l117.964-113.266c15.998-15.365 16.51-40.785 1.15-56.783M292.506 855.121c-40.233 0-82.198-15.149-127.31-45.444-18.413-12.363-23.317-37.311-10.953-55.724 12.363-18.407 37.311-23.311 55.729-10.953 70.316 47.221 110.048 35.846 151.375 2.199 17.203-14 42.497-11.415 56.497 5.788 14 17.202 11.41 42.497-5.792 56.497-39.014 31.76-78.369 47.637-119.546 47.637"/>
- </g>
-</svg>
diff --git a/backend/app/assets/images/backend-store.svg b/backend/app/assets/images/backend-store.svg
deleted file mode 100644
index 6991d22aaf..0000000000
--- a/backend/app/assets/images/backend-store.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-shop-window" viewBox="0 0 16 16">
- <path d="M2.97 1.35A1 1 0 0 1 3.73 1h8.54a1 1 0 0 1 .76.35l2.609 3.044A1.5 1.5 0 0 1 16 5.37v.255a2.375 2.375 0 0 1-4.25 1.458A2.371 2.371 0 0 1 9.875 8 2.37 2.37 0 0 1 8 7.083 2.37 2.37 0 0 1 6.125 8a2.37 2.37 0 0 1-1.875-.917A2.375 2.375 0 0 1 0 5.625V5.37a1.5 1.5 0 0 1 .361-.976l2.61-3.045zm1.78 4.275a1.375 1.375 0 0 0 2.75 0 .5.5 0 0 1 1 0 1.375 1.375 0 0 0 2.75 0 .5.5 0 0 1 1 0 1.375 1.375 0 1 0 2.75 0V5.37a.5.5 0 0 0-.12-.325L12.27 2H3.73L1.12 5.045A.5.5 0 0 0 1 5.37v.255a1.375 1.375 0 0 0 2.75 0 .5.5 0 0 1 1 0zM1.5 8.5A.5.5 0 0 1 2 9v6h12V9a.5.5 0 0 1 1 0v6h.5a.5.5 0 0 1 0 1H.5a.5.5 0 0 1 0-1H1V9a.5.5 0 0 1 .5-.5zm2 .5a.5.5 0 0 1 .5.5V13h8V9.5a.5.5 0 0 1 1 0V13a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V9.5a.5.5 0 0 1 .5-.5z"/>
-</svg>
diff --git a/backend/app/assets/images/backend-tick.svg b/backend/app/assets/images/backend-tick.svg
deleted file mode 100644
index 1ae274e546..0000000000
--- a/backend/app/assets/images/backend-tick.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2">
- <path fill="currentColor" d="M474.975 82.072c-5.79-5.77-15.123-5.77-20.874 0L173.92 362.589 58.76 247.27c-5.75-5.75-15.085-5.79-20.874 0-5.77 5.75-5.77 15.104 0 20.874l125.597 125.774c2.875 2.895 6.656 4.333 10.437 4.333 3.8 0 7.562-1.438 10.437-4.333l290.62-290.953c5.769-5.77 5.769-15.144 0-20.894z" fill-rule="nonzero" stroke="currentColor" stroke-width="24.024606"/>
-</svg>
diff --git a/backend/app/assets/images/backend-translate.svg b/backend/app/assets/images/backend-translate.svg
deleted file mode 100644
index 39a17d228d..0000000000
--- a/backend/app/assets/images/backend-translate.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-translate" viewBox="0 0 16 16">
- <path d="M4.545 6.714 4.11 8H3l1.862-5h1.284L8 8H6.833l-.435-1.286H4.545zm1.634-.736L5.5 3.956h-.049l-.679 2.022H6.18z"/>
- <path d="M0 2a2 2 0 0 1 2-2h7a2 2 0 0 1 2 2v3h3a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-3H2a2 2 0 0 1-2-2V2zm2-1a1 1 0 0 0-1 1v7a1 1 0 0 0 1 1h7a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1H2zm7.138 9.995c.193.301.402.583.63.846-.748.575-1.673 1.001-2.768 1.292.178.217.451.635.555.867 1.125-.359 2.08-.844 2.886-1.494.777.665 1.739 1.165 2.93 1.472.133-.254.414-.673.629-.89-1.125-.253-2.057-.694-2.82-1.284.681-.747 1.222-1.651 1.621-2.757H14V8h-3v1.047h.765c-.318.844-.74 1.546-1.272 2.13a6.066 6.066 0 0 1-.415-.492 1.988 1.988 0 0 1-.94.31z"/>
-</svg>
\ No newline at end of file
diff --git a/backend/app/assets/images/backend-update.svg b/backend/app/assets/images/backend-update.svg
deleted file mode 100644
index 1ae274e546..0000000000
--- a/backend/app/assets/images/backend-update.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2">
- <path fill="currentColor" d="M474.975 82.072c-5.79-5.77-15.123-5.77-20.874 0L173.92 362.589 58.76 247.27c-5.75-5.75-15.085-5.79-20.874 0-5.77 5.75-5.77 15.104 0 20.874l125.597 125.774c2.875 2.895 6.656 4.333 10.437 4.333 3.8 0 7.562-1.438 10.437-4.333l290.62-290.953c5.769-5.77 5.769-15.144 0-20.894z" fill-rule="nonzero" stroke="currentColor" stroke-width="24.024606"/>
-</svg>
diff --git a/backend/app/assets/images/backend-user.svg b/backend/app/assets/images/backend-user.svg
deleted file mode 100644
index c750d4f958..0000000000
--- a/backend/app/assets/images/backend-user.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 512 512" stroke-linejoin="round">
- <path fill="currentColor" d="M492.3 256c0-130.3-106-236.3-236.3-236.3 -130.3 0-236.3 106-236.3 236.3 0 66.6 27.8 126.8 72.3 169.8 1 1.4 2.3 2.5 3.7 3.4 42.2 39 98.4 63.1 160.2 63.1 61.9 0 118.1-24.1 160.2-63.1 1.4-0.9 2.7-2 3.7-3.4 44.5-43 72.3-103.2 72.3-169.8Zm-236.3-206.8c114 0 206.8 92.8 206.8 206.8 0 48.3-16.8 92.8-44.7 128 -12.8-41.3-49.4-73.7-99-88.5 27-19.6 44.7-51.3 44.7-87.1 0-59.4-48.3-107.6-107.8-107.6 -59.4 0-107.8 48.3-107.8 107.6 0 35.8 17.7 67.6 44.7 87.1 -49.6 14.9-86.2 47.2-99 88.5 -27.9-35.2-44.7-79.7-44.7-128 0-114 92.8-206.8 206.8-206.8Zm-78.2 159.1c0-43.1 35.1-78.1 78.3-78.1 43.2 0 78.3 35 78.3 78.1 0 43.1-35.1 78.1-78.2 78.1 -43.2 0-78.2-35-78.2-78.1Zm-59 201.9c4.4-54.2 61.9-94.2 137.2-94.2 75.4 0 132.8 40.1 137.2 94.2 -36.6 32.6-84.5 52.5-137.2 52.5 -52.7 0-100.7-20-137.2-52.5Z" style="stroke-width:10px;stroke:currentColor"/>
-</svg>
diff --git a/backend/app/assets/images/backend-users.svg b/backend/app/assets/images/backend-users.svg
deleted file mode 100644
index b09ba76f26..0000000000
--- a/backend/app/assets/images/backend-users.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-people" viewBox="0 0 16 16">
- <path d="M15 14s1 0 1-1-1-4-5-4-5 3-5 4 1 1 1 1h8zm-7.978-1A.261.261 0 0 1 7 12.996c.001-.264.167-1.03.76-1.72C8.312 10.629 9.282 10 11 10c1.717 0 2.687.63 3.24 1.276.593.69.758 1.457.76 1.72l-.008.002a.274.274 0 0 1-.014.002H7.022zM11 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm3-2a3 3 0 1 1-6 0 3 3 0 0 1 6 0zM6.936 9.28a5.88 5.88 0 0 0-1.23-.247A7.35 7.35 0 0 0 5 9c-4 0-5 3-5 4 0 .667.333 1 1 1h4.216A2.238 2.238 0 0 1 5 13c0-1.01.377-2.042 1.09-2.904.243-.294.526-.569.846-.816zM4.92 10A5.493 5.493 0 0 0 4 13H1c0-.26.164-1.03.76-1.724.545-.636 1.492-1.256 3.16-1.275zM1.5 5.5a3 3 0 1 1 6 0 3 3 0 0 1-6 0zm3-2a2 2 0 1 0 0 4 2 2 0 0 0 0-4z"/>
-</svg>
diff --git a/backend/app/assets/images/backend-view.svg b/backend/app/assets/images/backend-view.svg
deleted file mode 100644
index 15777d07d6..0000000000
--- a/backend/app/assets/images/backend-view.svg
+++ /dev/null
@@ -1,8 +0,0 @@
-<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2">
- <path fill="currentColor" d="M256 192c0 35.328-28.672 64-64 64 0 35.328 28.672 64 64 64s64-28.672 64-64-28.672-64-64-64zm0-128C124.736 64 0 212.736 0 256c0 43.264 124.736 192 256 192s256-148.736 256-192c0-43.264-124.736-192-256-192zm0 320c-70.688 0-128-57.312-128-128s57.312-128 128-128 128 57.312 128 128-57.312 128-128 128z" fill-rule="nonzero"/>
-</svg>
-
-
-<!-- To give Spree backwards compatability this file is duplicated in the following SVG files -->
- <!-- VIEW EYE-OPEN -->
-<!-- If you update this file, be sure to make the same changes in all of the files above -->
diff --git a/backend/app/assets/images/backend-void.svg b/backend/app/assets/images/backend-void.svg
deleted file mode 100644
index 58e7937096..0000000000
--- a/backend/app/assets/images/backend-void.svg
+++ /dev/null
@@ -1,7 +0,0 @@
-<svg width="100%" height="100%" viewBox="0 0 512 512" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
- <g transform="matrix(5.37908e-15,-16.6134,-16.6134,-5.37908e-15,470.536,472.199)">
- <path d="M14.061,12.927L24.78,23.646C25.073,23.939 25.073,24.414 24.78,24.707C24.487,25 24.013,25 23.72,24.707L13,13.987L2.28,24.707C1.987,25 1.513,25 1.22,24.707C0.927,24.414 0.927,23.939 1.22,23.646L11.939,12.927L1.22,2.207C0.927,1.914 0.927,1.439 1.22,1.146C1.366,1 1.558,0.927 1.75,0.927C1.942,0.927 2.134,1 2.28,1.146L13,11.866L23.72,1.146C23.866,1 24.058,0.927 24.25,0.927C24.442,0.927 24.634,1 24.78,1.146C25.073,1.439 25.073,1.914 24.78,2.207L14.061,12.927Z" style="fill-rule:nonzero;stroke:currentColor;stroke-width:2.05px;"/>
- </g>
-</svg>
-
-<!-- CANCEL CLOSE VOID-->
diff --git a/backend/app/assets/images/backend-window-sidebar.svg b/backend/app/assets/images/backend-window-sidebar.svg
deleted file mode 100644
index 98476ce873..0000000000
--- a/backend/app/assets/images/backend-window-sidebar.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-window-sidebar" viewBox="0 0 16 16">
- <path d="M2.5 4a.5.5 0 1 0 0-1 .5.5 0 0 0 0 1zm2-.5a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0zm1 .5a.5.5 0 1 0 0-1 .5.5 0 0 0 0 1z"/>
- <path d="M2 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V3a2 2 0 0 0-2-2H2zm12 1a1 1 0 0 1 1 1v2H1V3a1 1 0 0 1 1-1h12zM1 13V6h4v8H2a1 1 0 0 1-1-1zm5 1V6h9v7a1 1 0 0 1-1 1H6z"/>
-</svg>
\ No newline at end of file
diff --git a/backend/app/assets/images/credit_cards/credit_card.gif b/backend/app/assets/images/credit_cards/credit_card.gif
deleted file mode 100644
index 2e61a23c31..0000000000
Binary files a/backend/app/assets/images/credit_cards/credit_card.gif and /dev/null differ
diff --git a/backend/app/assets/images/noimage/backend-missing-image.svg b/backend/app/assets/images/noimage/backend-missing-image.svg
deleted file mode 100644
index 5642c39ef1..0000000000
--- a/backend/app/assets/images/noimage/backend-missing-image.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-image" viewBox="0 0 16 16">
- <path d="M6.002 5.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0z"/>
- <path d="M2.002 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V3a2 2 0 0 0-2-2h-12zm12 1a1 1 0 0 1 1 1v6.5l-3.777-1.947a.5.5 0 0 0-.577.093l-3.71 3.71-2.66-1.772a.5.5 0 0 0-.63.062L1.002 12V3a1 1 0 0 1 1-1h12z"/>
-</svg>
diff --git a/backend/app/assets/images/noimage/large.png b/backend/app/assets/images/noimage/large.png
deleted file mode 100644
index fd0e9b6bee..0000000000
Binary files a/backend/app/assets/images/noimage/large.png and /dev/null differ
diff --git a/backend/app/assets/images/noimage/mini.png b/backend/app/assets/images/noimage/mini.png
deleted file mode 100644
index ae0e527a85..0000000000
Binary files a/backend/app/assets/images/noimage/mini.png and /dev/null differ
diff --git a/backend/app/assets/images/noimage/product.png b/backend/app/assets/images/noimage/product.png
deleted file mode 100644
index fd0e9b6bee..0000000000
Binary files a/backend/app/assets/images/noimage/product.png and /dev/null differ
diff --git a/backend/app/assets/images/noimage/small.png b/backend/app/assets/images/noimage/small.png
deleted file mode 100644
index 0b5b8cd2a1..0000000000
Binary files a/backend/app/assets/images/noimage/small.png and /dev/null differ
diff --git a/backend/app/assets/javascripts/spree.js b/backend/app/assets/javascripts/spree.js
deleted file mode 100644
index e29686491b..0000000000
--- a/backend/app/assets/javascripts/spree.js
+++ /dev/null
@@ -1,78 +0,0 @@
-//= require jsuri
-function Spree () {}
-
-Spree.ready = function (callback) {
- return jQuery(document).on('page:load turbolinks:load', function () {
- return callback(jQuery)
- })
-}
-
-Spree.mountedAt = function () {
- return window.SpreePaths.mounted_at
-}
-
-Spree.adminPath = function () {
- return window.SpreePaths.admin
-}
-
-Spree.pathFor = function (path) {
- var locationOrigin = (window.location.protocol + '//' + window.location.hostname) + (window.location.port ? ':' + window.location.port : '')
-
- return this.url('' + locationOrigin + (this.mountedAt()) + path, this.url_params).toString()
-}
-
-Spree.localizedPathFor = function(path) {
- if (typeof (SPREE_LOCALE) !== 'undefined' && typeof (SPREE_CURRENCY) !== 'undefined') {
- var fullUrl = new URL(Spree.pathFor(path))
- var params = fullUrl.searchParams
- var pathName = fullUrl.pathname
-
- params.set('currency', SPREE_CURRENCY)
-
- if (pathName.match(/api\/v/)) {
- params.set('locale', SPREE_LOCALE)
- } else {
- pathName = (this.mountedAt()) + SPREE_LOCALE + '/' + path
- }
- return fullUrl.origin + pathName + '?' + params.toString()
- }
- return Spree.pathFor(path)
-}
-
-Spree.adminPathFor = function (path) {
- return this.pathFor('' + (this.adminPath()) + path)
-}
-
-Spree.url = function (uri, query) {
- if (uri.path === void 0) {
- // eslint-disable-next-line no-undef
- uri = new Uri(uri)
- }
- if (query) {
- $.each(query, function (key, value) {
- return uri.addQueryParam(key, value)
- })
- }
- return uri
-}
-
-Spree.ajax = function (urlOrSettings, settings) {
- var url
- if (typeof urlOrSettings === 'string') {
- return $.ajax(Spree.url(urlOrSettings).toString(), settings)
- } else {
- url = urlOrSettings['url']
- delete urlOrSettings['url']
- return $.ajax(Spree.url(url).toString(), urlOrSettings)
- }
-}
-
-Spree.routes = {
- states_search: Spree.pathFor('api/v1/states'),
- apply_coupon_code: function (orderId) {
- return Spree.pathFor('api/v1/orders/' + orderId + '/apply_coupon_code')
- },
- cart: Spree.pathFor('cart')
-}
-
-Spree.url_params = {}
diff --git a/backend/app/assets/javascripts/spree/backend.js b/backend/app/assets/javascripts/spree/backend.js
deleted file mode 100644
index 92100108b5..0000000000
--- a/backend/app/assets/javascripts/spree/backend.js
+++ /dev/null
@@ -1,110 +0,0 @@
-//= require modernizr
-//= require purify
-//= require sortable
-//= require flatpickr
-//= require jquery3
-//= require popper
-//= require bootstrap-sprockets
-//= require handlebars
-//= require cleave
-//= require js.cookie
-//= require jquery.jstree/jquery.jstree
-//= require jquery_ujs
-//= require jquery-ui/widgets/autocomplete
-//= require select2-full
-//= require sweetalert2
-//= require tinymce
-//= require spree/backend/global/tinymce
-
-//= require underscore-min.js
-//= require jsonapi-serializer.min
-
-//= require spree/backend/global/_index
-
-//= require spree
-//= require spree/backend/spree-select2
-//= require spree/backend/address_states
-//= require spree/backend/adjustments
-//= require spree/backend/admin
-//= require spree/backend/calculator
-//= require spree/backend/checkouts/edit
-//= require spree/backend/gateway
-//= require spree/backend/general_settings
-//= require spree/backend/handlebar_extensions
-//= require spree/backend/line_items
-//= require spree/backend/line_items_on_order_edit
-//= require spree/backend/multi_currency
-//= require spree/backend/option_type_autocomplete
-//= require spree/backend/option_value_picker
-//= require spree/backend/orders/edit
-//= require spree/backend/payments/edit
-//= require spree/backend/payments/new
-//= require spree/backend/product_picker
-//= require spree/backend/progress
-//= require spree/backend/promotions
-//= require spree/backend/cms/_index
-//= require spree/backend/menus/_index
-//= require spree/backend/returns/expedited_exchanges_warning
-//= require spree/backend/returns/return_item_selection
-//= require spree/backend/shipments
-//= require spree/backend/states
-//= require spree/backend/stock_location
-//= require spree/backend/stock_management
-//= require spree/backend/stock_movement
-//= require spree/backend/stock_transfer
-//= require spree/backend/taxon_autocomplete
-//= require spree/backend/taxon_permalink_preview
-//= require spree/backend/taxon_tree_menu
-//= require spree/backend/taxonomy
-//= require spree/backend/taxons
-//= require spree/backend/users/edit
-//= require spree/backend/user_picker
-//= require spree/backend/variant_autocomplete
-//= require spree/backend/variant_management
-//= require spree/backend/zone
-
-Spree.routes.clear_cache = Spree.adminPathFor('general_settings/clear_cache')
-Spree.routes.checkouts_api = Spree.pathFor('api/v1/checkouts')
-Spree.routes.classifications_api = Spree.pathFor('api/v1/classifications')
-Spree.routes.option_types_api = Spree.pathFor('api/v1/option_types')
-Spree.routes.option_values_api = Spree.pathFor('api/v1/option_values')
-Spree.routes.orders_api = Spree.pathFor('api/v1/orders')
-Spree.routes.products_api = Spree.pathFor('api/v1/products')
-Spree.routes.shipments_api = Spree.pathFor('api/v1/shipments')
-Spree.routes.checkouts_api = Spree.pathFor('api/v1/checkouts')
-Spree.routes.stock_locations_api = Spree.pathFor('api/v1/stock_locations')
-Spree.routes.taxon_products_api = Spree.pathFor('api/v1/taxons/products')
-Spree.routes.taxons_api = Spree.pathFor('api/v1/taxons')
-Spree.routes.users_api = Spree.pathFor('api/v1/users')
-Spree.routes.variants_api = Spree.pathFor('api/v1/variants')
-
-Spree.routes.edit_product = function (productId) {
- return Spree.adminPathFor('products/' + productId + '/edit')
-}
-
-Spree.routes.payments_api = function (orderId) {
- return Spree.pathFor('api/v1/orders/' + orderId + '/payments')
-}
-
-Spree.routes.stock_items_api = function (stockLocationId) {
- return Spree.pathFor('api/v1/stock_locations/' + stockLocationId + '/stock_items')
-}
-
-// API v2
-Spree.routes.countries_api_v2 = Spree.pathFor('api/v2/platform/countries')
-Spree.routes.classifications_api_v2 = Spree.pathFor('api/v2/platform/classifications')
-Spree.routes.menus_api_v2 = Spree.pathFor('api/v2/platform/menus')
-Spree.routes.menus_items_api_v2 = Spree.pathFor('api/v2/platform/menu_items')
-Spree.routes.option_types_api_v2 = Spree.pathFor('api/v2/platform/option_types')
-Spree.routes.option_values_api_v2 = Spree.pathFor('api/v2/platform/option_values')
-Spree.routes.pages_api_v2 = Spree.pathFor('api/v2/platform/cms_pages')
-Spree.routes.products_api_v2 = Spree.pathFor('/api/v2/platform/products')
-Spree.routes.sections_api_v2 = Spree.pathFor('/api/v2/platform/cms_sections')
-Spree.routes.taxons_api_v2 = Spree.pathFor('/api/v2/platform/taxons')
-Spree.routes.users_api_v2 = Spree.pathFor('api/v2/platform/users')
-
-Spree.apiV2Authentication = function() {
- return {
- 'Authorization': 'Bearer ' + OAUTH_TOKEN
- }
-}
diff --git a/backend/app/assets/javascripts/spree/backend/address_states.es6 b/backend/app/assets/javascripts/spree/backend/address_states.es6
deleted file mode 100644
index 781704a480..0000000000
--- a/backend/app/assets/javascripts/spree/backend/address_states.es6
+++ /dev/null
@@ -1,44 +0,0 @@
-function updateAddressState(region, successCallback) {
- const countryId = $('#' + region + 'country select').val()
- const stateContainer = $('#' + region + 'state').parent()
- const stateSelect = $('#' + region + 'state select')
- const stateInput = $('#' + region + 'state input.state_name')
-
- fetch(Spree.routes.countries_api_v2 + '/' + countryId + '?include=states', {
- headers: Spree.apiV2Authentication()
- }).then((response) => {
- switch (response.status) {
- case 200:
- response.json().then((json) => {
- const states = json.included
- const statesRequired = json.data.attributes.states_required
- if (states.length > 0) {
- stateSelect.html('')
- $.each(states, function (_pos, state) {
- const opt = $(document.createElement('option'))
- .prop('value', state.id)
- .html(state.attributes.name)
- stateSelect.append(opt).trigger('change')
- })
- stateSelect.prop('disabled', false).show()
- stateSelect.select2()
- stateInput.hide().prop('disabled', true)
- stateContainer.show()
- } else {
- stateSelect.val(null).trigger('change')
- if (stateSelect.data('select2')) {
- stateSelect.select2('destroy')
- }
- stateSelect.hide()
- if (statesRequired) {
- stateInput.prop('disabled', false).show()
- } else {
- stateContainer.hide()
- }
- }
- if (successCallback) successCallback()
- })
- break
- }
- })
-}
diff --git a/backend/app/assets/javascripts/spree/backend/adjustments.js b/backend/app/assets/javascripts/spree/backend/adjustments.js
deleted file mode 100644
index f6f41d90df..0000000000
--- a/backend/app/assets/javascripts/spree/backend/adjustments.js
+++ /dev/null
@@ -1,25 +0,0 @@
-/* global order_number, show_flash */
-$(function () {
- $('[data-hook=adjustments_new_coupon_code] #add_coupon_code').click(function () {
- var couponCode = $('#coupon_code').val()
- if (couponCode.length === 0) {
- return
- }
- $.ajax({
- type: 'PUT',
- url: Spree.url(Spree.routes.apply_coupon_code(order_number)),
- data: {
- coupon_code: couponCode,
- token: Spree.api_key
- }
- }).done(function () {
- window.location.reload()
- }).fail(function (message) {
- if (message.responseJSON['error']) {
- show_flash('error', message.responseJSON['error'])
- } else {
- show_flash('error', 'There was a problem adding this coupon code.')
- }
- })
- })
-})
diff --git a/backend/app/assets/javascripts/spree/backend/admin.js b/backend/app/assets/javascripts/spree/backend/admin.js
deleted file mode 100644
index 455aa33adf..0000000000
--- a/backend/app/assets/javascripts/spree/backend/admin.js
+++ /dev/null
@@ -1,143 +0,0 @@
-/* global order_number, show_flash */
-
-$(document).ready(function() {
- /**
- OBSERVE FIELD:
- **/
- $('.observe_field').on('change', function() {
- var target = $(this).data('update')
- $(target).hide()
- $.ajax({
- dataType: 'html',
- url: $(this).data('base-url') + encodeURIComponent($(this).val()),
- type: 'GET'
- }).done(function(data) {
- $(target).html(data)
- $(target).show()
- })
- })
-
- /**
- ADD FIELDS
- **/
- var uniqueId = 1
- $('.spree_add_fields').click(function() {
- var target = $(this).data('target')
- var newTableRow = $(target + ' tr:visible:last').clone()
- var newId = new Date().getTime() + (uniqueId++)
- newTableRow.find('input, select').each(function() {
- var el = $(this)
- el.val('')
- el.prop('id', el.prop('id').replace(/\d+/, newId))
- el.prop('name', el.prop('name').replace(/\d+/, newId))
- })
-
- // When cloning a new row, set the href of all icons to be an empty "#"
- // This is so that clicking on them does not perform the actions for the
- // duplicated row
- newTableRow.find('a').each(function() {
- var el = $(this)
- el.prop('href', '#')
- })
- $(target).prepend(newTableRow)
- })
-
- /**
- DELETE RESOURCE
- **/
- $('body').on('click', '.delete-resource', function() {
- var el = $(this)
- if (confirm(el.data('confirm'))) {
- $.ajax({
- type: 'POST',
- url: $(this).prop('href'),
- data: {
- _method: 'delete',
- authenticity_token: AUTH_TOKEN
- },
- dataType: 'script',
- complete: function() {
- el.blur()
- }
- }).done(function() {
- var $flashElement = $('#FlashAlertsContainer span[data-alert-type="success"]')
- if ($flashElement.length) {
- el.parents('tr').fadeOut('hide', function() {
- $(this).remove()
- })
- el.closest('.removable-dom-element').fadeOut('hide', function() {
- $(this).remove()
- })
- var livePreview = document.getElementById('pageLivePreview')
- if (livePreview) { livePreview.contentWindow.location.reload() }
- }
- }).fail(function(response) {
- show_flash('error', response.responseText)
- })
- } else {
- el.blur()
- }
- return false
- })
-
- /**
- REMOVE FIELDS
- **/
- $('body').on('click', 'a.spree_remove_fields', function() {
- var el = $(this)
- el.prev('input[type=hidden]').val('1')
- el.closest('.fields').hide()
- if (el.prop('href').substr(-1) === '#') {
- el.parents('tr').fadeOut('hide')
- } else if (el.prop('href')) {
- $.ajax({
- type: 'POST',
- url: el.prop('href'),
- data: {
- _method: 'delete',
- authenticity_token: AUTH_TOKEN
- }
- }).done(function() {
- el.parents('tr').fadeOut('hide', function() {
- $(this).remove()
- })
- }).fail(function(response) {
- show_flash('error', response.responseText)
- })
- }
- return false
- })
-
- /**
- SELECT PROPERTIES FROM PROTOTYPE
- **/
- $('body').on('click', '.select_properties_from_prototype', function() {
- $('#busy_indicator').show()
- var clickedLink = $(this)
- $.ajax({
- dataType: 'script',
- url: clickedLink.prop('href'),
- type: 'GET'
- }).done(function() {
- clickedLink.parent('td').parent('tr').hide()
- $('#busy_indicator').hide()
- })
- return false
- })
-
- /**
- UTILITY
- **/
- window.Spree.advanceOrder = function() {
- $.ajax({
- type: 'PUT',
- async: false,
- data: {
- token: Spree.api_key
- },
- url: Spree.url(Spree.routes.checkouts_api + '/' + order_number + '/advance')
- }).done(function() {
- window.location.reload()
- })
- }
-})
diff --git a/backend/app/assets/javascripts/spree/backend/calculator.js b/backend/app/assets/javascripts/spree/backend/calculator.js
deleted file mode 100644
index 923e8f2522..0000000000
--- a/backend/app/assets/javascripts/spree/backend/calculator.js
+++ /dev/null
@@ -1,19 +0,0 @@
-$(function () {
- var calculatorSelect = $('select#calc_type')
- var originalCalcType = calculatorSelect.prop('value')
- $('.calculator-settings-warning').hide()
- calculatorSelect.change(function () {
- // eslint-disable-next-line
- if (calculatorSelect.prop('value') == originalCalcType) {
- $('div.calculator-settings').show()
- $('#shipping_method_calculator_attributes_preferred_currency').removeAttr('disabled')
- $('.calculator-settings-warning').hide()
- $('.calculator-settings').find('input, textarea').prop('disabled', false)
- } else {
- $('div.calculator-settings').hide()
- $('#shipping_method_calculator_attributes_preferred_currency').attr('disabled', 'disabled')
- $('.calculator-settings-warning').show()
- $('.calculator-settings').find('input, textarea').prop('disabled', true)
- }
- })
-})
diff --git a/backend/app/assets/javascripts/spree/backend/checkouts/edit.js b/backend/app/assets/javascripts/spree/backend/checkouts/edit.js
deleted file mode 100644
index 069e79c8c7..0000000000
--- a/backend/app/assets/javascripts/spree/backend/checkouts/edit.js
+++ /dev/null
@@ -1,137 +0,0 @@
-function clearAddressFields(addressKinds) {
- if (addressKinds === undefined) {
- addressKinds = ['ship', 'bill']
- }
- addressKinds.forEach(function(addressKind) {
- ADDRESS_FIELDS.forEach(function(field) {
- $('#order_' + addressKind + '_address_attributes_' + field).val('')
- })
- })
-}
-
-function formatCustomerResult(customer) {
- var escapedResult = window.customerTemplate({
- customer: customer,
- bill_address: customer.bill_address,
- ship_address: customer.ship_address
- })
- return $(escapedResult)
-}
-
-function formatCustomerAddress(address, kind) {
- $('#order_' + kind + '_address_attributes_firstname').val(address.firstname)
- $('#order_' + kind + '_address_attributes_lastname').val(address.lastname)
- $('#order_' + kind + '_address_attributes_address1').val(address.address1)
- $('#order_' + kind + '_address_attributes_company').val(address.company)
- $('#order_' + kind + '_address_attributes_address2').val(address.address2)
- $('#order_' + kind + '_address_attributes_city').val(address.city)
- $('#order_' + kind + '_address_attributes_zipcode').val(address.zipcode)
- $('#order_' + kind + '_address_attributes_phone').val(address.phone)
- $('#order_' + kind + '_address_attributes_phone').val(address.phone)
- $('#order_' + kind + '_address_attributes_country_id').val(address.country.id)
- $('#order_' + kind + '_address_attributes_country_id').trigger('change')
-
- var stateSelect = $('#order_' + kind + '_address_attributes_state_id')
-
- updateAddressState(kind.charAt(0), function() {
- if (address.state) {
- stateSelect.val(address.state.id).trigger('change')
- }
- })
-}
-
-function formatCustomerSelection(customer) {
- $('#order_email').val(customer.email)
- $('#order_user_id').val(customer.id)
- $('#guest_checkout_true').prop('checked', false)
- $('#guest_checkout_false').prop('checked', true)
- $('#guest_checkout_false').prop('disabled', false)
-
- var billAddress = customer.bill_address
- var shipAddress = customer.ship_address
-
- if (billAddress) {
- formatCustomerAddress(billAddress, 'bill')
- } else {
- clearAddressFields(['bill'])
- }
-
- if (shipAddress) {
- formatCustomerAddress(shipAddress, 'ship')
- } else {
- clearAddressFields(['ship'])
- }
-
- return customer.email
-}
-
-$.fn.customerAutocomplete = function() {
- var jsonApiUsers = {}
-
- this.select2({
- minimumInputLength: 3,
- placeholder: Spree.translations.choose_a_customer,
- ajax: {
- url: Spree.routes.users_api_v2,
- datatype: 'json',
- headers: Spree.apiV2Authentication(),
- data: function (params) {
- return {
- filter: {
- 'm': 'or',
- email_i_cont: params.term,
- addresses_firstname_start: params.term,
- addresses_lastname_start: params.term
- },
- include: 'ship_address.country,ship_address.state,bill_address.country,bill_address.state'
- }
- },
- success: function(data) {
- var JSONAPIDeserializer = require('jsonapi-serializer').Deserializer
- new JSONAPIDeserializer({ keyForAttribute: 'snake_case' }).deserialize(data, function (_err, users) {
- jsonApiUsers = users
- })
- },
- processResults: function (_data) {
- return { results: jsonApiUsers } // we need to return deserialized json api data
- }
- },
- templateResult: formatCustomerResult
- }).on('select2:select', function (e) {
- var data = e.params.data;
- formatCustomerSelection(data)
- })
-}
-
-document.addEventListener('DOMContentLoaded', function() {
- $('#customer_search').customerAutocomplete()
-
- if ($('#customer_autocomplete_template').length > 0) {
- window.customerTemplate = Handlebars.compile($('#customer_autocomplete_template').text())
- }
-
- // Handle Billing Shipping Address
- var orderUseBillingInput = $('input#order_use_billing')
-
- var orderUseBilling = function () {
- if (!orderUseBillingInput.is(':checked')) {
- $('#shipping').show()
- } else {
- $('#shipping').hide()
- }
- }
-
- // On page load hide shipping address from
- orderUseBilling()
-
- // On click togggle shipping address from
- orderUseBillingInput.click(orderUseBilling)
-
- // If guest checkout clear fields
- $('#guest_checkout_true').change(function () {
- $('#customer_search').val('')
- $('#order_user_id').val('')
- $('#order_email').val('')
- clearAddressFields()
- })
-})
diff --git a/backend/app/assets/javascripts/spree/backend/cms/_index.es6 b/backend/app/assets/javascripts/spree/backend/cms/_index.es6
deleted file mode 100644
index 8e621c2c2f..0000000000
--- a/backend/app/assets/javascripts/spree/backend/cms/_index.es6
+++ /dev/null
@@ -1,4 +0,0 @@
-//= require spree/backend/cms/page
-//= require spree/backend/cms/section
-//= require spree/backend/cms/links
-//= require spree/backend/cms/live_preview
diff --git a/backend/app/assets/javascripts/spree/backend/cms/links.es6 b/backend/app/assets/javascripts/spree/backend/cms/links.es6
deleted file mode 100644
index 4112aba925..0000000000
--- a/backend/app/assets/javascripts/spree/backend/cms/links.es6
+++ /dev/null
@@ -1,25 +0,0 @@
-document.addEventListener('DOMContentLoaded', function() {
- const linkSwitcher = $('.link_switcher').select2()
-
- linkSwitcher.on('change', function() {
- const selectedLinkToValue = $(this).val()
- const linkSwitcherTarget = this.dataset.targetField || 'menu_item_link'
- const activePanel = document.querySelector(`div[data-panel-id='${linkSwitcherTarget}']`)
- const messagePanel = document.querySelector(`div[data-target-message-pannel='${linkSwitcherTarget}']`)
- const panelType = activePanel.dataset.panelType
-
- if (selectedLinkToValue === panelType) {
- activePanel.classList = ''
- activePanel.classList.add('d-block')
-
- messagePanel.classList = ''
- messagePanel.classList.add('d-none')
- } else {
- activePanel.classList = ''
- activePanel.classList.add('d-none')
-
- messagePanel.classList = ''
- messagePanel.classList.add('d-block')
- }
- })
-})
diff --git a/backend/app/assets/javascripts/spree/backend/cms/live_preview.es6 b/backend/app/assets/javascripts/spree/backend/cms/live_preview.es6
deleted file mode 100644
index 69f8d937ac..0000000000
--- a/backend/app/assets/javascripts/spree/backend/cms/live_preview.es6
+++ /dev/null
@@ -1,34 +0,0 @@
-document.addEventListener('DOMContentLoaded', function() {
- const LiveViewSwitcher = document.getElementById('LiveViewSwitcher')
-
- if (!LiveViewSwitcher) return
-
- LiveViewSwitcher.addEventListener('click', function(event) {
- if (event.target && event.target.matches("input[type='radio']")) {
- switchLiveViewClass(event.target.id)
- }
- })
-
- function switchLiveViewClass(value) {
- const liveViewCont = document.getElementById('liveViewCont')
-
- liveViewCont.classList = ''
- liveViewCont.classList.add(value)
- }
-
- const cmsSectionEditorFullScreen = document.getElementById('cmsSectionEditorFullScreen')
-
- cmsSectionEditorFullScreen.addEventListener('click', function(event) {
- if (this.getAttribute('aria-pressed') === 'true') {
- document.body.removeAttribute('data-sections-editor-full-screen')
- } else {
- document.body.setAttribute('data-sections-editor-full-screen', '')
- }
- })
-
- const queryString = window.location.search;
- const urlParams = new URLSearchParams(queryString);
- const fullScreenMode = urlParams.get('section_editor_full_screen_mode')
-
- if (fullScreenMode) cmsSectionEditorFullScreen.click()
-})
diff --git a/backend/app/assets/javascripts/spree/backend/cms/page.es6 b/backend/app/assets/javascripts/spree/backend/cms/page.es6
deleted file mode 100644
index 369598ef90..0000000000
--- a/backend/app/assets/javascripts/spree/backend/cms/page.es6
+++ /dev/null
@@ -1,133 +0,0 @@
-document.addEventListener('DOMContentLoaded', function() {
- const pageVisabilityAttribute = document.querySelectorAll('[data-cms-page-id]')
- const pageTypeSelector = document.getElementById('cms_page_type')
- const el = document.getElementById('cmsPagesectionsArea')
-
- if (pageTypeSelector) updateCmsPageType()
-
- $(pageTypeSelector).on('change', function() { updateCmsPageType() })
-
- if (el) {
- Sortable.create(el, {
- handle: '.move-handle',
- ghostClass: 'moving-this',
- animation: 550,
- easing: 'cubic-bezier(1, 0, 0, 1)',
- swapThreshold: 0.9,
- forceFallback: true,
- onEnd: function(evt) {
- handleSectionReposition(evt)
- }
- })
- }
-
- pageVisabilityAttribute.forEach(function(elem) {
- elem.addEventListener('change', function() {
- handleTogglePageVisibility(this)
- })
- })
-})
-
-function handleTogglePageVisibility(obj) {
- let checkedState = null
- if (obj.checked) checkedState = true
-
- const pageId = parseInt(obj.dataset.cmsPageId, 10)
-
- const data = {
- cms_page: {
- visible: checkedState
- }
- }
-
- fetch(Spree.routes.pages_api_v2 + `/${pageId}`, {
- method: 'PATCH',
- headers: {
- Authorization: 'Bearer ' + OAUTH_TOKEN,
- 'Content-Type': 'application/json'
- },
- body: JSON.stringify(data)
- })
- .then(response => {
- if (response.ok) {
- reloadPreview()
- toggleVisibilityState(obj)
- } else {
- // eslint-disable-next-line no-undef
- spreeHandleApiRequestError(response)
- }
- })
- .catch(err => { console.error(err) })
-}
-
-function toggleVisibilityState(obj) {
- const statusHolder = document.getElementById('visibilityStatus')
- const pageHidden = statusHolder.querySelector('.page_hidden')
- const pageVisible = statusHolder.querySelector('.page_visible')
-
- if (obj.checked) {
- pageHidden.classList.add('d-none')
- pageVisible.classList.remove('d-none')
- } else {
- pageVisible.classList.add('d-none')
- pageHidden.classList.remove('d-none')
- }
-}
-
-function reloadPreview() {
- const liveLiewArea = document.getElementById('pageLivePreview')
-
- if (!liveLiewArea) return
-
- liveLiewArea.contentWindow.location.reload();
-}
-
-function handleSectionReposition(evt) {
- const data = {
- section_id: parseInt(evt.item.dataset.sectionId, 10),
- new_position_idx: parseInt(evt.newIndex, 10)
- }
-
- fetch(Spree.routes.sections_api_v2 + '/reposition', {
- method: 'PATCH',
- headers: {
- Authorization: 'Bearer ' + OAUTH_TOKEN,
- 'Content-Type': 'application/json'
- },
- body: JSON.stringify(data)
- })
- .then(response => {
- if (response.ok) {
- reloadPreview()
- } else {
- // eslint-disable-next-line no-undef
- spreeHandleApiRequestError(response.status)
- }
- })
- .catch(err => { console.error(err) })
-}
-
-function updateCmsPageType() {
- const slugField = document.getElementById('cms_page_slug')
- const updatePageType = document.getElementById('updatePageType')
-
- if (!slugField) return
-
- const selectedLinkType = $('#cms_page_type').val()
-
- if (selectedLinkType === 'Spree::Cms::Pages::Homepage') {
- slugField.disabled = true
- } else {
- slugField.disabled = false
- }
-
- if (!updatePageType) return
-
- const existingType = updatePageType.dataset.pageType
-
- if (selectedLinkType === existingType) {
- updatePageType.classList.add('d-none')
- } else {
- updatePageType.classList.remove('d-none')
- }
-}
diff --git a/backend/app/assets/javascripts/spree/backend/cms/section.es6 b/backend/app/assets/javascripts/spree/backend/cms/section.es6
deleted file mode 100644
index 7de4c005d4..0000000000
--- a/backend/app/assets/javascripts/spree/backend/cms/section.es6
+++ /dev/null
@@ -1,43 +0,0 @@
-document.addEventListener('DOMContentLoaded', function() {
- const sectionKindSelector = $('#cms_section_type').select2()
- const layoutSwitcher = $('#cms_section_layout_style').select2()
-
- sectionKindSelector.on('change', function() {
- const selectedValue = $(sectionKindSelector).val()
- const message = document.getElementById('alertToClickUpdate')
- const activeSectionKind = document.getElementById('CmsSectionType')
-
- if (!activeSectionKind) return
-
- const panelType = activeSectionKind.dataset.panelSectionType
-
- if (selectedValue === panelType) {
- activeSectionKind.classList = ''
- activeSectionKind.classList.add('d-block')
-
- message.classList = ''
- message.classList.add('d-none')
- } else {
- activeSectionKind.classList = ''
- activeSectionKind.classList.add('d-none')
-
- message.classList = ''
- message.classList.add('d-block')
- }
- });
-
- if (!layoutSwitcher) return
-
- layoutSwitcher.on('change', function() {
- const layoutDefault = document.querySelector('#Default')
- const layoutReverse = document.querySelector('#Reversed')
-
- if (this.value === 'Default') {
- layoutDefault.classList = 'd-block'
- layoutReverse.classList = 'd-none'
- } else {
- layoutDefault.classList = 'd-none'
- layoutReverse.classList = 'd-block'
- }
- })
-})
diff --git a/backend/app/assets/javascripts/spree/backend/gateway.js b/backend/app/assets/javascripts/spree/backend/gateway.js
deleted file mode 100644
index 06507f8017..0000000000
--- a/backend/app/assets/javascripts/spree/backend/gateway.js
+++ /dev/null
@@ -1,14 +0,0 @@
-$(function () {
- var originalGtwyType = $('#gtwy-type').prop('value')
- $('div#gateway-settings-warning').hide()
- $('#gtwy-type').change(function () {
- // eslint-disable-next-line
- if ($('#gtwy-type').prop('value') == originalGtwyType) {
- $('div.gateway-settings').show()
- $('div#gateway-settings-warning').hide()
- } else {
- $('div.gateway-settings').hide()
- $('div#gateway-settings-warning').show()
- }
- })
-})
diff --git a/backend/app/assets/javascripts/spree/backend/general_settings.js b/backend/app/assets/javascripts/spree/backend/general_settings.js
deleted file mode 100644
index 27b985c5a8..0000000000
--- a/backend/app/assets/javascripts/spree/backend/general_settings.js
+++ /dev/null
@@ -1,24 +0,0 @@
-/* global show_flash */
-$(function () {
- $('[data-hook=general_settings_clear_cache] #clear_cache').click(function () {
- if (confirm(Spree.translations.are_you_sure)) {
- $.ajax({
- type: 'POST',
- url: Spree.routes.clear_cache,
- data: {
- authenticity_token: AUTH_TOKEN
- },
- dataType: 'json'
- }).done(function () {
- show_flash('success', 'Cache was flushed.')
- })
- .fail(function (message) {
- if (message.responseJSON['error']) {
- show_flash('error', message.responseJSON['error'])
- } else {
- show_flash('error', 'There was a problem while flushing cache.')
- }
- })
- }
- })
-})
diff --git a/backend/app/assets/javascripts/spree/backend/global/_index.js b/backend/app/assets/javascripts/spree/backend/global/_index.js
deleted file mode 100644
index a3eb44d8e2..0000000000
--- a/backend/app/assets/javascripts/spree/backend/global/_index.js
+++ /dev/null
@@ -1,11 +0,0 @@
-//= require spree/backend/global/alerts
-//= require spree/backend/global/bootstrap
-//= require spree/backend/global/flatpickr
-//= require spree/backend/global/ransack
-//= require spree/backend/global/info_alert
-//= require spree/backend/global/radio_panel_toggle
-//= require spree/backend/global/responsive_menus
-//= require spree/backend/global/select2_autocomplete
-//= require spree/backend/global/select2_populate
-//= require spree/backend/global/sortable
-//= require spree/backend/global/side_scroll_indication
diff --git a/backend/app/assets/javascripts/spree/backend/global/alerts.es6 b/backend/app/assets/javascripts/spree/backend/global/alerts.es6
deleted file mode 100644
index 5d9a0eac4c..0000000000
--- a/backend/app/assets/javascripts/spree/backend/global/alerts.es6
+++ /dev/null
@@ -1,66 +0,0 @@
-/* global Swal */
-
-document.addEventListener('DOMContentLoaded', function() {
- const alertEl = document.querySelectorAll('[data-alert-type]')
-
- if (!alertEl) return
-
- alertEl.forEach(function (elem) {
- const alertType = elem.dataset.alertType
- const alertMessage = elem.innerHTML
-
- show_flash(alertType, alertMessage)
- })
-})
-
-// eslint-disable-next-line camelcase
-function show_flash(type, message) {
- let sanitizedType = DOMPurify.sanitize(type)
- const sanitizedMessage = DOMPurify.sanitize(message)
-
- if (sanitizedType === 'notice') sanitizedType = 'info'
-
- // Set up Swal toast alert defaults
- const Toast = Swal.mixin({
- toast: true,
- position: 'bottom',
- showConfirmButton: false,
- showCloseButton: true,
- timer: 4500,
- timerProgressBar: false,
- showClass: {
- popup: 'animate__animated animate__fadeInUp animate__faster',
- backdrop: '-',
- icon: '-'
- },
- hideClass: {
- popup: 'animate__animated animate__fadeOutDown animate__faster',
- backdrop: '-',
- icon: '-'
- }
- })
-
- Toast.fire({
- icon: sanitizedType,
- title: sanitizedMessage
- })
-
- appendToFlashAlertsContainer(sanitizedMessage, sanitizedType)
-}
-
-function appendToFlashAlertsContainer (message, type) {
- if (type === 'info') type = 'notice'
-
- const parnetNode = document.querySelector('#FlashAlertsContainer')
- const node = document.createElement('SPAN');
- const textNode = document.createTextNode(message);
-
- // Only the most recent alert should be left in the #FlashAlertsContainer.
- parnetNode.innerHTML = ''
-
- node.classList.add('d-none')
- node.setAttribute('data-alert-type', type);
- node.appendChild(textNode)
-
- parnetNode.appendChild(node);
-}
diff --git a/backend/app/assets/javascripts/spree/backend/global/api_functions.es6 b/backend/app/assets/javascripts/spree/backend/global/api_functions.es6
deleted file mode 100644
index 2e0122be77..0000000000
--- a/backend/app/assets/javascripts/spree/backend/global/api_functions.es6
+++ /dev/null
@@ -1,5 +0,0 @@
-// eslint-disable-next-line no-unused-vars
-function spreeHandleApiRequestError (response) {
- // eslint-disable-next-line no-undef
- show_flash('error', `API Error: ${response}`)
-}
diff --git a/backend/app/assets/javascripts/spree/backend/global/bootstrap.es6 b/backend/app/assets/javascripts/spree/backend/global/bootstrap.es6
deleted file mode 100644
index 4cee2eb27d..0000000000
--- a/backend/app/assets/javascripts/spree/backend/global/bootstrap.es6
+++ /dev/null
@@ -1,15 +0,0 @@
-// Use this file for Boostrap customization applied across the Spree Backend
-
-document.addEventListener('DOMContentLoaded', function() {
- $('.with-tip').each(function() {
- $(this).tooltip({
- container: $(this)
- })
- })
-
- $('.with-tip').on('show.bs.tooltip', function(event) {
- if (('ontouchstart' in window)) {
- event.preventDefault()
- }
- })
-})
diff --git a/backend/app/assets/javascripts/spree/backend/global/flatpickr.es6 b/backend/app/assets/javascripts/spree/backend/global/flatpickr.es6
deleted file mode 100644
index b2e611b837..0000000000
--- a/backend/app/assets/javascripts/spree/backend/global/flatpickr.es6
+++ /dev/null
@@ -1,22 +0,0 @@
-document.addEventListener('DOMContentLoaded', function() {
- flatpickr.setDefaults({
- altInput: true,
- time_24hr: true,
- altInputClass: 'flatpickr-alt-input',
- locale: Spree.translations.flatpickr_locale
- })
-
- var dateFrom = flatpickr('.datePickerFrom', {
- onChange: function(selectedDates) {
- dateTo.set('minDate', selectedDates[0])
- }
- })
-
- var dateTo = flatpickr('.datePickerTo', {
- onChange: function(selectedDates) {
- dateFrom.set('maxDate', selectedDates[0])
- }
- })
-
- flatpickr('.datepicker', {})
-})
diff --git a/backend/app/assets/javascripts/spree/backend/global/info_alert.es6 b/backend/app/assets/javascripts/spree/backend/global/info_alert.es6
deleted file mode 100644
index 17cadda3aa..0000000000
--- a/backend/app/assets/javascripts/spree/backend/global/info_alert.es6
+++ /dev/null
@@ -1,38 +0,0 @@
-/* global Swal */
-document.addEventListener('DOMContentLoaded', function() {
- const infoToggle = document.querySelectorAll('[data-show-info]')
-
- infoToggle.forEach(function(infoElem) {
- infoElem.addEventListener('click', function() {
- const alertType = infoElem.dataset.alertKind
- const alertTitle = infoElem.dataset.alertTitle
- const alertHtml = infoElem.dataset.alertHtml
- const alertMessage = infoElem.dataset.alertMessage
-
- showInfoAlert(alertType, alertTitle, alertMessage, alertHtml)
- })
- })
-})
-
-// eslint-disable-next-line no-unused-vars
-function showInfoAlert(type = null, title = null, message = null, html = null) {
- const infoAlert = Swal.mixin({
- showConfirmButton: false,
- showCloseButton: true,
- timer: null,
- timerProgressBar: false,
- showClass: {
- popup: 'animate__animated animate__fadeInUp animate__faster'
- },
- hideClass: {
- popup: 'animate__animated animate__fadeOutDown animate__faster'
- }
- })
-
- infoAlert.fire({
- icon: type,
- title: title,
- text: message,
- html: html
- })
-}
diff --git a/backend/app/assets/javascripts/spree/backend/global/radio_panel_toggle.es6 b/backend/app/assets/javascripts/spree/backend/global/radio_panel_toggle.es6
deleted file mode 100644
index decc274398..0000000000
--- a/backend/app/assets/javascripts/spree/backend/global/radio_panel_toggle.es6
+++ /dev/null
@@ -1,18 +0,0 @@
-/**
- radioControlsVisibilityOfElement:
- Apply to individual radio button that makes another element visible when checked
-**/
-document.addEventListener('DOMContentLoaded', function() {
- $.fn.radioControlsVisibilityOfElement = function(dependentElementSelector) {
- if (!this.get(0)) { return }
- var showValue = this.get(0).value
- var radioGroup = $("input[name='" + this.get(0).name + "']")
- radioGroup.each(function() {
- $(this).click(function() {
- // eslint-disable-next-line eqeqeq
- $(dependentElementSelector).visible(this.checked && this.value == showValue)
- })
- if (this.checked) { this.click() }
- })
- }
-})
diff --git a/backend/app/assets/javascripts/spree/backend/global/ransack.es6 b/backend/app/assets/javascripts/spree/backend/global/ransack.es6
deleted file mode 100644
index d3e833b307..0000000000
--- a/backend/app/assets/javascripts/spree/backend/global/ransack.es6
+++ /dev/null
@@ -1,108 +0,0 @@
-document.addEventListener('DOMContentLoaded', function() {
- const QuickSearchInput = document.getElementById('quick_search')
-
- if (QuickSearchInput) {
- const QuickSearchPlaceHolder = QuickSearchInput.placeholder
- const TargetSearchFieldId = document.querySelector('input.js-quick-search-target').id
- const AssociatedLabelName = document.querySelector(`label[for="${TargetSearchFieldId}"]`).innerHTML
-
- QuickSearchInput.placeholder = `${QuickSearchPlaceHolder} ${AssociatedLabelName}`
- }
-
- $('.js-show-index-filters').click(function() {
- $('.filter-well').slideToggle()
- $(this).parents('.filter-wrap').toggleClass('collapsed')
- })
-
- // TODO: remove this js temp behaviour and fix this decent
- // Temp quick search
- // When there was a search term, copy it
- $('.js-quick-search').val($('.js-quick-search-target').val())
-
- // Catch the quick search form submit and submit the real form
- $('#quick-search').submit(function() {
- $('.js-quick-search-target').val($('.js-quick-search').val())
- $('#table-filter form').submit()
- return false
- })
-
- // Clickable ransack filters
- $('.js-add-filter').click(function() {
- var ransackField = $(this).data('ransack-field')
- var ransackValue = $(this).data('ransack-value')
-
- $('#' + ransackField).val(ransackValue)
- $('#table-filter form').submit()
- })
-
- $(document).on('click', '.js-delete-filter', function() {
- var ransackField = $(this).parents('.js-filter').data('ransack-field')
-
- $('#' + ransackField).val('')
- $('#table-filter form').submit()
- })
-
- function ransackField(value) {
- switch (value) {
- case 'Date Range':
- return 'Start'
- case '':
- return 'Stop'
- default:
- return value.trim()
- }
- }
-
- // To appear in the filtered options, the elements id attribute must start with 'q_',
- // and it must have the class'.js-filterable'.
- $('[id^="q_"].js-filterable').each(function() {
- var $this = $(this)
-
- if ($this.val() !== null && $this.val() !== '' && $this.val().length !== 0) {
- var ransackValue, filter
- var ransackFieldId = $this.attr('id')
- var label = $('label[for="' + ransackFieldId + '"]')
-
- if ($this.is('select')) {
- ransackValue = $this.find('option:selected').toArray().map(function(option) {
- return option.text;
- }).join(', ')
- } else {
- ransackValue = $this.val()
- }
-
- label = ransackField(label.text()) + ': ' + ransackValue
-
- var cleanLabel = DOMPurify.sanitize(label)
-
- filter = '<span class="js-filter badge badge-secondary d-inline-flex align-items-center" data-ransack-field="' + ransackFieldId + '">' + cleanLabel + '<i class="icon icon-cancel ml-2 js-delete-filter"></i></span>'
- $('.js-filters').append(filter).show()
- }
- })
-
- // per page dropdown
- // preserves all selected filters / queries supplied by user
- // changes only per_page value
- $('.js-per-page-select').change(function() {
- var form = $(this).closest('.js-per-page-form')
- var url = form.attr('action')
- var value = $(this).val().toString()
- if (url.match(/\?/)) {
- url += '&per_page=' + value
- } else {
- url += '?per_page=' + value
- }
- window.location = url
- })
-
- // injects per_page settings to all available search forms
- // so when user changes some filters / queries per_page is preserved
- $(document).ready(function() {
- var perPageDropdown = $('.js-per-page-select:first')
- if (perPageDropdown.length) {
- var perPageValue = perPageDropdown.val().toString()
- var perPageInput = '<input type="hidden" name="per_page" value=' + perPageValue + ' />'
- $('#table-filter form').append(perPageInput)
- }
- })
-})
diff --git a/backend/app/assets/javascripts/spree/backend/global/responsive_menus.es6 b/backend/app/assets/javascripts/spree/backend/global/responsive_menus.es6
deleted file mode 100644
index ab4b489e92..0000000000
--- a/backend/app/assets/javascripts/spree/backend/global/responsive_menus.es6
+++ /dev/null
@@ -1,56 +0,0 @@
-document.addEventListener('DOMContentLoaded', function() {
- var body = $('body')
- var modalBackdrop = $('#multi-backdrop')
-
- // Fail safe on screen resize
- var resizeTimer;
- window.addEventListener('resize', function() {
- document.body.classList.remove('modal-open', 'sidebar-open', 'contextualSideMenu-open');
- document.body.classList.add('resize-animation-stopper');
- clearTimeout(resizeTimer);
- resizeTimer = setTimeout(function() {
- document.body.classList.remove('resize-animation-stopper');
- }, 400);
- });
-
- function closeAllMenus() {
- body.removeClass()
- body.addClass('admin')
- modalBackdrop.removeClass('show')
- }
-
- modalBackdrop.click(closeAllMenus)
-
- // Main Menu Functionality
- var sidebarOpen = $('#sidebar-open')
- var sidebarClose = $('#sidebar-close')
- var activeItem = $('#main-sidebar').find('.selected')
-
- activeItem.closest('.nav-sidebar').addClass('active-option')
- activeItem.closest('.nav-pills').addClass('in show')
-
- function openMenu() {
- closeAllMenus()
- body.addClass('sidebar-open modal-open')
- modalBackdrop.addClass('show')
- }
- sidebarOpen.click(openMenu)
- sidebarClose.click(closeAllMenus)
-
- // Contextual Sidebar Menu
- var contextualSidebarMenuToggle = $('#contextual-menu-toggle')
- var contextualSidebarMenuClose = $('#contextual-menu-close')
-
- function toggleContextualMenu() {
- if (document.body.classList.contains('contextualSideMenu-open')) {
- closeAllMenus()
- } else {
- closeAllMenus()
- body.addClass('contextualSideMenu-open modal-open')
- modalBackdrop.addClass('show')
- }
- }
-
- contextualSidebarMenuToggle.click(toggleContextualMenu)
- contextualSidebarMenuClose.click(toggleContextualMenu)
-})
diff --git a/backend/app/assets/javascripts/spree/backend/global/select2_autocomplete.es6 b/backend/app/assets/javascripts/spree/backend/global/select2_autocomplete.es6
deleted file mode 100644
index 3b621dec05..0000000000
--- a/backend/app/assets/javascripts/spree/backend/global/select2_autocomplete.es6
+++ /dev/null
@@ -1,132 +0,0 @@
-// SELECT2 AUTOCOMPLETE JS
-// The JavaScript in this file allows Spree developers to set up Select2 autocomplete search
-// using the API v2 by simply adding data attributes to a select element.
-
-// REQUIRED ATTRIBUTES
-// You must provide a URL for the API V2, use the format shown below. See backend.js for other API V2 URL's.
-// REQUIRED:
-// data-autocomplete-url-value="products_api_v2"
-
-// OPTIONAL:
-// data-autocomplete-placeholder-value="Seach Pages" <- Sets the placeholder | DEFAULT is: 'Search'.
-// data-autocomplete-clear-value=boolean <- Allow select2 to be cleared | DEFAULT is: false (no clear button).
-// data-autocomplete-multiple-value=boolean <- Multiple or Single select | DEFAULT is: false (single).
-// data-autocomplete-return-attr-value="pretty_name" <- Return Attribute. | DEFAULT is: 'name'.
-// data-autocomplete-min-input-value="4" <- Minimum input for search | DEFAULT is: 3.
-// data-autocomplete-search-query-value="title_i_cont" <- Custom search query | DEFAULT is: 'name_i_cont'.
-// data-autocomplete-custom-return-id-value="permalink" <- Return a custom attribute | DEFAULT: returns id.
-// data-autocomplete-debug-mode-value=boolean <- Turn on console loggin of data returned by the request.
-//
-// Add your own custom URL params to the request as needed
-// EXAMPLE:
-// data-autocomplete-additional-url-params-value="filter[type_not_eq]=Spree::Cms::Pages::Homepage"
-
-document.addEventListener('DOMContentLoaded', function() {
- loadAutoCompleteParams()
-})
-
-// eslint-disable-next-line no-unused-vars
-function loadAutoCompleteParams() {
- const select2Autocompletes = document.querySelectorAll('select[data-autocomplete-url-value]')
- select2Autocompletes.forEach(element => buildParamsFromDataAttrs(element))
-}
-
-function buildParamsFromDataAttrs(element) {
- $(element).select2Autocomplete({
- apiUrl: Spree.routes[element.dataset.autocompleteUrlValue],
- placeholder: element.dataset.autocompletePlaceholderValue,
- allow_clear: element.dataset.autocompleteClearValue,
- multiple: element.dataset.autocompleteMultipleValue,
- return_attribute: element.dataset.autocompleteReturnAttrValue,
- minimum_input: element.dataset.autocompleteMinInputValue,
- search_query: element.dataset.autocompleteSearchQueryValue,
- custom_return_id: element.dataset.autocompleteCustomReturnIdValue,
- additional_url_params: element.dataset.autocompleteAdditionalUrlParamsValue,
- debug_mode: element.dataset.autocompleteDebugModeValue
- })
-}
-
-$.fn.select2Autocomplete = function(params) {
- let apiUrl = null
- let returnedFields
-
- const resourcePlural = params.apiUrl.match(/([^/]*)\/*$/)[1]
- const resourceSingular = resourcePlural.slice(0, -1)
- const select2placeHolder = params.placeholder || Spree.translations.search
- const select2Multiple = params.multiple || false
- const select2allowClear = params.allow_clear || false
- const returnAttribute = params.return_attribute || 'name'
- const minimumInput = params.minimum_input || 3
- const searchQuery = params.search_query || 'name_i_cont'
- const customReturnId = params.custom_return_id || null
- const additionalUrlParams = params.additional_url_params || null
- const DebugMode = params.debug_mode || null
-
- //
- // Set up a clean URL for sparseFields
- if (customReturnId == null) {
- returnedFields = returnAttribute
- } else {
- returnedFields = `${returnAttribute},${customReturnId}`
- }
- const sparseFields = `fields[${resourceSingular}]=${returnedFields}`
-
- //
- // Set up a clean URL for Additional URL Params
- if (additionalUrlParams != null) {
- // URL + Additional URL Params + Sparse Fields
- apiUrl = `${params.apiUrl}?${additionalUrlParams}&${sparseFields}`
- } else {
- // URL + Sparse Fields (the default response for a noraml Select2)
- apiUrl = `${params.apiUrl}?${sparseFields}`
- }
-
- if (DebugMode != null) console.log('Request URL:' + apiUrl)
-
- //
- // Format the returned values.
- function formatList(values) {
- if (customReturnId) {
- return values.map(function(obj) {
- return {
- id: obj.attributes[customReturnId],
- text: obj.attributes[returnAttribute]
- }
- })
- } else {
- return values.map(function(obj) {
- return {
- id: obj.id,
- text: obj.attributes[returnAttribute]
- }
- })
- }
- }
-
- //
- // Set-up Select2 and make AJAX request.
- this.select2({
- multiple: select2Multiple,
- allowClear: select2allowClear,
- placeholder: select2placeHolder,
- minimumInputLength: minimumInput,
- ajax: {
- url: apiUrl,
- headers: Spree.apiV2Authentication(),
- data: function(params) {
- return {
- filter: {
- [searchQuery]: params.term
- }
- }
- },
- processResults: function(json) {
- if (DebugMode != null) console.log(json)
-
- return {
- results: formatList(json.data)
- }
- }
- }
- })
-}
diff --git a/backend/app/assets/javascripts/spree/backend/global/select2_populate.es6 b/backend/app/assets/javascripts/spree/backend/global/select2_populate.es6
deleted file mode 100644
index a93ac86cd6..0000000000
--- a/backend/app/assets/javascripts/spree/backend/global/select2_populate.es6
+++ /dev/null
@@ -1,87 +0,0 @@
-/**
- populateSelectOptionsFromApi(params)
- Allows you to easily fetch data from API (Platfrom v2) and populate an empty <select> with <option> tags, including a selected <option> tag.
-
- ## EXAMPLE A
- # Populating a list of all taxons including a selected item
-
- populateSelectOptionsFromApi({
- targetElement: '#mySelectElement',
- apiUrl: Spree.routes.taxons_api_v2,
- returnAttribute: 'pretty_name',
-
- <% if @menu_item.linked_resource_id %>
- selectedOption: <%= @menu_item.linked_resource_id %>
- <% end %>
- })
-
- ## EXAMPLE B
- # Populating a single selected item using filter and returning an attribute other than the ID
-
- <% if resource.link_one.present? %>
- <script>
- populateSelectOptionsFromApi({
- targetElement: "#<%= save_to %>Select2",
- apiUrl: Spree.routes.taxons_api_v2 + "?filter[permalink_matches]=<%= resource.send(save_to) %>",
- returnValueFromAttributes: 'permalink',
- returnOptionText: 'pretty_name',
-
- <% if resource.send(save_to) %>
- selectedOption: "<%= resource.send(save_to) %>"
- <% end %>
- })
- </script>
- <% end %>
-**/
-
-// eslint-disable-next-line no-unused-vars
-const populateSelectOptionsFromApi = function(params) {
- createRequest(params, updateSelectSuccess, updateSelectError)
-}
-
-const handleErrors = function(response) {
- if (!response.ok) throw new Error((response.status + ': ' + response.statusText))
-
- return response.json()
-}
-
-const createRequest = function(params, succeed, fail) {
- const targetElement = params.targetElement
- const apiUrl = params.apiUrl
- const returnOptionText = params.returnOptionText
- const returnValueFromAttributes = params.returnValueFromAttributes || null
- const selectedOption = params.selectedOption
- const selectEl = document.querySelector(targetElement)
-
- fetch(apiUrl, { headers: Spree.apiV2Authentication() })
- .then((response) => handleErrors(response))
- .then((json) => succeed(json.data, returnValueFromAttributes, returnOptionText, selectEl, selectedOption))
- .catch((error) => fail(error, selectEl))
-}
-
-const updateSelectSuccess = function(parsedData, returnValueFromAttributes, returnOptionText, selectEl, selectedOption) {
- const selectedOpt = selectEl.querySelector('option[selected]')
-
- parsedData.forEach((object) => {
- const optionEl = document.createElement('option')
-
- if (returnValueFromAttributes == null) {
- optionEl.value = object.id
- if (parseInt(selectedOption, 10) === parseInt(object.id, 10)) optionEl.selected = true
- } else {
- optionEl.value = object.attributes[returnValueFromAttributes]
- if (selectedOpt.value === object.attributes[returnValueFromAttributes]) {
- selectedOpt.remove()
-
- optionEl.setAttribute('selected', 'selected')
- }
- }
-
- optionEl.innerHTML = object.attributes[returnOptionText]
- selectEl.appendChild(optionEl)
- })
-}
-
-const updateSelectError = function(error, selectEl) {
- console.log(error)
-}
diff --git a/backend/app/assets/javascripts/spree/backend/global/side_scroll_indication.es6 b/backend/app/assets/javascripts/spree/backend/global/side_scroll_indication.es6
deleted file mode 100644
index cd3390cf43..0000000000
--- a/backend/app/assets/javascripts/spree/backend/global/side_scroll_indication.es6
+++ /dev/null
@@ -1,137 +0,0 @@
-document.addEventListener('DOMContentLoaded', function () {
- const navWrapper = document.querySelectorAll('[data-nav-x-wrapper]')
- navWrapper.forEach(el => initHorizontalNav(el))
-})
-
-const SETTINGS = {
- navBarTravelling: false,
- navBarTravelDirection: '',
- navBarTravelDistance: 150
-}
-
-function initHorizontalNav (containerEl) {
- const navAdvanceLeft = containerEl.querySelector('.nav-x_Advancer_Left')
- const navAdvanceRight = containerEl.querySelector('.nav-x_Advancer_Right')
- const navContainer = containerEl.querySelector('[data-nav-x-container]')
- const navContent = navContainer.querySelector('[data-nav-x-content]')
- const activeNavItem = navContent.querySelector('.active')
-
- // Trigger on DOMContentLoaded
- setOverscrollIndicators()
-
- if (activeNavItem) focusActiveItem(navContainer, activeNavItem)
-
- window.addEventListener('resize', function () {
- // Trigger on window resize
- setOverscrollIndicators()
- focusActiveItem(navContainer, activeNavItem)
- })
-
- navContainer.addEventListener('scroll', function () {
- // Trigger on Side Scrolling
- setOverscrollIndicators()
- })
-
- function setOverscrollIndicators () {
- navContainer.setAttribute('data-overflowing', determineOverflow(navContent, navContainer))
- }
-
- navAdvanceLeft.addEventListener('click', function () {
- // If in the middle of a move return
- if (SETTINGS.navBarTravelling === true) return
-
- // If we have content overflowing both sides or on the left
- if (determineOverflow(navContent, navContainer) === 'left' || determineOverflow(navContent, navContainer) === 'both') {
- // Find how far this panel has been scrolled
- const availableScrollLeft = navContainer.scrollLeft
- // If the space available is less than two lots of our desired distance, just move the whole amount
- // otherwise, move by the amount in the settings
- if (availableScrollLeft < SETTINGS.navBarTravelDistance * 2) {
- navContent.style.transform = `translateX(${availableScrollLeft}px)`
- } else {
- navContent.style.transform = `translateX(${SETTINGS.navBarTravelDistance}px)`
- }
- // We do want a transition (this is set in CSS) when moving so remove the class that would prevent that
- navContent.classList.remove('nav-x_Transition_None')
- // Update our settings
- SETTINGS.navBarTravelDirection = 'left'
- SETTINGS.navBarTravelling = true
- }
- // Now update the attribute in the DOM
- navContainer.setAttribute('data-overflowing', determineOverflow(navContent, navContainer))
- })
-
- navAdvanceRight.addEventListener('click', function () {
- // If in the middle of a move return
- if (SETTINGS.navBarTravelling === true) return
-
- // If we have content overflowing both sides or on the right
- if (determineOverflow(navContent, navContainer) === 'right' || determineOverflow(navContent, navContainer) === 'both') {
- // Get the right edge of the container and content
- const navBarRightEdge = navContent.getBoundingClientRect().right
- const navBarScrollerRightEdge = navContainer.getBoundingClientRect().right
- // Now we know how much space we have available to scroll
- const availableScrollRight = Math.floor(navBarRightEdge - navBarScrollerRightEdge)
- // If the space available is less than two lots of our desired distance, just move the whole amount
- // otherwise, move by the amount in the settings
- if (availableScrollRight < SETTINGS.navBarTravelDistance * 2) {
- navContent.style.transform = `translateX(-${availableScrollRight}px)`
- } else {
- navContent.style.transform = `translateX(-${SETTINGS.navBarTravelDistance}px)`
- }
- // We do want a transition (this is set in CSS) when moving so remove the class that would prevent that
- navContent.classList.remove('nav-x_Transition_None')
- // Update our settings
- SETTINGS.navBarTravelDirection = 'right'
- SETTINGS.navBarTravelling = true
- }
- // Now update the attribute in the DOM
- navContainer.setAttribute('data-overflowing', determineOverflow(navContent, navContainer))
- })
-
- navContent.addEventListener('transitionend', function () {
- // get the value of the transform, apply that to the current scroll position (so get the scroll pos first) and then remove the transform
- const styleOfTransform = window.getComputedStyle(navContent, null)
- const tr = styleOfTransform.getPropertyValue('transform') || styleOfTransform.getPropertyValue('transform')
- // If there is no transition we want to default to 0 and not null
-
- const amount = Math.abs(parseInt(tr.split(',')[4]) || 0)
-
- navContent.style.transform = 'none'
- navContent.classList.add('nav-x_Transition_None')
- // Now lets set the scroll position
- if (SETTINGS.navBarTravelDirection === 'left') {
- navContainer.scrollLeft = navContainer.scrollLeft - amount
- } else {
- navContainer.scrollLeft = navContainer.scrollLeft + amount
- }
- SETTINGS.navBarTravelling = false
- })
-}
-
-// Set active link into view
-function focusActiveItem (containerEl, activeEl) {
- if (!activeEl) return
-
- containerEl.scrollLeft = activeEl.offsetLeft - 45
-}
-
-// Determine Scroll status
-function determineOverflow (content, container) {
- const containerMetrics = container.getBoundingClientRect()
- const containerMetricsRight = Math.floor(containerMetrics.right)
- const containerMetricsLeft = Math.floor(containerMetrics.left)
- const contentMetrics = content.getBoundingClientRect()
- const contentMetricsRight = Math.floor(contentMetrics.right)
- const contentMetricsLeft = Math.floor(contentMetrics.left)
-
- if (containerMetricsLeft > contentMetricsLeft && containerMetricsRight < contentMetricsRight) {
- return 'both'
- } else if (contentMetricsLeft < containerMetricsLeft) {
- return 'left'
- } else if (contentMetricsRight > containerMetricsRight) {
- return 'right'
- } else {
- return 'none'
- }
-}
diff --git a/backend/app/assets/javascripts/spree/backend/global/sortable.es6 b/backend/app/assets/javascripts/spree/backend/global/sortable.es6
deleted file mode 100644
index 7b11b4e7f1..0000000000
--- a/backend/app/assets/javascripts/spree/backend/global/sortable.es6
+++ /dev/null
@@ -1,35 +0,0 @@
-document.addEventListener('DOMContentLoaded', function() {
- var parentEl = document.getElementsByClassName('sortable')[0];
- if (parentEl) {
- var element = parentEl.querySelector('tbody')
- }
-
- if (element) {
- Sortable.create(element, {
- handle: '.move-handle',
- animation: 550,
- ghostClass: 'bg-light',
- dragClass: 'sortable-drag-v',
- easing: 'cubic-bezier(1, 0, 0, 1)',
- swapThreshold: 0.9,
- forceFallback: true,
- onEnd: function(evt) {
- var itemEl = evt.item
- var positions = { authenticity_token: AUTH_TOKEN }
- $.each($('tr', element), function(position, obj) {
- var reg = /spree_(\w+_?)+_(\d+)/
- var parts = reg.exec($(obj).prop('id'))
- if (parts) {
- positions['positions[' + parts[2] + ']'] = position + 1
- }
- })
- $.ajax({
- type: 'POST',
- dataType: 'json',
- url: $(itemEl).closest('table.sortable').data('sortable-link'),
- data: positions
- })
- }
- })
- }
-})
diff --git a/backend/app/assets/javascripts/spree/backend/global/tinymce.es6 b/backend/app/assets/javascripts/spree/backend/global/tinymce.es6
deleted file mode 100644
index 231d18711d..0000000000
--- a/backend/app/assets/javascripts/spree/backend/global/tinymce.es6
+++ /dev/null
@@ -1,11 +0,0 @@
-document.addEventListener('DOMContentLoaded', function() {
- // eslint-disable-next-line no-undef
- tinymce.init({
- selector: '.spree-rte',
- plugins: [
- 'image table paste code link table'
- ],
- menubar: false,
- toolbar: 'undo redo | styleselect | bold italic link forecolor backcolor | alignleft aligncenter alignright alignjustify | table | bullist numlist outdent indent | code '
- });
-})
diff --git a/backend/app/assets/javascripts/spree/backend/handlebar_extensions.js b/backend/app/assets/javascripts/spree/backend/handlebar_extensions.js
deleted file mode 100644
index 9a1557a413..0000000000
--- a/backend/app/assets/javascripts/spree/backend/handlebar_extensions.js
+++ /dev/null
@@ -1,17 +0,0 @@
-Handlebars.registerHelper('t', function (key) {
- if (Spree.translations[key]) {
- return Spree.translations[key]
- } else {
- console.error('No translation found for ' + key + '. Does it exist within spree/admin/shared/_translations.html.erb?')
- }
-})
-Handlebars.registerHelper('edit_product_url', function (productId) {
- return Spree.routes.edit_product(productId)
-})
-Handlebars.registerHelper('name_or_presentation', function (optionValue) {
- if (optionValue.option_type_name === 'color') {
- return optionValue.name
- } else {
- return optionValue.presentation
- }
-})
diff --git a/backend/app/assets/javascripts/spree/backend/line_items.js b/backend/app/assets/javascripts/spree/backend/line_items.js
deleted file mode 100644
index d8bef32b6b..0000000000
--- a/backend/app/assets/javascripts/spree/backend/line_items.js
+++ /dev/null
@@ -1,72 +0,0 @@
-/* global toggleItemEdit, order_number */
-$(function () {
- // handle edit click
- $('a.edit-line-item').click(toggleLineItemEdit)
- // handle cancel click
- $('a.cancel-line-item').click(toggleLineItemEdit)
- // handle save click
- $('a.save-line-item').click(function () {
- var save = $(this)
- var lineItemId = save.data('line-item-id')
- var quantity = parseInt(save.parents('tr').find('input.line_item_quantity').val())
- toggleItemEdit()
- adjustLineItem(lineItemId, quantity)
- })
- // handle delete click
- $('a.delete-line-item').click(function () {
- if (confirm(Spree.translations.are_you_sure_delete)) {
- var del = $(this)
- var lineItemId = del.data('line-item-id')
- toggleItemEdit()
- deleteLineItem(lineItemId)
- }
- })
-})
-
-function toggleLineItemEdit () {
- var link = $(this)
- var parent = link.parent()
- var tr = link.parents('tr')
- parent.find('a.edit-line-item').toggle()
- parent.find('a.cancel-line-item').toggle()
- parent.find('a.save-line-item').toggle()
- parent.find('a.delete-line-item').toggle()
- tr.find('td.line-item-qty-show').toggle()
- tr.find('td.line-item-qty-edit').toggle()
-}
-
-function lineItemURL (lineItemId) {
- // eslint-disable-next-line camelcase
- return Spree.routes.orders_api + '/' + order_number + '/line_items/' + lineItemId + '.json'
-}
-
-function adjustLineItem (lineItemId, quantity) {
- $.ajax({
- type: 'PUT',
- url: Spree.url(lineItemURL(lineItemId)),
- data: {
- line_item: {
- quantity: quantity
- },
- token: Spree.api_key
- }
- }).done(function () {
- window.Spree.advanceOrder()
- })
-}
-
-function deleteLineItem (lineItemId) {
- $.ajax({
- type: 'DELETE',
- url: Spree.url(lineItemURL(lineItemId)),
- headers: {
- 'X-Spree-Token': Spree.api_key
- }
- }).done(function () {
- $('#line-item-' + lineItemId).remove()
- if ($('.line-items tr.line-item').length === 0) {
- $('.line-items').remove()
- }
- window.Spree.advanceOrder()
- })
-}
diff --git a/backend/app/assets/javascripts/spree/backend/line_items_on_order_edit.js b/backend/app/assets/javascripts/spree/backend/line_items_on_order_edit.js
deleted file mode 100644
index 08250e26dd..0000000000
--- a/backend/app/assets/javascripts/spree/backend/line_items_on_order_edit.js
+++ /dev/null
@@ -1,52 +0,0 @@
-/* global variantLineItemTemplate, order_number */
-// This file contains the code for interacting with line items in the manual cart
-$(document).ready(function () {
- 'use strict'
-
- // handle variant selection, show stock level.
- $('#add_line_item_variant_id').change(function () {
- var variantId = $(this).val()
-
- var variant = _.find(window.variants, function (variant) {
- // eslint-disable-next-line eqeqeq
- return variant.id == variantId
- })
- $('#stock_details').html(variantLineItemTemplate({ variant: variant }))
- $('#stock_details').show()
- $('button.add_variant').click(addVariant)
- })
-})
-
-function addVariant () {
- $('#stock_details').hide()
- var variantId = $('select.variant_autocomplete').val()
- var quantity = $('input#variant_quantity').val()
-
- adjustLineItems(order_number, variantId, quantity)
- return 1
-}
-
-adjustLineItems = function(order_number, variant_id, quantity){
- var url = Spree.routes.orders_api + '/' + order_number + '/line_items'
-
- $.ajax({
- type: 'POST',
- url: Spree.url(url),
- data: {
- line_item: {
- variant_id: variant_id,
- quantity: quantity
- },
- token: Spree.api_key
- }
- }).done(function () {
- window.Spree.advanceOrder()
- window.location.reload()
- }).fail(function (msg) {
- if (typeof msg.responseJSON.message != 'undefined') {
- alert(msg.responseJSON.message)
- } else {
- alert(msg.responseJSON.exception)
- }
- })
-}
diff --git a/backend/app/assets/javascripts/spree/backend/menus/_index.es6 b/backend/app/assets/javascripts/spree/backend/menus/_index.es6
deleted file mode 100644
index 862de047c5..0000000000
--- a/backend/app/assets/javascripts/spree/backend/menus/_index.es6
+++ /dev/null
@@ -1,2 +0,0 @@
-//= require spree/backend/menus/menu
-//= require spree/backend/menus/menu_item
diff --git a/backend/app/assets/javascripts/spree/backend/menus/menu.es6 b/backend/app/assets/javascripts/spree/backend/menus/menu.es6
deleted file mode 100644
index f9e6f8c737..0000000000
--- a/backend/app/assets/javascripts/spree/backend/menus/menu.es6
+++ /dev/null
@@ -1,57 +0,0 @@
-/* eslint-disable no-new */
-
-document.addEventListener('DOMContentLoaded', function() {
- const menuItemSortable = {
- group: {
- name: 'sortable-menu',
- pull: true,
- put: true
- },
- handle: '.move-handle',
- swapThreshold: 0.5,
- emptyInsertThreshold: 8,
- dragClass: 'menu-item-dragged',
- draggable: '.dragable',
- animation: 350,
- forceFallback: false,
- onEnd: function (evt) {
- handleMenuItemMove(evt)
- }
- }
-
- let containers = null;
- containers = document.querySelectorAll('.menu-container');
-
- for (let i = 0; i < containers.length; i++) {
- new Sortable(containers[i], menuItemSortable);
- }
-})
-
-function handleMenuItemMove(evt) {
- const data = {
- new_parent_id: parseInt(evt.to.dataset.parentId, 10) || null,
- new_position_idx: parseInt(evt.newIndex, 10)
- }
-
- fetch(`${Spree.routes.menus_items_api_v2}/${evt.item.dataset.itemId}/reposition`, {
- method: 'PATCH',
- headers: {
- Authorization: 'Bearer ' + OAUTH_TOKEN,
- 'Content-Type': 'application/json'
- },
- body: JSON.stringify(data)
- })
- .then(response => {
- if (response.ok !== true) {
- handleMenuItemMoveError()
- }
- })
- .catch(err => {
- console.error(err);
- });
-}
-
-function handleMenuItemMoveError () {
- // eslint-disable-next-line no-undef
- show_flash('error', Spree.translations.move_could_not_be_saved)
-}
diff --git a/backend/app/assets/javascripts/spree/backend/menus/menu_item.es6 b/backend/app/assets/javascripts/spree/backend/menus/menu_item.es6
deleted file mode 100644
index 570f24d7eb..0000000000
--- a/backend/app/assets/javascripts/spree/backend/menus/menu_item.es6
+++ /dev/null
@@ -1,26 +0,0 @@
-document.addEventListener('DOMContentLoaded', function() {
- const menuItemType = $('#menu_item_item_type').select2()
-
- updateContainerMessage()
-
- menuItemType.on('change', function() {
- updateContainerMessage()
- });
-
- function updateContainerMessage () {
- const linkSettingsPanel = document.getElementById('LinkSettings')
-
- if (!linkSettingsPanel) return
-
- const selectedLinkType = $('#menu_item_item_type').val()
- const usingConainerMessage = document.getElementById('usingContainerInfo')
-
- if (selectedLinkType === 'Container') {
- linkSettingsPanel.classList.add('d-none')
- usingConainerMessage.classList.remove('d-none')
- } else {
- linkSettingsPanel.classList.remove('d-none')
- usingConainerMessage.classList.add('d-none')
- }
- }
-})
diff --git a/backend/app/assets/javascripts/spree/backend/multi_currency.js b/backend/app/assets/javascripts/spree/backend/multi_currency.js
deleted file mode 100644
index 7111f1aebc..0000000000
--- a/backend/app/assets/javascripts/spree/backend/multi_currency.js
+++ /dev/null
@@ -1,38 +0,0 @@
-//= require spree/backend
-
-$(document).ready(function () {
- $.expr[':'].Contains = function (a, i, m) {
- return (
- (a.textContent || a.innerText || '')
- .toUpperCase()
- .indexOf(m[3].toUpperCase()) >= 0
- )
- }
-
- function listFilter (list) {
- var input = $('#variant-price-search')
-
- $(input)
- .change(function () {
- var filter = $(this).val()
- if (filter) {
- $(list).find('.panel-title:not(:Contains(' + filter + '))').parent().hide()
- $(list).find('.panel-title:Contains(' + filter + ')').parent().show()
- } else {
- $(list)
- .find('.panel')
- .parent()
- .show()
- }
- return false
- })
- .keyup(function () {
- $(this).change()
- })
- }
-
- // ondomready
- $(function () {
- listFilter($('#variant-prices'))
- })
-})
diff --git a/backend/app/assets/javascripts/spree/backend/option_type_autocomplete.js b/backend/app/assets/javascripts/spree/backend/option_type_autocomplete.js
deleted file mode 100644
index 1390685b5f..0000000000
--- a/backend/app/assets/javascripts/spree/backend/option_type_autocomplete.js
+++ /dev/null
@@ -1,33 +0,0 @@
-$.fn.optionTypeAutocomplete = function () {
- 'use strict'
-
- console.warn('optionTypeAutocomplete is deprecated and will be removed in Spree 5.0')
-
- this.select2({
- minimumInputLength: 2,
- multiple: true,
- ajax: {
- url: Spree.routes.option_types_api_v2,
- datatype: 'json',
- headers: Spree.apiV2Authentication(),
- data: function (params) {
- return {
- filter: {
- name_i_cont: params.term
- }
- }
- },
- processResults: function (data) {
- return formatSelect2Options(data)
- }
- }
- })
-}
-
-$(document).ready(function () {
- var productOptionTypeSelector = document.getElementById('product_option_type_ids')
- if (productOptionTypeSelector == null) return
- if (productOptionTypeSelector.hasAttribute('data-autocomplete-url-value')) return
-
- $('#product_option_type_ids').optionTypeAutocomplete()
-})
diff --git a/backend/app/assets/javascripts/spree/backend/option_value_picker.js b/backend/app/assets/javascripts/spree/backend/option_value_picker.js
deleted file mode 100644
index d41d280688..0000000000
--- a/backend/app/assets/javascripts/spree/backend/option_value_picker.js
+++ /dev/null
@@ -1,59 +0,0 @@
-$.fn.optionValueAutocomplete = function (options) {
- 'use strict'
-
- // Default options
- options = options || {}
- var multiple = typeof (options.multiple) !== 'undefined' ? options.multiple : true
- var productSelect = options.productSelect
- var productId = options.productId
- var values = options.values
- var clearSelection = options.clearSelection
-
- function addOptions(select, productId, values) {
- $.ajax({
- type: 'GET',
- url: Spree.routes.option_values_api_v2,
- headers: Spree.apiV2Authentication(),
- dataType: 'json',
- data: {
- filter: {
- id_in: values,
- variants_product_id_eq: productId
- }
- }
- }).then(function (data) {
- select.addSelect2Options(data.data)
- })
- }
-
- this.select2({
- multiple: multiple,
- minimumInputLength: 1,
- ajax: {
- url: Spree.routes.option_values_api_v2,
- dataType: 'json',
- headers: Spree.apiV2Authentication(),
- data: function (params) {
- var selectedProductId = typeof (productSelect) !== 'undefined' ? productSelect.val() : null
-
- return {
- filter: {
- name_cont: params.term,
- variants_product_id_eq: selectedProductId
- }
- }
- },
- processResults: function(data) {
- return formatSelect2Options(data)
- }
- }
- })
-
- if (values && productId && !clearSelection) {
- addOptions(this, productId, values)
- }
-
- if (clearSelection) {
- this.val(null).trigger('change')
- }
-}
diff --git a/backend/app/assets/javascripts/spree/backend/orders/edit.js b/backend/app/assets/javascripts/spree/backend/orders/edit.js
deleted file mode 100644
index 8264afc5a4..0000000000
--- a/backend/app/assets/javascripts/spree/backend/orders/edit.js
+++ /dev/null
@@ -1,4 +0,0 @@
-$(document).ready(function () {
- 'use strict'
- $('[data-hook="add_product_name"]').find('.variant_autocomplete').variantAutocomplete()
-})
diff --git a/backend/app/assets/javascripts/spree/backend/payments/edit.js b/backend/app/assets/javascripts/spree/backend/payments/edit.js
deleted file mode 100644
index 7b2e40aaca..0000000000
--- a/backend/app/assets/javascripts/spree/backend/payments/edit.js
+++ /dev/null
@@ -1,231 +0,0 @@
-/* global show_flash */
-jQuery(function ($) {
- var extend = function (child, parent) {
- for (var key in parent) {
- if (hasProp.call(parent, key)) child[key] = parent[key]
- }
- function Ctor () {
- this.constructor = child
- }
- Ctor.prototype = parent.prototype
- child.prototype = new Ctor()
- child.__super__ = parent.prototype
- return child
- }
- var hasProp = {}.hasOwnProperty
- var EditPaymentView, Payment, PaymentView, ShowPaymentView, orderId
- orderId = $('#payments').data('order-id')
- Payment = (function () {
- function Payment (number) {
- this.url = Spree.url(((Spree.routes.payments_api(orderId)) + '/' + number + '.json') + '?token=' + Spree.api_key)
- this.json = $.getJSON(this.url.toString(), function (data) {
- this.data = data
- }.bind(this))
- this.updating = false
- }
-
- Payment.prototype.if_editable = function (callback) {
- return this.json.done(function (data) {
- var ref
- if ((ref = data.state) === 'checkout' || ref === 'pending') {
- return callback()
- }
- })
- }
-
- Payment.prototype.update = function (attributes) {
- this.updating = true
- var jqXHR = $.ajax({
- type: 'PUT',
- url: this.url.toString(),
- data: {
- payment: attributes
- }
- })
- jqXHR.always(function () {
- this.updating = false
- }.bind(this))
- jqXHR.done(function (data) {
- this.data = data
- }.bind(this))
- jqXHR.fail(function () {
- var response = (jqXHR.responseJSON && jqXHR.responseJSON.error) || jqXHR.statusText
- show_flash('error', response)
- })
- return jqXHR
- }
-
- Payment.prototype.amount = function () {
- return this.data.amount
- }
-
- Payment.prototype.display_amount = function () {
- return this.data.display_amount
- }
- return Payment
- })()
-
- PaymentView = (function () {
- function PaymentView ($el1, payment1) {
- this.$el = $el1
- this.payment = payment1
- this.render()
- }
-
- PaymentView.prototype.render = function () {
- return this.add_action_button()
- }
-
- PaymentView.prototype.show = function () {
- this.remove_buttons()
- return new ShowPaymentView(this.$el, this.payment)
- }
-
- PaymentView.prototype.edit = function () {
- this.remove_buttons()
- return new EditPaymentView(this.$el, this.payment)
- }
-
- PaymentView.prototype.add_action_button = function () {
- return this.$actions().prepend(this.$new_button(this.action))
- }
-
- PaymentView.prototype.remove_buttons = function () {
- return this.$buttons().remove()
- }
-
- PaymentView.prototype.$new_button = function (action) {
- return $('<a><i class="icon icon-' + action + '"></i></a>').attr({
- 'class': 'payment-action-' + action + ' btn btn-outline-secondary btn-sm no-filter',
- title: Spree.translations[action]
- }).data({
- action: action
- }).one({
- click: function (event) {
- event.preventDefault()
- },
- mouseup: function () {
- this[action]()
- }.bind(this)
- })
- }
-
- PaymentView.prototype.$buttons = function () {
- return this.$actions().find('.payment-action-' + this.action + ', .payment-action-cancel')
- }
-
- PaymentView.prototype.$actions = function () {
- return this.$el.find('.payment-action-buttons')
- }
-
- PaymentView.prototype.$amount = function () {
- return this.$el.find('td.amount')
- }
-
- return PaymentView
- })()
- ShowPaymentView = (function (superClass) {
- extend(ShowPaymentView, superClass)
-
- function ShowPaymentView () {
- return ShowPaymentView.__super__.constructor.apply(this, arguments)
- }
-
- ShowPaymentView.prototype.action = 'edit'
-
- ShowPaymentView.prototype.render = function () {
- ShowPaymentView.__super__.render.apply(this, arguments)
- this.set_actions_display()
- this.show_actions()
- return this.show_amount()
- }
-
- ShowPaymentView.prototype.set_actions_display = function () {
- var width = this.$actions().width()
- return this.$actions().width(width).css('text-align', 'left')
- }
-
- ShowPaymentView.prototype.show_actions = function () {
- return this.$actions().find('a').show()
- }
-
- ShowPaymentView.prototype.show_amount = function () {
- var amount = $('<span />').html(this.payment.display_amount()).one('click', function () {
- this.edit().$input().focus()
- }.bind(this))
- return this.$amount().html(amount)
- }
-
- return ShowPaymentView
- })(PaymentView)
- EditPaymentView = (function (superClass) {
- extend(EditPaymentView, superClass)
-
- function EditPaymentView () {
- return EditPaymentView.__super__.constructor.apply(this, arguments)
- }
-
- EditPaymentView.prototype.action = 'save'
-
- EditPaymentView.prototype.render = function () {
- EditPaymentView.__super__.render.apply(this, arguments)
- this.hide_actions()
- this.edit_amount()
- return this.add_cancel_button()
- }
-
- EditPaymentView.prototype.add_cancel_button = function () {
- return this.$actions().append(this.$new_button('cancel'))
- }
-
- EditPaymentView.prototype.hide_actions = function () {
- return this.$actions().find('a').not(this.$buttons()).hide()
- }
-
- EditPaymentView.prototype.edit_amount = function () {
- var amount = this.$amount()
- return amount.html(this.$new_input(amount.find('span').width()))
- }
-
- EditPaymentView.prototype.save = function () {
- if (!this.payment.updating) {
- return this.payment.update({
- amount: this.$input().val()
- }).done(function () {
- return this.show()
- }.bind(this))
- }
- }
-
- EditPaymentView.prototype.cancel = EditPaymentView.prototype.show
-
- EditPaymentView.prototype.$new_input = function (width) {
- var amount = this.constructor.normalize_amount(this.payment.display_amount())
- return $('<input />').prop({
- id: 'amount',
- class: 'form-control',
- value: amount
- }).width(width * 2).css({
- 'text-align': 'right'
- })
- }
-
- EditPaymentView.prototype.$input = function () {
- return this.$amount().find('input')
- }
-
- EditPaymentView.normalize_amount = function (amount) {
- var separator = Spree.translations.currency_separator
- return amount.replace(RegExp('[^\\d' + separator + ']', 'g'), '')
- }
-
- return EditPaymentView
- })(PaymentView)
- return $('.admin tr[data-hook=payments_row]').each(function () {
- var $el = $(this)
- var payment = new Payment($el.attr('data-number'))
- return payment.if_editable(function () {
- return new ShowPaymentView($el, payment)
- })
- })
-})
diff --git a/backend/app/assets/javascripts/spree/backend/payments/new.js b/backend/app/assets/javascripts/spree/backend/payments/new.js
deleted file mode 100644
index 46023e5017..0000000000
--- a/backend/app/assets/javascripts/spree/backend/payments/new.js
+++ /dev/null
@@ -1,63 +0,0 @@
-/* global Cleave */
-
-$(document).ready(function () {
- if ($('#new_payment').length) {
- var cardCodeCleave;
- var updateCardCodeCleave = function (length) {
- if (cardCodeCleave) cardCodeCleave.destroy()
-
- cardCodeCleave = new Cleave('.cardCode', {
- numericOnly: true,
- blocks: [length]
- })
- }
-
- updateCardCodeCleave(3)
-
- /* eslint-disable no-new */
- new Cleave('.cardNumber', {
- creditCard: true,
- onCreditCardTypeChanged: function (type) {
- $('.ccType').val(type)
-
- if (type === 'amex') {
- updateCardCodeCleave(4)
- } else {
- updateCardCodeCleave(3)
- }
- }
- })
- /* eslint-disable no-new */
- new Cleave('.cardExpiry', {
- date: true,
- datePattern: ['m', 'Y']
- })
-
- $('.payment_methods_radios').click(
- function () {
- $('.payment-methods').hide()
- $('.payment-methods :input').prop('disabled', true)
- if (this.checked) {
- $('#payment_method_' + this.value + ' :input').prop('disabled', false)
- $('#payment_method_' + this.value).show()
- }
- }
- )
-
- $('.payment_methods_radios').each(
- function () {
- if (this.checked) {
- $('#payment_method_' + this.value + ' :input').prop('disabled', false)
- $('#payment_method_' + this.value).show()
- } else {
- $('#payment_method_' + this.value).hide()
- $('#payment_method_' + this.value + ' :input').prop('disabled', true)
- }
-
- if ($('#card_new' + this.value).is('*')) {
- $('#card_new' + this.value).radioControlsVisibilityOfElement('#card_form' + this.value)
- }
- }
- )
- }
-})
diff --git a/backend/app/assets/javascripts/spree/backend/product_picker.js b/backend/app/assets/javascripts/spree/backend/product_picker.js
deleted file mode 100644
index 971ac07a80..0000000000
--- a/backend/app/assets/javascripts/spree/backend/product_picker.js
+++ /dev/null
@@ -1,66 +0,0 @@
-$.fn.productAutocomplete = function (options) {
- 'use strict'
-
- // Default options
- options = options || {}
- var multiple = typeof (options.multiple) !== 'undefined' ? options.multiple : true
- var values = typeof (options.values) !== 'undefined' ? options.values : null
-
- function formatProductList(products) {
- return products.map(function(obj) {
- return { id: obj.id, text: obj.name }
- })
- }
-
- function addOptions(select, values) {
- $.ajax({
- url: Spree.routes.products_api,
- dataType: 'json',
- data: {
- q: {
- id_in: values
- },
- token: Spree.api_key
- }
- }).then(function (data) {
- select.addSelect2Options(data.products)
- })
- }
-
- this.select2({
- multiple: multiple,
- minimumInputLength: 3,
- ajax: {
- url: Spree.routes.products_api,
- dataType: 'json',
- data: function (params) {
- return {
- q: {
- name_or_master_sku_cont: params.term
- },
- m: 'OR',
- token: Spree.api_key
- }
- },
- processResults: function(data) {
- var products = data.products ? data.products : []
- var results = formatProductList(products)
-
- return {
- results: results
- }
- }
- },
- templateSelection: function(data, _container) {
- return data.text
- }
- })
-
- if (values) {
- addOptions(this, values)
- }
-}
-
-$(document).ready(function () {
- $('.product_picker').productAutocomplete()
-})
diff --git a/backend/app/assets/javascripts/spree/backend/progress.js b/backend/app/assets/javascripts/spree/backend/progress.js
deleted file mode 100644
index 182c9cb59b..0000000000
--- a/backend/app/assets/javascripts/spree/backend/progress.js
+++ /dev/null
@@ -1,8 +0,0 @@
-$(function () {
- $(document).ajaxStart(function () {
- $('#progress').stop(true, true).fadeIn()
- })
- $(document).ajaxStop(function () {
- $('#progress').fadeOut()
- })
-})
diff --git a/backend/app/assets/javascripts/spree/backend/promotions.js b/backend/app/assets/javascripts/spree/backend/promotions.js
deleted file mode 100644
index 21fa4641d8..0000000000
--- a/backend/app/assets/javascripts/spree/backend/promotions.js
+++ /dev/null
@@ -1,170 +0,0 @@
-function initProductActions () {
- 'use strict'
-
- $('#promotion-filters').find('.variant_autocomplete').variantAutocomplete()
-
- $('.calculator-fields').each(function () {
- var $fieldsContainer = $(this)
- var $typeSelect = $fieldsContainer.find('.type-select')
- var $settings = $fieldsContainer.find('.settings')
- var $warning = $fieldsContainer.find('.js-warning')
- var originalType = $typeSelect.val()
-
- $warning.hide()
- $typeSelect.change(function () {
- if ($(this).val() === originalType) {
- $warning.hide()
- $settings.show()
- $settings.find('input').removeProp('disabled')
- } else {
- $warning.show()
- $settings.hide()
- $settings.find('input').prop('disabled', 'disabled')
- }
- })
- })
-
- //
- // Option Value Promo Rule
- //
- if ($('#promo-rule-option-value-template').length) {
- var optionValueSelectNameTemplate = Handlebars.compile($('#promo-rule-option-value-option-values-select-name-template').html())
- var optionValueTemplate = Handlebars.compile($('#promo-rule-option-value-template').html())
- var optionValuesList = $('.js-promo-rule-option-values')
-
- var addOptionValue = function (productId, values) {
- var template = optionValueTemplate({
- productId: productId
- })
-
- optionValuesList.append(template)
-
- var optionValueId = '#promo-rule-option-value-'
- if (productId) {
- optionValueId += productId.toString()
- }
- var optionValue = optionValuesList.find(optionValueId)
-
- var productSelect = optionValue.find('.js-promo-rule-option-value-product-select')
- var valuesSelect = optionValue.find('.js-promo-rule-option-value-option-values-select')
-
- productSelect.productAutocomplete({ multiple: false, values: productId })
- productSelect.on('select2:select', function(e) {
- valuesSelect.attr('disabled', false).removeClass('d-none').addClass('d-block')
- valuesSelect.attr('name', optionValueSelectNameTemplate({ productId: productSelect.val() }).trim())
- valuesSelect.optionValueAutocomplete({
- productId: productId,
- productSelect: productSelect,
- multiple: true,
- values: values,
- clearSelection: productId != productSelect.val()
- })
- })
- }
-
- var originalOptionValues = $('.js-original-promo-rule-option-values').data('original-option-values')
- if (!$('.js-original-promo-rule-option-values').data('loaded')) {
- if ($.isEmptyObject(originalOptionValues)) {
- addOptionValue(null, null)
- } else {
- $.each(originalOptionValues, addOptionValue)
- }
- }
- $('.js-original-promo-rule-option-values').data('loaded', true)
-
- $(document).on('click', '.js-add-promo-rule-option-value', function (event) {
- event.preventDefault()
- addOptionValue(null, null)
- })
-
- $(document).on('click', '.js-remove-promo-rule-option-value', function () {
- $(this).parents('.promo-rule-option-value').remove()
- })
- }
-
- //
- // Tiered Calculator
- //
- if ($('#tier-fields-template').length && $('#tier-input-name').length) {
- var tierFieldsTemplate = Handlebars.compile($('#tier-fields-template').html())
- var tierInputNameTemplate = Handlebars.compile($('#tier-input-name').html())
-
- var originalTiers = $('.js-original-tiers').data('original-tiers')
- $.each(originalTiers, function (base, value) {
- var fieldName = tierInputNameTemplate({ base: base }).trim()
- $('.js-tiers').append(tierFieldsTemplate({
- baseField: { value: base },
- valueField: { name: fieldName, value: value }
- }))
- })
-
- $(document).on('click', '.js-add-tier', function (event) {
- event.preventDefault()
- $('.js-tiers').append(tierFieldsTemplate({ valueField: { name: null } }))
- })
-
- $(document).on('click', '.js-remove-tier', function (event) {
- $(this).parents('.tier').remove()
- })
-
- $(document).on('change', '.js-base-input', function (event) {
- var valueInput = $(this).parents('.tier').find('.js-value-input')
- valueInput.attr('name', tierInputNameTemplate({ base: $(this).val() }).trim())
- })
- }
-
- //
- // CreateLineItems Promotion Action
- //
- (function () {
- function hideOrShowItemTables () {
- $('.promotion_action table').each(function () {
- if ($(this).find('td').length === 0) {
- $(this).hide()
- } else {
- $(this).show()
- }
- })
- }
- hideOrShowItemTables()
-
- // Remove line item
- function setupRemoveLineItems () {
- $('.remove_promotion_line_item').on('click', function () {
- var lineItemsEl = $($('.line_items_string')[0])
- var finder = new RegExp($(this).data('variant-id') + 'x\\d+')
- lineItemsEl.val(lineItemsEl.val().replace(finder, ''))
- $(this).parents('tr').remove()
- hideOrShowItemTables()
- })
- }
-
- setupRemoveLineItems()
- // Add line item to list
- $('.promotion_action.create_line_items button.add').off('click').click(function () {
- var $container = $(this).parents('.promotion_action')
- var product_name = $container.find('input[name="add_product_name"]').val()
- var variant_id = $container.find('input[name="add_variant_id"]').val()
- var quantity = $container.find('input[name="add_quantity"]').val()
- if (variant_id) {
- // Add to the table
- var newRow = '<tr><td>' + product_name + '</td><td>' + quantity + '</td><td><i class="icon icon-cancel"></i></td></tr>'
- $container.find('table').append(newRow)
- // Add to serialized string in hidden text field
- var $hiddenField = $container.find('.line_items_string')
- $hiddenField.val($hiddenField.val() + ',' + variantId + 'x' + quantity)
- setupRemoveLineItems()
- hideOrShowItemTables()
- }
- return false
- })
- })()
-}
-
-$(document).ready(function () {
- var promotion_form = $('form.edit_promotion')
-
- if (promotion_form.length) {
- initProductActions()
- }
-})
diff --git a/backend/app/assets/javascripts/spree/backend/returns/expedited_exchanges_warning.js b/backend/app/assets/javascripts/spree/backend/returns/expedited_exchanges_warning.js
deleted file mode 100644
index b9acc70f81..0000000000
--- a/backend/app/assets/javascripts/spree/backend/returns/expedited_exchanges_warning.js
+++ /dev/null
@@ -1,5 +0,0 @@
-$(function () {
- $(document).on('change', '.return-items-table .return-item-exchange-selection', function () {
- $('.expedited-exchanges-warning').fadeIn()
- })
-})
diff --git a/backend/app/assets/javascripts/spree/backend/returns/return_item_selection.js b/backend/app/assets/javascripts/spree/backend/returns/return_item_selection.js
deleted file mode 100644
index 6e44aacb28..0000000000
--- a/backend/app/assets/javascripts/spree/backend/returns/return_item_selection.js
+++ /dev/null
@@ -1,40 +0,0 @@
-$(document).ready(function () {
- var formFields = $("[data-hook='admin_customer_return_form_fields'], [data-hook='admin_return_authorization_form_fields']")
-
- function checkAddItemBox () {
- $(this).closest('tr').find('input.add-item').attr('checked', 'checked')
- updateSuggestedAmount()
- }
-
- function updateSuggestedAmount () {
- var totalPretaxRefund = 0
- var checkedItems = formFields.find('input.add-item:checked')
- $.each(checkedItems, function (i, checkbox) {
- var returnItemRow = $(checkbox).parents('tr')
- var returnQuantity = parseInt(returnItemRow.find('.refund-quantity-input').val(), 10)
- var purchasedQuantity = parseInt(returnItemRow.find('.purchased-quantity').text(), 10)
- var amount = (returnQuantity / purchasedQuantity) * parseFloat(returnItemRow.find('.charged-amount').data('chargedAmount'))
- returnItemRow.find('.refund-amount-input').val(amount.toFixed(2))
- totalPretaxRefund += amount
- })
-
- var displayTotal = isNaN(totalPretaxRefund) ? '' : totalPretaxRefund.toFixed(2)
- formFields.find('span#total_pre_tax_refund').html(displayTotal)
- }
-
- if (formFields.length > 0) {
- updateSuggestedAmount()
-
- formFields.find('input#select-all').on('change', function (ev) {
- var checkBoxes = $(ev.currentTarget).parents('table:first').find('input.add-item')
- checkBoxes.prop('checked', this.checked)
- updateSuggestedAmount()
- })
-
- formFields.find('input.add-item').on('change', updateSuggestedAmount)
- formFields.find('.refund-amount-input').on('keyup', updateSuggestedAmount)
- formFields.find('.refund-quantity-input').on('keyup mouseup', updateSuggestedAmount)
-
- formFields.find('input, select').not('.add-item').on('change', checkAddItemBox)
- }
-})
diff --git a/backend/app/assets/javascripts/spree/backend/shipments.js b/backend/app/assets/javascripts/spree/backend/shipments.js
deleted file mode 100644
index d339b38495..0000000000
--- a/backend/app/assets/javascripts/spree/backend/shipments.js
+++ /dev/null
@@ -1,367 +0,0 @@
-/* global shipments, variantStockTemplate, order_number */
-// Shipments AJAX API
-$(document).ready(function () {
- 'use strict'
-
- // handle variant selection, show stock level.
- $('#add_variant_id').change(function () {
- var variantId = parseInt($(this).val())
- var variant = _.find(window.variants, function (variant) {
- return variant.id === variantId
- })
-
- $('#stock_details').html(variantStockTemplate({ variant: variant }))
- $('#stock_details').show()
-
- $('button.add_variant').click(addVariantFromStockLocation)
- })
-
- // handle edit click
- $('a.edit-item').click(toggleItemEdit)
-
- // handle cancel click
- $('a.cancel-item').click(toggleItemEdit)
-
- // handle split click
- $('a.split-item').click(startItemSplit)
-
- // handle save click
- $('a.save-item').click(function () {
- var save = $(this)
- var shipmentNumber = save.data('shipment-number')
- var variantId = save.data('variant-id')
-
- var quantity = parseInt(save.parents('tr').find('input.line_item_quantity').val())
-
- toggleItemEdit()
- adjustShipmentItems(shipmentNumber, variantId, quantity)
- return false
- })
-
- // handle delete click
- $('a.delete-item').click(function (event) {
- if (confirm(Spree.translations.are_you_sure_delete)) {
- var del = $(this)
- var shipmentNumber = del.data('shipment-number')
- var variantId = del.data('variant-id')
- // eslint-disable-next-line
- var shipment = _.findWhere(shipments, { number: shipmentNumber + '' })
- var url = Spree.routes.shipments_api + '/' + shipmentNumber + '/remove'
-
- toggleItemEdit()
-
- $.ajax({
- type: 'PUT',
- url: Spree.url(url),
- data: {
- variant_id: variantId,
- token: Spree.api_key
- }
- }).done(function (msg) {
- window.location.reload()
- }).fail(function (msg) {
- alert(msg.responseJSON.message || msg.responseJSON.exception)
- })
- }
- return false
- })
-
- // handle ship click
- $('[data-hook=admin_shipment_form] a.ship').on('click', function () {
- var link = $(this)
- var shipmentNumber = link.data('shipment-number')
- var url = Spree.url(Spree.routes.shipments_api + '/' + shipmentNumber + '/ship.json')
- $.ajax({
- type: 'PUT',
- url: url,
- data: {
- token: Spree.api_key
- }
- }).done(function () {
- window.location.reload()
- }).fail(function (msg) {
- alert(msg.responseJSON.message || msg.responseJSON.exception)
- })
- })
-
- // handle shipping method edit click
- $('a.edit-method').click(toggleMethodEdit)
- $('a.cancel-method').click(toggleMethodEdit)
-
- // handle shipping method save
- $('[data-hook=admin_shipment_form] a.save-method').on('click', function (event) {
- event.preventDefault()
-
- var link = $(this)
- var shipmentNumber = link.data('shipment-number')
- var selectedShippingRateId = link.parents('tbody').find("select#selected_shipping_rate_id[data-shipment-number='" + shipmentNumber + "']").val()
- var unlock = link.parents('tbody').find("input[name='open_adjustment'][data-shipment-number='" + shipmentNumber + "']:checked").val()
- var url = Spree.url(Spree.routes.shipments_api + '/' + shipmentNumber + '.json')
-
- $.ajax({
- type: 'PUT',
- url: url,
- data: {
- shipment: {
- selected_shipping_rate_id: selectedShippingRateId,
- unlock: unlock
- },
- token: Spree.api_key
- }
- }).done(function () {
- window.location.reload()
- }).fail(function (msg) {
- alert(msg.responseJSON.message || msg.responseJSON.exception)
- })
- })
-
- function toggleTrackingEdit(event) {
- event.preventDefault()
-
- var link = $(this)
- link.parents('tbody').find('tr.edit-tracking').toggle()
- link.parents('tbody').find('tr.show-tracking').toggle()
- }
-
- // handle tracking edit click
- $('a.edit-tracking').click(toggleTrackingEdit)
- $('a.cancel-tracking').click(toggleTrackingEdit)
-
- function createTrackingValueContent(data) {
- var selectedShippingMethod = data.shipping_methods.filter(function (method) {
- return method.id === data.selected_shipping_rate.shipping_method_id
- })[0]
-
- if (selectedShippingMethod && selectedShippingMethod.tracking_url) {
- var shipmentTrackingUrl = selectedShippingMethod.tracking_url.replace(/:tracking/, data.tracking)
- return '<a target="_blank" href="' + shipmentTrackingUrl + '">' + data.tracking + '<a>'
- }
-
- return data.tracking
- }
-
- // handle tracking save
- $('[data-hook=admin_shipment_form] a.save-tracking').on('click', function (event) {
- event.preventDefault()
-
- var link = $(this)
- var shipmentNumber = link.data('shipment-number')
- var tracking = link.parents('tbody').find('input#tracking').val()
- var url = Spree.url(Spree.routes.shipments_api + '/' + shipmentNumber + '.json')
-
- $.ajax({
- type: 'PUT',
- url: url,
- data: {
- shipment: {
- tracking: tracking
- },
- token: Spree.api_key
- }
- }).done(function (data) {
- link.parents('tbody').find('tr.edit-tracking').toggle()
-
- var show = link.parents('tbody').find('tr.show-tracking')
- show.toggle()
-
- if (data.tracking) {
- show.find('.tracking-value').html($('<strong>').html(Spree.translations.tracking + ': ')).append(createTrackingValueContent(data))
- } else {
- show.find('.tracking-value').html(Spree.translations.no_tracking_present)
- }
- })
- })
-})
-
-function adjustShipmentItems(shipmentNumber, variantId, quantity) {
- var shipment = _.findWhere(shipments, { number: shipmentNumber + '' })
- var inventoryUnits = _.where(shipment.inventory_units, { variant_id: variantId })
- var url = Spree.routes.shipments_api + '/' + shipmentNumber
- var previousQuantity = inventoryUnits.reduce(function (accumulator, currentUnit, _index, _array) {
- return accumulator + currentUnit.quantity
- }, 0)
- var newQuantity = 0
-
- if (previousQuantity < quantity) {
- url += '/add'
- newQuantity = (quantity - previousQuantity)
- } else if (previousQuantity > quantity) {
- url += '/remove'
- newQuantity = (previousQuantity - quantity)
- }
- url += '.json'
-
- if (newQuantity !== 0) {
- $.ajax({
- type: 'PUT',
- url: Spree.url(url),
- data: {
- variant_id: variantId,
- quantity: newQuantity,
- token: Spree.api_key
- }
- }).done(function (msg) {
- window.location.reload()
- }).fail(function (msg) {
- alert(msg.responseJSON.message || msg.responseJSON.exception)
- })
- }
-}
-
-function toggleMethodEdit() {
- var link = $(this)
- link.parents('tbody').find('tr.edit-method').toggle()
- link.parents('tbody').find('tr.show-method').toggle()
-
- return false
-}
-
-function toggleItemEdit() {
- var link = $(this)
- var linkParent = link.parent()
- linkParent.find('a.edit-item').toggle()
- linkParent.find('a.cancel-item').toggle()
- linkParent.find('a.split-item').toggle()
- linkParent.find('a.save-item').toggle()
- linkParent.find('a.delete-item').toggle()
- link.parents('tr').find('td.item-qty-show').toggle()
- link.parents('tr').find('td.item-qty-edit').toggle()
-
- return false
-}
-
-function startItemSplit(event) {
- event.preventDefault()
- $('.cancel-split').each(function () {
- $(this).click()
- })
- var link = $(this)
- link.parent().find('a.edit-item').toggle()
- link.parent().find('a.split-item').toggle()
- link.parent().find('a.delete-item').toggle()
- var variantId = link.data('variant-id')
-
- var variant = {}
- $.ajax({
- type: 'GET',
- async: false,
- url: Spree.url(Spree.routes.variants_api),
- data: {
- q: {
- 'id_eq': variantId
- },
- token: Spree.api_key
- }
- }).done(function (data) {
- variant = data['variants'][0]
- }).fail(function (msg) {
- alert(msg.responseJSON.message || msg.responseJSON.exception)
- })
-
- var maxQuantity = link.closest('tr').data('item-quantity')
- var splitItemTemplate = Handlebars.compile($('#variant_split_template').text())
- link.closest('tr').after(splitItemTemplate({ variant: variant, shipments: shipments, max_quantity: maxQuantity }))
- $('a.cancel-split').click(cancelItemSplit)
- $('a.save-split').click(completeItemSplit)
-
- $('#item_stock_location').select2({ width: 'resolve', placeholder: Spree.translations.item_stock_placeholder })
-}
-
-function completeItemSplit(event) {
- event.preventDefault()
-
- if ($('#item_stock_location').val() === '') {
- alert('Please select the split destination.')
- return false
- }
-
- var link = $(this)
- var stockItemRow = link.closest('tr')
- var variantId = stockItemRow.data('variant-id')
- var quantity = stockItemRow.find('#item_quantity').val()
-
- var stockLocationId = stockItemRow.find('#item_stock_location').val()
- var originalShipmentNumber = link.closest('tbody').data('shipment-number')
-
- var selectedShipment = stockItemRow.find('#item_stock_location option:selected')
- var targetShipmentNumber = selectedShipment.data('shipment-number')
- var newShipment = selectedShipment.data('new-shipment')
-
- // eslint-disable-next-line eqeqeq
- if (stockLocationId != 'new_shipment') {
- var path, additionalData
- if (newShipment !== undefined) {
- // transfer to a new location data
- path = '/transfer_to_location'
- additionalData = { stock_location_id: stockLocationId }
- } else {
- // transfer to an existing shipment data
- path = '/transfer_to_shipment'
- additionalData = { target_shipment_number: targetShipmentNumber }
- }
-
- var data = {
- original_shipment_number: originalShipmentNumber,
- variant_id: variantId,
- quantity: quantity,
- token: Spree.api_key
- }
-
- $.ajax({
- type: 'POST',
- async: false,
- url: Spree.url(Spree.routes.shipments_api + path),
- data: $.extend(data, additionalData)
- }).fail(function (msg) {
- alert(msg.responseJSON.message || msg.responseJSON.exception)
- }).done(function (msg) {
- window.location.reload()
- })
- }
-}
-
-function cancelItemSplit(event) {
- event.preventDefault()
- var link = $(this)
- var prevRow = link.closest('tr').prev()
- link.closest('tr').remove()
- prevRow.find('a.edit-item').toggle()
- prevRow.find('a.split-item').toggle()
- prevRow.find('a.delete-item').toggle()
-}
-
-function addVariantFromStockLocation(event) {
- event.preventDefault()
-
- $('#stock_details').hide()
-
- var variantId = $('select.variant_autocomplete').val()
- var stockLocationId = $(this).data('stock-location-id')
- var quantity = $("input.quantity[data-stock-location-id='" + stockLocationId + "']").val()
-
- var shipment = _.find(shipments, function (shipment) {
- return shipment.stock_location_id === stockLocationId && (shipment.state === 'ready' || shipment.state === 'pending')
- })
-
- if (shipment === undefined) {
- $.ajax({
- type: 'POST',
- // eslint-disable-next-line camelcase
- url: Spree.url(Spree.routes.shipments_api + '?shipment[order_id]=' + order_number),
- data: {
- variant_id: variantId,
- quantity: quantity,
- stock_location_id: stockLocationId,
- token: Spree.api_key
- }
- }).done(function (msg) {
- window.location.reload()
- }).fail(function (msg) {
- alert(msg.responseJSON.message || msg.responseJSON.exception)
- })
- } else {
- // add to existing shipment
- adjustShipmentItems(shipment.number, variantId, quantity)
- }
- return 1
-}
diff --git a/backend/app/assets/javascripts/spree/backend/spree-select2.js b/backend/app/assets/javascripts/spree/backend/spree-select2.js
deleted file mode 100644
index b40ae9b27f..0000000000
--- a/backend/app/assets/javascripts/spree/backend/spree-select2.js
+++ /dev/null
@@ -1,58 +0,0 @@
-document.addEventListener('DOMContentLoaded', function() {
- // Initiate a standard Select2 on any select element with the class .select2
- // Remember to add a place holder in the HTML as needed.
- $('select.select2').select2({})
-
- // Initiate a Select2 with the option to clear, on any select element with the class .select2-clear
- // Set: include_blank: true in the ERB.
- // A placeholder is auto-added here as it is required to clear the Select2.
- $('select.select2-clear').select2({
- placeholder: Spree.translations.select_an_option,
- allowClear: true
- })
-})
-
-$.fn.addSelect2Options = function (data) {
- var select = this
-
- function appendOption(select, data) {
- var option = null;
- if (data.attributes) {
- // API v2
- option = new Option(data.attributes.name, data.id, true, true)
- } else {
- // API v1
- option = new Option(data.name, data.id, true, true)
- }
- select.append(option).trigger('change')
- }
-
- if (Array.isArray(data)) {
- data.map(function(row) {
- appendOption(select, row)
- })
- } else {
- appendOption(select, data)
- }
- select.trigger({
- type: 'select2:select',
- params: {
- data: data
- }
- })
-}
-
-$.fn.select2.defaults.set('width', 'style')
-$.fn.select2.defaults.set('dropdownAutoWidth', false)
-$.fn.select2.defaults.set('theme', 'bootstrap4')
-
-function formatSelect2Options(data) {
- var results = data.data.map(function (obj) {
- return {
- id: obj.id,
- text: obj.attributes.name
- }
- })
-
- return { results: results }
-}
diff --git a/backend/app/assets/javascripts/spree/backend/states.js b/backend/app/assets/javascripts/spree/backend/states.js
deleted file mode 100755
index ae8196cf4f..0000000000
--- a/backend/app/assets/javascripts/spree/backend/states.js
+++ /dev/null
@@ -1,13 +0,0 @@
-$(document).ready(function () {
- 'use strict'
-
- if ($('#new_state_link').length) {
- $('#country').on('change', function () {
- var newStateLinkHref = $('#new_state_link').prop('href')
- var selectedCountryId = $('#country option:selected').prop('value')
- var newLink = newStateLinkHref.replace(/countries\/(\d+)/,
- 'countries/' + selectedCountryId)
- $('#new_state_link').attr('href', newLink)
- })
- };
-})
diff --git a/backend/app/assets/javascripts/spree/backend/stock_location.js b/backend/app/assets/javascripts/spree/backend/stock_location.js
deleted file mode 100644
index 23208e3b8f..0000000000
--- a/backend/app/assets/javascripts/spree/backend/stock_location.js
+++ /dev/null
@@ -1,3 +0,0 @@
-$(document).ready(function () {
- $('[data-hook=stock_location_country] span#country .select2').on('change', function () { updateAddressState('') })
-})
diff --git a/backend/app/assets/javascripts/spree/backend/stock_management.js b/backend/app/assets/javascripts/spree/backend/stock_management.js
deleted file mode 100644
index 20a597c24c..0000000000
--- a/backend/app/assets/javascripts/spree/backend/stock_management.js
+++ /dev/null
@@ -1,14 +0,0 @@
-$(function () {
- $('.stock_item_backorderable').on('click', function () {
- $(this).parent('form').submit()
- })
- $('.toggle_stock_item_backorderable').on('submit', function () {
- $.ajax({
- type: this.method,
- url: this.action,
- data: $(this).serialize(),
- dataType: 'json'
- })
- return false
- })
-})
diff --git a/backend/app/assets/javascripts/spree/backend/stock_movement.js b/backend/app/assets/javascripts/spree/backend/stock_movement.js
deleted file mode 100644
index 067bb5498a..0000000000
--- a/backend/app/assets/javascripts/spree/backend/stock_movement.js
+++ /dev/null
@@ -1,35 +0,0 @@
-/* global variantTemplate */
-$(function () {
- var el = $('#stock_movement_stock_item_id')
- el.select2({
- placeholder: 'Find a stock item', // translate
- ajax: {
- url: Spree.url(Spree.routes.stock_items_api(el.data('stock-location-id'))),
- data: function (term, page) {
- return {
- q: {
- variant_product_name_cont: term
- },
- per_page: 50,
- page: page,
- token: Spree.api_key
- }
- },
- results: function (data, page) {
- var more = (page * 50) < data.count
- return {
- results: data.stock_items,
- more: more
- }
- }
- },
- formatResult: function (stockItem) {
- return variantTemplate({
- variant: stockItem.variant
- })
- },
- formatSelection: function (stockItem) {
- return Select2.util.escapeMarkup(stockItem.variant.name + '(' + stockItem.variant.options_text + ')')
- }
- })
-})
diff --git a/backend/app/assets/javascripts/spree/backend/stock_transfer.js b/backend/app/assets/javascripts/spree/backend/stock_transfer.js
deleted file mode 100644
index 0e8486849d..0000000000
--- a/backend/app/assets/javascripts/spree/backend/stock_transfer.js
+++ /dev/null
@@ -1,279 +0,0 @@
-$(function () {
- function TransferVariant (variant1) {
- // refactor variant1
- this.variant = variant1
- this.id = this.variant[0].variant.id
- this.name = this.variant[0].variant.name + ' - ' + this.variant[0].variant.sku
- this.quantity = 0
- }
- TransferVariant.prototype.add = function (quantity) {
- this.quantity += quantity
- return this.quantity
- }
-
- function TransferLocations () {
- this.source = $('#transfer_source_location_id')
- this.destination = $('#transfer_destination_location_id')
- this.source.change(this.populate_destination.bind(this))
- $('#transfer_receive_stock').change(this.receive_stock_change.bind(this))
- $.getJSON(Spree.url(Spree.routes.stock_locations_api) + '?token=' + Spree.api_key + '&per_page=1000', function (data) {
- this.locations = (function () {
- var ref = data.stock_locations
- var results = []
- var i, len
- for (i = 0, len = ref.length; i < len; i++) {
- results.push(ref[i])
- }
- return results
- })()
- if (this.locations.length < 2) {
- this.force_receive_stock()
- }
- this.populate_source()
- this.populate_destination()
- }.bind(this))
- }
-
- TransferLocations.prototype.force_receive_stock = function () {
- $('#receive_stock_field').hide()
- $('#transfer_receive_stock').prop('checked', true)
- this.toggle_source_location(true)
- }
-
- TransferLocations.prototype.is_source_location_hidden = function () {
- return $('#transfer_source_location_id_field').css('visibility') === 'hidden'
- }
-
- TransferLocations.prototype.toggle_source_location = function (hide) {
- if (hide == null) {
- hide = false
- }
- this.source.trigger('change')
- var transferSourceLocationIdField = $('#transfer_source_location_id_field')
- if (this.is_source_location_hidden() && !hide) {
- transferSourceLocationIdField.css('visibility', 'visible')
- transferSourceLocationIdField.show()
- } else {
- transferSourceLocationIdField.css('visibility', 'hidden')
- transferSourceLocationIdField.hide()
- }
- }
-
- TransferLocations.prototype.receive_stock_change = function (event) {
- this.toggle_source_location(event.target.checked)
- this.populate_destination(!event.target.checked)
- }
-
- TransferLocations.prototype.populate_source = function () {
- this.populate_select(this.source)
- this.source.trigger('change')
- }
-
- TransferLocations.prototype.populate_destination = function () {
- if (this.is_source_location_hidden()) {
- return this.populate_select(this.destination)
- } else {
- return this.populate_select(this.destination, parseInt(this.source.val()))
- }
- }
-
- TransferLocations.prototype.populate_select = function (select, except) {
- var i, len, location, ref
- if (except == null) {
- except = 0
- }
- select.children('option').remove()
- ref = this.locations
- for (i = 0, len = ref.length; i < len; i++) {
- location = ref[i]
- if (location.id !== except) {
- select.append($('<option></option>').text(location.name).attr('value', location.id))
- }
- }
- return select.select2()
- }
-
- function TransferVariants () {
- $('#transfer_source_location_id').change(this.refresh_variants.bind(this))
- }
-
- TransferVariants.prototype.receiving_stock = function () {
- return $('#transfer_receive_stock:checked').length > 0
- }
-
- TransferVariants.prototype.refresh_variants = function () {
- if (this.receiving_stock()) {
- return this._search_transfer_variants()
- } else {
- return this._search_transfer_stock_items()
- }
- }
-
- TransferVariants.prototype._search_transfer_variants = function () {
- return this.build_select(Spree.url(Spree.routes.variants_api), 'product_name_or_sku_cont')
- }
-
- TransferVariants.prototype._search_transfer_stock_items = function () {
- var stockLocationId = $('#transfer_source_location_id').val()
- return this.build_select(Spree.url(Spree.routes.stock_locations_api + ('/' + stockLocationId + '/stock_items')), 'variant_product_name_or_variant_sku_cont')
- }
-
- TransferVariants.prototype.format_variant_result = function (result) {
- // eslint-disable-next-line no-extra-boolean-cast
- if (!!result.options_text) {
- return result.name + ' - ' + result.sku + ' (' + result.options_text + ')'
- } else {
- return result.name + ' - ' + result.sku
- }
- }
-
- function formattedVariantList(obj) {
- return { id: obj.id, text: obj.name, name: obj.name, sku: obj.sku, options_text: obj.options_text, variant: obj }
- }
-
- function formattedStockItemsList(obj) {
- return { id: obj.variant.id, text: obj.variant.name, name: obj.variant.name, sku: obj.variant.sku, options_text: obj.variant.options_text, variant: obj.variant }
- }
-
- TransferVariants.prototype.build_select = function (url, query) {
- return $('#transfer_variant').select2({
- minimumInputLength: 3,
- ajax: {
- url: url,
- datatype: 'json',
- data: function (params) {
- var q = {}
- q[query] = params.term
- return {
- q: q,
- token: Spree.api_key
- }
- },
- processResults: function (data) {
- var result = data.variants || data.stock_items
- if (data.variants != null) {
- var res = (result).map(function (variant) {
- return formattedVariantList(variant)
- })
- } else {
- var res = (result).map(function (variant) {
- return formattedStockItemsList(variant)
- })
- }
-
- return {
- results: res
- }
- }
- },
- templateResult: function(variant) {
- if (variant.options_text !== "") {
- return variant.name + ' - ' + variant.sku + ' (' + variant.options_text + ')'
- } else {
- return variant.name + ' - ' + variant.sku
- }
- },
- templateSelection: function (variant) {
- // eslint-disable-next-line no-extra-boolean-cast
- if (!!variant.options_text) {
- return variant.name + (' (' + variant.options_text + ')') + (' - ' + variant.sku)
- } else {
- return variant.name + (' - ' + variant.sku)
- }
- }
- })
- }
-
- function TransferAddVariants () {
- this.variants = []
- this.template = Handlebars.compile($('#transfer_variant_template').html())
- $('#transfer_source_location_id').change(this.clear_variants.bind(this))
- $('button.transfer_add_variant').click(function (event) {
- event.preventDefault()
- if ($('#transfer_variant').select2('data') != null) {
- this.add_variant()
- } else {
- alert('Please select a variant first')
- }
- }.bind(this))
- $('#transfer-variants-table').on('click', '.transfer_remove_variant', function (event) {
- event.preventDefault()
- this.remove_variant($(event.target))
- }.bind(this))
- $('button.transfer_transfer').click(function () {
- if (!(this.variants.length > 0)) {
- alert('no variants to transfer')
- return false
- }
- }.bind(this))
- }
-
- TransferAddVariants.prototype.add_variant = function () {
- var variant = $('#transfer_variant').select2('data')
- var quantity = parseInt($('#transfer_variant_quantity').val())
- variant = this.find_or_add(variant)
- variant.add(quantity)
- return this.render()
- }
-
- TransferAddVariants.prototype.find_or_add = function (variant) {
- var existing = _.find(this.variants, function (v) {
- return v.id === variant.id
- })
- if (existing) {
- return existing
- } else {
- variant = new TransferVariant($.extend({}, variant))
- this.variants.push(variant)
- return variant
- }
- }
-
- TransferAddVariants.prototype.remove_variant = function (target) {
- var v
- var variantId = parseInt(target.data('variantId'))
- this.variants = (function () {
- var ref = this.variants
- var results = []
- var i, len
- for (i = 0, len = ref.length; i < len; i++) {
- v = ref[i]
- if (v.id !== variantId) {
- results.push(v)
- }
- }
- return results
- }.call(this))
- return this.render()
- }
-
- TransferAddVariants.prototype.clear_variants = function () {
- this.variants = []
- return this.render()
- }
-
- TransferAddVariants.prototype.contains = function (id) {
- return _.contains(_.pluck(this.variants, 'id'), id)
- }
-
- TransferAddVariants.prototype.render = function () {
- if (this.variants.length === 0) {
- $('#transfer-variants-table').hide()
- return $('.no-objects-found').show()
- } else {
- $('#transfer-variants-table').show()
- $('.no-objects-found').hide()
- return $('#transfer_variants_tbody').html(this.template({
- variants: this.variants
- }))
- }
- }
-
- if ($('#transfer_source_location_id').length > 0) {
- /* eslint-disable no-new */
- new TransferLocations()
- new TransferVariants()
- new TransferAddVariants()
- /* eslint-enable no-new */
- }
-})
diff --git a/backend/app/assets/javascripts/spree/backend/taxon_autocomplete.js b/backend/app/assets/javascripts/spree/backend/taxon_autocomplete.js
deleted file mode 100644
index 66f4031fb3..0000000000
--- a/backend/app/assets/javascripts/spree/backend/taxon_autocomplete.js
+++ /dev/null
@@ -1,45 +0,0 @@
-$.fn.taxonAutocomplete = function() {
- 'use strict'
-
- function formatTaxonList(values) {
- console.warn('taxonAutocomplete is deprecated and will be removed in Spree 5.0')
-
- return values.map(function (obj) {
- return {
- id: obj.id,
- text: obj.pretty_name
- }
- })
- }
-
- this.select2({
- multiple: true,
- placeholder: Spree.translations.taxon_placeholder,
- minimumInputLength: 2,
- ajax: {
- url: Spree.routes.taxons_api,
- dataType: 'json',
- data: function (params) {
- return {
- q: {
- name_cont: params.term
- },
- token: Spree.api_key
- }
- },
- processResults: function(data) {
- return {
- results: formatTaxonList(data.taxons)
- }
- }
- }
- })
-}
-
-$(document).ready(function () {
- var productTaxonSelector = document.getElementById('product_taxon_ids')
- if (productTaxonSelector == null) return
- if (productTaxonSelector.hasAttribute('data-autocomplete-url-value')) return
-
- $('#product_taxon_ids').taxonAutocomplete()
-})
diff --git a/backend/app/assets/javascripts/spree/backend/taxon_permalink_preview.js b/backend/app/assets/javascripts/spree/backend/taxon_permalink_preview.js
deleted file mode 100644
index e96181c49b..0000000000
--- a/backend/app/assets/javascripts/spree/backend/taxon_permalink_preview.js
+++ /dev/null
@@ -1,11 +0,0 @@
-$(document).ready(function () {
- if ($('#permalink_part_display').length) {
- var field = $('#permalink_part')
- var target = $('#permalink_part_display')
- var permalinkPartDefault = target.text().trim()
- target.text(permalinkPartDefault + field.val())
- field.on('keyup blur', function () {
- target.text(permalinkPartDefault + $(this).val())
- })
- };
-})
diff --git a/backend/app/assets/javascripts/spree/backend/taxon_tree_menu.js b/backend/app/assets/javascripts/spree/backend/taxon_tree_menu.js
deleted file mode 100644
index 6ab95338d0..0000000000
--- a/backend/app/assets/javascripts/spree/backend/taxon_tree_menu.js
+++ /dev/null
@@ -1,35 +0,0 @@
-var root = typeof exports !== 'undefined' && exports !== null ? exports : this
-
-root.taxon_tree_menu = function (obj, context) {
- var adminBaseUrl = Spree.url(Spree.routes.admin_taxonomy_taxons_path)
- var editUrl = adminBaseUrl.clone()
- editUrl.setPath(editUrl.path() + '/' + obj.attr('id') + '/edit')
- return {
- create: {
- label: '<i class="icon icon-add"></i>' + Spree.translations.add,
- action: function (obj) {
- return context.create(obj)
- }
- },
- rename: {
- label: '<i class="icon icon-edit"></i> ' + Spree.translations.rename,
- action: function (obj) {
- return context.rename(obj)
- }
- },
- remove: {
- label: '<i class="icon icon-delete"></i> ' + Spree.translations.remove,
- action: function (obj) {
- return context.remove(obj)
- }
- },
- edit: {
- separator_before: true,
- label: '<i class="icon icon-settings"></i> ' + Spree.translations.edit,
- action: function () {
- window.location = editUrl.toString()
- return window.location
- }
- }
- }
-}
diff --git a/backend/app/assets/javascripts/spree/backend/taxonomy.js b/backend/app/assets/javascripts/spree/backend/taxonomy.js
deleted file mode 100644
index 4841229ff5..0000000000
--- a/backend/app/assets/javascripts/spree/backend/taxonomy.js
+++ /dev/null
@@ -1,178 +0,0 @@
-/* globals show_flash, base_url, taxon_tree_menu */
-
-function handleAjaxError (lastRollback) {
- $.jstree.rollback(lastRollback)
- show_flash('error', '<strong>' + Spree.translations.server_error + '</strong><br />' + Spree.translations.taxonomy_tree_error)
-}
-
-function handleMove (e, data) {
- var lastRollback = data.rlbk
- var position = data.rslt.cp
- var node = data.rslt.o
- var newParent = data.rslt.np
- var url = Spree.url(base_url).clone()
- url.setPath(url.path() + '/' + node.prop('id'))
- if (newParent.attr('id') === data.rslt.op.attr('id') && position > data.rslt.cop) {
- position = position - 1
- }
- $.ajax({
- type: 'POST',
- dataType: 'json',
- url: url.toString(),
- data: {
- _method: 'put',
- 'taxon[parent_id]': newParent.prop('id'),
- 'taxon[child_index]': position,
- token: Spree.api_key
- }
- }).fail(function () {
- handleAjaxError(lastRollback)
- })
- return true
-}
-
-function handleCreate (e, data) {
- var lastRollback = data.rlbk
- var node = data.rslt.obj
- var name = data.rslt.name
- var position = data.rslt.position
- var newParent = data.rslt.parent
- return $.ajax({
- type: 'POST',
- dataType: 'json',
- url: base_url.toString(),
- data: {
- 'taxon[name]': name,
- 'taxon[parent_id]': newParent.prop('id'),
- 'taxon[child_index]': position,
- token: Spree.api_key
- }
- }).done(function (data) {
- node.prop('id', data.id)
- }).fail(function () {
- return handleAjaxError(lastRollback)
- })
-}
-
-function handleRename (e, data) {
- var lastRollback = data.rlbk
- var node = data.rslt.obj
- var name = data.rslt.new_name
- var url = Spree.url(base_url).clone()
- url.setPath(url.path() + '/' + node.prop('id'))
- return $.ajax({
- type: 'POST',
- dataType: 'json',
- url: url.toString(),
- data: {
- _method: 'put',
- 'taxon[name]': name,
- token: Spree.api_key
- }
- }).fail(function () {
- handleAjaxError(lastRollback)
- })
-}
-
-function handleDelete (e, data) {
- var lastRollback = data.rlbk
- var node = data.rslt.obj
- var deleteUrl = base_url.clone()
- deleteUrl.setPath(deleteUrl.path() + '/' + node.prop('id'))
- if (confirm(Spree.translations.are_you_sure_delete)) {
- $.ajax({
- type: 'POST',
- dataType: 'json',
- url: deleteUrl.toString(),
- data: {
- _method: 'delete',
- token: Spree.api_key
- }
- }).fail(function () {
- handleAjaxError(lastRollback)
- })
- } else {
- $.jstree.rollback(lastRollback)
- lastRollback = null
- }
-}
-
-var root = typeof exports !== 'undefined' && exports !== null ? exports : this
-
-root.setup_taxonomy_tree = function (taxonomyId) {
- var $taxonomyTree = $('#taxonomy_tree')
- if (taxonomyId !== void 0) {
- // this is defined within admin/taxonomies/edit
- root.base_url = Spree.url(Spree.routes.taxonomy_taxons_path)
- $.ajax({
- url: Spree.url(base_url.path().replace('/taxons', '/jstree')).toString(),
- data: {
- token: Spree.api_key
- }
- }).done(function (taxonomy) {
- // eslint-disable-next-line no-unused-vars
- var lastRollback = null
- var conf = {
- json_data: {
- data: taxonomy,
- ajax: {
- url: function (e) {
- return Spree.url(base_url.path() + '/' + e.prop('id') + '/jstree' + '?token=' + Spree.api_key).toString()
- }
- }
- },
- themes: {
- theme: 'spree',
- url: Spree.url(Spree.routes.jstree_theme_path)
- },
- strings: {
- new_node: Spree.translations.new_taxon,
- loading: Spree.translations.loading + '...'
- },
- crrm: {
- move: {
- check_move: function (m) {
- var newParent, node, position
- position = m.cp
- node = m.o
- newParent = m.np
- if (!newParent || node.prop('rel') === 'root') {
- return false
- }
- // can't drop before root
- if (newParent.prop('id') === 'taxonomy_tree' && position === 0) {
- return false
- }
- return true
- }
- }
- },
- contextmenu: {
- items: function (obj) {
- return taxon_tree_menu(obj, this)
- }
- },
- plugins: ['themes', 'json_data', 'dnd', 'crrm', 'contextmenu']
- }
- return $taxonomyTree.jstree(conf).bind('move_node.jstree', handleMove).bind('remove.jstree', handleDelete).bind('create.jstree', handleCreate).bind('rename.jstree', handleRename).bind('loaded.jstree', function () {
- return $(this).jstree('core').toggle_node($('.jstree-icon').first())
- })
- })
-
- $taxonomyTree.on('dblclick', 'a', function () {
- var iOS = /iPad|iPhone|iPod/.test(navigator.platform || '')
- if (iOS) {
- $taxonomyTree.jstree('show_contextmenu', this)
- } else {
- $taxonomyTree.jstree('rename', this)
- }
- })
-
- // suppress form submit on enter/return
- $(document).keypress(function (event) {
- if (event.keyCode === 13) {
- event.preventDefault()
- }
- })
- }
-}
diff --git a/backend/app/assets/javascripts/spree/backend/taxons.js b/backend/app/assets/javascripts/spree/backend/taxons.js
deleted file mode 100644
index c3d99051aa..0000000000
--- a/backend/app/assets/javascripts/spree/backend/taxons.js
+++ /dev/null
@@ -1,145 +0,0 @@
-/* global productTemplate */
-$(function () {
- window.productTemplate = Handlebars.compile($('#product_template').text())
- var taxonProducts = $('#taxon_products')
- var taxonId = $('#taxon_id')
-
- var el = document.getElementById('taxon_products')
- if (el) {
- Sortable.create(el, {
- handle: '.sort-handle',
- ghostClass: 'moving-this',
- animation: 550,
- easing: 'cubic-bezier(1, 0, 0, 1)',
- swapThreshold: 0.9,
- forceFallback: true,
- onEnd: function (evt) {
- var classificationId = evt.item.getAttribute('data-classification-id')
- var newIndex = evt.newIndex
- return $.ajax({
- url: Spree.routes.classifications_api_v2 + '/' + classificationId.toString() + '/reposition',
- headers: Spree.apiV2Authentication(),
- method: 'PUT',
- dataType: 'json',
- data: {
- classification: {
- position: newIndex
- }
- }
- })
- }
- })
- }
-
- if (taxonId.length > 0) {
- taxonId.select2({
- placeholder: Spree.translations.find_a_taxon,
- minimumInputLength: 3,
- multiple: false,
- ajax: {
- url: Spree.routes.taxons_api_v2,
- datatype: 'json',
- headers: Spree.apiV2Authentication(),
- data: function (params, page) {
- return {
- per_page: 50,
- page: page,
- filter: {
- name_cont: params.term
- }
- }
- },
- processResults: function (data, page) {
- var more = page < data.meta.total_pages
-
- var results = data.data.map(function (obj) {
- return {
- id: obj.id,
- text: obj.attributes.pretty_name
- }
- })
-
- return {
- results: results,
- pagination: {
- more: more
- }
- }
- }
- }
- }).on('select2:select', function (e) {
- $.ajax({
- url: Spree.routes.classifications_api_v2,
- headers: Spree.apiV2Authentication(),
- data: {
- filter: {
- taxon_id_eq: e.params.data.id
- },
- include: 'product.images',
- per_page: 150,
- sort: 'position'
- }
- }).done(function (json) {
- taxonProducts.empty()
-
- if (json.meta.total_count === 0) {
- return taxonProducts.html('<p class="text-center w-100 p-4">' + Spree.translations.no_results + '</p>')
- } else {
- var results = []
-
- json.data.forEach(function (classification) {
- var productId = classification.relationships.product.data.id.toString()
-
- var product = json.included.find(function(included) {
- if (included.type === 'product' && included.id === productId) {
- return included
- }
- })
-
- if (product && classification) {
- var imageUrl = null
-
- if (product.relationships.images.data.length > 0) {
- var imageId = product.relationships.images.data[0].id
-
- var image = json.included.find(function(included) {
- if (included.type === 'image' && included.id === imageId) {
- return included
- }
- })
-
- if (image && image.attributes && image.attributes.styles) {
- imageUrl = image.attributes.styles[2].url
- }
- }
-
- results.push(taxonProducts.append(productTemplate({
- product: product,
- classification: classification,
- image: imageUrl
- })))
- }
- })
-
- return results
- }
- })
- })
- }
-
- taxonProducts.on('click', '.js-delete-product', function (e) {
- var product = $(this).parents('.product')
- var classificationId = product.data('classification-id')
- $.ajax({
- url: Spree.routes.classifications_api_v2 + '/' + classificationId.toString(),
- headers: Spree.apiV2Authentication(),
- type: 'DELETE'
- }).done(function () {
- product.fadeOut(400, function (e) {
- product.remove()
- })
- })
- })
-
- $('.variant_autocomplete').variantAutocomplete()
-})
diff --git a/backend/app/assets/javascripts/spree/backend/user_picker.js b/backend/app/assets/javascripts/spree/backend/user_picker.js
deleted file mode 100644
index 106fd7bfa2..0000000000
--- a/backend/app/assets/javascripts/spree/backend/user_picker.js
+++ /dev/null
@@ -1,38 +0,0 @@
-$.fn.userAutocomplete = function () {
- 'use strict'
-
- function formatUserList(values) {
- return values.map(function (obj) {
- return {
- id: obj.id,
- text: obj.attributes.email
- }
- })
- }
-
- this.select2({
- multiple: true,
- minimumInputLength: 1,
- ajax: {
- url: Spree.routes.users_api_v2,
- dataType: 'json',
- headers: Spree.apiV2Authentication(),
- data: function (params) {
- return {
- filter: {
- email_i_cont: params.term
- }
- }
- },
- processResults: function(data) {
- return {
- results: formatUserList(data.data)
- }
- }
- }
- })
-}
-
-$(document).ready(function () {
- $('.user_picker').userAutocomplete()
-})
diff --git a/backend/app/assets/javascripts/spree/backend/users/edit.js b/backend/app/assets/javascripts/spree/backend/users/edit.js
deleted file mode 100644
index 32fe6e96ce..0000000000
--- a/backend/app/assets/javascripts/spree/backend/users/edit.js
+++ /dev/null
@@ -1,17 +0,0 @@
-$(document).ready(function () {
- var useBilling = $('#user_use_billing')
-
- if (useBilling.is(':checked')) {
- $('#shipping').hide()
- }
-
- useBilling.change(function () {
- if (this.checked) {
- $('#shipping').hide()
- return $('#shipping input, #shipping select').prop('disabled', true)
- } else {
- $('#shipping').show()
- $('#shipping input, #shipping select').prop('disabled', false)
- }
- })
-})
diff --git a/backend/app/assets/javascripts/spree/backend/variant_autocomplete.js b/backend/app/assets/javascripts/spree/backend/variant_autocomplete.js
deleted file mode 100644
index 4c9f425a95..0000000000
--- a/backend/app/assets/javascripts/spree/backend/variant_autocomplete.js
+++ /dev/null
@@ -1,62 +0,0 @@
-/* global variantTemplate */
-// variant autocompletion
-$(function () {
- var variantAutocompleteTemplate = $('#variant_autocomplete_template')
- if (variantAutocompleteTemplate.length > 0) {
- window.variantTemplate = Handlebars.compile(variantAutocompleteTemplate.text())
- window.variantStockTemplate = Handlebars.compile($('#variant_autocomplete_stock_template').text())
- window.variantLineItemTemplate = Handlebars.compile($('#variant_line_items_autocomplete_stock_template').text())
- }
-})
-
-function formatVariantResult(variant) {
- if (variant.loading) {
- return variant.text
- }
-
- if (variant['images'][0] !== undefined && variant['images'][0].mini_url !== undefined) {
- variant.image = variant.images[0].mini_url
- }
- return $(variantTemplate({
- variant: variant
- }))
-}
-
-$.fn.variantAutocomplete = function () {
-
- // deal with initSelection
- return this.select2({
- placeholder: Spree.translations.variant_placeholder,
- minimumInputLength: 3,
- quietMillis: 200,
- ajax: {
- url: Spree.url(Spree.routes.variants_api),
- dataType: 'json',
- data: function (params) {
- var query = {
- q: {
- search_by_product_name_or_sku: params.term
- },
- token: Spree.api_key
- }
-
- return query;
- },
- processResults: function(data) {
- window.variants = data['variants']
- return {
- results: data.variants
- }
- }
- },
- templateResult: formatVariantResult,
- templateSelection: function(variant) {
- if (!!variant.options_text) {
- return variant.name + '(' + variant.options_text + ')'
- } else {
- return variant.name
- }
- }
- })
-
-}
diff --git a/backend/app/assets/javascripts/spree/backend/variant_management.js b/backend/app/assets/javascripts/spree/backend/variant_management.js
deleted file mode 100644
index de2f8d45d5..0000000000
--- a/backend/app/assets/javascripts/spree/backend/variant_management.js
+++ /dev/null
@@ -1,15 +0,0 @@
-$(function () {
- $('.track_inventory_checkbox').on('click', function () {
- $(this).siblings('.variant_track_inventory').val($(this).is(':checked'))
- $(this).parents('form').submit()
- })
- $('.toggle_variant_track_inventory').on('submit', function () {
- $.ajax({
- type: this.method,
- url: this.action,
- data: $(this).serialize(),
- dataType: 'json'
- })
- return false
- })
-})
diff --git a/backend/app/assets/javascripts/spree/backend/zone.js b/backend/app/assets/javascripts/spree/backend/zone.js
deleted file mode 100644
index c894c3994b..0000000000
--- a/backend/app/assets/javascripts/spree/backend/zone.js
+++ /dev/null
@@ -1,44 +0,0 @@
-$(function () {
- var countryBased = $('#country_based')
- var stateBased = $('#state_based')
- countryBased.click(show_country)
- stateBased.click(show_state)
- if (countryBased.is(':checked')) {
- show_country()
- } else if (stateBased.is(':checked')) {
- show_state()
- } else {
- show_state()
- stateBased.click()
- }
-})
-// eslint-disable-next-line camelcase
-function show_country () {
- $('#state_members :input').each(function () {
- $(this).prop('disabled', true)
- })
- $('#state_members').hide()
- $('#zone_members :input').each(function () {
- $(this).prop('disabled', true)
- })
- $('#zone_members').hide()
- $('#country_members :input').each(function () {
- $(this).prop('disabled', false)
- })
- $('#country_members').show()
-}
-// eslint-disable-next-line camelcase
-function show_state () {
- $('#country_members :input').each(function () {
- $(this).prop('disabled', true)
- })
- $('#country_members').hide()
- $('#zone_members :input').each(function () {
- $(this).prop('disabled', true)
- })
- $('#zone_members').hide()
- $('#state_members :input').each(function () {
- $(this).prop('disabled', false)
- })
- $('#state_members').show()
-}
diff --git a/backend/app/assets/stylesheets/spree/backend.css b/backend/app/assets/stylesheets/spree/backend.css
deleted file mode 100644
index 76bd978820..0000000000
--- a/backend/app/assets/stylesheets/spree/backend.css
+++ /dev/null
@@ -1,11 +0,0 @@
-/*
- * This is a manifest file that'll automatically include all the stylesheets available in this directory
- * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
- * the top of the compiled file, but it's generally better to create a new file per style scope.
-
- *= require jquery-ui/autocomplete
- *= require select2
- *= require animate
- *= require flatpickr
- *= require spree/backend/spree_admin
-*/
diff --git a/backend/app/assets/stylesheets/spree/backend/components/_badges.scss b/backend/app/assets/stylesheets/spree/backend/components/_badges.scss
deleted file mode 100644
index 427a137f5d..0000000000
--- a/backend/app/assets/stylesheets/spree/backend/components/_badges.scss
+++ /dev/null
@@ -1,46 +0,0 @@
-// Green
-.badge-completed,
-.badge-complete,
-.badge-resumed,
-.badge-considered_safe,
-.badge-paid,
-.badge-shipped,
-.badge-ready,
-.badge-active,
-.badge-success,
-.badge-sold,
-.badge-open,
-.badge-authorized {
- @include badge-variant($success);
-}
-
-// Red
-.badge-failed,
-.badge-considered_risky,
-.badge-error,
-.badge-invalid,
-.badge-closed {
- @include badge-variant($danger);
-}
-
-// Orange
-.badge-processing,
-.badge-pending,
-.badge-awaiting_return,
-.badge-returned,
-.badge-credit_owed,
-.badge-balance_due,
-.badge-backorder,
-.badge-checkout,
-.badge-cart,
-.badge-address,
-.badge-delivery,
-.badge-payment,
-.badge-confirm,
-.badge-canceled,
-.badge-void,
-.badge-inactive,
-.badge-notice,
-.badge-partial {
- @include badge-variant($light);
-}
diff --git a/backend/app/assets/stylesheets/spree/backend/components/_buttons.scss b/backend/app/assets/stylesheets/spree/backend/components/_buttons.scss
deleted file mode 100644
index e65e5d7a6b..0000000000
--- a/backend/app/assets/stylesheets/spree/backend/components/_buttons.scss
+++ /dev/null
@@ -1,41 +0,0 @@
-.payment-action-save {
- @include button-variant($success, $success, $success );
-}
-
-.btn,
-.nav-pills > li > a {
- vertical-align: middle;
- transition: color 0.1s linear 0s, background-color 0.1s linear 0s, opacity 0.2s linear 0s !important;
-}
-
-.btn {
- text-align: center;
-
- .ship {
- color: #fff;
- }
- svg,
- i.icon {
- margin-bottom: 3px;
- }
-}
-
-input#image_attachment >
-input[type="button"],
-input[type="file"]::-webkit-file-upload-button {
- @include border-radius();
- border: 1px solid;
- background-color: white;
- color: $secondary;
- border-color: $secondary;
- padding: 0.375rem 0.75rem;
- &:hover {
- color: white;
- background-color: $secondary;
- }
-}
-
-.actions .btn,
-.page-actions .btn {
- margin: 2px;
-}
diff --git a/backend/app/assets/stylesheets/spree/backend/components/_filters.scss b/backend/app/assets/stylesheets/spree/backend/components/_filters.scss
deleted file mode 100644
index e49066567b..0000000000
--- a/backend/app/assets/stylesheets/spree/backend/components/_filters.scss
+++ /dev/null
@@ -1,64 +0,0 @@
-#table-filter {
- display: none;
- margin-top: 7.5px;
-}
-
-.index-filter-button .icon-chevron-right {
- transform: rotate(0);
- transition: .3s ease-in-out;
- margin-bottom: 0;
-}
-
-.collapsed .icon-chevron-right {
- transform: rotate(90deg);
- transition: .3s ease-in-out;
-}
-
-.default-filter-icon {
- opacity: 0.1;
-}
-
-i.js-delete-filter {
- margin-bottom: 0;
-}
-
-.index-filter-button {
- font-size: $font-size-sm;
-
- button {
- height: 100%;
- text-transform: uppercase;
- letter-spacing: 2px;
- font-weight: bold;
- font-size: $small-font-size;
- border-color: $input-border-color;
- border-right: none;
- border-top-right-radius: 0;
- border-bottom-right-radius: 0;
- background-color: $white;
-
- &:hover, &:focus {
- background-color: $gray-100;
- }
- }
-
- .js-quick-search {
- font-size: $font-size-sm;
- border-top-left-radius: 0;
- border-bottom-left-radius: 0;
- }
-}
-
-.sort_link {
- .icon, svg {
- margin-left: 5px;
- margin-bottom: 2px;
- width: 0.8rem;
- height: 0.8rem;
-
- }
-
- svg.default-filter-arrow {
- opacity: 0.1;
- }
-}
diff --git a/backend/app/assets/stylesheets/spree/backend/components/_icons.scss b/backend/app/assets/stylesheets/spree/backend/components/_icons.scss
deleted file mode 100644
index 3d2c43fde6..0000000000
--- a/backend/app/assets/stylesheets/spree/backend/components/_icons.scss
+++ /dev/null
@@ -1,292 +0,0 @@
-span.icon, span.glyphicon {
- vertical-align: text-top;
-}
-
-// Maps Glyphicons to Spree .icon prefix.
-// You can apply same pattern to extend with more icons.
-//
-// example:
-// glyphicon glyphicon-pencil => icon icon-edit
-//
-
-// All Glyphicons Halflings in Bootstrap v3.3.1.0
-$default_icons: (
- adjust
- align-center
- align-justify
- align-left
- align-right
- arrow-down
- arrow-left
- arrow-right
- arrow-up
- asterisk
- backward
- ban-circle
- barcode
- bell
- bold
- book
- bookmark
- briefcase
- bullhorn
- calendar
- camera
- certificate
- check
- chevron-down
- chevron-left
- chevron-right
- chevron-up
- circle-arrow-down
- circle-arrow-left
- circle-arrow-right
- circle-arrow-up
- cloud
- cloud-download
- cloud-upload
- cog
- collapse-down
- collapse-up
- comment
- compressed
- copyright-mark
- credit-card
- cutlery
- dashboard
- download
- download-alt
- earphone
- eject
- envelope
- euro
- exclamation-sign
- expand
- export
- eye-close
- eye-open
- facetime-video
- fast-backward
- fast-forward
- file
- film
- filter
- fire
- flag
- flash
- floppy-disk
- floppy-open
- floppy-remove
- floppy-save
- floppy-saved
- folder-close
- folder-open
- font
- forward
- fullscreen
- gbp
- gift
- glass
- globe
- hand-down
- hand-left
- hand-right
- hand-up
- hd-video
- hdd
- header
- headphones
- heart
- heart-empty
- home
- import
- inbox
- indent-left
- indent-right
- info-sign
- italic
- leaf
- link
- list
- list-alt
- lock
- log-in
- log-out
- magnet
- map-marker
- minus
- minus-sign
- move
- music
- new-window
- off
- ok
- ok-circle
- ok-sign
- open
- paperclip
- pause
- pencil
- phone
- phone-alt
- picture
- plane
- play
- play-circle
- plus
- plus-sign
- print
- pushpin
- qrcode
- question-sign
- random
- record
- refresh
- registration-mark
- remove
- remove-circle
- remove-sign
- repeat
- resize-full
- resize-horizontal
- resize-small
- resize-vertical
- retweet
- road
- saved
- screenshot
- sd-video
- search
- send
- share
- share-alt
- shopping-cart
- signal
- sort
- sort-by-alphabet
- sort-by-alphabet-alt
- sort-by-attributes
- sort-by-attributes-alt
- sort-by-order
- sort-by-order-alt
- sound-5-1
- sound-6-1
- sound-7-1
- sound-dolby
- sound-stereo
- star
- star-empty
- stats
- step-backward
- step-forward
- stop
- subtitles
- tag
- tags
- tasks
- text-height
- text-width
- th
- th-large
- th-list
- thumbs-down
- thumbs-up
- time
- tint
- tower
- transfer
- trash
- tree-conifer
- tree-deciduous
- unchecked
- upload
- usd
- user
- volume-down
- volume-off
- volume-up
- warning-sign
- wrench
- zoom-in
- zoom-out
-);
-
-// We prefer alias/remap these so its easy to understand which icon to use.
-// Note: If desired alias exist as default, then remove it from default Array,
-// or write a smarter @each scope below that can actually override.
-// ==========> default | alias
-$alias_icons: (plus add)
- (pencil edit)
- (ok capture)
- (remove void)
- (bullhorn promotion)
- (share return)
- (send shipment)
- (share clone)
- (refresh update)
- (remove cancel)
- (resize-full split)
- (ok save)
- (eye-open show)
- (remove delete)
- (minus refund)
- (th-large products)
- (th-large variants)
- (picture images)
- (tag properties)
- (inbox stock)
- (usd money)
- (globe translate)
- (ok approve);
-
-span.icon {
- @extend .glyphicon;
- top:2px;
-
- // Map defaults.
- @each $icon in $default_icons {
- &.icon-#{$icon} { @extend .glyphicon-#{$icon}; }
- }
-
- // Map and override with aliases.
- @each $map in $alias_icons {
- $icon: nth($map, 1);
- $alias: nth($map, 2);
- &.icon-#{$alias} { @extend .glyphicon-#{$icon}; }
- }
-}
-
-// Spree SVG Icon Defaults
-i.icon {
- display: inline-block;
- width: 1rem;
- height: 1rem;
- overflow: hidden;
- vertical-align: middle;
- background-repeat: no-repeat;
- background-size: 100%;
- background-position: center;
-}
-
-
-// Spree SVG Icons in JS
-
-// The icons listed below are used by javascript generated content
-// If you wish to use an existing SVG icon in javascript generated content
-// use <i> tags like this -> <i class="icon icon-close"></i>
-// Using <span> tags will fall back to legacy glyphicon font based icons
-
-i.icon-close,
-i.icon-cancel,
-i.icon-delete,
-i.icon-void { background-image: url(asset-path("backend-cancel.svg")); }
-i.icon-save { background-image: url(asset-path("backend-save.svg")); }
-i.icon-add { background-image: url(asset-path("backend-add.svg")); }
-i.icon-search { background-image: url(asset-path("backend-search.svg")); }
-i.icon-settings { background-image: url(asset-path("backend-settings.svg")); }
-i.icon-delete { background-image: url(asset-path("backend-delete.svg")); }
-i.icon-edit { background-image: url(asset-path("backend-edit.svg")); }
-i.icon-chevron-down { background-image: url(asset-path("backend-chevron-down.svg")); }
-i.icon-chevron-left { background-image: url(asset-path("backend-chevron-left.svg")); }
-i.icon-chevron-right { background-image: url(asset-path("backend-chevron-right.svg")); }
-i.icon-chevron-up { background-image: url(asset-path("backend-chevron-up.svg")); }
diff --git a/backend/app/assets/stylesheets/spree/backend/components/_main.scss b/backend/app/assets/stylesheets/spree/backend/components/_main.scss
deleted file mode 100644
index 73b1e73346..0000000000
--- a/backend/app/assets/stylesheets/spree/backend/components/_main.scss
+++ /dev/null
@@ -1,38 +0,0 @@
-#main-part {
- margin-top: 50px;
-}
-
-#logo {
- width: auto;
- height: 36px;
-}
-
-#multi-backdrop {
- z-index: 0;
- height: 0;
- width: 0;
-}
-
-body.modal-open #multi-backdrop {
- z-index: 1040;
- width: 100vw;
- height: 100vh;
-}
-
-.sort-handle {
- cursor: grab;
-}
-
-.no-wrap {
- white-space: nowrap;
-}
-
-.card-body {
- padding: 0.75rem;
-}
-
-@include media-breakpoint-up(sm) {
- .card-body {
- padding: 1.25rem;
- }
-}
diff --git a/backend/app/assets/stylesheets/spree/backend/components/_navbar.scss b/backend/app/assets/stylesheets/spree/backend/components/_navbar.scss
deleted file mode 100644
index fafbba5cbe..0000000000
--- a/backend/app/assets/stylesheets/spree/backend/components/_navbar.scss
+++ /dev/null
@@ -1,64 +0,0 @@
-.header {
- .navbar {
- background-color: $navbar-inverse-bg;
- padding: 0;
- height: 50px;
-
- a:hover {
- text-decoration: none;
- }
- .btn {
- &:hover,
- &:focus {
- text-decoration: none;
- outline: 0;
- outline: none;
- -webkit-box-shadow: none;
- box-shadow: none;
- }
- }
-
- #accountNav {
- i {
- font-size: 1.3em;
- line-height: 1rem;
- }
- }
-
- #storeSwitcherDropdown {
- .dropdown-menu.show {
- min-width:250px;
- width: fit-content;
- max-width: 90vw;
- max-height: 70vh;
- overflow-y: scroll !important;
- top:110%;
- left: 50%;
- right: 50%;
- transform: translate(-50%, 0%);
- box-shadow: 0 1rem 2.5rem rgba(18,38,63,.1),0 .5rem 1rem -.75rem rgba(18,38,63,.1);
-
- @include media-breakpoint-up(lg) {
- left: 0%;
- right: 0%;
- transform: translate(0%, 0%);
- }
-
- a {
- white-space: nowrap;
- overflow-x: hidden;
- text-overflow: ellipsis;
-
- svg {
- vertical-align: text-top;
- margin-right: 1em;
- }
-
- &.disabled svg {
- color: $success;
- }
- }
- }
- }
- }
-}
diff --git a/backend/app/assets/stylesheets/spree/backend/components/_navigation.scss b/backend/app/assets/stylesheets/spree/backend/components/_navigation.scss
deleted file mode 100644
index 63df434faa..0000000000
--- a/backend/app/assets/stylesheets/spree/backend/components/_navigation.scss
+++ /dev/null
@@ -1,19 +0,0 @@
-.navbar-toggler {
- border: none;
- right: 0;
- top: 0;
- cursor: pointer;
-}
-
-ul#spreePageTabs {
- li.nav-item {
- margin-left: 0.2em;
- a {
- padding: 0.3rem 1rem;
- }
-
- &:first-child {
- margin-left: 0;
- }
- }
-}
diff --git a/backend/app/assets/stylesheets/spree/backend/components/_page_header.scss b/backend/app/assets/stylesheets/spree/backend/components/_page_header.scss
deleted file mode 100644
index f57a06fa62..0000000000
--- a/backend/app/assets/stylesheets/spree/backend/components/_page_header.scss
+++ /dev/null
@@ -1,9 +0,0 @@
-.content-header.page-header {
- .page-actions {
- text-align: right;
-
- form {
- display: inline-block
- }
- }
-}
diff --git a/backend/app/assets/stylesheets/spree/backend/components/_progress.scss b/backend/app/assets/stylesheets/spree/backend/components/_progress.scss
deleted file mode 100644
index 0310e3ea74..0000000000
--- a/backend/app/assets/stylesheets/spree/backend/components/_progress.scss
+++ /dev/null
@@ -1,22 +0,0 @@
-// The progress loader which is positioned at the bottom of the page
-#progress {
- display: none;
- width: 100%;
- position: fixed;
- left: 0;
- bottom: 0;
- z-index: 1001;
- .alert {
- box-shadow: none;
- margin: 0;
- border-radius: 0;
- .progress-message {
- color: #31708f;
- font-weight: bold;
- text-align: center;
- }
- .spinner {
- float: right;
- }
- }
-}
diff --git a/backend/app/assets/stylesheets/spree/backend/components/_sidebar.scss b/backend/app/assets/stylesheets/spree/backend/components/_sidebar.scss
deleted file mode 100644
index a9572692af..0000000000
--- a/backend/app/assets/stylesheets/spree/backend/components/_sidebar.scss
+++ /dev/null
@@ -1,148 +0,0 @@
-aside#main-sidebar {
- overflow-y: auto; /* Scrollable contents if viewport is shorter than content. */
- background-color: $gray-100;
- border-right: 1px solid $gray-200;
- width: 100%;
- left: -100%;
- margin-top: 0;
- height: 100%;
- transition: 0.3s ease;
- z-index: 1041;
-}
-
-body.sidebar-open {
- overflow-x: hidden;
- aside#main-sidebar {
- left:0;
- transition: 0.3s ease;
- }
- .disable-when-main-menu-is-open {
- z-index: 1040 !important;
- }
-}
-
-a.sidebar-submenu-item:hover {
- text-decoration: none;
- background-color: $gray-200;
- cursor: pointer
-}
-
-ul.active-option {
- background-color: $gray-200;
- .drop-menu-indicator {
- transform: rotate(-90deg);
- }
-}
-
-ul.nav-sidebar {
- > li {
- > a {
- color: $gray-700;
-
- &:hover,
- &[aria-expanded="true"] {
- text-decoration: none;
- }
-
- .drop-menu-indicator {
- right: 1rem;
- }
-
- &[aria-expanded="true"] {
- .drop-menu-indicator {
- transform: rotate(-90deg);
- transition: .3s ease-in-out;
- }
- }
-
- &[aria-expanded="false"] {
- .drop-menu-indicator {
- transform: rotate(0deg);
- transition: .3s ease-in-out;
- }
- }
- }
- }
-}
-
-#contextualSideMenu {
- max-height: 85vh;
- overflow-x: auto;
- background-color: white;
- position: fixed;
- left:0;
- top: -100%;
- z-index: 1041;
- transition: .3s ease-in-out;
- .page-actions__close {
- margin: -1.5rem -1.5rem 1.5rem;
- }
-}
-
-#contextual-menu-toggle {
- & svg {
- transform:rotate(0deg);
- transition: transform .3s ease-in-out;
- }
-}
-
-#sidebar a svg {
- margin-bottom: 3px;
-}
-
-body.contextualSideMenu-open #contextualSideMenu {
- top: 0;
- transition: .3s ease-in-out;
-}
-
-body.contextualSideMenu-open #contextual-menu-toggle {
- svg {
- transform:rotate(180deg);
- transition: transform .3s ease-in-out;
- }
-}
-
-.contextual-title {
- font-size:1.25rem;
-}
-
-@include media-breakpoint-up(sm) {
- aside#main-sidebar {
- width: 50%;
- }
-}
-
-@include media-breakpoint-up(md) {
- aside#main-sidebar {
- width: 30%;
- }
-}
-
-@include media-breakpoint-up(lg) {
-
- #contextualSideMenu {
- border: none;
- height: max-content;
- z-index: 1000;
- position: sticky;
- top: 75px;
- transition: none;
- }
- aside#main-sidebar {
- left: 0;
- z-index: 999;
- margin-top: 50px;
- height: calc(100% - 50px);
- transition: none;
- body.sidebar-open {
- aside#main-sidebar {
- left:0;
- transition: none;
- }
- }
- }
-
- .contextual-title {
- font-size:1.5rem;
- }
-}
diff --git a/backend/app/assets/stylesheets/spree/backend/components/_spinner.scss b/backend/app/assets/stylesheets/spree/backend/components/_spinner.scss
deleted file mode 100644
index 7c7528f94f..0000000000
--- a/backend/app/assets/stylesheets/spree/backend/components/_spinner.scss
+++ /dev/null
@@ -1,95 +0,0 @@
-@-webkit-keyframes spinner {
- 0% {
- -webkit-transform: rotate(0deg);
- -moz-transform: rotate(0deg);
- -ms-transform: rotate(0deg);
- -o-transform: rotate(0deg);
- transform: rotate(0deg);
- }
-
- 100% {
- -webkit-transform: rotate(360deg);
- -moz-transform: rotate(360deg);
- -ms-transform: rotate(360deg);
- -o-transform: rotate(360deg);
- transform: rotate(360deg);
- }
-}
-
-@-moz-keyframes spinner {
- 0% {
- -webkit-transform: rotate(0deg);
- -moz-transform: rotate(0deg);
- -ms-transform: rotate(0deg);
- -o-transform: rotate(0deg);
- transform: rotate(0deg);
- }
-
- 100% {
- -webkit-transform: rotate(360deg);
- -moz-transform: rotate(360deg);
- -ms-transform: rotate(360deg);
- -o-transform: rotate(360deg);
- transform: rotate(360deg);
- }
-}
-
-@-o-keyframes spinner {
- 0% {
- -webkit-transform: rotate(0deg);
- -moz-transform: rotate(0deg);
- -ms-transform: rotate(0deg);
- -o-transform: rotate(0deg);
- transform: rotate(0deg);
- }
-
- 100% {
- -webkit-transform: rotate(360deg);
- -moz-transform: rotate(360deg);
- -ms-transform: rotate(360deg);
- -o-transform: rotate(360deg);
- transform: rotate(360deg);
- }
-}
-
-@keyframes spinner {
- 0% {
- -webkit-transform: rotate(0deg);
- -moz-transform: rotate(0deg);
- -ms-transform: rotate(0deg);
- -o-transform: rotate(0deg);
- transform: rotate(0deg);
- }
-
- 100% {
- -webkit-transform: rotate(360deg);
- -moz-transform: rotate(360deg);
- -ms-transform: rotate(360deg);
- -o-transform: rotate(360deg);
- transform: rotate(360deg);
- }
-}
-
-/* :not(:required) hides this rule from IE9 and below */
-.spinner:not(:required) {
- -webkit-animation: spinner 1500ms infinite linear;
- -moz-animation: spinner 1500ms infinite linear;
- -ms-animation: spinner 1500ms infinite linear;
- -o-animation: spinner 1500ms infinite linear;
- animation: spinner 1500ms infinite linear;
- -webkit-border-radius: 0.5em;
- -moz-border-radius: 0.5em;
- -ms-border-radius: 0.5em;
- -o-border-radius: 0.5em;
- border-radius: 0.5em;
- -webkit-box-shadow: rgba(0, 0, 51, 0.3) 1.5em 0 0 0, rgba(0, 0, 51, 0.3) 1.1em 1.1em 0 0, rgba(0, 0, 51, 0.3) 0 1.5em 0 0, rgba(0, 0, 51, 0.3) -1.1em 1.1em 0 0, rgba(0, 0, 51, 0.3) -1.5em 0 0 0, rgba(0, 0, 51, 0.3) -1.1em -1.1em 0 0, rgba(0, 0, 51, 0.3) 0 -1.5em 0 0, rgba(0, 0, 51, 0.3) 1.1em -1.1em 0 0;
- -moz-box-shadow: rgba(0, 0, 51, 0.3) 1.5em 0 0 0, rgba(0, 0, 51, 0.3) 1.1em 1.1em 0 0, rgba(0, 0, 51, 0.3) 0 1.5em 0 0, rgba(0, 0, 51, 0.3) -1.1em 1.1em 0 0, rgba(0, 0, 51, 0.3) -1.5em 0 0 0, rgba(0, 0, 51, 0.3) -1.1em -1.1em 0 0, rgba(0, 0, 51, 0.3) 0 -1.5em 0 0, rgba(0, 0, 51, 0.3) 1.1em -1.1em 0 0;
- box-shadow: rgba(0, 0, 51, 0.3) 1.5em 0 0 0, rgba(0, 0, 51, 0.3) 1.1em 1.1em 0 0, rgba(0, 0, 51, 0.3) 0 1.5em 0 0, rgba(0, 0, 51, 0.3) -1.1em 1.1em 0 0, rgba(0, 0, 51, 0.3) -1.5em 0 0 0, rgba(0, 0, 51, 0.3) -1.1em -1.1em 0 0, rgba(0, 0, 51, 0.3) 0 -1.5em 0 0, rgba(0, 0, 51, 0.3) 1.1em -1.1em 0 0;
- display: inline-block;
- font-size: 6px;
- width: 0.8em;
- height: 0.8em;
- margin: 1.5em;
- overflow: hidden;
- text-indent: 100%;
-}
diff --git a/backend/app/assets/stylesheets/spree/backend/components/_tables.scss b/backend/app/assets/stylesheets/spree/backend/components/_tables.scss
deleted file mode 100644
index 31154e9982..0000000000
--- a/backend/app/assets/stylesheets/spree/backend/components/_tables.scss
+++ /dev/null
@@ -1,139 +0,0 @@
-table.table {
- font-size: $font-size-sm;
-
- th {
- padding: 0.5rem;
-
- &.handel-head {
- width: 50px;
- }
- a.sort_link {
- white-space: nowrap;
- }
- }
-
- td {
- padding: 0.5rem;
- }
-
- td.move-handle {
- width:45px;
- }
-
- .badge {
- text-transform: uppercase;
- }
-
- thead {
- th {
- text-transform: uppercase;
- font-size: $small-font-size;
- padding: 0.5rem;
- padding-top: 14px;
- padding-bottom: 14px;
- vertical-align: top;
- border-top: 0;
- }
- }
-
- tbody {
- tr {
- background: white;
- td {
- vertical-align: middle;
- .filterable {
- margin-left: .2em;
- cursor: pointer;
- width: 0.9rem;
- height:0.9rem;
- opacity: 0.25;
- &:hover {
- opacity: 1;
- }
- }
- }
- }
- }
-}
-
-.table-active-filters {
- display: none;
-
- .js-filter {
- .icon {
- cursor: pointer;
- }
- }
-
- .badge-secondary {
- .icon {
- filter: invert(1);
- }
- }
-
- .badge {
- display: inline-block;
- margin-right: .5em;
- margin-bottom: .5em;
-
- &:hover {
- opacity: .8;
- }
- }
-}
-
-.card {
- > .table,
- .table-responsive > .table {
- border-right: 0;
- border-left: 0;
- margin-bottom: 0;
-
- &:last-child, &:last-of-type {
- border-bottom: 0;
- }
-
- td:first-child,
- th:first-child {
- border-left: 0;
- }
-
- td:last-child,
- th:last-child {
- border-right: 0;
- }
-
- tr:first-child td,
- tr:first-child th {
- border-top: 0;
- }
-
- tr:last-child td {
- border-bottom: 0;
- }
- }
-
- .card-header + .table,
- .card-header + .table-responsive > .table {
- border-top: 0;
- }
-}
-
-div.table-responsive table.table-bordered {
- border-top: 1px solid $input-border-color !important;
-}
-
-.sortable-drag-v {
- border: 1px solid $info;
- border-radius: $border-radius;
- width:100%;
- text-align: right;
- opacity: 0;
- td {
- border-top: none;
- opacity:0;
- &:first-child {
- opacity: 1;
- }
- }
-}
diff --git a/backend/app/assets/stylesheets/spree/backend/components/_taxon_products_view.scss b/backend/app/assets/stylesheets/spree/backend/components/_taxon_products_view.scss
deleted file mode 100644
index 2a8aad5758..0000000000
--- a/backend/app/assets/stylesheets/spree/backend/components/_taxon_products_view.scss
+++ /dev/null
@@ -1,35 +0,0 @@
-.taxon-products-view {
- ul.taxon {
-
- li.product {
- list-style: none;
- .thumbnail {
- width: 100%;
- }
-
- .product-info {
- font-size: 0.8em;
- }
- }
- }
-}
-
-ul#taxon_products {
- -webkit-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- -o-user-select: none;
- user-select: none;
-
- .dropdown-menu {
- min-width: 8rem;
- }
-
- .products-ddb::after {
- display: none;
- }
-
- li.moving-this div.card {
- border-color: $info;
- }
-}
diff --git a/backend/app/assets/stylesheets/spree/backend/global/_mixins.scss b/backend/app/assets/stylesheets/spree/backend/global/_mixins.scss
deleted file mode 100644
index d6b082a5a1..0000000000
--- a/backend/app/assets/stylesheets/spree/backend/global/_mixins.scss
+++ /dev/null
@@ -1,78 +0,0 @@
-// Mixin to prefix several properties at once
-
-// EXAMPLE
-// @include prefix((
-// appearance: none,
-// touch-callout: none,
-// user-select: none
-// ), webkit moz ms khtml);
-
-@mixin prefix($declarations, $prefixes: ()) {
- @each $property, $value in $declarations {
- @each $prefix in $prefixes {
- #{'-' + $prefix + '-' + $property}: $value;
- }
-
- // Output standard non-prefixed declaration
- #{$property}: $value;
- }
-}
-
-
-@mixin switch($res: 'sm') {
- $index: 1rem;
- $mainVal: 1rem;
- $baseVal: 1rem;
-
- @if $res == 'md' {
- $index: 2rem;
- $mainVal: 1.5rem;
- $baseVal: 1rem;
- min-height: $index;
- } @else if $res == 'lg' {
- $index: 3rem;
- $mainVal: 2rem;
- $baseVal: 1rem;
- } @else if $res == 'xl' {
- $index: 4rem;
- $mainVal: 2.5rem;
- $baseVal: 1rem;
- }
-
- .custom-control-label {
- padding-left: #{$baseVal};
- padding-bottom: #{$mainVal};
- }
-
- .custom-control-label::before {
- height: $mainVal;
- width: calc(#{$index} + 0.75rem);
- border-radius: $mainVal * 2;
- }
-
- .custom-control-label::after {
- width: calc(#{$mainVal} - 4px);
- height: calc(#{$mainVal} - 4px);
- border-radius: calc(#{$index} - (#{$mainVal} / 2));
- }
-
- .custom-control-input:checked ~ .custom-control-label::after {
- transform: translateX(calc(#{$mainVal} - 0.25rem));
- }
-}
-
-.custom-switch.custom-switch-sm {
- @include switch();
-}
-
-.custom-switch.custom-switch-md {
- @include switch('md');
-}
-
-.custom-switch.custom-switch-lg {
- @include switch('lg');
-}
-
-.custom-switch.custom-switch-xl {
- @include switch('xl');
-}
diff --git a/backend/app/assets/stylesheets/spree/backend/global/_variables.scss b/backend/app/assets/stylesheets/spree/backend/global/_variables.scss
deleted file mode 100644
index b75e90d2b6..0000000000
--- a/backend/app/assets/stylesheets/spree/backend/global/_variables.scss
+++ /dev/null
@@ -1,38 +0,0 @@
-/*------------------------------------------
- Colors
- -----------------------------------------*/
- $primary: darken(#478DC1, 10);
- $success: darken(#7DB942, 2);
- $info: #48B0F7;
- $warning: #F8D053;
- $danger: #F55753;
- $input-border-color: darken(#EDEDED, 5);
-
-/*------------------------------------------
- Components
- -----------------------------------------*/
- $border-radius: 5px;
-
-/*------------------------------------------
- Fonts
- -----------------------------------------*/
- $headings-font-weight: 300;
-
-/*------------------------------------------
- Buttons
- -----------------------------------------*/
-
-/*------------------------------------------
- Navbar
- -----------------------------------------*/
- $navbar-inverse-bg: darken($primary, 15);
-
-/*------------------------------------------
- Forms
- -----------------------------------------*/
- $label-margin-bottom: 0;
-
-/*------------------------------------------
- Plugins
- -----------------------------------------*/
- $select2-icon-size: 0.7rem;
diff --git a/backend/app/assets/stylesheets/spree/backend/plugins/_flatpickr.scss b/backend/app/assets/stylesheets/spree/backend/plugins/_flatpickr.scss
deleted file mode 100644
index 2383a1c124..0000000000
--- a/backend/app/assets/stylesheets/spree/backend/plugins/_flatpickr.scss
+++ /dev/null
@@ -1,113 +0,0 @@
-.flatpickr-calendar {
- // Custom Flatpickr styling for Spree + BS4.
- .flatpickr-current-month {
- span.cur-month:hover {
- background: transparent;
- }
- .numInputWrapper {
- margin-left: 3px;
- border-radius: $border-radius;
- overflow: hidden;
- }
-
- .flatpickr-monthDropdown-months {
- @include prefix((
- appearance: none
- ), webkit moz ms khtml);
-
- padding: 0.2em;
- border-radius: $border-radius;
- }
- }
-
- .numInputWrapper span.arrowUp {
- border-color: transparent;
- border-radius: 0;
- }
-
- .numInputWrapper span.arrowDown {
- border-color: transparent;
- border-radius: 0;
- }
-
- .flatpickr-day {
- margin: 2px 0;
- border-radius: $border-radius ;
- }
-
- .flatpickr-months .flatpickr-prev-month:hover svg,
- .flatpickr-months .flatpickr-next-month:hover svg {
- fill: $primary;
- }
-
- .flatpickr-time {
- border-radius: 0 0 5px 5px;
- &:after {
- display: none;
- }
- .numInputWrapper {
- span {
- border-color: transparent;
- border-radius: 0;
- }
- }
- }
-
- // Required to stop an opened cal showing above the nav bar.
- &.open {
- z-index: $zindex-dropdown;
- }
-}
-
-// Mixin for calendar toggle icon show/hide.
-@mixin swith-appended-icon {
- &:placeholder-shown:not(:focus) + * {
- @content;
- }
-}
-
-.input-group.datePickerFrom,
-.input-group.datePickerTo,
-.input-group.datepicker {
- input.flatpickr-alt-input[readonly] {
- // Flatpickr alternate input is read-only,
- // style it as an active input field.
- background-color: white !important;
-
- // Fix a bug where occasionally the whole screen will highlight
- // if you clicked the Flatpcikr input box while moving the cursor.
- @include prefix((
- appearance: none,
- touch-callout: none,
- user-select: none
- ), webkit moz ms khtml);
-
- @include swith-appended-icon {
- opacity: 0;
- }
- }
-
- // Required for calendar toggle icon show/hide.
- .append_under {
- position: absolute;
- right: 0;
- top: 0;
- z-index: 0;
- height: 100%;
- }
-
- // Styling for calendar toggle icon toggle
- .input-group-append:not(:last-child) >
- .force-round {
- z-index: 5;
- border-top-right-radius: $border-radius !important;
- border-bottom-right-radius: $border-radius !important;
- }
-
- // Styling for calendar toggle icon toggle
- .form-control:not(:first-child),
- .input-group >.flatpickr-alt-input:not(:first-child) {
- border-top-left-radius: $border-radius !important;
- border-bottom-left-radius: $border-radius !important;
- }
-}
diff --git a/backend/app/assets/stylesheets/spree/backend/plugins/_jquery_ui.scss b/backend/app/assets/stylesheets/spree/backend/plugins/_jquery_ui.scss
deleted file mode 100644
index b5e683b73e..0000000000
--- a/backend/app/assets/stylesheets/spree/backend/plugins/_jquery_ui.scss
+++ /dev/null
@@ -1,5 +0,0 @@
-.ui-widget {
- font-family: $headings-font-family;
- font-size: $font-size-base;
- font-weight: 400;
-}
diff --git a/backend/app/assets/stylesheets/spree/backend/plugins/_nav_x.scss b/backend/app/assets/stylesheets/spree/backend/plugins/_nav_x.scss
deleted file mode 100644
index f840bf8b18..0000000000
--- a/backend/app/assets/stylesheets/spree/backend/plugins/_nav_x.scss
+++ /dev/null
@@ -1,95 +0,0 @@
-[data-nav-x-wrapper] {
- position: relative;
- padding: 0;
- overflow: hidden;
-}
-
-[data-nav-x-container] {
- overflow-x: auto;
- overflow-y: hidden;
- white-space: nowrap;
- position: relative;
- -ms-overflow-style: none;
- scrollbar-width: none;
-
- &::-webkit-scrollbar {
- display: none;
- }
-}
-
-[data-nav-x-content] {
- float: left;
- transition: transform .2s ease-in-out;
- position: relative;
-
- & > * {
- z-index: 200;
- }
-
- // Bug fix for iOS jittery elastic scroll from Bootstrap
- // transaition on pills and buttons.
- & > li > a {
- transition: none !important;
- }
-}
-
-.nav-x_Transition_None {
- transition: none;
-}
-
-.nav-x_Advancer {
- appearance: none;
- background: transparent;
- border: 0;
- position: absolute;
- padding: 5px;
- height: 100%;
- width: fit-content;
- top: 0;
- bottom: 0;
- opacity: 0;
- transition: linear 0.01s 0.6s, opacity 0.4s;
- z-index:300;
-
- &:focus {
- outline: 0;
- }
-
- &:hover {
- cursor: pointer;
- }
-
- svg {
- height: 1.5em;
- width: 1.5em;
- color: rgba(128, 128, 128, 0.56);
- }
-}
-
-.nav-x_Advancer_Left {
- border-right: 2px solid rgba(128, 128, 128, 0.56);
- background: linear-gradient(90deg, rgba(255,255,255,1) 0%, rgba(255,255,255,1) 65%, rgba(255,255,255,0.8533788515406162) 100%);
- left: -46px;
- padding-right: 0;
-}
-
-[data-overflowing="both"] ~ .nav-x_Advancer_Left,
-[data-overflowing="left"] ~ .nav-x_Advancer_Left {
- opacity: 1;
- left: -1px;
- transition: linear 0.01s, opacity 0.4s 0.02s;
-}
-
-.nav-x_Advancer_Right {
- border-left: 2px solid rgba(128, 128, 128, 0.56);
- background: linear-gradient(90deg, rgba(255,255,255,0.850577731092437) 0%, rgba(255,255,255,1) 35%, rgba(255,255,255,1) 100%);
- right: -46px;
- padding-left: 0;
-}
-
-[data-overflowing="both"] ~ .nav-x_Advancer_Right,
-[data-overflowing="right"] ~ .nav-x_Advancer_Right {
- opacity: 1;
- right: -1px;
- transition: linear 0.01s, opacity 0.4s 0.02s;
-}
diff --git a/backend/app/assets/stylesheets/spree/backend/plugins/_select2_bootstrap4.scss b/backend/app/assets/stylesheets/spree/backend/plugins/_select2_bootstrap4.scss
deleted file mode 100644
index 330a6daa80..0000000000
--- a/backend/app/assets/stylesheets/spree/backend/plugins/_select2_bootstrap4.scss
+++ /dev/null
@@ -1,622 +0,0 @@
-// Variables directly translating Bootstrap variables
-// -------------------------
-$s2bs-border-radius-base: $border-radius !default;
-$s2bs-border-radius-large: $border-radius-lg !default;
-$s2bs-border-radius-small: $border-radius-sm !default;
-$s2bs-btn-default-bg: transparent !default;
-$s2bs-btn-default-border: $dark !default;
-$s2bs-btn-default-color: $dark !default;
-$s2bs-caret-padding: $custom-select-indicator-padding !default;
-$s2bs-caret-width-base: 0.25rem !default;
-$s2bs-caret-width-large: 0.3125rem !default;
-$s2bs-cursor-disabled: not-allowed !default;
-$s2bs-dropdown-bg: $dropdown-bg !default;
-$s2bs-dropdown-header-color: $dropdown-header-color !default;
-$s2bs-dropdown-link-active-bg: $dropdown-link-active-bg !default;
-$s2bs-dropdown-link-active-color: $dropdown-link-active-color !default;
-$s2bs-dropdown-link-disabled-color: $dropdown-link-disabled-color !default;
-$s2bs-dropdown-link-hover-bg: $dropdown-link-hover-bg !default;
-$s2bs-dropdown-link-hover-color: $dropdown-link-hover-color !default;
-$s2bs-font-size-base: $font-size-base !default;
-$s2bs-font-size-large: $font-size-lg !default;
-$s2bs-font-size-small: $font-size-sm !default;
-$s2bs-padding-base-horizontal: $custom-select-padding-x !default;
-$s2bs-padding-large-horizontal: $input-padding-x-lg !default;
-$s2bs-padding-small-horizontal: $input-padding-x-sm !default;
-$s2bs-padding-base-vertical: $custom-select-padding-y !default;
-$s2bs-padding-large-vertical: $input-btn-padding-y-lg !default;
-$s2bs-padding-small-vertical: $input-btn-padding-y-sm !default;
-$s2bs-line-height: $custom-select-line-height !default;
-$s2bs-input-bg: $input-bg !default;
-$s2bs-input-bg-disabled: $input-disabled-bg !default;
-$s2bs-input-color: $input-color !default;
-$s2bs-input-color-placeholder: $input-placeholder-color !default;
-$s2bs-input-border: $input-border-color !default;
-$s2bs-input-border-width: $input-border-width !default;
-$s2bs-input-border-focus: $input-focus-border-color !default;
-$s2bs-input-border-radius: $input-border-radius !default;
-$s2bs-input-height-base: $input-height !default;
-$s2bs-input-height-large: $input-height-lg !default;
-$s2bs-input-height-small: $input-height-sm !default;
-
-
-// Theme-specific variables
-// -------------------------
-$s2bs-dropdown-arrow-color: $s2bs-input-color-placeholder !default;
-$s2bs-dropdown-box-shadow: 0 6px 12px rgba(0,0,0,.175) !default;
-$s2bs-dropdown-box-shadow-above: 0px -6px 12px rgba(0,0,0,.175) !default;
-$s2bs-clear-selection-color: $s2bs-dropdown-arrow-color !default;
-$s2bs-clear-selection-hover-color: $s2bs-btn-default-color !default;
-$s2bs-remove-choice-color: $s2bs-input-color-placeholder !default;
-$s2bs-remove-choice-hover-color: $s2bs-btn-default-color !default;
-$s2bs-selection-choice-border-radius: $s2bs-border-radius-base !default;
-$s2bs-dropdown-header-padding-vertical: $s2bs-padding-base-vertical !default;
-$s2bs-dropdown-header-font-size: $s2bs-font-size-small !default;
-
-
-// Bootstrap defaults not available as pre-defined variables
-// These should not be overridden.
-// -------------------------
-$s2bs-form-control-default-box-shadow: inset 0 1px 1px rgba(0,0,0,.075) !default;
-$s2bs-form-control-focus-box-shadow: $s2bs-form-control-default-box-shadow, 0 0 8px rgba($s2bs-input-border-focus, 0.6) !default;
-$s2bs-form-control-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s !default;
-
-
-//
-// Mixins
-// --------------------------------------------------
-@mixin bootstrap-input-defaults($font-size: $s2bs-font-size-base) {
- @include box-shadow($s2bs-form-control-default-box-shadow);
- background-color: $s2bs-input-bg;
- border: $s2bs-input-border-width solid $s2bs-input-border;
- @include border-radius($s2bs-input-border-radius);
- color: $s2bs-input-color;
- font-size: $font-size;
-}
-
-@mixin validation-state-focus($color) {
- $shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten($color, 20%);
-
- .select2-dropdown,
- .select2-selection {
- border-color: $color;
- }
-
- .select2-container--focus .select2-selection,
- .select2-container--open .select2-selection {
- @include box-shadow($shadow);
- border-color: darken($color, 10%);
- }
-
- &.select2-drop-active {
- border-color: darken($color, 10%);
-
- &.select2-drop.select2-drop-above {
- border-top-color: darken($color, 10%);
- }
- }
-}
-
-@mixin dropdown-arrow {
- .select2-selection--single {
- .select2-selection__arrow b {
- border-color: transparent transparent $s2bs-dropdown-arrow-color transparent;
- border-width: 0 $s2bs-caret-width-large $s2bs-caret-width-large $s2bs-caret-width-large;
- }
- }
-}
-
-.select2-container--bootstrap4 {
- display: block;
-
- .select2-selection {
- @include bootstrap-input-defaults;
- outline: 0;
-
- &.form-control {
- @include border-radius($s2bs-border-radius-base);
- }
- }
-
- .select2-search__field {
- outline: 0;
-
- &::-webkit-input-placeholder {
- color: $s2bs-input-color-placeholder;
- }
-
- &::-moz-placeholder {
- color: $s2bs-input-color-placeholder;
- opacity: 1;
- }
-
- &:-moz-placeholder {
- color: $s2bs-input-color-placeholder;
- }
-
- &:-ms-input-placeholder {
- color: $s2bs-input-color-placeholder;
- }
- }
-
- .select2-search--dropdown {
- .select2-search__field {
- @include bootstrap-input-defaults;
- }
- }
-
- .select2-results__group {
- color: $s2bs-dropdown-header-color;
- display: block;
- padding: $s2bs-dropdown-header-padding-vertical $s2bs-padding-base-horizontal;
- font-size: $s2bs-dropdown-header-font-size;
- line-height: $s2bs-line-height;
- white-space: nowrap;
- }
-
- .select2-results__option {
- padding: $s2bs-padding-base-vertical $s2bs-padding-base-horizontal;
- font-size: $s2bs-font-size-base;
-
- &[role=group] {
- padding: 0;
- }
-
- &[aria-disabled=true] {
- color: $s2bs-dropdown-link-disabled-color;
- cursor: $s2bs-cursor-disabled;
- }
-
- &[aria-selected=true] {
- background-color: $s2bs-dropdown-link-hover-bg;
- color: $s2bs-dropdown-link-hover-color;
- }
- &--highlighted[aria-selected] {
- background-color: $s2bs-dropdown-link-active-bg;
- color: $s2bs-dropdown-link-active-color;
- }
-
- .select2-results__option {
- padding: $s2bs-padding-base-vertical $s2bs-padding-base-horizontal;
-
- .select2-results__group {
- padding-left: 0;
- }
-
- .select2-results__option {
- margin-left: -$s2bs-padding-base-horizontal;
- padding-left: $s2bs-padding-base-horizontal*2;
-
- .select2-results__option {
- margin-left: -$s2bs-padding-base-horizontal*2;
- padding-left: $s2bs-padding-base-horizontal*3;
-
- .select2-results__option {
- margin-left: -$s2bs-padding-base-horizontal*3;
- padding-left: $s2bs-padding-base-horizontal*4;
-
- .select2-results__option {
- margin-left: -$s2bs-padding-base-horizontal*4;
- padding-left: $s2bs-padding-base-horizontal*5;
-
- .select2-results__option {
- margin-left: -$s2bs-padding-base-horizontal*5;
- padding-left: $s2bs-padding-base-horizontal*6;
- }
- }
- }
- }
- }
- }
- }
-
- &.select2-container--focus,
- &.select2-container--open {
- .select2-selection {
- @include box-shadow($s2bs-form-control-focus-box-shadow);
- @include transition($s2bs-form-control-transition);
- border-color: $s2bs-input-border-focus;
- }
- }
-
- .select2-selection__clear {
- margin-top: -2px; //make up for lowercase line centering
- padding-left: 3px;
- padding-right: 3px;
- margin-left: -3px;
- margin-right: -3px;
- color: $s2bs-clear-selection-color;
- cursor: pointer;
- float: right;
- font-weight: bold;
-
- &:hover {
- color: $s2bs-clear-selection-hover-color;
- }
- }
-
- .select2-selection--multiple {
- min-height: $s2bs-input-height-base;
- padding: 0;
- height: auto;
- cursor: text;
-
- .select2-selection__rendered {
- box-sizing: border-box;
- display: block;
- line-height: $s2bs-line-height;
- list-style: none;
- margin: 0;
- overflow: hidden;
- padding: $s2bs-padding-base-vertical $s2bs-padding-base-horizontal 0 $s2bs-padding-base-horizontal;
- width: 100%;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
-
- .select2-selection__placeholder {
- color: $s2bs-input-color-placeholder;
- float: left;
- margin-top: 5px;
- }
-
- .select2-selection__clear {
- border: $s2bs-input-border-width solid transparent;
- margin-bottom: calc(#{$s2bs-padding-base-horizontal/2} + 2px);
- }
-
- .select2-selection__choice {
- color: $s2bs-input-color;
- background: $s2bs-btn-default-bg;
- border: $s2bs-input-border-width solid $s2bs-btn-default-border;
- @include border-radius($s2bs-selection-choice-border-radius);
- cursor: default;
- float: left;
- overflow: hidden;
- text-overflow: ellipsis;
- max-width: 100%;
- margin: 0 $s2bs-padding-base-horizontal/2 $s2bs-padding-base-horizontal/2 0;
- padding: 0 $s2bs-padding-base-horizontal;
- }
-
- .select2-search--inline {
- margin-bottom: $s2bs-padding-base-horizontal/2;
-
- .select2-search__field {
- background: transparent;
-
- line-height: $s2bs-line-height;
- margin-top: 0;
- }
- }
-
- .select2-selection__choice__remove {
- color: $s2bs-remove-choice-color;
- cursor: pointer;
- display: inline-block;
- font-weight: bold;
- margin-right: $s2bs-padding-base-horizontal / 2;
- margin-left: -($s2bs-padding-base-horizontal / 2);
-
- &:hover {
- color: $s2bs-remove-choice-hover-color;
- }
- }
- }
-
- &.select2-container--disabled {
- .select2-selection {
- border-color: $s2bs-input-border;
- @include box-shadow(none);
- }
-
- .select2-selection,
- .select2-search__field { /* stylelint-disable-line no-descending-specificity */
- cursor: $s2bs-cursor-disabled;
- }
-
- .select2-selection,
- .select2-selection--multiple .select2-selection__choice {
- background-color: $s2bs-input-bg-disabled;
- }
-
- .select2-selection__clear,
- .select2-selection--multiple .select2-selection__choice__remove {
- display: none;
- }
- }
-
- .select2-selection--single {
- display: flex;
- align-items: center;
- height: $s2bs-input-height-base;
- line-height: $s2bs-line-height;
- padding: 0 ($s2bs-padding-base-horizontal + $s2bs-caret-padding) 0 $s2bs-padding-base-horizontal;
-
- .select2-selection__arrow {
- display: flex;
- justify-content: center;
- align-items: center;
- position: absolute;
- top: 0;
- bottom: 0;
- right: $s2bs-padding-base-horizontal;
-
- b {
- border-color: $s2bs-dropdown-arrow-color transparent transparent transparent;
- border-style: solid;
- border-width: $s2bs-caret-width-base $s2bs-caret-width-base 0 $s2bs-caret-width-base;
- }
- }
-
- .select2-selection__rendered {
- flex-grow: 1;
- padding: 0 3px 0 0;
- margin-right: -3px;
- color: $s2bs-input-color;
- }
-
- .select2-selection__placeholder {
- color: $s2bs-input-color-placeholder;
- }
- }
-
- .input-group-lg & .select2-selection {
- &.select2-container--open {
- @include dropdown-arrow;
- }
- }
-
- &.select2-container--open {
- .select2-selection .select2-selection__arrow b {
- border-color: transparent transparent $s2bs-dropdown-arrow-color transparent;
- border-width: 0 $s2bs-caret-width-base $s2bs-caret-width-base $s2bs-caret-width-base;
- }
-
- &.select2-container--below {
- .select2-selection {
- @include border-bottom-radius(0);
- border-bottom-color: transparent;
- }
- }
-
- &.select2-container--above {
- .select2-selection {
- @include border-top-radius(0);
- border-top-color: transparent;
- }
- }
- }
-
- .select2-dropdown {
- @include box-shadow($s2bs-dropdown-box-shadow);
- border-color: $s2bs-input-border-focus;
- border-width: $s2bs-input-border-width;
- overflow-x: hidden;
- margin-top: -1px;
-
- background-color: $dropdown-bg;
-
- &--above {
- @include box-shadow($s2bs-dropdown-box-shadow-above);
- margin-top: 1px;
- }
- }
-
- .select2-results > .select2-results__options {
- max-height: 200px;
- overflow-y: auto;
- }
-
- .select2-selection--single.input-sm,
- .input-group-sm & .select2-selection--single,
- .form-group-sm & .select2-selection--single {
- @include border-radius($s2bs-border-radius-small);
- font-size: $s2bs-font-size-small;
- height: $s2bs-input-height-small;
- line-height: $s2bs-line-height;
-
- // .select2-selection__arrow b { }
- }
-
- .select2-selection--multiple.input-sm,
- .input-group-sm & .select2-selection--multiple,
- .form-group-sm & .select2-selection--multiple {
- min-height: $s2bs-input-height-small;
- @include border-radius($s2bs-border-radius-small);
-
- .select2-selection__rendered
- {
- padding: $s2bs-padding-small-vertical $s2bs-padding-small-horizontal 0 $s2bs-padding-small-horizontal;
- font-size: $s2bs-font-size-small;
- }
-
- .select2-selection__clear {
- margin-bottom: calc(#{$s2bs-padding-small-horizontal/2} + 2px);
- }
-
- .select2-selection__choice {
- line-height: $s2bs-line-height;
- margin: 0 $s2bs-padding-small-horizontal/2 $s2bs-padding-small-horizontal/2 0;
- padding: 0 $s2bs-padding-small-horizontal;
- }
-
- .select2-search--inline {
- margin-bottom: $s2bs-padding-small-horizontal/2;
- .select2-search__field {
- font-size: $s2bs-font-size-small;
- }
- }
-
- .select2-selection__choice__remove {
- margin-right: $s2bs-padding-small-horizontal / 2;
- margin-left: -($s2bs-padding-small-horizontal / 2);
- }
- }
-
- .select2-selection--single.input-lg,
- .input-group-lg & .select2-selection--single,
- .form-group-lg & .select2-selection--single {
- @include border-radius($s2bs-border-radius-large);
- font-size: $s2bs-font-size-large;
- height: $s2bs-input-height-large;
- line-height: $s2bs-line-height;
- padding: $s2bs-padding-large-vertical ($s2bs-padding-large-horizontal + $s2bs-caret-padding) $s2bs-padding-large-vertical $s2bs-padding-large-horizontal;
-
- .select2-selection__arrow {
- b {
- border-width: $s2bs-caret-width-large $s2bs-caret-width-large 0 $s2bs-caret-width-large;
- }
- }
- }
-
- .select2-selection--multiple.input-lg,
- .input-group-lg & .select2-selection--multiple,
- .form-group-lg & .select2-selection--multiple {
- min-height: $s2bs-input-height-large;
- @include border-radius($s2bs-border-radius-large);
-
- .select2-selection__rendered
- {
- padding: $s2bs-padding-large-vertical $s2bs-padding-large-horizontal 0 $s2bs-padding-large-horizontal;
- font-size: $s2bs-font-size-large;
- }
-
- .select2-selection__clear {
- margin-bottom: calc(#{$s2bs-padding-large-horizontal/2} + 2px);
- }
-
- .select2-selection__choice {
- font-size: $s2bs-font-size-large;
- margin: 0 $s2bs-padding-large-horizontal/2 $s2bs-padding-large-horizontal/2 0;
- padding: 0 $s2bs-padding-large-horizontal;
-
- }
-
- .select2-search--inline {
- margin-bottom: $s2bs-padding-large-horizontal/2;
- .select2-search__field {
- font-size: $s2bs-font-size-large;
- }
- }
-
- .select2-selection__choice__remove {
- margin-right: $s2bs-padding-large-horizontal / 2;
- margin-left: -($s2bs-padding-large-horizontal / 2);
- }
- }
-
- .select2-selection.input-lg.select2-container--open {
- @include dropdown-arrow;
- }
-
- &[dir="rtl"] {
-
- .select2-selection--single {
- padding-left: $s2bs-padding-base-horizontal + $s2bs-caret-padding;
- padding-right: $s2bs-padding-base-horizontal;
-
- .select2-selection__rendered {
- padding-right: 0;
- padding-left: 0;
- text-align: right;
- }
-
- .select2-selection__clear {
- float: left;
- }
-
- .select2-selection__arrow {
- left: $s2bs-padding-base-horizontal;
- right: auto;
-
- b {
- margin-left: 0;
- }
- }
- }
-
- .select2-selection--multiple {
- .select2-selection__choice,
- .select2-selection__placeholder,
- .select2-search--inline {
- float: right;
- }
-
- .select2-selection__choice {
- margin-left: 0;
- margin-right: $s2bs-padding-base-horizontal/2;
- }
-
- .select2-selection__choice__remove {
- margin-left: 2px;
- margin-right: auto;
- }
- }
- }
-}
-
-.has-warning {
- @include validation-state-focus($warning);
-}
-
-.has-error {
- @include validation-state-focus($danger);
-}
-
-.has-success {
- @include validation-state-focus($success);
-}
-
-.input-group > .select2-container--bootstrap4 {
- display: table;
- table-layout: fixed;
- position: relative;
- z-index: 2;
- width: 100%;
- margin-bottom: 0;
-
- > .selection > .select2-selection.form-control {
- float: none;
- }
-
- &.select2-container--open,
- &.select2-container--focus{
- z-index: 3;
- }
-
-
- &,
- .input-group-btn,
- .input-group-btn .btn {
- vertical-align: top;
- }
-}
-
-.input-group > .select2-hidden-accessible {
- &:first-child + .select2-container--bootstrap4 > .selection > .select2-selection,
- &:first-child + .select2-container--bootstrap4 > .selection > .select2-selection.form-control {
- @include border-right-radius(0);
- }
-
- &:not(:first-child) + .select2-container--bootstrap4:not(:last-child) > .selection > .select2-selection,
- &:not(:first-child) + .select2-container--bootstrap4:not(:last-child) > .selection > .select2-selection.form-control {
- border-radius: 0;
- }
-
- &:not(:first-child):not(:last-child) + .select2-container--bootstrap4:last-child > .selection > .select2-selection,
- &:not(:first-child):not(:last-child) + .select2-container--bootstrap4:last-child > .selection > .select2-selection.form-control {
- @include border-left-radius(0);
- }
-}
-
-.form-control.select2-hidden-accessible {
- position: absolute !important;
- width: 1px !important;
-}
-
-.form-inline .select2-container--bootstrap4 {
- @include media-breakpoint-up(sm) {
- display: inline-block;
- }
-}
diff --git a/backend/app/assets/stylesheets/spree/backend/plugins/_select2_custom.scss b/backend/app/assets/stylesheets/spree/backend/plugins/_select2_custom.scss
deleted file mode 100644
index 5ad5d9fb85..0000000000
--- a/backend/app/assets/stylesheets/spree/backend/plugins/_select2_custom.scss
+++ /dev/null
@@ -1,11 +0,0 @@
-// Stop an open select2-dropdown from appearing over fixed nav bar.
-.select2-dropdown {
- z-index: 1028;
-}
-
-// Hides the empty <li> tag highligted in open select2-dropdown.
-ul.select2-results__options {
- li:empty {
- display: none;
- }
-}
diff --git a/backend/app/assets/stylesheets/spree/backend/plugins/_sweetalert2_custom.scss b/backend/app/assets/stylesheets/spree/backend/plugins/_sweetalert2_custom.scss
deleted file mode 100644
index 2427dabf20..0000000000
--- a/backend/app/assets/stylesheets/spree/backend/plugins/_sweetalert2_custom.scss
+++ /dev/null
@@ -1,100 +0,0 @@
-// Custom SCSS Standard SweetAlerts
-body.swal2-shown {
- .swal2-popup {
- border-radius:$border-radius;
- }
- .swal2-html-container {
- text-align: left;
- font-size: 0.9em;
-
- .alert-link {
- font-weight: 400;
- }
- }
- .swal2-content {
- padding: 0 !important;
- }
- .swal2-header {
- .swal2-icon {
- width: 2.5em;
- height: 2.5em;
-
- .swal2-icon-content {
- font-size: 2.15em;
- }
- }
-
- .swal2-close {
- top: 3px;
- right: 3px;
- padding-bottom: 3px;
-
- &:hover {
- color:grey;
- }
- }
- }
-}
-
-// Custom SCSS Toast SweetAlerts
-body.swal2-toast-shown .swal2-container.swal2-bottom {
- right: -50% !important;
- max-width: 500px;
-
- .swal2-popup.swal2-toast {
- border-width: 3px;
- border-style: solid;
- box-shadow: none !important;
- margin-bottom: 50px;
-
- .swal2-icon {
- display: none !important;
- }
-
- button.swal2-close {
- min-width: .8em;
- padding-bottom: 0.1em;
- &:hover {
- opacity: 0.75;
- }
- }
- }
-}
-
-@include media-breakpoint-down(sm) {
- body.swal2-toast-shown .swal2-container.swal2-bottom {
- .swal2-popup.swal2-toast {
- button.swal2-close {
- padding-bottom: 0;
- }
- }
- }
-}
-
-.swal2-popup.swal2-toast.swal2-icon-success {
- @extend .alert-success;
- h2, button {
- @extend .alert-success;
- }
-}
-
-.swal2-popup.swal2-toast.swal2-icon-error {
- @extend .alert-danger;
- h2, button {
- @extend .alert-danger;
- }
-}
-
-.swal2-popup.swal2-toast.swal2-icon-info {
- @extend .alert-info;
- h2, button {
- @extend .alert-info;
- }
-}
-
-.swal2-popup.swal2-toast.swal2-icon-question {
- @extend .alert-warning;
- h2, button {
- @extend .alert-warning;
- }
-}
diff --git a/backend/app/assets/stylesheets/spree/backend/plugins/_tinymce_custom.scss b/backend/app/assets/stylesheets/spree/backend/plugins/_tinymce_custom.scss
deleted file mode 100644
index 88d4cc0696..0000000000
--- a/backend/app/assets/stylesheets/spree/backend/plugins/_tinymce_custom.scss
+++ /dev/null
@@ -1,4 +0,0 @@
-// Removes Tiny MCE branding
-.tox-statusbar__branding {
- display: none;
-}
diff --git a/backend/app/assets/stylesheets/spree/backend/shared/_base.scss b/backend/app/assets/stylesheets/spree/backend/shared/_base.scss
deleted file mode 100644
index 2c720af18e..0000000000
--- a/backend/app/assets/stylesheets/spree/backend/shared/_base.scss
+++ /dev/null
@@ -1,115 +0,0 @@
-.row {
- padding: 0 0 15px 0;
-}
-
-.card {
- overflow: hidden;
-}
-
-.is-hidden {
- display: none;
-}
-
-.tooltip{
- pointer-events: none;
- z-index: $zindex-dropdown;
-}
-
-figure.admin-img-holder {
- max-width: 275px;
- border: 2px dashed grey;
- border-radius: $border-radius;
- overflow: hidden;
- display: inline-block;
-
- img {
- max-width: 100%;
- height: auto;
- }
-}
-
-div.admin-product-image-container {
- border: 1px solid $gray-500;
- background-color: #fefefe;
- border-radius: $border-radius;
- overflow: hidden;
- display: flex;
- justify-content: center;
- margin: auto;
-
- a {
- display: flex
- }
-
- img {
- max-width: 100%;
- height: auto;
- align-self: center;
- transform: scale(1.6);
- }
-
- svg {
- color: $gray-600;
- align-self: center;
- }
-
- &.mini-img {
- border-radius: $border-radius / 2;
- width: 24px;
- height: 24px;
- }
-
- &.small-img {
- border-radius: $border-radius;
- width: 50px;
- height: 50px;
- }
-
- &.product-img {
- border-width: 2px;
- border-radius: $border-radius * 2;
- width: 100px;
- height: 100px;
- }
-
- &.large-img {
- border-width: 3px;
- border-radius: $border-radius * 3;
- width: 300px;
- height: 300px;
- }
-}
-
-.js-remove-promo-rule-option-value {
- color: $primary !important;
- &:hover {
- color: darken($primary, 10) !important;
- }
-}
-
-.button_to {
- display: inline-block;
-}
-
-.move-handle {
- cursor: grab;
-}
-
-.badge-light-muted-text {
- color: rgba(0, 0, 0, 0.50);
-}
-
-.truncate {
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
-}
-
-[data-show-info] {
- color: $primary;
- cursor: pointer;
-}
-
-#contentHeaderRow {
- min-height: 51px;
-}
diff --git a/backend/app/assets/stylesheets/spree/backend/shared/_forms.scss b/backend/app/assets/stylesheets/spree/backend/shared/_forms.scss
deleted file mode 100644
index d4eedf3424..0000000000
--- a/backend/app/assets/stylesheets/spree/backend/shared/_forms.scss
+++ /dev/null
@@ -1,72 +0,0 @@
-label {
- font-size: $font-size-sm;
-
- &:hover {
- cursor: pointer;
- }
-}
-
-span.or {
- @extend label;
-
- padding: 0 10px;
-}
-
-.form-group {
- &.withError {
- label, .formError, .required {
- color: $danger;
- }
-
- input,
- .select2-choice {
- border-color: $danger;
- }
- }
-}
-
-// Hide number toggler
- // Chrome, Safari, Edge, Opera
-input.hide-number-toggle::-webkit-outer-spin-button,
-input.hide-number-toggle::-webkit-inner-spin-button {
- -webkit-appearance: none;
- margin: 0;
-}
- // Firefox
-input[type=number].hide-number-toggle {
- -moz-appearance: textfield;
-}
-
-input[type="file"] {
- width: fit-content;
- max-width: 100%;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
-}
-
-
-// Remove the default 5px outlines and box-shadows
-// from all inputs on focus.
-.form-control:focus {
- box-shadow: none !important;
-}
-
-*:focus {
- outline: none;
-}
-
-:-webkit-direct-focus {
- outline-color: transparent;
- outline-style: auto;
- outline-width: 0;
-}
-
-.custom-select {
- background: $input-bg url(asset-path("backend-chevron-down.svg")) no-repeat right 0.5rem center/8px 10px;
- background-size: 0.7em;
- &:focus{
- outline: none;
- box-shadow: none;
- }
-}
diff --git a/backend/app/assets/stylesheets/spree/backend/shared/_glyphicons_urls_fix.scss b/backend/app/assets/stylesheets/spree/backend/shared/_glyphicons_urls_fix.scss
deleted file mode 100644
index c3d3f30752..0000000000
--- a/backend/app/assets/stylesheets/spree/backend/shared/_glyphicons_urls_fix.scss
+++ /dev/null
@@ -1,10 +0,0 @@
-// fix for glyphicons broken in production builds
-@font-face {
- font-family: 'Glyphicons Halflings';
- src: asset-url('glyphicons-halflings-regular.eot');
- src:
- asset-url('glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'),
- asset-url('glyphicons-halflings-regular.woff') format('woff'),
- asset-url('glyphicons-halflings-regular.ttf') format('truetype'),
- asset-url('glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
-}
diff --git a/backend/app/assets/stylesheets/spree/backend/spree_admin.css.scss b/backend/app/assets/stylesheets/spree/backend/spree_admin.css.scss
deleted file mode 100644
index 97cd7656fa..0000000000
--- a/backend/app/assets/stylesheets/spree/backend/spree_admin.css.scss
+++ /dev/null
@@ -1,37 +0,0 @@
-@import 'global/variables';
-@import 'global/mixins';
-
-@import 'bootstrap';
-@import 'glyphicons';
-@import 'shared/glyphicons_urls_fix';
-
-@import 'components/navbar';
-@import 'components/sidebar';
-@import 'components/tables';
-@import 'components/badges';
-@import 'components/main';
-@import 'components/page_header';
-@import 'components/icons';
-@import 'components/buttons';
-@import 'components/filters';
-@import 'components/navigation';
-@import 'components/taxon_products_view';
-@import 'components/progress';
-@import 'components/spinner';
-
-@import 'plugins/sweetalert2_custom';
-@import 'plugins/jquery_ui';
-@import 'plugins/flatpickr';
-@import 'plugins/select2_bootstrap4';
-@import 'plugins/select2_custom';
-@import 'plugins/tinymce_custom';
-@import 'plugins/nav_x';
-
-@import 'shared/base';
-@import 'shared/forms';
-
-@import 'views/menus';
-@import 'views/cms_pages';
-@import 'views/order_payments';
-@import 'views/product_properties';
-@import 'views/prototypes';
diff --git a/backend/app/assets/stylesheets/spree/backend/views/_cms_pages.scss b/backend/app/assets/stylesheets/spree/backend/views/_cms_pages.scss
deleted file mode 100644
index 06693c46cd..0000000000
--- a/backend/app/assets/stylesheets/spree/backend/views/_cms_pages.scss
+++ /dev/null
@@ -1,148 +0,0 @@
-#ImageGalleryLayout {
- #LayoutType {
- color: rgb(134, 134, 134);
- }
-
- .select2-container--bootstrap4 {
- max-width: 200px;
- margin: auto;
- }
-}
-
-#standardPage {
- .sp-pb-0 {
- padding-bottom: 0 !important;
- }
-
- .sp-card {
- border-bottom: 0;
- border-radius: 5px 5px 0 0;
- }
-}
-
-[aria-expanded="false"] {
- span.more {
- display: inline;
- }
- span.less {
- display: none;
- }
-}
-
-[aria-expanded="true"] {
- span.more {
- display: none;
- }
- span.less {
- display: inline;
- }
-}
-
-button#cmsSectionEditorFullScreen {
- span.exit {
- display: none;
- }
-
- &.active {
- span.exit {
- display: inline;
- }
- }
-}
-
-#liveViewCont {
- height: 100%;
-
- .embed-responsive {
- height: 100%;
- }
-}
-
-#draggableSectionsHolder {
- max-height: 750px;
-}
-
-#cmsPagesectionsArea {
- overflow-x: hidden;
- overflow-y: scroll;
- max-height: 100%;
-
- .border {
- border-color: #9c9c9c !important;
- }
-
- // Hide scroll-bar in live preview
- // sidebar.
- -ms-overflow-style: none; /* IE and Edge */
- scrollbar-width: none; /* Firefox */
- &::-webkit-scrollbar {
- display: none;
- }
-}
-
-@include media-breakpoint-up(md) {
- body[data-sections-editor-full-screen] {
- .hide-on-full-screen-mode {
- display: none;
- }
-
- #pageSectionsArea {
- position: fixed;
- top: 0;
- left: 0;
- z-index: 9999;
- background: white;
- padding: 15px 15px 0 15px;
- height: 100vh;
-
- #cmsPagesectionsArea {
- max-height: 90vh;
- }
-
- .embed-responsive-4by3 {
- height: 90vh;
- }
- }
-
- #draggableSectionsHolder {
- max-width: 350px;
- }
- }
-}
-
-#pageLivePreview {
- transform-origin: top left;
- background: rgb(62, 62, 62);
-}
-
-.desktopLiveView {
- #pageLivePreview {
- width: 200.5%;
- height:200.5%;
- inset: 50%;
- transform: scale(0.5) translate(-50%, -50%);
- max-width: 2600px;
- }
-}
-
-.tabletLiveView {
- #pageLivePreview {
- width: 85%;
- height: 133.5%;
- inset: 50%;
- transform: scale(0.75) translate(-50%, -50%);
- max-width: 991px;
- min-width: 768px;
- }
-}
-
-.mobileLiveView {
- #pageLivePreview {
- width: 60%;
- height: 133.5%;
- inset: 50%;
- transform: scale(0.75) translate(-50%, -50%);
- max-width: 767px;
- min-width: 375px;
- }
-}
diff --git a/backend/app/assets/stylesheets/spree/backend/views/_menus.scss b/backend/app/assets/stylesheets/spree/backend/views/_menus.scss
deleted file mode 100644
index a89072cc14..0000000000
--- a/backend/app/assets/stylesheets/spree/backend/views/_menus.scss
+++ /dev/null
@@ -1,61 +0,0 @@
-#menuItemImgContainer {
- width: 200px;
- img {
- max-width: 100%;
- }
-}
-
-#menuArea {
- .space-buttons {
- box-shadow: -11px 0 16px 6px white;
- z-index: 9;
- a {
- margin: 2px;
- }
- }
- .container-item-row {
- overflow: hidden;
- border: 1px solid $border-color;
- margin: 2px;
- background-color: white;
- }
-
- .menu-container-item {
- border: solid 1px transparent;
- padding: 0;
- background-color: var(--light);
-
- .menu-container {
- margin-left: 25px;
- background-color: var(--light);
- }
-
- @include media-breakpoint-up(sm) {
- .menu-container {
- margin-left: 50px;
- }
- }
- }
-
- .sortable-chosen {
- border: 1px dashed var(--gray);
- border-radius: 5px;
- }
-
- .menu_items_image_holder {
- position: relative;
- border: 1px solid $border-color;
- border-radius: 7px;
- overflow: hidden;
- width: 45px;
- height: 45px;
- img {
- position: absolute;
- left: 50%;
- top: 50%;
- height: 100%;
- width: auto;
- transform: translate(-50%,-50%);
- }
- }
-}
diff --git a/backend/app/assets/stylesheets/spree/backend/views/_order_payments.scss b/backend/app/assets/stylesheets/spree/backend/views/_order_payments.scss
deleted file mode 100644
index 12fae3c292..0000000000
--- a/backend/app/assets/stylesheets/spree/backend/views/_order_payments.scss
+++ /dev/null
@@ -1,12 +0,0 @@
-// Styling For Order Payments
-div.previous_cards {
- ul {
- li {
- list-style: none;
- margin: 5px 0;
- input {
- margin-right: 10px;
- }
- }
- }
-}
diff --git a/backend/app/assets/stylesheets/spree/backend/views/_product_properties.scss b/backend/app/assets/stylesheets/spree/backend/views/_product_properties.scss
deleted file mode 100644
index 209953a1aa..0000000000
--- a/backend/app/assets/stylesheets/spree/backend/views/_product_properties.scss
+++ /dev/null
@@ -1,11 +0,0 @@
-table#product_properties {
- .show_property {
- text-align: center;
- }
- .property_name input {
- min-width: 140px;
- }
- .value input {
- min-width: 180px;
- }
-}
diff --git a/backend/app/assets/stylesheets/spree/backend/views/prototypes.scss b/backend/app/assets/stylesheets/spree/backend/views/prototypes.scss
deleted file mode 100644
index 8e80d5933e..0000000000
--- a/backend/app/assets/stylesheets/spree/backend/views/prototypes.scss
+++ /dev/null
@@ -1,42 +0,0 @@
-$color_size: 26px;
-
-.product-prototype-options {
- .option-type-values {
- &__color {
- display: flex;
- flex-wrap: wrap;
- align-items: center;
- max-width: 350px;
- input {
- display: none;
- }
- }
- li {
- display: flex;
- align-items: center;
- margin: 0.25rem;
- input {
- margin-right: 0.5rem;
- }
- }
- }
- .option-value__color {
- border-radius: 50%;
- border: 2px solid #d3d3d3;
- width: $color_size;
- height: $color_size;
- overflow: hidden;
- padding: 1px;
- &:after {
- content: '';
- display: inline-block;
- width: 100%;
- height: 100%;
- background-color: var(--presentation);
- border-radius: 50%;
- }
- }
- input:checked + .option-value__color {
- border-color: #565656;
- }
-}
diff --git a/backend/app/controllers/concerns/spree/admin/order_concern.rb b/backend/app/controllers/concerns/spree/admin/order_concern.rb
deleted file mode 100644
index da44a7a94c..0000000000
--- a/backend/app/controllers/concerns/spree/admin/order_concern.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-module Spree
- module Admin
- module OrderConcern
- extend ActiveSupport::Concern
-
- included do
- rescue_from ActiveRecord::RecordNotFound, with: :resource_not_found
- end
-
- protected
-
- def load_order
- @order = current_store.orders.find_by!(number: params[:order_id])
- authorize! action, @order
- @order
- end
-
- def resource_not_found
- flash[:error] = flash_message_for(model_class.new, :not_found)
- redirect_to spree.admin_orders_path
- end
- end
- end
-end
diff --git a/backend/app/controllers/concerns/spree/admin/product_concern.rb b/backend/app/controllers/concerns/spree/admin/product_concern.rb
deleted file mode 100644
index b47938dba2..0000000000
--- a/backend/app/controllers/concerns/spree/admin/product_concern.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-module Spree
- module Admin
- module ProductConcern
- extend ActiveSupport::Concern
-
- def product_scope
- current_store.products.accessible_by(current_ability, :index)
- end
- end
- end
-end
diff --git a/backend/app/controllers/spree/admin/adjustments_controller.rb b/backend/app/controllers/spree/admin/adjustments_controller.rb
deleted file mode 100644
index 4953e19e82..0000000000
--- a/backend/app/controllers/spree/admin/adjustments_controller.rb
+++ /dev/null
@@ -1,44 +0,0 @@
-module Spree
- module Admin
- class AdjustmentsController < ResourceController
- belongs_to 'spree/order', find_by: :number
-
- create.after :update_totals
- destroy.after :update_totals
- update.after :update_totals
-
- skip_before_action :load_resource, only: [:toggle_state, :edit, :update, :destroy]
-
- before_action :find_adjustment, only: [:destroy, :edit, :update]
-
- after_action :delete_promotion_from_order, only: [:destroy], if: -> { @adjustment.destroyed? && @adjustment.promotion? }
-
- def index
- @adjustments = @order.all_adjustments.eligible.order(created_at: :asc)
- end
-
- private
-
- def find_adjustment
- # Need to assign to @object here to keep ResourceController happy
- @adjustment = @object = parent.all_adjustments.find(params[:id])
- end
-
- def update_totals
- @order.reload.update_with_updater!
- end
-
- # Override method used to create a new instance to correctly
- # associate adjustment with order
- def build_resource
- parent.adjustments.build(order: parent)
- end
-
- def delete_promotion_from_order
- return if @adjustment.source.nil?
-
- @order.promotions.delete(@adjustment.source.promotion)
- end
- end
- end
-end
diff --git a/backend/app/controllers/spree/admin/base_controller.rb b/backend/app/controllers/spree/admin/base_controller.rb
deleted file mode 100644
index 669d07a0c9..0000000000
--- a/backend/app/controllers/spree/admin/base_controller.rb
+++ /dev/null
@@ -1,118 +0,0 @@
-module Spree
- module Admin
- class BaseController < ApplicationController
- include Spree::Core::ControllerHelpers::Auth
- include Spree::Core::ControllerHelpers::Search
- include Spree::Core::ControllerHelpers::Store
- include Spree::Core::ControllerHelpers::StrongParameters
- include Spree::Core::ControllerHelpers::Locale
- include Spree::Core::ControllerHelpers::Currency
-
- respond_to :html
-
- helper 'spree/base'
- helper 'spree/admin/navigation'
- helper 'spree/locale'
- helper 'spree/currency'
- layout 'spree/layouts/admin'
-
- before_action :authorize_admin
- before_action :generate_admin_api_key
- before_action :load_stores
-
- helper_method :admin_oauth_token
-
- protected
-
- def action
- params[:action].to_sym
- end
-
- def authorize_admin
- record = if respond_to?(:model_class, true) && model_class
- model_class
- else
- controller_name.to_sym
- end
- authorize! :admin, record
- authorize! action, record
- end
-
- def redirect_unauthorized_access
- if try_spree_current_user
- flash[:error] = Spree.t(:authorization_failure)
- redirect_to spree.admin_forbidden_path
- else
- store_location
- if defined?(spree.admin_login_path)
- redirect_to spree.admin_login_path
- elsif respond_to?(:spree_login_path)
- redirect_to spree_login_path
- elsif spree.respond_to?(:root_path)
- redirect_to spree.root_path
- else
- redirect_to main_app.respond_to?(:root_path) ? main_app.root_path : '/'
- end
- end
- end
-
- # Need to generate an API key for a user due to some backend actions
- # requiring authentication to the Spree API
- def generate_admin_api_key
- if (user = try_spree_current_user) && user.spree_api_key.blank?
- user.generate_spree_api_key!
- end
- end
-
- def flash_message_for(object, event_sym)
- resource_desc = object.class.model_name.human
- resource_desc += " \"#{object.name}\"" if (object.persisted? || object.destroyed?) && object.respond_to?(:name) && object.name.present? && !object.is_a?(Spree::Order)
- Spree.t(event_sym, resource: resource_desc)
- end
-
- def render_js_for_destroy
- render partial: '/spree/admin/shared/destroy'
- end
-
- def config_locale
- Spree::Backend::Config[:locale]
- end
-
- def stores_scope
- Spree::Store.accessible_by(current_ability, :show)
- end
-
- def load_stores
- @stores = stores_scope.order(default: :desc)
- end
-
- def can_not_transition_without_customer_info
- unless @order.billing_address.present?
- flash[:notice] = Spree.t(:fill_in_customer_info)
- redirect_to spree.edit_admin_order_customer_url(@order)
- end
- end
-
- def admin_oauth_application
- @admin_oauth_application ||= begin
- Spree::OauthApplication.find_or_create_by!(name: 'Admin Panel', scopes: 'admin', redirect_uri: '')
- end
- end
-
- # FIXME: auto-expire this token
- def admin_oauth_token
- user = try_spree_current_user
- return unless user
-
- @admin_oauth_token ||= begin
- Spree::OauthAccessToken.active_for(user).where(application_id: admin_oauth_application.id).last ||
- Spree::OauthAccessToken.create!(
- resource_owner: user,
- application_id: admin_oauth_application.id,
- scopes: admin_oauth_application.scopes
- )
- end.token
- end
- end
- end
-end
diff --git a/backend/app/controllers/spree/admin/cms_pages_controller.rb b/backend/app/controllers/spree/admin/cms_pages_controller.rb
deleted file mode 100644
index e8f797ca84..0000000000
--- a/backend/app/controllers/spree/admin/cms_pages_controller.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-module Spree
- module Admin
- class CmsPagesController < ResourceController
- private
-
- def scope
- current_store.cms_pages
- end
-
- def find_resource
- scope.find(params[:id])
- end
-
- def collection
- return @collection if @collection.present?
-
- params[:q] ||= {}
- @collection = scope
-
- @search = @collection.ransack(params[:q])
- @collection = @search.result.page(params[:page]).per(params[:per_page])
- end
-
- def location_after_save
- spree.edit_admin_cms_page_path(@cms_page)
- end
- end
- end
-end
diff --git a/backend/app/controllers/spree/admin/cms_sections_controller.rb b/backend/app/controllers/spree/admin/cms_sections_controller.rb
deleted file mode 100644
index 5b5a7f7222..0000000000
--- a/backend/app/controllers/spree/admin/cms_sections_controller.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-module Spree
- module Admin
- class CmsSectionsController < ResourceController
- belongs_to 'spree/cms_page'
-
- def collection_url
- spree.edit_admin_cms_page_path(@cms_page)
- end
-
- def location_after_save
- spree.edit_admin_cms_page_cms_section_path(@cms_page, @cms_section)
- end
- end
- end
-end
diff --git a/backend/app/controllers/spree/admin/countries_controller.rb b/backend/app/controllers/spree/admin/countries_controller.rb
deleted file mode 100644
index b07b931ea6..0000000000
--- a/backend/app/controllers/spree/admin/countries_controller.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-module Spree
- module Admin
- class CountriesController < ResourceController
- private
-
- def collection
- super.order(:name)
- end
- end
- end
-end
diff --git a/backend/app/controllers/spree/admin/customer_returns_controller.rb b/backend/app/controllers/spree/admin/customer_returns_controller.rb
deleted file mode 100644
index e11fdcbff1..0000000000
--- a/backend/app/controllers/spree/admin/customer_returns_controller.rb
+++ /dev/null
@@ -1,67 +0,0 @@
-module Spree
- module Admin
- class CustomerReturnsController < ResourceController
- belongs_to 'spree/order', find_by: :number
-
- before_action :parent # ensure order gets loaded to support our pseudo parent-child relationship
- before_action :load_form_data, only: [:new, :edit]
-
- create.before :build_return_items_from_params
- create.fails :load_form_data
-
- def edit
- returned_items = @customer_return.return_items
- @pending_return_items = returned_items.select(&:pending?)
- @accepted_return_items = returned_items.select(&:accepted?)
- @rejected_return_items = returned_items.select(&:rejected?)
- @manual_intervention_return_items = returned_items.select(&:manual_intervention_required?)
- @pending_reimbursements = @customer_return.reimbursements.select(&:pending?)
-
- super
- end
-
- private
-
- def location_after_save
- url_for([:edit, :admin, @order, @customer_return])
- end
-
- def build_resource
- Spree::CustomerReturn.new
- end
-
- def find_resource
- current_store.customer_returns.accessible_by(current_ability, :show).find(params[:id])
- end
-
- def collection
- parent # trigger loading the order
-
- order_customer_return_ids = @order.return_items.accessible_by(current_ability).pluck(:customer_return_id).uniq.compact
- @collection ||= current_store.customer_returns.where(id: order_customer_return_ids)
- @customer_returns = @collection
- end
-
- def load_form_data
- return_items = @order.inventory_units.map(&:current_or_new_return_item).reject(&:customer_return_id)
- @rma_return_items = return_items.select(&:return_authorization_id)
- end
-
- def permitted_resource_params
- @permitted_resource_params ||= params.require('customer_return').permit(permitted_customer_return_attributes)
- end
-
- def build_return_items_from_params
- return_items_params = permitted_resource_params.delete(:return_items_attributes).values
-
- @customer_return.return_items = return_items_params.map do |item_params|
- next unless item_params.delete('returned') == '1'
-
- return_item = item_params[:id] ? Spree::ReturnItem.find(item_params[:id]) : Spree::ReturnItem.new
- return_item.attributes = item_params
- return_item
- end.compact
- end
- end
- end
-end
diff --git a/backend/app/controllers/spree/admin/errors_controller.rb b/backend/app/controllers/spree/admin/errors_controller.rb
deleted file mode 100644
index 1182704050..0000000000
--- a/backend/app/controllers/spree/admin/errors_controller.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-module Spree
- module Admin
- class ErrorsController < BaseController
- skip_before_action :authorize_admin
-
- def forbidden
- render status: 403
- end
- end
- end
-end
diff --git a/backend/app/controllers/spree/admin/general_settings_controller.rb b/backend/app/controllers/spree/admin/general_settings_controller.rb
deleted file mode 100644
index e557fd67fb..0000000000
--- a/backend/app/controllers/spree/admin/general_settings_controller.rb
+++ /dev/null
@@ -1,50 +0,0 @@
-module Spree
- module Admin
- class GeneralSettingsController < Spree::Admin::BaseController
- include Spree::Backend::Callbacks
-
- before_action :update_currency_settings, only: :update
-
- def edit
- @preferences_security = []
- end
-
- def update
- params.each do |name, value|
- next unless Spree::Config.has_preference? name
-
- Spree::Config[name] = value
- end
-
- flash[:success] = Spree.t(:successfully_updated, resource: Spree.t(:general_settings))
- redirect_to spree.edit_admin_general_settings_path
- end
-
- def clear_cache
- Rails.cache.clear
- invoke_callbacks(:clear_cache, :after)
- head :no_content
- end
-
- private
-
- def update_currency_settings
- params.each do |name, value|
- next unless Spree::Config.has_preference?(name) && name.eql?('supported_currencies')
-
- value = update_value(value)
- Spree::Config[name] = value
- end
- end
-
- def update_value(value)
- value.split(',').
- map { |curr| ::Money::Currency.find(curr.strip).try(:iso_code) }.
- concat([Spree::Config[:currency]]).
- uniq.
- compact.
- join(',')
- end
- end
- end
-end
diff --git a/backend/app/controllers/spree/admin/images_controller.rb b/backend/app/controllers/spree/admin/images_controller.rb
deleted file mode 100644
index 50a1123968..0000000000
--- a/backend/app/controllers/spree/admin/images_controller.rb
+++ /dev/null
@@ -1,53 +0,0 @@
-module Spree
- module Admin
- class ImagesController < ResourceController
- before_action :load_product
- before_action :load_edit_data, except: :index
-
- create.before :set_viewable
- update.before :set_viewable
-
- private
-
- def location_after_destroy
- spree.admin_product_images_url(@product)
- end
-
- def location_after_save
- spree.admin_product_images_url(@product)
- end
-
- def load_edit_data
- @variants = @product.variants.map do |variant|
- [variant.sku_and_options_text, variant.id]
- end
- @variants.insert(0, [Spree.t(:all), @product.master_id])
- end
-
- def set_viewable
- @image.viewable_type = 'Spree::Variant'
- @image.viewable_id = params[:image][:viewable_id]
- end
-
- def load_product
- @product = scope.friendly.find(params[:product_id])
- end
-
- def scope
- current_store.products
- end
-
- def collection_url
- spree.admin_product_images_url
- end
-
- def modle_class
- Spree::Image
- end
-
- def collection
- @collection ||= load_product.variant_images
- end
- end
- end
-end
diff --git a/backend/app/controllers/spree/admin/log_entries_controller.rb b/backend/app/controllers/spree/admin/log_entries_controller.rb
deleted file mode 100644
index ffdd7457e3..0000000000
--- a/backend/app/controllers/spree/admin/log_entries_controller.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-module Spree
- module Admin
- class LogEntriesController < Spree::Admin::BaseController
- include Spree::Admin::OrderConcern
- before_action :load_order
- before_action :load_payment
-
- def index
- @log_entries = @payment.log_entries
- end
-
- private
-
- def load_payment
- @payment = @order.payments.find_by!(number: params[:payment_id])
- end
- end
- end
-end
diff --git a/backend/app/controllers/spree/admin/menu_items_controller.rb b/backend/app/controllers/spree/admin/menu_items_controller.rb
deleted file mode 100644
index 7c3a550221..0000000000
--- a/backend/app/controllers/spree/admin/menu_items_controller.rb
+++ /dev/null
@@ -1,33 +0,0 @@
-module Spree
- module Admin
- class MenuItemsController < ResourceController
- belongs_to 'spree/menu'
-
- before_action :load_data
-
- def collection_url
- spree.edit_admin_menu_path(@menu)
- end
-
- def location_after_save
- spree.edit_admin_menu_menu_item_path(@menu, @menu_item)
- end
-
- def remove_icon
- if @menu_item.icon&.destroy
- flash[:success] = Spree.t('notice_messages.icon_removed')
- redirect_to spree.edit_admin_menu_menu_item_path(@menu, @menu_item)
- else
- flash[:error] = Spree.t('errors.messages.cannot_remove_icon')
- render :edit
- end
- end
-
- private
-
- def load_data
- @menu_item_types = Spree::MenuItem::ITEM_TYPE
- end
- end
- end
-end
diff --git a/backend/app/controllers/spree/admin/menus_controller.rb b/backend/app/controllers/spree/admin/menus_controller.rb
deleted file mode 100644
index eaaf0b1158..0000000000
--- a/backend/app/controllers/spree/admin/menus_controller.rb
+++ /dev/null
@@ -1,32 +0,0 @@
-module Spree
- module Admin
- class MenusController < ResourceController
- def index; end
-
- private
-
- def scope
- current_store.menus
- end
-
- def find_resource
- scope.find(params[:id])
- end
-
- def collection
- return @collection if @collection.present?
-
- params[:q] ||= {}
- @collection = scope
-
- @search = @collection.ransack(params[:q])
- @collection = @search.result.page(params[:page]).
- per(params[:per_page] || Spree::Backend::Config[:menus_per_page])
- end
-
- def location_after_save
- spree.edit_admin_menu_path(@menu)
- end
- end
- end
-end
diff --git a/backend/app/controllers/spree/admin/option_types_controller.rb b/backend/app/controllers/spree/admin/option_types_controller.rb
deleted file mode 100644
index f49b777b7a..0000000000
--- a/backend/app/controllers/spree/admin/option_types_controller.rb
+++ /dev/null
@@ -1,36 +0,0 @@
-module Spree
- module Admin
- class OptionTypesController < ResourceController
- before_action :setup_new_option_value, only: :edit
-
- def update_values_positions
- ApplicationRecord.transaction do
- params[:positions].each do |id, index|
- Spree::OptionValue.where(id: id).update_all(position: index)
- end
- end
-
- respond_to do |format|
- format.html { redirect_to spree.admin_product_variants_url(params[:product_id]) }
- format.js { render plain: 'Ok' }
- end
- end
-
- protected
-
- def location_after_save
- if @option_type.created_at == @option_type.updated_at
- edit_admin_option_type_url(@option_type)
- else
- admin_option_types_url
- end
- end
-
- private
-
- def setup_new_option_value
- @option_type.option_values.build if @option_type.option_values.empty?
- end
- end
- end
-end
diff --git a/backend/app/controllers/spree/admin/option_values_controller.rb b/backend/app/controllers/spree/admin/option_values_controller.rb
deleted file mode 100644
index 5c44d48fe4..0000000000
--- a/backend/app/controllers/spree/admin/option_values_controller.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-module Spree
- module Admin
- class OptionValuesController < Spree::Admin::BaseController
- def destroy
- option_value = Spree::OptionValue.find(params[:id])
- option_value.destroy
- render plain: nil
- end
- end
- end
-end
diff --git a/backend/app/controllers/spree/admin/orders/customer_details_controller.rb b/backend/app/controllers/spree/admin/orders/customer_details_controller.rb
deleted file mode 100644
index 9db5933016..0000000000
--- a/backend/app/controllers/spree/admin/orders/customer_details_controller.rb
+++ /dev/null
@@ -1,68 +0,0 @@
-module Spree
- module Admin
- module Orders
- class CustomerDetailsController < Spree::Admin::BaseController
- include Spree::Admin::OrderConcern
-
- before_action :load_order
- before_action :load_user, only: :update, unless: :guest_checkout?
-
- def show
- edit
- render action: :edit
- end
-
- def edit
- @order.build_bill_address(country: current_store.default_country) if @order.bill_address.nil?
- @order.build_ship_address(country: current_store.default_country) if @order.ship_address.nil?
- end
-
- def update
- params[:order][:user_id] = nil if guest_checkout?
- if @order.update(order_params)
- @order.associate_user!(@user, @order.email.blank?) unless guest_checkout?
- @order.next if @order.address?
- @order.refresh_shipment_rates(Spree::ShippingMethod::DISPLAY_ON_BACK_END)
-
- if @order.errors.empty?
- flash[:success] = Spree.t('customer_details_updated')
- redirect_to spree.edit_admin_order_url(@order)
- else
- render action: :edit
- end
- else
- render action: :edit
- end
- end
-
- private
-
- def order_params
- params.require(:order).permit(
- :email, :user_id, :use_billing,
- bill_address_attributes: permitted_address_attributes,
- ship_address_attributes: permitted_address_attributes
- )
- end
-
- def model_class
- Spree::Order
- end
-
- def load_user
- @user = (Spree.user_class.find_by(id: order_params[:user_id]) ||
- Spree.user_class.find_by(email: order_params[:email]))
-
- unless @user
- flash.now[:error] = Spree.t(:user_not_found)
- render :edit
- end
- end
-
- def guest_checkout?
- params[:guest_checkout] == 'true'
- end
- end
- end
- end
-end
diff --git a/backend/app/controllers/spree/admin/orders_controller.rb b/backend/app/controllers/spree/admin/orders_controller.rb
deleted file mode 100644
index 915e728c26..0000000000
--- a/backend/app/controllers/spree/admin/orders_controller.rb
+++ /dev/null
@@ -1,174 +0,0 @@
-module Spree
- module Admin
- class OrdersController < Spree::Admin::BaseController
- include Spree::Admin::OrderConcern
-
- before_action :initialize_order_events
- before_action :load_order, only: %i[
- edit update cancel resume approve resend open_adjustments
- close_adjustments cart channel set_channel
- ]
-
- respond_to :html
-
- def index
- params[:q] ||= {}
- params[:q][:completed_at_not_null] ||= '1' if Spree::Backend::Config[:show_only_complete_orders_by_default]
- @show_only_completed = params[:q][:completed_at_not_null] == '1'
- params[:q][:s] ||= @show_only_completed ? 'completed_at desc' : 'created_at desc'
- params[:q][:completed_at_not_null] = '' unless @show_only_completed
-
- # As date params are deleted if @show_only_completed, store
- # the original date so we can restore them into the params
- # after the search
- created_at_gt = params[:q][:created_at_gt]
- created_at_lt = params[:q][:created_at_lt]
-
- params[:q].delete(:inventory_units_shipment_id_null) if params[:q][:inventory_units_shipment_id_null] == '0'
-
- if params[:q][:created_at_gt].present?
- params[:q][:created_at_gt] = begin
- Time.zone.parse(params[:q][:created_at_gt]).beginning_of_day
- rescue StandardError
- ''
- end
- end
-
- if params[:q][:created_at_lt].present?
- params[:q][:created_at_lt] = begin
- Time.zone.parse(params[:q][:created_at_lt]).end_of_day
- rescue StandardError
- ''
- end
- end
-
- if @show_only_completed
- params[:q][:completed_at_gt] = params[:q].delete(:created_at_gt)
- params[:q][:completed_at_lt] = params[:q].delete(:created_at_lt)
- end
-
- @search = scope.preload(:user).accessible_by(current_ability, :index).ransack(params[:q])
-
- # lazy loading other models here (via includes) may result in an invalid query
- # e.g. SELECT DISTINCT DISTINCT "spree_orders".id, "spree_orders"."created_at" AS alias_0 FROM "spree_orders"
- # see https://github.com/spree/spree/pull/3919
- @orders = @search.result(distinct: true).
- page(params[:page]).
- per(params[:per_page] || Spree::Backend::Config[:admin_orders_per_page])
-
- # Restore dates
- params[:q][:created_at_gt] = created_at_gt
- params[:q][:created_at_lt] = created_at_lt
- end
-
- def new
- @order = scope.create(order_params)
- redirect_to cart_admin_order_url(@order)
- end
-
- def edit
- can_not_transition_without_customer_info
-
- @order.refresh_shipment_rates(ShippingMethod::DISPLAY_ON_BACK_END) unless @order.completed?
- end
-
- def cart
- @order.refresh_shipment_rates(ShippingMethod::DISPLAY_ON_BACK_END) unless @order.completed?
-
- if @order.shipments.shipped.exists?
- redirect_to spree.edit_admin_order_url(@order)
- end
- end
-
- def update
- if @order.update(params[:order]) && @order.line_items.present?
- @order.update_with_updater!
- unless @order.completed?
- # Jump to next step if order is not completed.
- redirect_to spree.admin_order_customer_path(@order) and return
- end
- elsif @order.line_items.empty?
- @order.errors.add(:line_items, Spree.t('errors.messages.blank'))
- end
-
- render action: :edit
- end
-
- def cancel
- @order.canceled_by(try_spree_current_user)
- flash[:success] = Spree.t(:order_canceled)
- redirect_back fallback_location: spree.edit_admin_order_url(@order)
- end
-
- def resume
- @order.resume!
- flash[:success] = Spree.t(:order_resumed)
- redirect_back fallback_location: spree.edit_admin_order_url(@order)
- end
-
- def approve
- @order.approved_by(try_spree_current_user)
- flash[:success] = Spree.t(:order_approved)
- redirect_back fallback_location: spree.edit_admin_order_url(@order)
- end
-
- def resend
- @order.deliver_order_confirmation_email
- flash[:success] = Spree.t(:order_email_resent)
-
- redirect_back fallback_location: spree.edit_admin_order_url(@order)
- end
-
- def open_adjustments
- adjustments = @order.all_adjustments.finalized
- adjustments.update_all(state: 'open')
- flash[:success] = Spree.t(:all_adjustments_opened)
-
- respond_with(@order) { |format| format.html { redirect_back fallback_location: spree.admin_order_adjustments_url(@order) } }
- end
-
- def close_adjustments
- adjustments = @order.all_adjustments.not_finalized
- adjustments.update_all(state: 'closed')
- flash[:success] = Spree.t(:all_adjustments_closed)
-
- respond_with(@order) { |format| format.html { redirect_back fallback_location: spree.admin_order_adjustments_url(@order) } }
- end
-
- def set_channel
- if @order.update(order_params)
- flash[:success] = flash_message_for(@order, :successfully_updated)
- else
- flash[:error] = @order.errors.full_messages.join(', ')
- end
-
- redirect_to channel_admin_order_url(@order)
- end
-
- private
-
- def scope
- current_store.orders.accessible_by(current_ability, :index)
- end
-
- def order_params
- params[:created_by_id] = try_spree_current_user.try(:id)
- params.permit(:created_by_id, :user_id, :store_id, :channel)
- end
-
- def load_order
- @order = scope.includes(:adjustments).find_by!(number: params[:id])
- authorize! action, @order
- end
-
- # Used for extensions which need to provide their own custom event links on the order details view.
- def initialize_order_events
- @order_events = %w{approve cancel resume}
- end
-
- def model_class
- Spree::Order
- end
- end
- end
-end
diff --git a/backend/app/controllers/spree/admin/payment_methods_controller.rb b/backend/app/controllers/spree/admin/payment_methods_controller.rb
deleted file mode 100644
index 038431c3a0..0000000000
--- a/backend/app/controllers/spree/admin/payment_methods_controller.rb
+++ /dev/null
@@ -1,94 +0,0 @@
-module Spree
- module Admin
- class PaymentMethodsController < ResourceController
- skip_before_action :load_resource, only: :create
- before_action :load_data
- before_action :validate_payment_method_provider, only: :create
-
- respond_to :html
-
- def create
- @payment_method = params[:payment_method].delete(:type).constantize.new(payment_method_params)
- @object = @payment_method
- set_current_store
- invoke_callbacks(:create, :before)
- if @payment_method.save
- invoke_callbacks(:create, :after)
- flash[:success] = Spree.t(:successfully_created, resource: Spree.t(:payment_method))
- redirect_to spree.edit_admin_payment_method_path(@payment_method)
- else
- invoke_callbacks(:create, :fails)
- respond_with(@payment_method)
- end
- end
-
- def update
- invoke_callbacks(:update, :before)
- payment_method_type = params[:payment_method].delete(:type)
- if @payment_method['type'].to_s != payment_method_type
- @payment_method.update_columns(
- type: payment_method_type,
- updated_at: Time.current
- )
- @payment_method = scope.find(params[:id])
- end
-
- attributes = payment_method_params.merge(preferences_params)
- attributes.each do |k, _v|
- attributes.delete(k) if k.include?('password') && attributes[k].blank?
- end
-
- if @payment_method.update(attributes)
- set_current_store
- invoke_callbacks(:update, :after)
- flash[:success] = Spree.t(:successfully_updated, resource: Spree.t(:payment_method))
- redirect_to spree.edit_admin_payment_method_path(@payment_method)
- else
- invoke_callbacks(:update, :fails)
- respond_with(@payment_method)
- end
- end
-
- private
-
- def scope
- current_store.payment_methods.accessible_by(current_ability, :index)
- end
-
- def collection
- return @collection if @collection.present?
-
- params[:q] ||= {}
- @collection = super.order(position: :asc)
-
- @collection = scope.order(position: :asc)
-
- @search = @collection.ransack(params[:q])
- @collection = @search.result.page(params[:page]).per(params[:per_page])
- end
-
- def load_data
- @providers = Gateway.providers.sort_by(&:name)
- end
-
- def validate_payment_method_provider
- valid_payment_methods = Rails.application.config.spree.payment_methods.map(&:to_s)
- unless valid_payment_methods.include?(params[:payment_method][:type])
- flash[:error] = Spree.t(:invalid_payment_provider)
- redirect_to new_admin_payment_method_path
- end
- end
-
- def payment_method_params
- params.require(:payment_method).permit!
- end
-
- def preferences_params
- key = ActiveModel::Naming.param_key(@payment_method)
- return {} unless params.key? key
-
- params.require(key).permit!
- end
- end
- end
-end
diff --git a/backend/app/controllers/spree/admin/payments_controller.rb b/backend/app/controllers/spree/admin/payments_controller.rb
deleted file mode 100644
index 4b7daa8c28..0000000000
--- a/backend/app/controllers/spree/admin/payments_controller.rb
+++ /dev/null
@@ -1,112 +0,0 @@
-module Spree
- module Admin
- class PaymentsController < Spree::Admin::BaseController
- include Spree::Backend::Callbacks
- include Spree::Admin::OrderConcern
-
- before_action :load_order
- before_action :load_payment, except: [:create, :new, :index]
- before_action :load_data
- before_action :can_not_transition_without_customer_info
-
- respond_to :html
-
- def index
- @payments = @order.payments.includes(refunds: :reason)
- @refunds = @payments.flat_map(&:refunds)
- redirect_to new_admin_order_payment_url(@order) if @payments.empty?
- end
-
- def new
- # Move order to payment state in order to capture tax generated on shipments
- @order.next if @order.can_go_to_state?('payment')
- @payment = @order.payments.build
- end
-
- def create
- invoke_callbacks(:create, :before)
-
- begin
- if @payment_method.store_credit?
- Spree::Dependencies.checkout_add_store_credit_service.constantize.call(order: @order)
- payments = @order.payments.store_credits.valid
- else
- @payment ||= @order.payments.build(object_params)
- if @payment.payment_method.source_required? && params[:card].present? && params[:card] != 'new'
- @payment.source = @payment.payment_method.payment_source_class.find_by(id: params[:card])
- end
- @payment.save
- payments = [@payment]
- end
-
- if payments && (saved_payments = payments.select &:persisted?).any?
- invoke_callbacks(:create, :after)
-
- # Transition order as far as it will go.
- while @order.next; end
- # If "@order.next" didn't trigger payment processing already (e.g. if the order was
- # already complete) then trigger it manually now
-
- saved_payments.each { |payment| payment.process! if payment.reload.checkout? && @order.complete? }
- flash[:success] = flash_message_for(saved_payments.first, :successfully_created)
- redirect_to spree.admin_order_payments_path(@order)
- else
- @payment ||= @order.payments.build(object_params)
- invoke_callbacks(:create, :fails)
- flash[:error] = Spree.t(:payment_could_not_be_created)
- render :new
- end
- rescue Spree::Core::GatewayError => e
- invoke_callbacks(:create, :fails)
- flash[:error] = e.message.to_s
- redirect_to new_admin_order_payment_path(@order)
- end
- end
-
- def fire
- return unless event = params[:e] and @payment.payment_source
-
- # Because we have a transition method also called void, we do this to avoid conflicts.
- event = 'void_transaction' if event == 'void'
- if @payment.send("#{event}!")
- flash[:success] = Spree.t(:payment_updated)
- else
- flash[:error] = Spree.t(:cannot_perform_operation)
- end
- rescue Spree::Core::GatewayError => ge
- flash[:error] = ge.message.to_s
- ensure
- redirect_to spree.admin_order_payments_path(@order)
- end
-
- private
-
- def object_params
- if params[:payment] and params[:payment_source] and source_params = params.delete(:payment_source)[params[:payment][:payment_method_id]]
- params[:payment][:source_attributes] = source_params
- end
-
- params.require(:payment).permit(permitted_payment_attributes)
- end
-
- def load_data
- @amount = params[:amount] || load_order.total
- @payment_methods = @order.collect_backend_payment_methods
- if @payment&.payment_method
- @payment_method = @payment.payment_method
- else
- @payment_method = @payment_methods.find { |payment_method| payment_method.id == params[:payment][:payment_method_id].to_i } if params[:payment]
- @payment_method ||= @payment_methods.first
- end
- end
-
- def load_payment
- @payment = @order.payments.find_by!(number: params[:id])
- end
-
- def model_class
- Spree::Payment
- end
- end
- end
-end
diff --git a/backend/app/controllers/spree/admin/prices_controller.rb b/backend/app/controllers/spree/admin/prices_controller.rb
deleted file mode 100644
index 944df5e4d8..0000000000
--- a/backend/app/controllers/spree/admin/prices_controller.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-module Spree
- module Admin
- class PricesController < ResourceController
- belongs_to 'spree/product', find_by: :slug
-
- def create
- params.require(:vp).permit!
- params[:vp].each do |variant_id, prices|
- next unless variant_id
-
- variant = parent.variants_including_master.find(variant_id)
- next unless variant
-
- supported_currencies_for_all_stores.each do |currency|
- price = variant.price_in(currency.iso_code)
- price.price = (prices[currency.iso_code]['price'].blank? ? nil : prices[currency.iso_code]['price'])
- price.compare_at_price = (prices[currency.iso_code]['compare_at_price'].blank? ? nil : prices[currency.iso_code]['compare_at_price'])
- price.save! if price.new_record? && price.price || !price.new_record? && price.changed?
- end
- end
- flash[:success] = Spree.t('notice_messages.prices_saved')
- redirect_to spree.admin_product_path(parent)
- end
- end
- end
-end
diff --git a/backend/app/controllers/spree/admin/product_properties_controller.rb b/backend/app/controllers/spree/admin/product_properties_controller.rb
deleted file mode 100644
index cad347b7c1..0000000000
--- a/backend/app/controllers/spree/admin/product_properties_controller.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-module Spree
- module Admin
- class ProductPropertiesController < ResourceController
- belongs_to 'spree/product', find_by: :slug
- before_action :find_properties
- before_action :setup_property, only: :index
-
- private
-
- def find_properties
- @properties = Spree::Property.pluck(:name)
- end
-
- def setup_property
- @product.product_properties.build
- end
- end
- end
-end
diff --git a/backend/app/controllers/spree/admin/products_controller.rb b/backend/app/controllers/spree/admin/products_controller.rb
deleted file mode 100644
index 1790a95bff..0000000000
--- a/backend/app/controllers/spree/admin/products_controller.rb
+++ /dev/null
@@ -1,173 +0,0 @@
-module Spree
- module Admin
- class ProductsController < ResourceController
- include Spree::Admin::ProductConcern
-
- helper 'spree/products'
-
- before_action :load_data, except: :index
-
- create.before :create_before
- update.before :update_before
- helper_method :clone_object_url
-
- def show
- session[:return_to] ||= request.referer
- redirect_to action: :edit
- end
-
- def index
- session[:return_to] = request.url
- respond_with(@collection)
- end
-
- def update
- if params[:product][:taxon_ids].present?
- params[:product][:taxon_ids] = params[:product][:taxon_ids].reject(&:empty?)
- end
- if params[:product][:option_type_ids].present?
- params[:product][:option_type_ids] = params[:product][:option_type_ids].reject(&:empty?)
- end
- invoke_callbacks(:update, :before)
- if @object.update(permitted_resource_params)
- set_current_store
- invoke_callbacks(:update, :after)
- flash[:success] = flash_message_for(@object, :successfully_updated)
- respond_with(@object) do |format|
- format.html { redirect_to location_after_save }
- format.js { render layout: false }
- end
- else
- # Stops people submitting blank slugs, causing errors when they try to
- # update the product again
- @product.slug = @product.slug_was if @product.slug.blank?
- invoke_callbacks(:update, :fails)
- respond_with(@object)
- end
- end
-
- def destroy
- @product = product_scope.friendly.find(params[:id])
-
- begin
- # TODO: why is @product.destroy raising ActiveRecord::RecordNotDestroyed instead of failing with false result
- if @product.destroy
- flash[:success] = Spree.t('notice_messages.product_deleted')
- else
- flash[:error] = Spree.t('notice_messages.product_not_deleted', error: @product.errors.full_messages.to_sentence)
- end
- rescue ActiveRecord::RecordNotDestroyed => e
- flash[:error] = Spree.t('notice_messages.product_not_deleted', error: e.message)
- end
-
- respond_with(@product) do |format|
- format.html { redirect_to collection_url }
- format.js { render_js_for_destroy }
- end
- end
-
- def clone
- @new = @product.duplicate
-
- if @new.persisted?
- flash[:success] = Spree.t('notice_messages.product_cloned')
- redirect_to spree.edit_admin_product_url(@new)
- else
- flash[:error] = Spree.t('notice_messages.product_not_cloned', error: @new.errors.full_messages.to_sentence)
- redirect_to spree.admin_products_url
- end
- rescue ActiveRecord::RecordInvalid => e
- # Handle error on uniqueness validation on product fields
- flash[:error] = Spree.t('notice_messages.product_not_cloned', error: e.message)
- redirect_to spree.admin_products_url
- end
-
- def stock
- @variants = @product.variants.includes(*variant_stock_includes)
- @variants = [@product.master] if @variants.empty?
- @stock_locations = StockLocation.accessible_by(current_ability)
- if @stock_locations.empty?
- flash[:error] = Spree.t(:stock_management_requires_a_stock_location)
- redirect_to spree.admin_stock_locations_path
- end
- end
-
- protected
-
- def find_resource
- product_scope.with_deleted.friendly.find(params[:id])
- end
-
- def location_after_save
- spree.edit_admin_product_url(@product)
- end
-
- def load_data
- @taxons = Taxon.order(:name)
- @option_types = OptionType.order(:name)
- @tax_categories = TaxCategory.order(:name)
- @shipping_categories = ShippingCategory.order(:name)
- end
-
- def collection
- return @collection if @collection.present?
-
- params[:q] ||= {}
- params[:q][:deleted_at_null] ||= '1'
- params[:q][:not_discontinued] ||= '1'
-
- params[:q][:s] ||= 'name asc'
-
- @collection = product_scope
-
- # Don't delete params[:q][:deleted_at_null] here because it is used in view to check the
- # checkbox for 'q[deleted_at_null]'. This also messed with pagination when deleted_at_null is checked.
- if params[:q][:deleted_at_null] == '0'
- @collection = @collection.with_deleted
- end
- # @search needs to be defined as this is passed to search_form_for
- # Temporarily remove params[:q][:deleted_at_null] from params[:q] to ransack products.
- # This is to include all products and not just deleted products.
- @search = @collection.ransack(params[:q].reject { |k, _v| k.to_s == 'deleted_at_null' })
- @collection = @search.result.
- includes(product_includes).
- page(params[:page]).
- per(params[:per_page] || Spree::Backend::Config[:admin_products_per_page])
- @collection
- end
-
- def create_before
- return if params[:product][:prototype_id].blank?
-
- @prototype = Spree::Prototype.find(params[:product][:prototype_id])
- end
-
- def update_before
- # NOTE: we only reset the product properties if we're receiving a post
- # from the form on that tab
- return unless params[:clear_product_properties]
-
- params[:product] ||= {}
- end
-
- def product_includes
- {
- variant_images: [],
- tax_category: [],
- master: [],
- variants: [:prices]
- }
- end
-
- def clone_object_url(resource)
- clone_admin_product_url resource
- end
-
- private
-
- def variant_stock_includes
- [:images, stock_items: :stock_location, option_values: :option_type]
- end
- end
- end
-end
diff --git a/backend/app/controllers/spree/admin/promotion_actions_controller.rb b/backend/app/controllers/spree/admin/promotion_actions_controller.rb
deleted file mode 100644
index 4cb51cd3d3..0000000000
--- a/backend/app/controllers/spree/admin/promotion_actions_controller.rb
+++ /dev/null
@@ -1,45 +0,0 @@
-class Spree::Admin::PromotionActionsController < Spree::Admin::BaseController
- before_action :load_promotion, only: [:create, :destroy]
- before_action :validate_promotion_action_type, only: :create
-
- def create
- @calculators = Spree::Promotion::Actions::CreateAdjustment.calculators
- @promotion_action = params[:action_type].constantize.new(params[:promotion_action])
- @promotion_action.promotion = @promotion
- if @promotion_action.save
- flash[:success] = Spree.t(:successfully_created, resource: Spree.t(:promotion_action))
- end
- respond_to do |format|
- format.html { redirect_to spree.edit_admin_promotion_path(@promotion) }
- format.js { render layout: false }
- end
- end
-
- def destroy
- @promotion_action = @promotion.promotion_actions.find(params[:id])
- if @promotion_action.destroy
- flash[:success] = Spree.t(:successfully_removed, resource: Spree.t(:promotion_action))
- end
- respond_to do |format|
- format.html { redirect_to spree.edit_admin_promotion_path(@promotion) }
- format.js { render layout: false }
- end
- end
-
- private
-
- def load_promotion
- @promotion = current_store.promotions.find(params[:promotion_id])
- end
-
- def validate_promotion_action_type
- valid_promotion_action_types = Rails.application.config.spree.promotions.actions.map(&:to_s)
- unless valid_promotion_action_types.include?(params[:action_type])
- flash[:error] = Spree.t(:invalid_promotion_action)
- respond_to do |format|
- format.html { redirect_to spree.edit_admin_promotion_path(@promotion) }
- format.js { render layout: false }
- end
- end
- end
-end
diff --git a/backend/app/controllers/spree/admin/promotion_categories_controller.rb b/backend/app/controllers/spree/admin/promotion_categories_controller.rb
deleted file mode 100644
index 024be2974d..0000000000
--- a/backend/app/controllers/spree/admin/promotion_categories_controller.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-module Spree
- module Admin
- class PromotionCategoriesController < ResourceController
- end
- end
-end
diff --git a/backend/app/controllers/spree/admin/promotion_rules_controller.rb b/backend/app/controllers/spree/admin/promotion_rules_controller.rb
deleted file mode 100644
index 9dea34e3f1..0000000000
--- a/backend/app/controllers/spree/admin/promotion_rules_controller.rb
+++ /dev/null
@@ -1,54 +0,0 @@
-class Spree::Admin::PromotionRulesController < Spree::Admin::BaseController
- helper 'spree/admin/promotion_rules'
-
- before_action :load_promotion, only: [:create, :destroy]
- before_action :validate_promotion_rule_type, only: :create
-
- def create
- @promotion_rule = @promotion_rule_type.new(promotion_rule_params)
- @promotion_rule.promotion = @promotion
- if @promotion_rule.save
- flash[:success] = Spree.t(:successfully_created, resource: Spree.t(:promotion_rule))
- end
- respond_to do |format|
- format.html { redirect_to spree.edit_admin_promotion_path(@promotion) }
- format.js { render layout: false }
- end
- end
-
- def destroy
- @promotion_rule = @promotion.promotion_rules.find(params[:id])
- if @promotion_rule.destroy
- flash[:success] = Spree.t(:successfully_removed, resource: Spree.t(:promotion_rule))
- end
- respond_to do |format|
- format.html { redirect_to spree.edit_admin_promotion_path(@promotion) }
- format.js { render layout: false }
- end
- end
-
- private
-
- def load_promotion
- @promotion = current_store.promotions.find(params[:promotion_id])
- end
-
- def validate_promotion_rule_type
- requested_type = params[:promotion_rule].delete(:type)
- promotion_rule_types = Rails.application.config.spree.promotions.rules
- @promotion_rule_type = promotion_rule_types.detect do |klass|
- klass.name == requested_type
- end
- unless @promotion_rule_type
- flash[:error] = Spree.t(:invalid_promotion_rule)
- respond_to do |format|
- format.html { redirect_to spree.edit_admin_promotion_path(@promotion) }
- format.js { render layout: false }
- end
- end
- end
-
- def promotion_rule_params
- params[:promotion_rule].permit!
- end
-end
diff --git a/backend/app/controllers/spree/admin/promotions_controller.rb b/backend/app/controllers/spree/admin/promotions_controller.rb
deleted file mode 100644
index 0211528c8f..0000000000
--- a/backend/app/controllers/spree/admin/promotions_controller.rb
+++ /dev/null
@@ -1,53 +0,0 @@
-module Spree
- module Admin
- class PromotionsController < ResourceController
- before_action :load_data, except: :clone
-
- helper 'spree/admin/promotion_rules'
-
- def clone
- promotion = current_store.promotions.find(params[:id])
- duplicator = Spree::PromotionHandler::PromotionDuplicator.new(promotion)
-
- @new_promo = duplicator.duplicate
-
- if @new_promo.errors.empty?
- flash[:success] = Spree.t('promotion_cloned')
- redirect_to spree.edit_admin_promotion_url(@new_promo)
- else
- flash[:error] = Spree.t('promotion_not_cloned', error: @new_promo.errors.full_messages.to_sentence)
- redirect_to spree.admin_promotions_url(@new_promo)
- end
- end
-
- protected
-
- def location_after_save
- spree.edit_admin_promotion_url(@promotion)
- end
-
- def load_data
- @calculators = Rails.application.config.spree.calculators.promotion_actions_create_adjustments
- @promotion_categories = Spree::PromotionCategory.order(:name)
- end
-
- def collection
- return @collection if defined?(@collection)
-
- params[:q] ||= HashWithIndifferentAccess.new
- params[:q][:s] ||= 'id desc'
-
- @collection = super
- @search = @collection.ransack(params[:q])
- @collection = @search.result(distinct: true).
- includes(promotion_includes).
- page(params[:page]).
- per(params[:per_page] || Spree::Backend::Config[:admin_promotions_per_page])
- end
-
- def promotion_includes
- [:promotion_actions]
- end
- end
- end
-end
diff --git a/backend/app/controllers/spree/admin/properties_controller.rb b/backend/app/controllers/spree/admin/properties_controller.rb
deleted file mode 100644
index 85b6d336da..0000000000
--- a/backend/app/controllers/spree/admin/properties_controller.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-module Spree
- module Admin
- class PropertiesController < ResourceController
- def index
- respond_with(@collection)
- end
-
- private
-
- def collection
- return @collection if @collection.present?
-
- # params[:q] can be blank upon pagination
- params[:q] = {} if params[:q].blank?
-
- @collection = super
- @search = @collection.ransack(params[:q])
- @collection = @search.result.
- page(params[:page]).
- per(Spree::Backend::Config[:admin_properties_per_page])
- end
- end
- end
-end
diff --git a/backend/app/controllers/spree/admin/prototypes_controller.rb b/backend/app/controllers/spree/admin/prototypes_controller.rb
deleted file mode 100644
index 7497cea9b6..0000000000
--- a/backend/app/controllers/spree/admin/prototypes_controller.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-module Spree
- module Admin
- class PrototypesController < ResourceController
- def show
- if request.xhr?
- render layout: false
- else
- redirect_to spree.admin_prototypes_path
- end
- end
-
- def available
- @prototypes = Prototype.order('name asc')
- respond_with(@prototypes) do |format|
- format.html { render layout: !request.xhr? }
- format.js
- end
- end
-
- def select
- @prototype ||= Prototype.find(params[:id])
- @prototype_properties = @prototype.properties
- end
- end
- end
-end
diff --git a/backend/app/controllers/spree/admin/refund_reasons_controller.rb b/backend/app/controllers/spree/admin/refund_reasons_controller.rb
deleted file mode 100644
index e08a6a69ce..0000000000
--- a/backend/app/controllers/spree/admin/refund_reasons_controller.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-module Spree
- module Admin
- class RefundReasonsController < ResourceController
- end
- end
-end
diff --git a/backend/app/controllers/spree/admin/refunds_controller.rb b/backend/app/controllers/spree/admin/refunds_controller.rb
deleted file mode 100644
index cfaa2c3ad0..0000000000
--- a/backend/app/controllers/spree/admin/refunds_controller.rb
+++ /dev/null
@@ -1,38 +0,0 @@
-module Spree
- module Admin
- class RefundsController < ResourceController
- belongs_to 'spree/payment', find_by: :number
- before_action :load_order
-
- helper_method :refund_reasons
-
- rescue_from Spree::Core::GatewayError, with: :spree_core_gateway_error
-
- private
-
- def location_after_save
- admin_order_payments_path(@payment.order)
- end
-
- def load_order
- # the spree/admin/shared/order_tabs partial expects the @order instance variable to be set
- @order = @payment.order if @payment
- end
-
- def refund_reasons
- @refund_reasons ||= RefundReason.active.all
- end
-
- def build_resource
- super.tap do |refund|
- refund.amount = refund.payment.credit_allowed
- end
- end
-
- def spree_core_gateway_error(error)
- flash[:error] = error.message
- render :new
- end
- end
- end
-end
diff --git a/backend/app/controllers/spree/admin/reimbursement_types_controller.rb b/backend/app/controllers/spree/admin/reimbursement_types_controller.rb
deleted file mode 100644
index 64fc179258..0000000000
--- a/backend/app/controllers/spree/admin/reimbursement_types_controller.rb
+++ /dev/null
@@ -1,32 +0,0 @@
-module Spree
- module Admin
- class ReimbursementTypesController < ResourceController
- def update
- invoke_callbacks(:update, :before)
- if @object.update(permitted_resource_params_for_update)
- invoke_callbacks(:update, :after)
- respond_with(@object) do |format|
- format.html do
- flash[:success] = flash_message_for(@object, :successfully_updated)
- redirect_to location_after_save
- end
- format.js { render layout: false }
- end
- else
- invoke_callbacks(:update, :fails)
- respond_with(@object) do |format|
- format.html { render action: :edit }
- format.js { render layout: false }
- end
- end
- end
-
- private
-
- def permitted_resource_params_for_update
- params_hash = @object.type.underscore.remove('spree/').tr('/', '_')
- params.require(params_hash.to_s).permit(:name, :active, :mutable)
- end
- end
- end
-end
diff --git a/backend/app/controllers/spree/admin/reimbursements_controller.rb b/backend/app/controllers/spree/admin/reimbursements_controller.rb
deleted file mode 100644
index 9a4703dbd9..0000000000
--- a/backend/app/controllers/spree/admin/reimbursements_controller.rb
+++ /dev/null
@@ -1,45 +0,0 @@
-module Spree
- module Admin
- class ReimbursementsController < ResourceController
- belongs_to 'spree/order', find_by: :number
-
- before_action :load_simulated_refunds, only: :edit
-
- rescue_from Spree::Core::GatewayError, with: :spree_core_gateway_error
-
- def perform
- @reimbursement.perform!
- redirect_to location_after_save
- end
-
- private
-
- def build_resource
- if params[:build_from_customer_return_id].present?
- customer_return = CustomerReturn.find(params[:build_from_customer_return_id])
-
- Reimbursement.build_from_customer_return(customer_return)
- else
- super
- end
- end
-
- def location_after_save
- if @reimbursement.reimbursed?
- admin_order_reimbursement_path(parent, @reimbursement)
- else
- edit_admin_order_reimbursement_path(parent, @reimbursement)
- end
- end
-
- def load_simulated_refunds
- @reimbursement_objects = @reimbursement.simulate
- end
-
- def spree_core_gateway_error(error)
- flash[:error] = error.message
- redirect_to spree.edit_admin_order_reimbursement_path(parent, @reimbursement)
- end
- end
- end
-end
diff --git a/backend/app/controllers/spree/admin/reports_controller.rb b/backend/app/controllers/spree/admin/reports_controller.rb
deleted file mode 100644
index 6baa31043b..0000000000
--- a/backend/app/controllers/spree/admin/reports_controller.rb
+++ /dev/null
@@ -1,76 +0,0 @@
-module Spree
- module Admin
- class ReportsController < Spree::Admin::BaseController
- respond_to :html
-
- class << self
- def available_reports
- @@available_reports
- end
-
- def add_available_report!(report_key, report_description_key = nil)
- if report_description_key.nil?
- report_description_key = "#{report_key}_description"
- end
- @@available_reports[report_key] = { name: Spree.t(report_key), description: Spree.t(report_description_key) }
- end
- end
-
- def initialize
- super
- ReportsController.add_available_report!(:sales_total)
- end
-
- def index
- @reports = ReportsController.available_reports
- end
-
- def sales_total
- params[:q] = {} unless params[:q]
-
- params[:q][:completed_at_gt] = if params[:q][:completed_at_gt].blank?
- Time.zone.now.beginning_of_month
- else
- begin
- Time.zone.parse(params[:q][:completed_at_gt]).beginning_of_day
- rescue StandardError
- Time.zone.now.beginning_of_month
- end
- end
-
- if params[:q] && !params[:q][:completed_at_lt].blank?
- params[:q][:completed_at_lt] = begin
- Time.zone.parse(params[:q][:completed_at_lt]).end_of_day
- rescue StandardError
- ''
- end
- end
-
- params[:q][:s] ||= 'completed_at desc'
-
- @search = scope.complete.ransack(params[:q])
- @orders = @search.result
-
- @totals = {}
- @orders.each do |order|
- @totals[order.currency] = { item_total: ::Money.new(0, order.currency), adjustment_total: ::Money.new(0, order.currency), sales_total: ::Money.new(0, order.currency) } unless @totals[order.currency]
- @totals[order.currency][:item_total] += order.display_item_total.money
- @totals[order.currency][:adjustment_total] += order.display_adjustment_total.money
- @totals[order.currency][:sales_total] += order.display_total.money
- end
- end
-
- private
-
- def scope
- current_store.orders.accessible_by(current_ability, :index)
- end
-
- def model_class
- Spree::Admin::ReportsController
- end
-
- @@available_reports = {}
- end
- end
-end
diff --git a/backend/app/controllers/spree/admin/resource_controller.rb b/backend/app/controllers/spree/admin/resource_controller.rb
deleted file mode 100644
index 1a6a9dddf9..0000000000
--- a/backend/app/controllers/spree/admin/resource_controller.rb
+++ /dev/null
@@ -1,281 +0,0 @@
-class Spree::Admin::ResourceController < Spree::Admin::BaseController
- include Spree::Backend::Callbacks
-
- helper_method :new_object_url, :edit_object_url, :object_url, :collection_url
- before_action :load_resource, except: :update_positions
- before_action :set_currency, :set_current_store, only: [:new, :create]
-
- rescue_from ActiveRecord::RecordNotFound, with: :resource_not_found
-
- respond_to :html
-
- def new
- invoke_callbacks(:new_action, :before)
- respond_with(@object) do |format|
- format.html { render layout: !request.xhr? }
- format.js { render layout: false } if request.xhr?
- end
- end
-
- def edit
- respond_with(@object) do |format|
- format.html { render layout: !request.xhr? }
- format.js { render layout: false } if request.xhr?
- end
- end
-
- def update
- invoke_callbacks(:update, :before)
- if @object.update(permitted_resource_params)
- set_current_store
- invoke_callbacks(:update, :after)
- respond_with(@object) do |format|
- format.html do
- flash[:success] = flash_message_for(@object, :successfully_updated)
- redirect_to location_after_save
- end
- format.js { render layout: false }
- end
- else
- invoke_callbacks(:update, :fails)
- respond_with(@object) do |format|
- format.html { render action: :edit }
- format.js { render layout: false }
- end
- end
- end
-
- def create
- invoke_callbacks(:create, :before)
- @object.attributes = permitted_resource_params
- if @object.save
- invoke_callbacks(:create, :after)
- flash[:success] = flash_message_for(@object, :successfully_created)
- respond_with(@object) do |format|
- format.html { redirect_to location_after_save }
- format.js { render layout: false }
- end
- else
- invoke_callbacks(:create, :fails)
- respond_with(@object) do |format|
- format.html { render action: :new }
- format.js { render layout: false }
- end
- end
- end
-
- def update_positions
- base_scope = model_class.try(:for_store, current_store) || model_class
-
- ApplicationRecord.transaction do
- params[:positions].each do |id, index|
- base_scope.find(id).set_list_position(index)
- end
- end
-
- respond_to do |format|
- format.js { head :ok }
- end
- end
-
- def destroy
- invoke_callbacks(:destroy, :before)
- if @object.destroy
- invoke_callbacks(:destroy, :after)
- flash[:success] = flash_message_for(@object, :successfully_removed)
- else
- invoke_callbacks(:destroy, :fails)
- flash[:error] = @object.errors.full_messages.join(', ')
- end
-
- respond_with(@object) do |format|
- format.html { redirect_to location_after_destroy }
- format.js { render_js_for_destroy }
- end
- end
-
- protected
-
- class << self
- attr_accessor :parent_data
-
- def belongs_to(model_name, options = {})
- @parent_data ||= {}
- @parent_data[:model_name] = model_name
- @parent_data[:model_class] = model_name.to_s.classify.constantize
- @parent_data[:find_by] = options[:find_by] || :id
- end
- end
-
- def model_class
- @model_class ||= resource.model_class
- end
-
- def resource_not_found
- flash[:error] = flash_message_for(model_class.new, :not_found)
- redirect_to collection_url
- end
-
- def resource
- return @resource if @resource
-
- parent_model_name = parent_data[:model_name] if parent_data
- @resource = Spree::Admin::Resource.new controller_path, controller_name, parent_model_name, object_name
- end
-
- def load_resource
- if member_action?
- @object ||= load_resource_instance
-
- # call authorize! a third time (called twice already in Admin::BaseController)
- # this time we pass the actual instance so fine-grained abilities can control
- # access to individual records, not just entire models.
- authorize! action, @object
-
- instance_variable_set("@#{resource.object_name}", @object)
- else
- @collection ||= collection
-
- # note: we don't call authorize here as the collection method should use
- # CanCan's accessible_by method to restrict the actual records returned
-
- instance_variable_set("@#{controller_name}", @collection)
- end
- end
-
- def load_resource_instance
- if new_actions.include?(action)
- build_resource
- elsif params[:id]
- find_resource
- end
- end
-
- def parent_data
- self.class.parent_data
- end
-
- def parent
- if parent_data.present?
- base_scope = parent_data[:model_class].try(:for_store, current_store) || parent_data[:model_class]
-
- @parent ||= base_scope.
- # Don't use `find_by_attribute_name` to workaround globalize/globalize#423 bug
- send(:find_by, parent_data[:find_by].to_s => params["#{resource.model_name}_id"])
- instance_variable_set("@#{resource.model_name}", @parent)
-
- raise ActiveRecord::RecordNotFound if @parent.nil?
-
- @parent
- end
- end
-
- def find_resource
- if parent_data.present?
- parent.send(controller_name).find(params[:id])
- else
- base_scope = model_class.try(:for_store, current_store) || model_class
- base_scope.find(params[:id])
- end
- end
-
- def build_resource
- if parent_data.present?
- parent.send(controller_name).build
- else
- model_class.new
- end
- end
-
- def collection
- return parent.send(controller_name) if parent_data.present?
-
- base_scope = model_class.try(:for_store, current_store) || model_class
-
- if model_class.respond_to?(:accessible_by) &&
- !current_ability.has_block?(params[:action], model_class)
- base_scope.accessible_by(current_ability, action)
- else
- base_scope.where(nil)
- end
- end
-
- def location_after_destroy
- collection_url
- end
-
- def location_after_save
- collection_url
- end
-
- def set_current_store
- return if @object.nil?
-
- ensure_current_store(@object)
- end
-
- def set_currency
- return if @object.nil?
-
- @object.currency = current_currency if model_class.method_defined?(:currency=)
- @object.cost_currency = current_currency if model_class.method_defined?(:cost_currency=)
- end
-
- # URL helpers
-
- def new_object_url(options = {})
- if parent_data.present?
- spree.new_polymorphic_url([:admin, parent, model_class], options)
- else
- spree.new_polymorphic_url([:admin, model_class], options)
- end
- end
-
- def edit_object_url(object, options = {})
- if parent_data.present?
- spree.send "edit_admin_#{resource.model_name}_#{resource.object_name}_url",
- parent, object, options
- else
- spree.send "edit_admin_#{resource.object_name}_url", object, options
- end
- end
-
- def object_url(object = nil, options = {})
- target = object || @object
- if parent_data.present?
- spree.send "admin_#{resource.model_name}_#{resource.object_name}_url", parent, target, options
- else
- spree.send "admin_#{resource.object_name}_url", target, options
- end
- end
-
- def collection_url(options = {})
- if parent_data.present?
- spree.polymorphic_url([:admin, parent, model_class], options)
- else
- spree.polymorphic_url([:admin, model_class], options)
- end
- end
-
- # This method should be overridden when object_name does not match the controller name
- def object_name; end
-
- # Allow all attributes to be updatable.
- #
- # Other controllers can, should, override it to set custom logic
- def permitted_resource_params
- params[resource.object_name].present? ? params.require(resource.object_name).permit! : ActionController::Parameters.new
- end
-
- def collection_actions
- [:index]
- end
-
- def member_action?
- !collection_actions.include? action
- end
-
- def new_actions
- [:new, :create]
- end
-end
diff --git a/backend/app/controllers/spree/admin/return_authorization_reasons_controller.rb b/backend/app/controllers/spree/admin/return_authorization_reasons_controller.rb
deleted file mode 100644
index fd7a7b135d..0000000000
--- a/backend/app/controllers/spree/admin/return_authorization_reasons_controller.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-module Spree
- module Admin
- class ReturnAuthorizationReasonsController < ResourceController
- end
- end
-end
diff --git a/backend/app/controllers/spree/admin/return_authorizations_controller.rb b/backend/app/controllers/spree/admin/return_authorizations_controller.rb
deleted file mode 100644
index 0965469385..0000000000
--- a/backend/app/controllers/spree/admin/return_authorizations_controller.rb
+++ /dev/null
@@ -1,51 +0,0 @@
-module Spree
- module Admin
- class ReturnAuthorizationsController < ResourceController
- belongs_to 'spree/order', find_by: :number
-
- before_action :load_form_data, only: [:new, :edit]
- create.fails :load_form_data
- update.fails :load_form_data
-
- def cancel
- @return_authorization.cancel!
- flash[:success] = Spree.t(:return_authorization_canceled)
- redirect_back fallback_location: spree.edit_admin_order_return_authorization_path(@order, @return_authorization)
- end
-
- private
-
- def load_form_data
- load_return_items
- load_reimbursement_types
- load_return_authorization_reasons
- end
-
- # To satisfy how nested attributes works we want to create placeholder ReturnItems for
- # any InventoryUnits that have not already been added to the ReturnAuthorization.
- def load_return_items
- all_inventory_units = @return_authorization.order.inventory_units
- associated_inventory_units = @return_authorization.return_items.map(&:inventory_unit)
- unassociated_inventory_units = all_inventory_units - associated_inventory_units
-
- new_return_items = unassociated_inventory_units.map do |new_unit|
- Spree::ReturnItem.new(inventory_unit: new_unit, return_authorization: @return_authorization).tap(&:set_default_pre_tax_amount)
- end
-
- @form_return_items = (@return_authorization.return_items + new_return_items).sort_by(&:inventory_unit_id)
- end
-
- def load_reimbursement_types
- @reimbursement_types = Spree::ReimbursementType.accessible_by(current_ability).active
- end
-
- def load_return_authorization_reasons
- @reasons = Spree::ReturnAuthorizationReason.active.to_a
- # Only allow an inactive reason if it's already associated to the RMA
- if @return_authorization.reason && !@return_authorization.reason.active?
- @reasons << @return_authorization.reason
- end
- end
- end
- end
-end
diff --git a/backend/app/controllers/spree/admin/return_index_controller.rb b/backend/app/controllers/spree/admin/return_index_controller.rb
deleted file mode 100644
index 12f5f83281..0000000000
--- a/backend/app/controllers/spree/admin/return_index_controller.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-module Spree
- module Admin
- class ReturnIndexController < BaseController
- def return_authorizations
- collection(Spree::ReturnAuthorization)
- respond_with(@collection)
- end
-
- def customer_returns
- collection(current_store.customer_returns)
- respond_with(@collection)
- end
-
- private
-
- def collection(resource)
- return @collection if @collection.present?
-
- params[:q] ||= {}
-
- @collection = resource.all
- # @search needs to be defined as this is passed to search_form_for
- @search = @collection.ransack(params[:q])
- per_page = params[:per_page] || Spree::Backend::Config[:admin_customer_returns_per_page]
- @collection = @search.result.order(created_at: :desc).page(params[:page]).per(per_page)
- end
- end
- end
-end
diff --git a/backend/app/controllers/spree/admin/return_items_controller.rb b/backend/app/controllers/spree/admin/return_items_controller.rb
deleted file mode 100644
index 9e1f3b941c..0000000000
--- a/backend/app/controllers/spree/admin/return_items_controller.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-module Spree
- module Admin
- class ReturnItemsController < ResourceController
- def location_after_save
- url_for([:edit, :admin, @return_item.customer_return.order, @return_item.customer_return])
- end
- end
- end
-end
diff --git a/backend/app/controllers/spree/admin/roles_controller.rb b/backend/app/controllers/spree/admin/roles_controller.rb
deleted file mode 100644
index 4adbce634f..0000000000
--- a/backend/app/controllers/spree/admin/roles_controller.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-module Spree
- module Admin
- class RolesController < ResourceController
- end
- end
-end
diff --git a/backend/app/controllers/spree/admin/shipping_categories_controller.rb b/backend/app/controllers/spree/admin/shipping_categories_controller.rb
deleted file mode 100644
index e9d1677027..0000000000
--- a/backend/app/controllers/spree/admin/shipping_categories_controller.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-module Spree
- module Admin
- class ShippingCategoriesController < ResourceController
- end
- end
-end
diff --git a/backend/app/controllers/spree/admin/shipping_methods_controller.rb b/backend/app/controllers/spree/admin/shipping_methods_controller.rb
deleted file mode 100644
index d381036fe2..0000000000
--- a/backend/app/controllers/spree/admin/shipping_methods_controller.rb
+++ /dev/null
@@ -1,48 +0,0 @@
-module Spree
- module Admin
- class ShippingMethodsController < ResourceController
- before_action :load_data, except: :index
- before_action :set_shipping_category, only: [:create, :update]
- before_action :set_zones, only: [:create, :update]
-
- def destroy
- @object.destroy
-
- flash[:success] = flash_message_for(@object, :successfully_removed)
-
- respond_with(@object) do |format|
- format.html { redirect_to collection_url }
- format.js { render_js_for_destroy }
- end
- end
-
- private
-
- def set_shipping_category
- return true if params['shipping_method'][:shipping_categories].blank?
-
- @shipping_method.shipping_categories = Spree::ShippingCategory.where(id: params['shipping_method'][:shipping_categories])
- @shipping_method.save
- params[:shipping_method].delete(:shipping_categories)
- end
-
- def set_zones
- return true if params['shipping_method'][:zones].blank?
-
- @shipping_method.zones = Spree::Zone.where(id: params['shipping_method'][:zones])
- @shipping_method.save
- params[:shipping_method].delete(:zones)
- end
-
- def location_after_save
- edit_admin_shipping_method_path(@shipping_method)
- end
-
- def load_data
- @available_zones = Zone.order(:name)
- @tax_categories = Spree::TaxCategory.order(:name)
- @calculators = ShippingMethod.calculators.sort_by(&:name)
- end
- end
- end
-end
diff --git a/backend/app/controllers/spree/admin/state_changes_controller.rb b/backend/app/controllers/spree/admin/state_changes_controller.rb
deleted file mode 100644
index dcd3ed0851..0000000000
--- a/backend/app/controllers/spree/admin/state_changes_controller.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-module Spree
- module Admin
- class StateChangesController < Spree::Admin::BaseController
- include Spree::Admin::OrderConcern
-
- before_action :load_order, only: [:index]
-
- def index
- @state_changes = @order.state_changes.includes(:user).order(created_at: :desc)
- end
- end
- end
-end
diff --git a/backend/app/controllers/spree/admin/states_controller.rb b/backend/app/controllers/spree/admin/states_controller.rb
deleted file mode 100644
index eb56588a55..0000000000
--- a/backend/app/controllers/spree/admin/states_controller.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-module Spree
- module Admin
- class StatesController < ResourceController
- belongs_to 'spree/country'
- before_action :load_data
-
- def index
- respond_with(@collection) do |format|
- format.html
- format.js { render partial: 'state_list' }
- end
- end
-
- protected
-
- def location_after_save
- admin_country_states_url(@country)
- end
-
- def collection
- super.order(:name)
- end
-
- def load_data
- @countries = Spree::Country.where(states_required: true).order(:name)
- end
- end
- end
-end
diff --git a/backend/app/controllers/spree/admin/stock_items_controller.rb b/backend/app/controllers/spree/admin/stock_items_controller.rb
deleted file mode 100644
index fa37b0242b..0000000000
--- a/backend/app/controllers/spree/admin/stock_items_controller.rb
+++ /dev/null
@@ -1,52 +0,0 @@
-module Spree
- module Admin
- class StockItemsController < Spree::Admin::BaseController
- before_action :determine_backorderable, only: :update
-
- def update
- stock_item.save
- respond_to do |format|
- format.js { head :ok }
- end
- end
-
- def create
- variant = current_store.variants.find(params[:variant_id])
- stock_location = StockLocation.find(params[:stock_location_id])
- stock_movement = stock_location.stock_movements.build(stock_movement_params)
- stock_movement.stock_item = stock_location.set_up_stock_item(variant)
-
- if stock_movement.save
- flash[:success] = flash_message_for(stock_movement, :successfully_created)
- else
- flash[:error] = Spree.t(:could_not_create_stock_movement)
- end
-
- redirect_back fallback_location: spree.stock_admin_product_url(variant.product)
- end
-
- def destroy
- stock_item.destroy
-
- respond_with(@stock_item) do |format|
- format.html { redirect_back fallback_location: spree.stock_admin_product_url(stock_item.product) }
- format.js
- end
- end
-
- private
-
- def stock_movement_params
- params.require(:stock_movement).permit(permitted_stock_movement_attributes)
- end
-
- def stock_item
- @stock_item ||= current_store.stock_items.find(params[:id])
- end
-
- def determine_backorderable
- stock_item.backorderable = params[:stock_item].present? && params[:stock_item][:backorderable].present?
- end
- end
- end
-end
diff --git a/backend/app/controllers/spree/admin/stock_locations_controller.rb b/backend/app/controllers/spree/admin/stock_locations_controller.rb
deleted file mode 100644
index 24186b159f..0000000000
--- a/backend/app/controllers/spree/admin/stock_locations_controller.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-module Spree
- module Admin
- class StockLocationsController < ResourceController
- before_action :set_country, only: :new
-
- private
-
- def set_country
- @stock_location.country = current_store.default_country
- unless @stock_location.country
- flash[:error] = Spree.t(:stock_locations_need_a_default_country)
- redirect_to spree.admin_stock_locations_path
- end
- end
- end
- end
-end
diff --git a/backend/app/controllers/spree/admin/stock_movements_controller.rb b/backend/app/controllers/spree/admin/stock_movements_controller.rb
deleted file mode 100644
index f8f442aea5..0000000000
--- a/backend/app/controllers/spree/admin/stock_movements_controller.rb
+++ /dev/null
@@ -1,38 +0,0 @@
-module Spree
- module Admin
- class StockMovementsController < Spree::Admin::BaseController
- respond_to :html
- helper_method :stock_location
-
- def index
- @stock_movements = stock_location.stock_movements.recent.
- includes(stock_item: { variant: :product }).
- page(params[:page])
- end
-
- def new
- @stock_movement = stock_location.stock_movements.build
- end
-
- def create
- @stock_movement = stock_location.stock_movements.build(stock_movement_params)
- if @stock_movement.save
- flash[:success] = flash_message_for(@stock_movement, :successfully_created)
- redirect_to spree.admin_stock_location_stock_movements_path(stock_location)
- else
- render :new
- end
- end
-
- private
-
- def stock_location
- @stock_location ||= StockLocation.find(params[:stock_location_id])
- end
-
- def stock_movement_params
- params.require(:stock_movement).permit(:quantity, :stock_item_id, :action)
- end
- end
- end
-end
diff --git a/backend/app/controllers/spree/admin/stock_transfers_controller.rb b/backend/app/controllers/spree/admin/stock_transfers_controller.rb
deleted file mode 100644
index d97582ac69..0000000000
--- a/backend/app/controllers/spree/admin/stock_transfers_controller.rb
+++ /dev/null
@@ -1,63 +0,0 @@
-module Spree
- module Admin
- class StockTransfersController < Admin::BaseController
- before_action :load_stock_locations, only: :index
-
- def index
- @q = StockTransfer.ransack(params[:q])
-
- @stock_transfers = @q.result.
- includes(stock_movements: { stock_item: :stock_location }).
- order(created_at: :desc).
- page(params[:page])
- end
-
- def show
- @stock_transfer = StockTransfer.find_by!(number: params[:id])
- end
-
- def new; end
-
- def create
- if params[:variant].nil?
- flash.now[:error] = Spree.t('stock_transfer.errors.must_have_variant')
- render :new
- elsif any_missing_variants?(params[:variant])
- flash.now[:error] = Spree.t('stock_transfer.errors.variants_unavailable', stock: source_location.name)
- render :new
- else
- variants = Hash.new(0)
- params[:variant].each_with_index do |variant_id, i|
- variants[variant_id] += params[:quantity][i].to_i
- end
- stock_transfer = StockTransfer.create(reference: params[:reference])
- stock_transfer.transfer(source_location,
- destination_location,
- variants)
-
- flash[:success] = Spree.t(:stock_successfully_transferred)
- redirect_to spree.admin_stock_transfer_path(stock_transfer)
- end
- end
-
- private
-
- def load_stock_locations
- @stock_locations = Spree::StockLocation.active.order_default
- end
-
- def source_location
- @source_location ||= params.key?(:transfer_receive_stock) ? nil :
- StockLocation.find(params[:transfer_source_location_id])
- end
-
- def destination_location
- @destination_location ||= StockLocation.find(params[:transfer_destination_location_id])
- end
-
- def any_missing_variants?(variant_ids)
- source_location&.stock_items&.where(variant_id: variant_ids, count_on_hand: 0)&.any?
- end
- end
- end
-end
diff --git a/backend/app/controllers/spree/admin/store_credit_categories_controller.rb b/backend/app/controllers/spree/admin/store_credit_categories_controller.rb
deleted file mode 100644
index cb40f19e62..0000000000
--- a/backend/app/controllers/spree/admin/store_credit_categories_controller.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-module Spree
- module Admin
- class StoreCreditCategoriesController < ResourceController
- end
- end
-end
diff --git a/backend/app/controllers/spree/admin/store_credits_controller.rb b/backend/app/controllers/spree/admin/store_credits_controller.rb
deleted file mode 100644
index 6041ef1417..0000000000
--- a/backend/app/controllers/spree/admin/store_credits_controller.rb
+++ /dev/null
@@ -1,99 +0,0 @@
-module Spree
- module Admin
- class StoreCreditError < StandardError; end
-
- class StoreCreditsController < Spree::Admin::BaseController
- before_action :load_user
- before_action :load_categories, only: [:new, :edit]
- before_action :load_store_credit, only: [:new, :edit, :update]
- before_action :ensure_unused_store_credit, only: [:update]
-
- def index
- @store_credits = @user.store_credits.for_store(current_store).includes(:category).reverse_order
- end
-
- def create
- @store_credit = @user.store_credits.build(
- permitted_store_credit_params.merge(
- created_by: try_spree_current_user,
- action_originator: try_spree_current_user,
- store: current_store
- )
- )
-
- if @store_credit.save
- flash[:success] = flash_message_for(@store_credit, :successfully_created)
- redirect_to spree.admin_user_store_credits_path(@user)
- else
- load_categories
- flash[:error] = Spree.t('store_credit.errors.unable_to_create')
- render :new
- end
- end
-
- def update
- @store_credit.assign_attributes(permitted_store_credit_params)
- @store_credit.created_by = try_spree_current_user
-
- if @store_credit.save
- flash[:success] = flash_message_for(@store_credit, :successfully_updated)
- redirect_to spree.admin_user_store_credits_path(@user)
- else
- load_categories
- flash[:error] = Spree.t('store_credit.errors.unable_to_update')
- render :edit
- end
- end
-
- def destroy
- @store_credit = @user.store_credits.for_store(current_store).find(params[:id])
- ensure_unused_store_credit
-
- if @store_credit.destroy
- flash[:success] = flash_message_for(@store_credit, :successfully_removed)
- respond_with(@store_credit) do |format|
- format.html { redirect_to spree.admin_user_store_credits_path(@user) }
- format.js { render_js_for_destroy }
- end
- else
- render plain: Spree.t('store_credit.errors.unable_to_delete'), status: :unprocessable_entity
- end
- end
-
- protected
-
- def permitted_store_credit_params
- params.require(:store_credit).permit(permitted_store_credit_attributes)
- end
-
- private
-
- def load_user
- @user = Spree.user_class.find_by(id: params[:user_id])
-
- unless @user
- flash[:error] = Spree.t(:user_not_found)
- redirect_to spree.admin_path
- end
- end
-
- def load_categories
- @credit_categories = Spree::StoreCreditCategory.order(:name)
- end
-
- def load_store_credit
- @store_credit = scope.find_by(id: params[:id]) || scope.new
- end
-
- def scope
- current_store.store_credits
- end
-
- def ensure_unused_store_credit
- unless @store_credit.amount_used.zero?
- raise StoreCreditError, Spree.t('store_credit.errors.cannot_change_used_store_credit')
- end
- end
- end
- end
-end
diff --git a/backend/app/controllers/spree/admin/stores_controller.rb b/backend/app/controllers/spree/admin/stores_controller.rb
deleted file mode 100644
index 76fa63301f..0000000000
--- a/backend/app/controllers/spree/admin/stores_controller.rb
+++ /dev/null
@@ -1,139 +0,0 @@
-module Spree
- module Admin
- class StoresController < Spree::Admin::BaseController
- before_action :load_store, only: [:new, :edit, :update]
- before_action :set_default_currency, only: :new
- before_action :set_default_locale, only: :new
- before_action :normalize_supported_currencies, only: [:create, :update]
- before_action :normalize_supported_locales, only: [:create, :update]
- before_action :set_default_country_id, only: :new
- before_action :load_all_countries, only: [:new, :edit, :update, :create]
- before_action :load_all_zones, only: [:new, :edit, :update, :create]
-
- def index
- if params[:ids]
- load_stores_by_ids
- elsif params[:q]
- load_stores_by_query
- end
-
- respond_with(@stores) do |format|
- format.json { render layout: false }
- end
- end
-
- def load_stores_by_ids
- @stores = stores_scope.where(id: params[:ids].split(','))
- end
-
- def load_stores_by_query
- @stores = if defined?(SpreeGlobalize)
- stores_scope.joins(:translations).where("LOWER(#{Store::Translation.table_name}.name) LIKE LOWER(:query)",
- query: "%#{params[:q]}%")
- else
- stores_scope.where('LOWER(name) LIKE LOWER(:query)', query: "%#{params[:q]}%")
- end
- end
-
- def create
- @store = stores_scope.new(permitted_store_params)
-
- if @store.save
- flash[:success] = flash_message_for(@store, :successfully_created)
- redirect_to @store.formatted_url + spree.admin_stores_path
- else
- flash[:error] = "#{Spree.t('store_errors.unable_to_create')}: #{@store.errors.full_messages.join(', ')}"
- render :new
- end
- end
-
- def update
- @store.assign_attributes(permitted_store_params)
-
- if @store.save
- flash[:success] = flash_message_for(@store, :successfully_updated)
- redirect_to spree.admin_stores_path
- else
- flash[:error] = "#{Spree.t('store_errors.unable_to_update')}: #{@store.errors.full_messages.join(', ')}"
- redirect_to spree.edit_admin_store_path(@store)
- end
- end
-
- def destroy
- @store = stores_scope.find(params[:id])
-
- if @store.destroy
- flash[:success] = flash_message_for(@store, :successfully_removed)
- respond_with(@store) do |format|
- format.html { redirect_to spree.admin_stores_path }
- format.js { render_js_for_destroy }
- end
- else
- render plain: "#{Spree.t('store_errors.unable_to_delete')}: #{@store.errors.full_messages.join(', ')}", status: :unprocessable_entity
- end
- end
-
- def set_default
- store = stores_scope.find(params[:id])
- stores = stores_scope.where.not(id: params[:id])
-
- ApplicationRecord.transaction do
- store.update(default: true)
- stores.update_all(default: false)
- end
-
- if store.errors.empty?
- flash[:success] = Spree.t(:store_set_as_default, store: store.name)
- else
- flash[:error] = "#{Spree.t(:store_not_set_as_default, store: store.name)} #{store.errors.full_messages.join(', ')}"
- end
-
- redirect_to spree.admin_stores_path
- end
-
- protected
-
- def permitted_store_params
- params.require(:store).permit(permitted_store_attributes)
- end
-
- private
-
- def load_store
- @store = stores_scope.find_by(id: params[:id]) || stores_scope.new
- end
-
- def load_all_countries
- @countries = Spree::Country.all
- end
-
- def load_all_zones
- @zones = Spree::Zone.pluck(:name, :id)
- end
-
- def set_default_currency
- @store.default_currency = Spree::Config[:currency]
- end
-
- def set_default_locale
- @store.default_locale = I18n.locale
- end
-
- def normalize_supported_currencies
- if params[:store][:supported_currencies]&.is_a?(Array)
- params[:store][:supported_currencies] = params[:store][:supported_currencies].compact.uniq.reject(&:blank?).join(',')
- end
- end
-
- def normalize_supported_locales
- if params[:store][:supported_locales]&.is_a?(Array)
- params[:store][:supported_locales] = params[:store][:supported_locales].compact.uniq.reject(&:blank?).join(',')
- end
- end
-
- def set_default_country_id
- @store.default_country_id = Spree::Config[:default_country_id]
- end
- end
- end
-end
diff --git a/backend/app/controllers/spree/admin/tax_categories_controller.rb b/backend/app/controllers/spree/admin/tax_categories_controller.rb
deleted file mode 100644
index 34a050d586..0000000000
--- a/backend/app/controllers/spree/admin/tax_categories_controller.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-module Spree
- module Admin
- class TaxCategoriesController < ResourceController
- end
- end
-end
diff --git a/backend/app/controllers/spree/admin/tax_rates_controller.rb b/backend/app/controllers/spree/admin/tax_rates_controller.rb
deleted file mode 100644
index 15db5a1493..0000000000
--- a/backend/app/controllers/spree/admin/tax_rates_controller.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-module Spree
- module Admin
- class TaxRatesController < ResourceController
- before_action :load_data
-
- private
-
- def load_data
- @available_zones = Zone.order(:name)
- @available_categories = TaxCategory.order(:name)
- @calculators = TaxRate.calculators.sort_by(&:name)
- end
- end
- end
-end
diff --git a/backend/app/controllers/spree/admin/taxonomies_controller.rb b/backend/app/controllers/spree/admin/taxonomies_controller.rb
deleted file mode 100644
index 6963dedde8..0000000000
--- a/backend/app/controllers/spree/admin/taxonomies_controller.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-module Spree
- module Admin
- class TaxonomiesController < ResourceController
- private
-
- def location_after_save
- if @taxonomy.created_at == @taxonomy.updated_at
- edit_admin_taxonomy_url(@taxonomy)
- else
- admin_taxonomies_url
- end
- end
- end
- end
-end
diff --git a/backend/app/controllers/spree/admin/taxons_controller.rb b/backend/app/controllers/spree/admin/taxons_controller.rb
deleted file mode 100644
index 845f6b3c54..0000000000
--- a/backend/app/controllers/spree/admin/taxons_controller.rb
+++ /dev/null
@@ -1,136 +0,0 @@
-module Spree
- module Admin
- class TaxonsController < Spree::Admin::BaseController
- before_action :load_taxonomy, only: [:create, :edit, :update, :remove_icon]
- before_action :load_taxon, only: [:edit, :update, :remove_icon]
- before_action :set_permalink_part, only: [:edit, :update]
- respond_to :html, :js
-
- def index; end
-
- def create
- @taxon = @taxonomy.taxons.build(params[:taxon].except(:icon))
- @taxon.build_icon(attachment: taxon_params[:icon])
- if @taxon.save
- respond_with(@taxon) do |format|
- format.json { render json: @taxon.to_json }
- end
- else
- flash[:error] = Spree.t('errors.messages.could_not_create_taxon')
- respond_with(@taxon) do |format|
- format.html { redirect_to @taxonomy ? edit_admin_taxonomy_url(@taxonomy) : admin_taxonomies_url }
- end
- end
- end
-
- def edit; end
-
- def update
- successful = @taxon.transaction do
- parent_id = params[:taxon][:parent_id]
- set_position
- set_parent(parent_id)
-
- @taxon.save!
-
- # regenerate permalink
- regenerate_permalink if parent_id
-
- set_permalink_params
-
- # check if we need to rename child taxons if parent name or permalink changes
- @update_children = true if params[:taxon][:name] != @taxon.name || params[:taxon][:permalink] != @taxon.permalink
-
- @taxon.create_icon(attachment: taxon_params[:icon]) if taxon_params[:icon]
- @taxon.update(taxon_params.except(:icon))
- end
- if successful
- flash[:success] = flash_message_for(@taxon, :successfully_updated)
-
- # rename child taxons
- rename_child_taxons if @update_children
-
- respond_with(@taxon) do |format|
- format.html { redirect_to spree.edit_admin_taxonomy_url(@taxonomy) }
- format.json { render json: @taxon.to_json }
- end
- else
- respond_with(@taxon) do |format|
- format.html { render :edit }
- format.json { render json: @taxon.errors.full_messages.to_sentence, status: 422 }
- end
- end
- end
-
- def remove_icon
- if @taxon.icon.destroy
- flash[:success] = Spree.t('notice_messages.icon_removed')
- redirect_to spree.edit_admin_taxonomy_taxon_url(@taxonomy.id, @taxon.id)
- else
- flash[:error] = Spree.t('errors.messages.cannot_remove_icon')
- render :edit
- end
- end
-
- private
-
- def set_permalink_part
- @permalink_part = @taxon.permalink.split('/').last
- @parent_permalink = @taxon.permalink.split('/')[0...-1].join('/')
- @parent_permalink += '/' unless @parent_permalink.blank?
- end
-
- def taxon_params
- params.require(:taxon).permit(permitted_taxon_attributes)
- end
-
- def load_taxon
- @taxon = @taxonomy.taxons.find(params[:id])
- end
-
- def load_taxonomy
- @taxonomy = if defined?(SpreeGlobalize)
- scope.includes(:translations, taxons: [:translations]).find(params[:taxonomy_id])
- else
- scope.find(params[:taxonomy_id])
- end
- end
-
- def set_position
- new_position = params[:taxon][:position]
- @taxon.child_index = new_position.to_i if new_position
- end
-
- def set_parent(parent_id)
- @taxon.parent = current_store.taxons.find(parent_id.to_i) if parent_id
- end
-
- def set_permalink_params
- if params.key? 'permalink_part'
- params[:taxon][:permalink] = @parent_permalink + params[:permalink_part]
- end
- end
-
- def rename_child_taxons
- @taxon.descendants.each do |taxon|
- reload_taxon_and_set_permalink(taxon)
- end
- end
-
- def regenerate_permalink
- reload_taxon_and_set_permalink(@taxon)
- @update_children = true
- end
-
- def reload_taxon_and_set_permalink(taxon)
- taxon.reload
- taxon.set_permalink
- taxon.save!
- end
-
- def scope
- current_store.taxonomies
- end
- end
- end
-end
diff --git a/backend/app/controllers/spree/admin/users_controller.rb b/backend/app/controllers/spree/admin/users_controller.rb
deleted file mode 100644
index b01882f5d1..0000000000
--- a/backend/app/controllers/spree/admin/users_controller.rb
+++ /dev/null
@@ -1,115 +0,0 @@
-module Spree
- module Admin
- class UsersController < ResourceController
- rescue_from Spree::Core::DestroyWithOrdersError, with: :user_destroy_with_orders_error
-
- after_action :sign_in_if_change_own_password, only: :update
-
- def show
- redirect_to spree.edit_admin_user_path(@user)
- end
-
- def create
- @user = Spree.user_class.new(user_params)
- if @user.save
- flash[:success] = flash_message_for(@user, :successfully_created)
- redirect_to spree.edit_admin_user_path(@user)
- else
- render :new
- end
- end
-
- def update
- if params[:user][:password].blank? && params[:user][:password_confirmation].blank?
- params[:user].delete(:password)
- params[:user].delete(:password_confirmation)
- end
-
- if @user.update(user_params)
- flash[:success] = Spree.t(:account_updated)
- redirect_to spree.edit_admin_user_path(@user)
- else
- render :edit
- end
- end
-
- def addresses
- if request.put?
- params[:user][:bill_address_attributes][:user_id] = @user.id if params[:user][:bill_address_attributes].present?
- params[:user][:ship_address_attributes][:user_id] = @user.id if params[:user][:ship_address_attributes].present?
- if @user.update(user_params)
- flash.now[:success] = Spree.t(:account_updated)
- end
-
- render :addresses
- end
- end
-
- def orders
- params[:q] ||= {}
- @search = current_store.orders.reverse_chronological.ransack(params[:q].merge(user_id_eq: @user.id))
- @orders = @search.result.page(params[:page])
- end
-
- def items
- params[:q] ||= {}
- @search = current_store.orders.includes(
- line_items: {
- variant: [:product, { option_values: :option_type }]
- }
- ).ransack(params[:q].merge(user_id_eq: @user.id))
- @orders = @search.result.page(params[:page])
- end
-
- def generate_api_key
- if @user.generate_spree_api_key!
- flash[:success] = Spree.t('api.key_generated')
- end
- redirect_to spree.edit_admin_user_path(@user)
- end
-
- def clear_api_key
- if @user.clear_spree_api_key!
- flash[:success] = Spree.t('api.key_cleared')
- end
- redirect_to spree.edit_admin_user_path(@user)
- end
-
- def model_class
- Spree.user_class
- end
-
- protected
-
- def collection
- return @collection if @collection.present?
-
- @collection = super
- @search = @collection.ransack(params[:q])
- @collection = @search.result.page(params[:page]).per(Spree::Backend::Config[:admin_users_per_page])
- end
-
- private
-
- def user_params
- params.require(:user).permit(permitted_user_attributes |
- [:use_billing,
- spree_role_ids: [],
- ship_address_attributes: permitted_address_attributes,
- bill_address_attributes: permitted_address_attributes])
- end
-
- # handling raise from Spree::Admin::ResourceController#destroy
- def user_destroy_with_orders_error
- invoke_callbacks(:destroy, :fails)
- render status: :forbidden, plain: Spree.t(:error_user_destroy_with_orders)
- end
-
- def sign_in_if_change_own_password
- if try_spree_current_user == @user && @user.password.present?
- sign_in(@user, event: :authentication, bypass: true)
- end
- end
- end
- end
-end
diff --git a/backend/app/controllers/spree/admin/variants_controller.rb b/backend/app/controllers/spree/admin/variants_controller.rb
deleted file mode 100644
index aa76413a3f..0000000000
--- a/backend/app/controllers/spree/admin/variants_controller.rb
+++ /dev/null
@@ -1,65 +0,0 @@
-module Spree
- module Admin
- class VariantsController < ResourceController
- include Spree::Admin::ProductConcern
-
- belongs_to 'spree/product', find_by: :slug
- new_action.before :new_before
- before_action :redirect_on_empty_option_values, only: [:new]
- before_action :load_data, only: [:new, :create, :edit, :update]
-
- # override the destroy method to set deleted_at value
- # instead of actually deleting the product.
- def destroy
- @variant = parent.variants.find(params[:id])
- if @variant.destroy
- flash[:success] = Spree.t('notice_messages.variant_deleted')
- else
- flash[:error] = Spree.t('notice_messages.variant_not_deleted', error: @variant.errors.full_messages.to_sentence)
- end
-
- respond_with(@variant) do |format|
- format.html { redirect_to spree.admin_product_variants_url(params[:product_id]) }
- format.js { render_js_for_destroy }
- end
- end
-
- protected
-
- def new_before
- master = @object.product.master
- @object.attributes = master.attributes.except(
- 'id', 'created_at', 'deleted_at', 'sku', 'is_master'
- )
-
- # Shallow Clone of the default price to populate the price field.
- @object.default_price = master.default_price.clone if master.default_price.present?
- end
-
- def collection
- return @collection if @collection.present?
-
- params[:q] ||= {}
- @deleted = params.dig(:q, :deleted_at_null) || '0'
-
- @collection = super
- @collection = @collection.deleted if @deleted == '1'
- # @search needs to be defined as this is passed to search_link
- @search = @collection.ransack(params[:q])
- @collection = @search.result.
- page(params[:page]).
- per(params[:per_page] || Spree::Backend::Config[:variants_per_page])
- end
-
- private
-
- def load_data
- @tax_categories = TaxCategory.order(:name)
- end
-
- def redirect_on_empty_option_values
- redirect_to spree.admin_product_variants_url(params[:product_id]) if @product.empty_option_values?
- end
- end
- end
-end
diff --git a/backend/app/controllers/spree/admin/variants_including_master_controller.rb b/backend/app/controllers/spree/admin/variants_including_master_controller.rb
deleted file mode 100644
index ac102ca644..0000000000
--- a/backend/app/controllers/spree/admin/variants_including_master_controller.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-module Spree
- module Admin
- class VariantsIncludingMasterController < VariantsController
- belongs_to 'spree/product', find_by: :slug
-
- def model_class
- Spree::Variant
- end
-
- def object_name
- 'variant'
- end
- end
- end
-end
diff --git a/backend/app/controllers/spree/admin/zones_controller.rb b/backend/app/controllers/spree/admin/zones_controller.rb
deleted file mode 100644
index 62f7be47e6..0000000000
--- a/backend/app/controllers/spree/admin/zones_controller.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-module Spree
- module Admin
- class ZonesController < ResourceController
- before_action :load_data, except: :index
-
- def new
- @zone.zone_members.build
- end
-
- protected
-
- def collection
- params[:q] ||= {}
- params[:q][:s] ||= 'name asc'
- @search = super.ransack(params[:q])
- @zones = @search.result.page(params[:page]).per(params[:per_page])
- end
-
- def load_data
- @countries = Country.order(:name)
- @states = State.order(:name)
- @zones = Zone.order(:name)
- end
- end
- end
-end
diff --git a/backend/app/helpers/spree/admin/adjustments_helper.rb b/backend/app/helpers/spree/admin/adjustments_helper.rb
deleted file mode 100644
index 847c39a975..0000000000
--- a/backend/app/helpers/spree/admin/adjustments_helper.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-module Spree
- module Admin
- module AdjustmentsHelper
- def display_adjustable(adjustable)
- case adjustable
- when Spree::LineItem
- display_line_item(adjustable)
- when Spree::Shipment
- display_shipment(adjustable)
- when Spree::Order
- display_order(adjustable)
- end
- end
-
- private
-
- def display_line_item(line_item)
- variant = line_item.variant
- parts = []
- parts << variant.product.name
- parts << "(#{variant.options_text})" if variant.options_text.present?
- parts << line_item.display_total
- safe_join(parts, '<br />'.html_safe)
- end
-
- def display_shipment(shipment)
- "#{Spree.t(:shipment)} ##{shipment.number}<br>#{shipment.display_cost}".html_safe
- end
-
- def display_order(_order)
- Spree.t(:order)
- end
- end
- end
-end
diff --git a/backend/app/helpers/spree/admin/base_helper.rb b/backend/app/helpers/spree/admin/base_helper.rb
deleted file mode 100644
index e7bc6d4ee6..0000000000
--- a/backend/app/helpers/spree/admin/base_helper.rb
+++ /dev/null
@@ -1,298 +0,0 @@
-module Spree
- module Admin
- module BaseHelper
- SELECT2_SUPPORTED_LOCALES = %w[
- af ar az bg bn bs ca cs da de dsb el en eo es et eu fa fi fr gl he
- hi hr hsb hu hy id is it ja ka km ko lt lv mk ms nb ne nl pa pl ps
- pt pt-BR ro ru sk sl sq sr sr-Cyrl sv th tk tr uk vi zh-CN zh-TW
- ].freeze
-
- FLATPICKR_SUPPORTED_LOCALES = %w[
- ar at az be bg bn bs cs cy da de eo es et fa fi fo fr ga gr he
- hi hr hu id is it ja ka km ko kz lv mk mn ms my nl no pa pl pt ro ru
- si sk sl sq sr sv th tr uk uz vn zh
- ].freeze
-
- def flash_alert(flash)
- if flash.present?
- type = flash.first[0]
- message = flash.first[1]
- content_tag(:span, message, class: 'd-none', data: { alert_type: type })
- end
- end
-
- def field_container(model, method, options = {}, &block)
- css_classes = options[:class].to_a
- css_classes << 'field'
- css_classes << 'withError' if error_message_on(model, method).present?
- content_tag(
- :div, capture(&block),
- options.merge(class: css_classes.join(' '), id: "#{model}_#{method}_field")
- )
- end
-
- # Returns Humanized Dropdown Values From a Constant In the Model
- # Pass the model name as a string and then a hash containing the constant name
- # and the option to paramatize the return value.
- #
- # Example:
- #
- # spree_humanize_dropdown_values('Spree::CmsPage', { const: 'TYPES' })
- # spree_humanize_dropdown_values('Spree::Menu', { const: 'MENU_TYPES', paramterize_values: true })
- #
- def spree_humanize_dropdown_values(model_name, options = {})
- formatted_option_values = []
-
- const = options[:const] || nil
- paramterize_values = options[:paramterize_values] || false
-
- return unless const.present?
-
- model_name.constantize.const_get(const).map do |type|
- return_value = if paramterize_values
- type.parameterize(separator: '_')
- else
- type
- end
-
- formatted_option_values << [spree_humanize_type(type), return_value]
- end
-
- formatted_option_values
- end
-
- def spree_humanize_type(obj)
- last_word = obj.split('::', 10).last
-
- if last_word.starts_with?('Cms')
- last_word.slice(3, 100).gsub(/(?<=[a-z])(?=[A-Z])/, ' ')
- else
- last_word.gsub(/(?<=[a-z])(?=[A-Z])/, ' ')
- end
- end
-
- def error_message_on(object, method, _options = {})
- object = convert_to_model(object)
- obj = object.respond_to?(:errors) ? object : instance_variable_get("@#{object}")
-
- if obj && obj.errors[method].present?
- errors = safe_join(obj.errors[method], '<br />'.html_safe)
- content_tag(:span, errors, class: 'formError')
- else
- ''
- end
- end
-
- def svg_icon(name:, classes: '', width:, height:)
- if name.ends_with?('.svg')
- icon_name = File.basename(name, File.extname(name))
- inline_svg_tag "backend-#{icon_name}.svg", class: "icon-#{icon_name} #{classes}", size: "#{width}px*#{height}px"
- else
- inline_svg_tag "backend-#{name}.svg", class: "icon-#{name} #{classes}", size: "#{width}px*#{height}px"
- end
- end
-
- def datepicker_field_value(date)
- unless date.blank?
- l(date, format: '%Y/%m/%d')
- end
- end
-
- def preference_field_tag(name, value, options)
- if options[:key] == :currency
- return select_tag(name,
- options_from_collection_for_select(supported_currencies_for_all_stores, :iso_code, :iso_code, value),
- class: 'select2')
- end
-
- case options[:type]
- when :integer
- text_field_tag(name, value, preference_field_options(options))
- when :boolean
- hidden_field_tag(name, 0, id: "#{name}_hidden") +
- check_box_tag(name, 1, value, preference_field_options(options))
- when :string
- text_field_tag(name, value, preference_field_options(options))
- when :password
- password_field_tag(name, value, preference_field_options(options))
- when :text
- text_area_tag(name, value, preference_field_options(options))
- else
- text_field_tag(name, value, preference_field_options(options))
- end
- end
-
- def preference_field_for(form, field, options)
- case options[:type]
- when :integer
- form.text_field(field, preference_field_options(options))
- when :boolean
- form.check_box(field, preference_field_options(options))
- when :string
- form.text_field(field, preference_field_options(options))
- when :password
- form.password_field(field, preference_field_options(options))
- when :text
- form.text_area(field, preference_field_options(options))
- else
- form.text_field(field, preference_field_options(options))
- end
- end
-
- def preference_field_options(options)
- field_options = case options[:type]
- when :integer
- {
- size: 10,
- class: 'input_integer form-control'
- }
- when :boolean
- {
- class: 'form-check-input'
- }
- when :string
- {
- size: 10,
- class: 'input_string form-control'
- }
- when :password
- {
- size: 10,
- class: 'password_string form-control'
- }
- when :text
- {
- rows: 15,
- cols: 85,
- class: 'form-control'
- }
- else
- {
- size: 10,
- class: 'input_string form-control'
- }
- end
-
- field_options.merge!(readonly: options[:readonly],
- disabled: options[:disabled],
- size: options[:size])
- end
-
- def preference_fields(object, form)
- return unless object.respond_to?(:preferences)
-
- fields = object.preferences.keys.map do |key|
- if object.has_preference?(key)
- case key
- when :currency
- content_tag(:div, form.label("preferred_#{key}", Spree.t(key)) +
- (form.select "preferred_#{key}", currency_options(object.preferences[key]), {}, { class: 'form-control select2' }),
- class: 'form-group', id: [object.class.to_s.parameterize, 'preference', key].join('-'))
- else
- if object.preference_type(key).to_sym == :boolean
- content_tag(:div, preference_field_for(form, "preferred_#{key}", type: object.preference_type(key)) +
- form.label("preferred_#{key}", Spree.t(key), class: 'form-check-label'),
- class: 'form-group form-check', id: [object.class.to_s.parameterize, 'preference', key].join('-'))
- else
- content_tag(:div, form.label("preferred_#{key}", Spree.t(key)) +
- preference_field_for(form, "preferred_#{key}", type: object.preference_type(key)),
- class: 'form-group', id: [object.class.to_s.parameterize, 'preference', key].join('-'))
- end
- end
- end
- end
- safe_join(fields)
- end
-
- # renders hidden field and link to remove record using nested_attributes
- def link_to_icon_remove_fields(form)
- url = form.object.persisted? ? [:admin, form.object] : '#'
- link_to_with_icon('delete.svg', '', url,
- class: 'spree_remove_fields btn btn-sm btn-danger',
- data: {
- action: 'remove'
- },
- title: Spree.t(:remove),
- no_text: true
- ) + form.hidden_field(:_destroy)
- end
-
- def spree_dom_id(record)
- dom_id(record, 'spree')
- end
-
- I18N_PLURAL_MANY_COUNT = 2.1
- def plural_resource_name(resource_class)
- resource_class.model_name.human(count: I18N_PLURAL_MANY_COUNT)
- end
-
- def order_time(time)
- return '' if time.blank?
-
- [I18n.l(time.to_date), time.strftime('%l:%M %p %Z').strip].join(' ')
- end
-
- def required_span_tag
- content_tag(:span, ' *', class: 'required font-weight-bold text-danger')
- end
-
- def product_preview_link(product)
- button_link_to(
- Spree.t(:preview_product),
- spree_storefront_resource_url(product),
- class: 'btn-outline-secondary', icon: 'view.svg', id: 'admin_preview_product', target: :blank
- )
- end
-
- def taxon_preview_link(taxon)
- button_link_to(
- Spree.t(:preview_taxon),
- spree_storefront_resource_url(taxon),
- class: 'btn-outline-secondary', icon: 'view.svg', id: 'admin_preview_taxon', target: :blank
- )
- end
-
- def admin_logout_link
- if defined?(admin_logout_path)
- admin_logout_path
- elsif defined?(spree_logout_path)
- spree_logout_path
- end
- end
-
- def select2_local_fallback
- stripped_locale = I18n.locale.to_s.split('-').first
-
- if ['zh-CN', 'zh-TW', 'sr-Cyrl', 'pt-BR'].include?(I18n.locale.to_s)
- I18n.locale
- elsif SELECT2_SUPPORTED_LOCALES.include? stripped_locale
- stripped_locale
- else
- 'en'
- end
- end
-
- def flatpickr_local_fallback
- stripped_locale = I18n.locale.to_s.split('-').first
-
- if I18n.locale.to_s == 'zh-TW'
- # Taiwanese is a popular language in Spree,
- # it has been well translated.
- 'zh-tw'
- elsif FLATPICKR_SUPPORTED_LOCALES.include? stripped_locale
- stripped_locale
- else
- 'default'
- end
- end
-
- def product_wysiwyg_editor_enabled?
- Spree::Backend::Config[:product_wysiwyg_editor_enabled]
- end
-
- def taxon_wysiwyg_editor_enabled?
- Spree::Backend::Config[:taxon_wysiwyg_editor_enabled]
- end
- end
- end
-end
diff --git a/backend/app/helpers/spree/admin/cms_helper.rb b/backend/app/helpers/spree/admin/cms_helper.rb
deleted file mode 100644
index a35735de84..0000000000
--- a/backend/app/helpers/spree/admin/cms_helper.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-module Spree
- module Admin
- module CmsHelper
- def cms_page_preview_url(page)
- page_localization = if page.locale == current_store.default_locale
- nil
- else
- page.locale
- end
-
- spree_storefront_resource_url(page, locale: page_localization)
- end
- end
- end
-end
diff --git a/backend/app/helpers/spree/admin/customer_returns_helper.rb b/backend/app/helpers/spree/admin/customer_returns_helper.rb
deleted file mode 100644
index ab43f242dc..0000000000
--- a/backend/app/helpers/spree/admin/customer_returns_helper.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-module Spree
- module Admin
- module CustomerReturnsHelper
- def reimbursement_types
- @reimbursement_types ||= Spree::ReimbursementType.accessible_by(current_ability).active
- end
- end
- end
-end
diff --git a/backend/app/helpers/spree/admin/images_helper.rb b/backend/app/helpers/spree/admin/images_helper.rb
deleted file mode 100644
index eed14efb91..0000000000
--- a/backend/app/helpers/spree/admin/images_helper.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-module Spree
- module Admin
- module ImagesHelper
- def options_text_for(image)
- if image.viewable.is_a?(Spree::Variant)
- if image.viewable.is_master?
- Spree.t(:all)
- else
- image.viewable.sku_and_options_text
- end
- else
- Spree.t(:all)
- end
- end
- end
- end
-end
diff --git a/backend/app/helpers/spree/admin/menu_helper.rb b/backend/app/helpers/spree/admin/menu_helper.rb
deleted file mode 100644
index 977b9b4434..0000000000
--- a/backend/app/helpers/spree/admin/menu_helper.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-module Spree
- module Admin
- module MenuHelper
- def menu_item_bar(menu, item)
- render 'spree/admin/menus/nested_menu_items/item_bar', menu: menu, item: item
- end
-
- def build_menu_item(menu, item)
- decendents = []
-
- unless item.leaf?
- item.children.each do |child_item|
- decendents << build_menu_item(menu, child_item) unless item.leaf?
- end
- end
-
- info_row = menu_item_bar(menu, item)
- menu_container = content_tag(:div, raw(decendents.join), class: 'menu-container', data: { parent_id: item.id })
-
- content_tag(:div, info_row + menu_container,
- class: 'menu-item menu-container-item dragable removable-dom-element',
- data: { item_id: item.id })
- end
-
- def default_menu_for_store?(menu)
- menu.store.default_locale == menu.locale
- end
- end
- end
-end
diff --git a/backend/app/helpers/spree/admin/navigation_helper.rb b/backend/app/helpers/spree/admin/navigation_helper.rb
deleted file mode 100644
index d3f4ff2dc5..0000000000
--- a/backend/app/helpers/spree/admin/navigation_helper.rb
+++ /dev/null
@@ -1,291 +0,0 @@
-module Spree
- module Admin
- module NavigationHelper
- # Makes an admin navigation tab (<li> tag) that links to a routing resource under /admin.
- # The arguments should be a list of symbolized controller names that will cause this tab to
- # be highlighted, with the first being the name of the resouce to link (uses URL helpers).
- #
- # Option hash may follow. Valid options are
- # * :label to override link text, otherwise based on the first resource name (translated)
- # * :route to override automatically determining the default route
- # * :match_path as an alternative way to control when the tab is active, /products would
- # match /admin/products, /admin/products/5/variants etc. Can be a String or a Regexp.
- # Controller names are ignored if :match_path is provided.
- #
- # Example:
- # # Link to /admin/orders, also highlight tab for ProductsController and ShipmentsController
- # tab :orders, :products, :shipments
-
- ICON_SIZE = 16
-
- def tab(*args)
- options = { label: args.first.to_s }
-
- # Return if resource is found and user is not allowed to :admin
- return '' if (klass = klass_for(options[:label])) && cannot?(:admin, klass)
-
- options = options.merge(args.pop) if args.last.is_a?(Hash)
- options[:route] ||= "admin_#{args.first}"
-
- destination_url = options[:url] || spree.send("#{options[:route]}_path")
- titleized_label = Spree.t(options[:label], default: options[:label], scope: [:admin, :tab]).titleize
-
- css_classes = ['sidebar-menu-item d-block w-100 position-relative']
-
- selected = if options[:match_path].is_a? Regexp
- request.fullpath =~ options[:match_path]
- elsif options[:match_path]
- request.fullpath.starts_with?("#{spree.admin_path}#{options[:match_path]}")
- else
- args.include?(controller.controller_name.to_sym)
- end
-
- link = if options[:icon]
- link_to_with_icon(
- options[:icon],
- titleized_label,
- destination_url,
- class: 'w-100 p-3 d-flex align-items-center'
- )
- else
- link_to(
- titleized_label,
- destination_url,
- class: "sidebar-submenu-item w-100 py-2 py-md-1 pl-3 d-block #{'text-success' if selected}"
- )
- end
-
- css_classes << 'selected' if selected
-
- css_classes << options[:css_class] if options[:css_class]
- content_tag('li', link, class: css_classes.join(' '))
- end
-
- # Single main menu item
- def main_menu_item(text, url: nil, icon: nil)
- link_to url, 'data-toggle': 'collapse', class: 'd-flex w-100 p-3 position-relative align-items-center' do
- if icon.ends_with?('.svg')
- svg_icon(name: icon, classes: 'mr-2', width: ICON_SIZE, height: ICON_SIZE) +
- content_tag(:span, " #{text}", class: 'text') +
- svg_icon(name: 'chevron-left.svg', classes: 'drop-menu-indicator position-absolute', width: (ICON_SIZE - 4), height: (ICON_SIZE - 4))
- else
- content_tag(:span, nil, class: "icon icon-#{icon} mr-2") +
- content_tag(:span, " #{text}", class: 'text') +
- svg_icon(name: 'chevron-left.svg', classes: 'drop-menu-indicator position-absolute', width: (ICON_SIZE - 4), height: (ICON_SIZE - 4))
- end
- end
- end
-
- # Main menu tree menu
- def main_menu_tree(text, icon: nil, sub_menu: nil, url: '#')
- content_tag :li, class: 'sidebar-menu-item d-block w-100' do
- main_menu_item(text, url: url, icon: icon) +
- render(partial: "spree/admin/shared/sub_menu/#{sub_menu}")
- end
- end
-
- # the per_page_dropdown is used on index pages like orders, products, promotions etc.
- # this method generates the select_tag
- def per_page_dropdown
- # there is a config setting for admin_products_per_page, only for the orders page
- if @products && per_page_default = Spree::Backend::Config.admin_products_per_page
- per_page_options = []
- 5.times do |amount|
- per_page_options << (amount + 1) * Spree::Backend::Config.admin_products_per_page
- end
- else
- per_page_default = Spree::Backend::Config.admin_orders_per_page
- per_page_options = %w{25 50 75}
- end
-
- selected_option = params[:per_page].try(:to_i) || per_page_default
-
- select_tag(:per_page,
- options_for_select(per_page_options, selected_option),
- class: "w-auto form-control js-per-page-select per-page-selected-#{selected_option} custom-select")
- end
-
- # helper method to create proper url to apply per page ing
- # fixes https://github.com/spree/spree/issues/6888
- def per_page_dropdown_params(args = nil)
- args = params.permit!.to_h.clone
- args.delete(:page)
- args.delete(:per_page)
- args
- end
-
- # finds class for a given symbol / string
- #
- # Example :
- # :products returns Spree::Product
- # :my_products returns MyProduct if MyProduct is defined
- # :my_products returns My::Product if My::Product is defined
- # if cannot constantize it returns nil
- # This will allow us to use cancan abilities on tab
- def klass_for(name)
- model_name = name.to_s
-
- ["Spree::#{model_name.classify}", model_name.classify, model_name.tr('_', '/').classify].find(&:safe_constantize).try(:safe_constantize)
- end
-
- def link_to_clone(resource, options = {})
- options[:data] = { action: 'clone', 'original-title': Spree.t(:clone) }
- options[:class] = 'btn btn-warning btn-sm with-tip'
- options[:method] = :post
- options[:icon] = 'clone.svg'
- button_link_to '', clone_object_url(resource), options
- end
-
- def link_to_clone_promotion(promotion, options = {})
- options[:data] = { action: 'clone', 'original-title': Spree.t(:clone) }
- options[:class] = 'btn btn-warning btn-sm with-tip'
- options[:method] = :post
- options[:icon] = 'clone.svg'
- button_link_to '', clone_admin_promotion_path(promotion), options
- end
-
- def link_to_edit(resource, options = {})
- url = options[:url] || edit_object_url(resource)
- options[:data] = { action: 'edit' }
- options[:class] = 'btn btn-primary btn-sm'
- link_to_with_icon('edit.svg', Spree.t(:edit), url, options)
- end
-
- def link_to_edit_url(url, options = {})
- options[:data] = { action: 'edit' }
- options[:class] = 'btn btn-primary btn-sm'
- link_to_with_icon('edit.svg', Spree.t(:edit), url, options)
- end
-
- def link_to_delete(resource, options = {})
- url = options[:url] || object_url(resource)
- name = options[:name] || Spree.t(:delete)
- options[:class] = 'btn btn-danger btn-sm delete-resource'
- options[:data] = { confirm: Spree.t(:are_you_sure), action: 'remove' }
- link_to_with_icon 'delete.svg', name, url, options
- end
-
- def link_to_with_icon(icon_name, text, url, options = {})
- options[:class] = (options[:class].to_s + " icon-link with-tip action-#{icon_name}").strip
- options[:title] = text if options[:no_text]
- text = options[:no_text] ? '' : content_tag(:span, text, class: 'text')
- options.delete(:no_text)
- if icon_name
- icon = if icon_name.ends_with?('.svg')
- svg_icon(name: icon_name, classes: "#{'mr-2' unless text.empty?} icon icon-#{icon_name}", width: ICON_SIZE, height: ICON_SIZE)
- else
- content_tag(:span, '', class: "#{'mr-2' unless text.empty?} icon icon-#{icon_name}")
- end
- text = "#{icon} #{text}"
- end
- link_to(text.html_safe, url, options)
- end
-
- def spree_icon(icon_name)
- if icon_name.ends_with?('.svg')
- icon_name ? svg_icon(name: icon_name, classes: icon_name, width: ICON_SIZE, height: ICON_SIZE) : ''
- else
- icon_name ? content_tag(:span, '', class: icon_name) : ''
- end
- end
-
- # Override: Add disable_with option to prevent multiple request on consecutive clicks
- def button(text, icon_name = nil, button_type = 'submit', options = {})
- if icon_name
- icon = if icon_name.ends_with?('.svg')
- svg_icon(name: icon_name, classes: "icon icon-#{icon_name}", width: ICON_SIZE, height: ICON_SIZE)
- else
- content_tag(:span, '', class: "icon icon-#{icon_name}")
- end
- text = "#{icon} #{text}"
- end
- button_tag(
- text.html_safe,
- options.merge(
- type: button_type,
- class: "btn btn-primary #{options[:class]}",
- 'data-disable-with' => "#{Spree.t(:saving)}..."
- )
- )
- end
-
- def button_link_to(text, url, html_options = {})
- if html_options[:method] &&
- !html_options[:method].to_s.casecmp('get').zero? &&
- !html_options[:remote]
- form_tag(url, method: html_options.delete(:method)) do
- button(text, html_options.delete(:icon), nil, html_options)
- end
- else
- if html_options['data-update'].nil? && html_options[:remote]
- object_name, action = url.split('/')[-2..-1]
- html_options['data-update'] = [action, object_name.singularize].join('_')
- end
-
- html_options.delete('data-update') unless html_options['data-update']
-
- html_options[:class] = html_options[:class] ? "btn #{html_options[:class]}" : 'btn btn-outline-secondary'
-
- if html_options[:icon]
- icon = if html_options[:icon].ends_with?('.svg')
- svg_icon(name: html_options[:icon], classes: "icon icon-#{html_options[:icon]}", width: ICON_SIZE, height: ICON_SIZE)
- else
- content_tag(:span, '', class: "icon icon-#{html_options[:icon]}")
- end
- text = "#{icon} #{text}"
- end
-
- link_to(text.html_safe, url, html_options.except(:icon))
- end
- end
-
- def configurations_sidebar_menu_item(link_text, url, options = {})
- is_selected = url.ends_with?(controller.controller_name) ||
- url.ends_with?("#{controller.controller_name}/edit") ||
- url.ends_with?("#{controller.controller_name.singularize}/edit")
-
- options[:class] = 'sidebar-menu-item d-block w-100'
- options[:class] << ' selected' if is_selected
- content_tag(:li, options) do
- link_to(link_text, url, class: "#{'text-success' if is_selected} sidebar-submenu-item w-100 py-2 py-md-1 pl-3 d-block")
- end
- end
-
- def active_badge(condition, options = {})
- label = options[:label]
- label ||= condition ? Spree.t(:say_yes) : Spree.t(:say_no)
- css_class = condition ? 'badge-active' : 'badge-inactive'
-
- content_tag(:strong, class: "badge #{css_class} text-uppercase") do
- label
- end
- end
-
- def main_part_classes
- if cookies['sidebar-minimized'] == 'true'
- 'col-12 sidebar-collapsed'
- else
- 'col-9 offset-3 col-md-10 offset-md-2'
- end
- end
-
- def main_sidebar_classes
- ActiveSupport::Deprecation.warn(<<-DEPRECATION, caller)
- Admin::NavigationsHelper#main_sidebar_classes is deprecated and will be removed in Spree 5.0.
- DEPRECATION
- if cookies['sidebar-minimized'] == 'true'
- 'col-3 col-md-2 sidebar'
- else
- 'p-0 col-3 col-md-2 sidebar'
- end
- end
-
- def wrapper_classes
- ActiveSupport::Deprecation.warn(<<-DEPRECATION, caller)
- Admin::NavigationsHelper#wrapper_classes is deprecated and will be removed in Spree 5.0.
- DEPRECATION
- 'sidebar-minimized' if cookies['sidebar-minimized'] == 'true'
- end
- end
- end
-end
diff --git a/backend/app/helpers/spree/admin/orders_helper.rb b/backend/app/helpers/spree/admin/orders_helper.rb
deleted file mode 100644
index e9db03b439..0000000000
--- a/backend/app/helpers/spree/admin/orders_helper.rb
+++ /dev/null
@@ -1,69 +0,0 @@
-module Spree
- module Admin
- module OrdersHelper
- # Renders all the extension partials that may have been specified in the extensions
- def event_links(order, events)
- links = []
- events.each do |event|
- next unless order.send("can_#{event}?")
-
- label = Spree.t(event, scope: 'admin.order.events', default: Spree.t(event))
- links << button_link_to(
- label.capitalize,
- [event.to_sym, :admin, order],
- method: :put,
- icon: event.to_s + '.svg',
- data: { confirm: Spree.t(:order_sure_want_to, event: label) }
- )
- end
- safe_join(links, ''.html_safe)
- end
-
- def line_item_shipment_price(line_item, quantity)
- Spree::Money.new(line_item.price * quantity, currency: line_item.currency)
- end
-
- def avs_response_code
- {
- 'A' => 'Street address matches, but 5-digit and 9-digit postal code do not match.',
- 'B' => 'Street address matches, but postal code not verified.',
- 'C' => 'Street address and postal code do not match.',
- 'D' => 'Street address and postal code match. ',
- 'E' => 'AVS data is invalid or AVS is not allowed for this card type.',
- 'F' => "Card member's name does not match, but billing postal code matches.",
- 'G' => 'Non-U.S. issuing bank does not support AVS.',
- 'H' => "Card member's name does not match. Street address and postal code match.",
- 'I' => 'Address not verified.',
- 'J' => "Card member's name, billing address, and postal code match.",
- 'K' => "Card member's name matches but billing address and billing postal code do not match.",
- 'L' => "Card member's name and billing postal code match, but billing address does not match.",
- 'M' => 'Street address and postal code match. ',
- 'N' => 'Street address and postal code do not match.',
- 'O' => "Card member's name and billing address match, but billing postal code does not match.",
- 'P' => 'Postal code matches, but street address not verified.',
- 'Q' => "Card member's name, billing address, and postal code match.",
- 'R' => 'System unavailable.',
- 'S' => 'Bank does not support AVS.',
- 'T' => "Card member's name does not match, but street address matches.",
- 'U' => 'Address information unavailable. Returned if the U.S. bank does not support non-U.S. AVS or if the AVS in a U.S. bank is not functioning properly.',
- 'V' => "Card member's name, billing address, and billing postal code match.",
- 'W' => 'Street address does not match, but 9-digit postal code matches.',
- 'X' => 'Street address and 9-digit postal code match.',
- 'Y' => 'Street address and 5-digit postal code match.',
- 'Z' => 'Street address does not match, but 5-digit postal code matches.'
- }
- end
-
- def cvv_response_code
- {
- 'M' => 'CVV2 Match',
- 'N' => 'CVV2 No Match',
- 'P' => 'Not Processed',
- 'S' => 'Issuer indicates that CVV2 data should be present on the card, but the merchant has indicated data is not present on the card',
- 'U' => 'Issuer has not certified for CVV2 or Issuer has not provided Visa with the CVV2 encryption keys',
- '' => 'Transaction failed because wrong CVV2 number was entered or no CVV2 number was entered'
- }
- end
- end
- end
-end
diff --git a/backend/app/helpers/spree/admin/payments_helper.rb b/backend/app/helpers/spree/admin/payments_helper.rb
deleted file mode 100644
index 8b310e9055..0000000000
--- a/backend/app/helpers/spree/admin/payments_helper.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-module Spree
- module Admin
- module PaymentsHelper
- def payment_method_name(payment)
- payment_method = payment.payment_method
-
- link_to payment_method.name, spree.edit_admin_payment_method_path(payment_method)
- end
- end
- end
-end
diff --git a/backend/app/helpers/spree/admin/promotion_rules_helper.rb b/backend/app/helpers/spree/admin/promotion_rules_helper.rb
deleted file mode 100644
index 9172530041..0000000000
--- a/backend/app/helpers/spree/admin/promotion_rules_helper.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-module Spree
- module Admin
- module PromotionRulesHelper
- def options_for_promotion_rule_types(promotion)
- existing = promotion.rules.map { |rule| rule.class.name }
- rule_names = Rails.application.config.spree.promotions.rules.map(&:name).reject { |r| existing.include? r }
- options = rule_names.map { |name| [Spree.t("promotion_rule_types.#{name.demodulize.underscore}.name"), name] }
- options_for_select(options)
- end
- end
- end
-end
diff --git a/backend/app/helpers/spree/admin/reimbursement_type_helper.rb b/backend/app/helpers/spree/admin/reimbursement_type_helper.rb
deleted file mode 100644
index 43ddab201f..0000000000
--- a/backend/app/helpers/spree/admin/reimbursement_type_helper.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-module Spree
- module Admin
- module ReimbursementTypeHelper
- def reimbursement_type_name(reimbursement_type)
- reimbursement_type.present? ? reimbursement_type.name.humanize : ''
- end
- end
- end
-end
diff --git a/backend/app/helpers/spree/admin/reimbursements_helper.rb b/backend/app/helpers/spree/admin/reimbursements_helper.rb
deleted file mode 100644
index 99890c933e..0000000000
--- a/backend/app/helpers/spree/admin/reimbursements_helper.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-module Spree
- module Admin
- module ReimbursementsHelper
- def reimbursement_status_color(reimbursement)
- case reimbursement.reimbursement_status
- when 'reimbursed' then 'success'
- when 'pending' then 'notice'
- when 'errored' then 'error'
- else raise "unknown reimbursement status: #{reimbursement.reimbursement_status}"
- end
- end
- end
- end
-end
diff --git a/backend/app/helpers/spree/admin/stock_locations_helper.rb b/backend/app/helpers/spree/admin/stock_locations_helper.rb
deleted file mode 100644
index 0dd4a27161..0000000000
--- a/backend/app/helpers/spree/admin/stock_locations_helper.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-module Spree
- module Admin
- module StockLocationsHelper
- def display_name(stock_location)
- name_parts = [stock_location.admin_name, stock_location.name]
- name_parts.delete_if(&:blank?)
- name_parts.join(' / ')
- end
-
- def state(stock_location)
- stock_location.active? ? 'active' : 'inactive'
- end
- end
- end
-end
diff --git a/backend/app/helpers/spree/admin/stock_movements_helper.rb b/backend/app/helpers/spree/admin/stock_movements_helper.rb
deleted file mode 100644
index bb89661f39..0000000000
--- a/backend/app/helpers/spree/admin/stock_movements_helper.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-module Spree
- module Admin
- module StockMovementsHelper
- def pretty_originator(stock_movement)
- if stock_movement.originator.respond_to?(:number)
- if stock_movement.originator.respond_to?(:order)
- link_to stock_movement.originator.number, [:edit, :admin, stock_movement.originator.order]
- elsif stock_movement.originator.is_a?(Spree::StockTransfer)
- link_to stock_movement.originator.number, spree.admin_stock_transfer_url(stock_movement.originator)
- else
- stock_movement.originator.number
- end
- else
- ''
- end
- end
-
- def display_variant(stock_movement)
- variant = stock_movement.stock_item.variant
- output = [variant.name]
- output << variant.options_text unless variant.options_text.blank?
- safe_join(output, '<br />'.html_safe)
- end
- end
- end
-end
diff --git a/backend/app/helpers/spree/admin/stores_helper.rb b/backend/app/helpers/spree/admin/stores_helper.rb
deleted file mode 100644
index 0efc3705df..0000000000
--- a/backend/app/helpers/spree/admin/stores_helper.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-module Spree
- module Admin
- module StoresHelper
- def selected_checkout_zone(store)
- store&.checkout_zone || Spree::Zone.default_checkout_zone
- end
-
- def stores_dropdown_values
- formatted_stores = []
-
- @stores.map { |store| formatted_stores << [store.unique_name, store.id] }
-
- formatted_stores
- end
-
- def store_switcher_link(store)
- if current_store.id == store.id
- classes = 'disabled bg-light'
- icon = svg_icon name: 'circle-fill.svg', width: '18', height: '18'
- else
- classes = nil
- icon = svg_icon name: 'circle.svg', width: '18', height: '18'
- end
-
- link_to icon + store.unique_name, url_for(host: store.formatted_url),
- class: "#{classes} text-dark p-3 dropdown-item", id: store.code
- end
- end
- end
-end
diff --git a/backend/app/helpers/spree/admin/taxons_helper.rb b/backend/app/helpers/spree/admin/taxons_helper.rb
deleted file mode 100644
index c9a8ebe8b4..0000000000
--- a/backend/app/helpers/spree/admin/taxons_helper.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-module Spree
- module Admin
- module TaxonsHelper
- def taxon_path(taxon)
- taxon.ancestors.reverse.collect(&:name).join(' >> ')
- end
- end
- end
-end
diff --git a/backend/app/models/spree/admin/resource.rb b/backend/app/models/spree/admin/resource.rb
deleted file mode 100644
index e31a0c528f..0000000000
--- a/backend/app/models/spree/admin/resource.rb
+++ /dev/null
@@ -1,36 +0,0 @@
-module Spree
- module Admin
- class Resource
- def initialize(controller_path, controller_name, parent_model, object_name = nil)
- @controller_path = controller_path
- @controller_name = controller_name
- @parent_model = parent_model
- @object_name = object_name
- end
-
- def sub_namespace_parts
- @controller_path.split('/')[2..-2]
- end
-
- def model_class
- sub_namespace = sub_namespace_parts.map(&:capitalize).join('::')
- sub_namespace = "#{sub_namespace}::" unless sub_namespace.empty?
- "Spree::#{sub_namespace}#{@controller_name.classify}".constantize
- end
-
- def model_name
- sub_namespace = sub_namespace_parts.join('/')
- sub_namespace = "#{sub_namespace}/" unless sub_namespace.empty?
- @parent_model.gsub("spree/#{sub_namespace}", '')
- end
-
- def object_name
- return @object_name if @object_name
-
- sub_namespace = sub_namespace_parts.join('_')
- sub_namespace = "#{sub_namespace}_" unless sub_namespace.empty?
- "#{sub_namespace}#{@controller_name.singularize}"
- end
- end
- end
-end
diff --git a/backend/app/models/spree/backend_configuration.rb b/backend/app/models/spree/backend_configuration.rb
deleted file mode 100644
index 0d684fdbc7..0000000000
--- a/backend/app/models/spree/backend_configuration.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-module Spree
- class BackendConfiguration < Preferences::Configuration
- preference :admin_path, :string, default: '/admin'
- preference :admin_products_per_page, :integer, default: Kaminari.config.default_per_page
- preference :admin_orders_per_page, :integer, default: Kaminari.config.default_per_page
- preference :admin_properties_per_page, :integer, default: Kaminari.config.default_per_page
- preference :admin_promotions_per_page, :integer, default: Kaminari.config.default_per_page
- preference :admin_customer_returns_per_page, :integer, default: Kaminari.config.default_per_page
- preference :admin_users_per_page, :integer, default: Kaminari.config.default_per_page
- preference :admin_show_version, :boolean, default: true
- preference :locale, :string, default: Rails.application.config.i18n.default_locale
- preference :variants_per_page, :integer, default: Kaminari.config.default_per_page
- preference :menus_per_page, :integer, default: Kaminari.config.default_per_page
- preference :product_wysiwyg_editor_enabled, :boolean, default: true
- preference :taxon_wysiwyg_editor_enabled, :boolean, default: true
- preference :show_only_complete_orders_by_default, :boolean, default: true
-
- ORDER_TABS ||= [:orders, :payments, :creditcard_payments,
- :shipments, :credit_cards, :return_authorizations,
- :customer_returns, :adjustments, :customer_details]
- PRODUCT_TABS ||= [:products, :option_types, :properties, :prototypes,
- :variants, :product_properties, :taxonomies,
- :taxons]
- REPORT_TABS ||= [:reports]
- CONFIGURATION_TABS ||= [:configurations, :general_settings, :tax_categories,
- :tax_rates, :zones, :countries, :states,
- :payment_methods, :shipping_methods,
- :shipping_categories, :stock_transfers,
- :stock_locations, :trackers, :refund_reasons,
- :reimbursement_types, :return_authorization_reasons,
- :stores]
- PROMOTION_TABS ||= [:promotions, :promotion_categories]
- USER_TABS ||= [:users]
- end
-end
diff --git a/backend/app/views/kaminari/admin-twitter-bootstrap-4/_first_page.html.erb b/backend/app/views/kaminari/admin-twitter-bootstrap-4/_first_page.html.erb
deleted file mode 100644
index e59086b17f..0000000000
--- a/backend/app/views/kaminari/admin-twitter-bootstrap-4/_first_page.html.erb
+++ /dev/null
@@ -1,13 +0,0 @@
-<%# Link to the "First" page
- - available local variables
- url: url to the first page
- current_page: a page object for the currently displayed page
- total_pages: total number of pages
- per_page: number of items to fetch per page
- remote: data-remote -%>
-
-<% unless current_page.first? %>
- <li class="first page-item">
- <%= link_to_unless current_page.first?, svg_icon(name: "double-chevron-left.svg", width: '13', height: '16', classes: 'spree-icon-arrow-left mb-0'), url, remote: remote, class: 'page-link', 'aria-label': 'First page' %>
- </li>
-<% end %>
diff --git a/backend/app/views/kaminari/admin-twitter-bootstrap-4/_gap.html.erb b/backend/app/views/kaminari/admin-twitter-bootstrap-4/_gap.html.erb
deleted file mode 100644
index a7f00c7d12..0000000000
--- a/backend/app/views/kaminari/admin-twitter-bootstrap-4/_gap.html.erb
+++ /dev/null
@@ -1,12 +0,0 @@
-<%# Non-link tag that stands for skipped pages...
- - available local variables
- current_page: a page object for the currently displayed page
- total_pages: total number of pages
- per_page: number of items to fetch per page
- remote: data-remote -%>
-
-<li class="page gap disabled page-item d-none d-lg-flex">
- <a href="#" onclick="return false;" class="page-link">
- <%= raw(t 'views.pagination.truncate') %>
- </a>
-</li>
diff --git a/backend/app/views/kaminari/admin-twitter-bootstrap-4/_last_page.html.erb b/backend/app/views/kaminari/admin-twitter-bootstrap-4/_last_page.html.erb
deleted file mode 100644
index 3b56140331..0000000000
--- a/backend/app/views/kaminari/admin-twitter-bootstrap-4/_last_page.html.erb
+++ /dev/null
@@ -1,13 +0,0 @@
-<%# Link to the "Last" page
- - available local variables
- url: url to the last page
- current_page: a page object for the currently displayed page
- total_pages: total number of pages
- per_page: number of items to fetch per page
- remote: data-remote -%>
-
-<% unless current_page.last? %>
- <li class="last next page-item"><%# "next" class present for border styling in twitter bootstrap %>
- <%= link_to_unless current_page.last?, svg_icon(name: "double-chevron-right.svg", width: '13', height: '16', classes: 'spree-icon-arrow-right mb-0'), url, remote: remote, class: 'page-link', 'aria-label': 'Last page' %>
- </li>
-<% end %>
diff --git a/backend/app/views/kaminari/admin-twitter-bootstrap-4/_next_page.html.erb b/backend/app/views/kaminari/admin-twitter-bootstrap-4/_next_page.html.erb
deleted file mode 100644
index c4fb9882ec..0000000000
--- a/backend/app/views/kaminari/admin-twitter-bootstrap-4/_next_page.html.erb
+++ /dev/null
@@ -1,13 +0,0 @@
-<%# Link to the "Next" page
- - available local variables
- url: url to the next page
- current_page: a page object for the currently displayed page
- total_pages: total number of pages
- per_page: number of items to fetch per page
- remote: data-remote -%>
-
-<% unless current_page.last? %>
- <li class="next_page page-item">
- <%= link_to_unless current_page.last?, svg_icon(name: "chevron-right.svg", width: '13', height: '16', classes: 'spree-icon-arrow-right mb-0'), url, rel: 'next', remote: remote, class: 'page-link', 'aria-label': 'Next page' %>
- </li>
-<% end %>
diff --git a/backend/app/views/kaminari/admin-twitter-bootstrap-4/_page.html.erb b/backend/app/views/kaminari/admin-twitter-bootstrap-4/_page.html.erb
deleted file mode 100644
index a5d6ef1821..0000000000
--- a/backend/app/views/kaminari/admin-twitter-bootstrap-4/_page.html.erb
+++ /dev/null
@@ -1,18 +0,0 @@
-<%# Link showing page number
- - available local variables
- page: a page object for "this" page
- url: url to this page
- current_page: a page object for the currently displayed page
- total_pages: total number of pages
- per_page: number of items to fetch per page
- remote: data-remote -%>
-
-<li class="page<%= ' active' if page.current? %> page-item">
- <%= link_to page,
- url,
- opts = {
- remote: remote,
- rel: page.next? ? 'next' : page.prev? ? 'prev' : nil,
- class: 'page-link'
- } %>
-</li>
diff --git a/backend/app/views/kaminari/admin-twitter-bootstrap-4/_paginator.html.erb b/backend/app/views/kaminari/admin-twitter-bootstrap-4/_paginator.html.erb
deleted file mode 100644
index 61a9735f0d..0000000000
--- a/backend/app/views/kaminari/admin-twitter-bootstrap-4/_paginator.html.erb
+++ /dev/null
@@ -1,25 +0,0 @@
-<%# The container tag
- - available local variables
- current_page: a page object for the currently displayed page
- total_pages: total number of pages
- per_page: number of items to fetch per page
- remote: data-remote
- paginator: the paginator that renders the pagination tags inside -%>
-
-<% pagination_class ||= '' %>
-
-<%= paginator.render do %>
- <ul class="pagination d-inline-flex <%= pagination_class %>">
- <%= first_page_tag unless current_page.first? %>
- <%= prev_page_tag unless current_page.first? %>
- <% each_page do |page| %>
- <% if page.left_outer? || page.right_outer? || page.inside_window? %>
- <%= page_tag page %>
- <% elsif !page.was_truncated? %>
- <%= gap_tag %>
- <% end %>
- <% end %>
- <%= next_page_tag unless current_page.last? %>
- <%= last_page_tag unless current_page.last? %>
- </ul>
-<% end %>
diff --git a/backend/app/views/kaminari/admin-twitter-bootstrap-4/_prev_page.html.erb b/backend/app/views/kaminari/admin-twitter-bootstrap-4/_prev_page.html.erb
deleted file mode 100644
index 0512c58066..0000000000
--- a/backend/app/views/kaminari/admin-twitter-bootstrap-4/_prev_page.html.erb
+++ /dev/null
@@ -1,13 +0,0 @@
-<%# Link to the "Previous" page
- - available local variables
- url: url to the previous page
- current_page: a page object for the currently displayed page
- total_pages: total number of pages
- per_page: number of items to fetch per page
- remote: data-remote -%>
-
-<% unless current_page.first? %>
- <li class="prev page-item">
- <%= link_to_unless current_page.first?, svg_icon(name: "chevron-left.svg", width: '13', height: '16', classes: 'spree-icon-arrow-left mb-0'), url, rel: 'prev', remote: remote, class: 'page-link', 'aria-label': 'Previous page' %>
- </li>
-<% end %>
diff --git a/backend/app/views/spree/admin/adjustments/_adjustment.html.erb b/backend/app/views/spree/admin/adjustments/_adjustment.html.erb
deleted file mode 100644
index 0f585ce19a..0000000000
--- a/backend/app/views/spree/admin/adjustments/_adjustment.html.erb
+++ /dev/null
@@ -1,29 +0,0 @@
-<%
- @edit_url = edit_admin_order_adjustment_path(@order, adjustment)
- @delete_url = admin_order_adjustment_path(@order, adjustment)
-%>
-
-<tr id="<%= spree_dom_id(adjustment) %>" class="<%= adjustment.eligible? ? 'eligible' : 'ineligible' %>" data-hook="adjustment_row">
- <td>
- <%= display_adjustable(adjustment.adjustable) %>
- </td>
- <td>
- <%= adjustment.label %>
- </td>
- <td class="text-center">
- <%= adjustment.display_amount.to_html %>
- </td>
- <td class="text-center">
- <span class="text-lowercase badge badge-<%= adjustment.state %>">
- <%= Spree.t("state_machine_states.#{adjustment.state}") %>
- </span>
- </td>
- <td class="actions">
- <span class="d-flex justify-content-center">
- <% if adjustment.open? %>
- <%= link_to_edit(adjustment, no_text: true) if can?(:edit, adjustment) %>
- <%= link_to_delete(adjustment, no_text: true) if can?(:delete, adjustment) %>
- <% end %>
- </span>
- </td>
-</tr>
diff --git a/backend/app/views/spree/admin/adjustments/_adjustments_table.html.erb b/backend/app/views/spree/admin/adjustments/_adjustments_table.html.erb
deleted file mode 100644
index 6c371f151f..0000000000
--- a/backend/app/views/spree/admin/adjustments/_adjustments_table.html.erb
+++ /dev/null
@@ -1,31 +0,0 @@
-<div class="card-header">
- <h3 class="card-title mb-0 h5"><%= Spree.t(:order_adjustments) %></h3>
-</div>
-<div class="table-responsive">
- <table class="table table-bordered adjustments" data-hook="adjustments">
- <thead data-hook="adjustmment_head">
- <tr>
- <th><%= Spree.t(:adjustable) %></th>
- <th><%= Spree.t(:description) %></th>
- <th class="text-center"><%= Spree.t(:amount) %></th>
- <th class="text-center"><%= Spree.t(:status) %></th>
- <th class="actions"></th>
- </tr>
- </thead>
- <tbody>
- <%= render partial: "adjustment", collection: @adjustments %>
- </tbody>
- </table>
-</div>
-<% if can?(:edit, Spree::Adjustment) %>
- <div class="card-footer">
- <div class="row text-center pb-0">
- <div class="col-12 col-lg-6">
- <%= button_to Spree.t(:open_all_adjustments), open_adjustments_admin_order_path(@order), method: :get, class: "btn btn-success" %>
- </div>
- <div class="col-12 col-lg-6">
- <%= button_to Spree.t(:close_all_adjustments), close_adjustments_admin_order_path(@order), method: :get, class: "btn btn-danger" %>
- </div>
- </div>
- </div>
-<% end %>
diff --git a/backend/app/views/spree/admin/adjustments/_form.html.erb b/backend/app/views/spree/admin/adjustments/_form.html.erb
deleted file mode 100644
index 23057edd38..0000000000
--- a/backend/app/views/spree/admin/adjustments/_form.html.erb
+++ /dev/null
@@ -1,12 +0,0 @@
-<div data-hook="admin_adjustment_form_fields">
- <%= f.field_container :amount, class: ['form-group'] do %>
- <%= f.label :amount, raw(Spree.t(:amount) + required_span_tag) %>
- <%= text_field :adjustment, :amount, class: 'form-control' %>
- <%= f.error_message_on :amount %>
- <% end %>
- <%= f.field_container :label, class: ['form-group'] do %>
- <%= f.label :label, raw(Spree.t(:description) + required_span_tag) %>
- <%= text_field :adjustment, :label, class: 'form-control' %>
- <%= f.error_message_on :label %>
- <% end %>
-</div>
diff --git a/backend/app/views/spree/admin/adjustments/edit.html.erb b/backend/app/views/spree/admin/adjustments/edit.html.erb
deleted file mode 100644
index df399e909e..0000000000
--- a/backend/app/views/spree/admin/adjustments/edit.html.erb
+++ /dev/null
@@ -1,19 +0,0 @@
-<%= render partial: 'spree/admin/shared/order_tabs', locals: { current: :adjustments } %>
-
-<% content_for :page_title do %>
- / <%= Spree.t(:edit) %> <%= Spree.t(:adjustment) %>
-<% end %>
-
-<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @adjustment } %>
-
-<%= form_for @adjustment, url: admin_order_adjustment_path(@order, @adjustment), method: :put do |f| %>
- <fieldset>
- <%= render partial: 'form', locals: { f: f } %>
-
- <div class="form-actions" data-hook="buttons">
- <%= button Spree.t(:continue), 'save.svg' %>
- <span class="or"><%= Spree.t(:or) %></span>
- <%= button_link_to Spree.t('actions.cancel'), spree.admin_order_adjustments_url(@order), icon: 'cancel.svg' %>
- </div>
- </fieldset>
-<% end %>
diff --git a/backend/app/views/spree/admin/adjustments/index.html.erb b/backend/app/views/spree/admin/adjustments/index.html.erb
deleted file mode 100644
index 29f09a8b80..0000000000
--- a/backend/app/views/spree/admin/adjustments/index.html.erb
+++ /dev/null
@@ -1,36 +0,0 @@
-<%= render partial: 'spree/admin/shared/order_tabs', locals: { current: :adjustments} %>
-
-<% content_for :page_title do %>
- / <%= Spree.t(:adjustments) %>
-<% end %>
-
-<% content_for :page_actions do %>
- <%= button_link_to(Spree.t(:new_adjustment), new_admin_order_adjustment_url(@order), class: "btn-success", icon: 'add.svg') if can? :create, Spree::Adjustment %>
-<% end %>
-
-<% if @adjustments.present? %>
- <div class="card mb-3">
- <%= render partial: 'adjustments_table' %>
- </div>
-<% else %>
- <div class="alert alert-warning">
- <%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree::Adjustment)) %>
- </div>
-<% end %>
-
-<% if @order.can_add_coupon? %>
- <div class="card bg-light mb-3" data-hook="adjustments_new_coupon_code">
- <div class="card-body">
- <div class="form-group">
- <%= text_field_tag "coupon_code", "", placeholder: Spree.t(:coupon_code), class: "form-control" %>
- </div>
- <%= button Spree.t(:add_coupon_code), 'add.svg', 'submit', id: "add_coupon_code" %>
- </div>
- </div>
-<% end %>
-
-<script>
- var order_number = '<%= @order.number %>';
-</script>
-
-<%= render partial: 'spree/admin/shared/order_summary' %>
diff --git a/backend/app/views/spree/admin/adjustments/new.html.erb b/backend/app/views/spree/admin/adjustments/new.html.erb
deleted file mode 100644
index 113fc9d587..0000000000
--- a/backend/app/views/spree/admin/adjustments/new.html.erb
+++ /dev/null
@@ -1,19 +0,0 @@
-<%= render partial: 'spree/admin/shared/order_tabs', locals: { current: :adjustments } %>
-
-<% content_for :page_title do %>
- / <%= Spree.t(:new_adjustment) %>
-<% end %>
-
-<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @adjustment } %>
-
-<%= form_for @adjustment, url: admin_order_adjustments_path do |f| %>
- <fieldset>
- <%= render partial: 'form', locals: { f: f } %>
-
- <div class="form-actions" data-hook="buttons">
- <%= button Spree.t(:continue), 'save' %>
- <span class="or"><%= Spree.t(:or) %></span>
- <%= button_link_to Spree.t('actions.cancel'), spree.admin_order_adjustments_url(@order), icon: 'cancel' %>
- </div>
- </fieldset>
-<% end %>
diff --git a/backend/app/views/spree/admin/cms_pages/_form.html.erb b/backend/app/views/spree/admin/cms_pages/_form.html.erb
deleted file mode 100644
index a56020da6d..0000000000
--- a/backend/app/views/spree/admin/cms_pages/_form.html.erb
+++ /dev/null
@@ -1,135 +0,0 @@
-<div id="<% if @cms_page.type == 'Spree::Cms::Pages::StandardPage' %>standardPage<% end %>" data-hook="admin_page_form_fields">
- <div class="row sp-pb-0">
- <div class="col-12">
- <div class="card sp-card">
- <% unless %w[new create].include? controller.action_name %>
- <div class="card-header col-12">
- <div class="row no-gutters pb-0">
- <div class="col d-flex justify-content-start align-items-center">
- <%= f.field_container :visible, class: ['form-group pb-0 mb-0'] do %>
- <div class="custom-control custom-switch custom-switch-md">
- <%= f.check_box :visible, class: 'custom-control-input', data: {cms_page_id: @cms_page.id} %>
- <label class="custom-control-label" for="cms_page_visible"></label>
- <%= f.error_message_on :visible %>
- </div>
- <% end %>
-
- <span id="visibilityStatus" class="d-flex align-items-center">
- <span class="page_hidden badge badge-secondary <% if @cms_page.visible? %>d-none<% end %>">
- <%= svg_icon name: "eye-slash-fill.svg", width: '18', height: '18' %> <%= Spree.t('admin.cms.draft_mode') %>
- </span>
-
- <span class="page_visible badge badge-primary <% if @cms_page.draft_mode? %>d-none<% end %>">
- <%= svg_icon name: "view.svg", width: '18', height: '18' %> <%= Spree.t('admin.cms.visible') %>
- </span>
- </span>
- </div>
- <div class="col-auto d-flex align-items-center">
- <span class="badge badge-secondary">
- <%= svg_icon name: "translate.svg", width: '18', height: '18' %> <%= locale_full_name(@cms_page.locale) %>
- </span>
- </div>
- </div>
- </div>
- <% end %>
-
- <div class="card-body pb-2">
- <div class="row pb-0">
-
- <%= f.field_container :title, class: ['form-group col-12 col-md-6'] do %>
- <%= f.label :title, raw(Spree.t('admin.cms.title') + required_span_tag) %>
- <%= f.text_field :title, class: 'form-control', required: true %>
- <%= f.error_message_on :title %>
- <% end %>
-
- <%= f.field_container :type, class: ['form-group col-12 col-md-6'] do %>
- <%= f.label :type, Spree.t('admin.cms.page_type') %>
- <%= f.select(:type, spree_humanize_dropdown_values('Spree::CmsPage', {const: 'TYPES'}), {include_blank: false}, class: 'select2') %>
- <%= f.error_message_on :type %>
- <% end %>
-
- <% unless %w[new create].include? controller.action_name %>
- <div class="col-12 mt-3">
- <div id="updatePageType" data-page-type="<%= @cms_page.type %>" class="alert alert-info d-none">
- <% button_type = Spree.t('update') %>
- <%= raw Spree.t('admin.cms.click_button_to_change_page_type', button_type: button_type) %>
- </div>
- </div>
- <% end %>
- </div>
-
- <div class="<% unless %w[new create].include? controller.action_name %>collapse<% end %>" id="cmsPageSettings">
- <div class="row pb-0">
- <div class="col-12"><hr></div>
- <%= f.field_container :locale, class: ['form-group col-12 col-md-4'] do %>
- <%= f.label :language %>
- <%= f.select :locale, options_from_collection_for_select(supported_locales_options, :last, :first, @cms_page.locale || I18n.locale), {}, { class: 'select2' } %>
- <%= f.error_message_on :default_locale %>
- <% end %>
-
- <%= f.field_container :meta_title, class: ['form-group col-12 col-md-4'] do %>
- <%= f.label :meta_title, Spree.t('admin.cms.meta_title') %>
- <%= f.text_field :meta_title, class: 'form-control' %>
- <%= f.error_message_on :meta_title %>
- <% end %>
-
- <%= f.field_container :slug, class: ['form-group col-12 col-md-4'] do %>
- <div id="noHomePage">
- <%= f.label :slug, Spree.t('slug') %>
- <%= f.text_field :slug, class: 'form-control', disabled: @cms_page.homepage? %>
- <%= f.error_message_on :slug %>
- </div>
- <% end %>
-
- <%= f.field_container :meta_description, class: ['form-group col-12'] do %>
- <%= f.label :meta_description, Spree.t('admin.cms.meta_description') %>
- <%= f.text_area :meta_description, { rows: 3, class: 'form-control' } %>
- <%= f.error_message_on :meta_description %>
- <% end %>
- </div>
- </div>
-
- <% unless %w[new create].include? controller.action_name %>
- <div class="row pb-0">
- <% if @cms_page.type != 'Spree::Cms::Pages::StandardPage' %>
- <div class="col-12 col-sm-7">
- <%= render partial: 'spree/admin/shared/edit_resource_links' %>
- </div>
- <% else %>
- <div class="col"></div>
- <% end %>
-
- <div class="col-12 col-sm text-right pt-3 pt-sm-0">
- <button id="toggleMorePageSettingsButton" class="btn btn-outline-secondary" type="button" data-toggle="collapse" data-target="#cmsPageSettings" aria-expanded="false" aria-controls="collapsePageSettings">
- <%= raw Spree.t('admin.cms.more_page_settings') %>
- </button>
- </div>
- </div>
- <% end %>
-
- <% if %w[new create].include? controller.action_name %>
- <div class="row pb-0">
- <div class="col-6">
- <%= render partial: 'spree/admin/shared/new_resource_links' %>
- </div>
- </div>
- <% end %>
- </div>
- </div>
- </div>
- </div>
-</div>
-
-<% if @cms_page.type == 'Spree::Cms::Pages::StandardPage' %>
- <div class="row">
- <div class="col-12">
- <%= f.field_container :content, class: ['form-group'] do %>
- <%= f.text_area :content, { rows: 22, class: 'spree-rte'} %>
- <%= f.error_message_on :content %>
- <% end %>
- </div>
- </div>
- <div class="d-flex ">
- <%= render partial: 'spree/admin/shared/edit_resource_links' %>
- </div>
-<% end %>
diff --git a/backend/app/views/spree/admin/cms_pages/_live_preview_area.html.erb b/backend/app/views/spree/admin/cms_pages/_live_preview_area.html.erb
deleted file mode 100644
index b6e5ae3e2a..0000000000
--- a/backend/app/views/spree/admin/cms_pages/_live_preview_area.html.erb
+++ /dev/null
@@ -1,61 +0,0 @@
- <div class="row">
- <div id="pageSectionsArea" class="col-12">
-
- <hr class="mt-4 hide-on-full-screen-mode">
- <div class="row">
- <div class="col d-flex justify-content-start">
- <%= button_link_to Spree.t('admin.cms.add_new_section'), spree.new_admin_cms_page_cms_section_path(@cms_page), icon: 'add.svg', class: 'no-wrap btn btn-success align-self-center' %>
- </div>
- <div class="col d-none d-md-flex justify-content-end">
- <div id="LiveViewSwitcher" class="btn-group btn-group-toggle" data-toggle="buttons">
- <label class="btn btn-outline-primary active">
- <input type="radio" name="options" id="mobileLiveView" autocomplete="off"> Mobile
- </label>
- <label class="btn btn-outline-primary">
- <input type="radio" name="options" id="tabletLiveView" autocomplete="off"> Tablet
- </label>
- <label class="btn btn-outline-primary">
- <input type="radio" name="options" id="desktopLiveView" autocomplete="off" checked> Desktop
- </label>
- </div>
-
- <div class="ml-2">
- <button id="cmsSectionEditorFullScreen" type="button" class="btn btn-outline-primary no-wrap" data-toggle="button" autocomplete="off"><%= raw Spree.t('admin.cms.full_screen_mode') %></button>
- </div>
- </div>
- </div>
- <div class="row no-gutters">
- <div id="draggableSectionsHolder" class="col-12 col-md-3 bg-light border">
- <% if @cms_page.cms_sections.any? %>
- <div id="cmsPagesectionsArea" class="card-body row m-0 p-1 no-gutters">
- <% @cms_page.cms_sections.each do |section| %>
- <%= render 'spree/admin/cms_pages/section_template', section: section %>
- <% end %>
- </div>
-
- <% else %>
- <div class="row">
- <div class="col-12">
- <div class="alert alert-info no-objects-found m-4">
- <%= raw Spree.t('admin.cms.no_sections_found_please_add_one') %>
- </div>
- </div>
- </div>
- <% end %>
- </div>
-
- <div class="d-none d-md-block col bg-secondary border border-left-0">
- <div id="liveViewCont" class="desktopLiveView">
- <div class="embed-responsive embed-responsive-4by3">
- <iframe class="embed-responsive-item"
- id="pageLivePreview"
- src="<%= cms_page_preview_url(@cms_page) + "?no_cache=#{rand(1...10000)}" %>"
- sandbox="allow-same-origin allow-forms allow-popups allow-scripts allow-modals">
- </iframe>
- </div>
- </div>
- </div>
-
- </div>
- </div>
- </div>
diff --git a/backend/app/views/spree/admin/cms_pages/_section_template.html.erb b/backend/app/views/spree/admin/cms_pages/_section_template.html.erb
deleted file mode 100644
index ce43d2277c..0000000000
--- a/backend/app/views/spree/admin/cms_pages/_section_template.html.erb
+++ /dev/null
@@ -1,16 +0,0 @@
-<div class="col-12 p-0 removable-dom-element" data-section-id="<%= section.id %>">
- <div class="row m-0 mb-1 pb-0 border border-secondary bg-white">
- <div class="col move-handle d-flex pr-0 truncate">
- <div class="py-3 align-items-center overflow-hidden w-100">
- <h6 class="m-0 truncate"><%= section.name %></h6>
- <small class="form-text mt-0 text-muted"><%= spree_humanize_type(section.type) %></small>
- </div>
- </div>
- <div>
- <div class="col h-100 d-flex flex-column align-self-sm-stretch p-0 justify-content-between actions cms_section_action_col">
- <%= link_to_edit(section, no_text: true, url: spree.edit_admin_cms_page_cms_section_path(@cms_page, section)) %>
- <%= link_to_delete(section, no_text: true, url: spree.admin_cms_page_cms_section_path(@cms_page, section)) if can?(:destroy, section) %>
- </div>
- </div>
- </div>
-</div>
diff --git a/backend/app/views/spree/admin/cms_pages/edit.html.erb b/backend/app/views/spree/admin/cms_pages/edit.html.erb
deleted file mode 100644
index b284f87d97..0000000000
--- a/backend/app/views/spree/admin/cms_pages/edit.html.erb
+++ /dev/null
@@ -1,21 +0,0 @@
-<% content_for :page_title do %>
- <%= link_to Spree.t('admin.cms.all_pages'), spree.admin_cms_pages_path %> / <%= @cms_page.title %>
-<% end %>
-
-<% content_for :page_actions do %>
- <%= button_link_to(Spree.t('admin.cms.preview_page'),
- cms_page_preview_url(@cms_page),
- class: 'btn-outline-secondary',
- icon: 'view.svg',
- id: 'admin_preview_product',
- target: :blank) %>
-<% end %>
-
-<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @cms_page } %>
-<%= form_for [:admin, @cms_page], as: :cms_page, url: spree.admin_cms_page_path do |f| %>
- <%= render partial: 'form', locals: { f: f } %>
-<% end %>
-
-<% if @cms_page.sections? %>
- <%= render partial: 'live_preview_area' %>
-<% end %>
diff --git a/backend/app/views/spree/admin/cms_pages/index.html.erb b/backend/app/views/spree/admin/cms_pages/index.html.erb
deleted file mode 100644
index bffbada9cb..0000000000
--- a/backend/app/views/spree/admin/cms_pages/index.html.erb
+++ /dev/null
@@ -1,84 +0,0 @@
-<% content_for :page_title do %>
- <%= Spree.t('admin.cms.all_pages') %>
-<% end %>
-
-<% content_for :page_actions do %>
- <%= button_link_to Spree.t('admin.cms.add_new_page'), new_object_url, { class: "btn-success", icon: 'add.svg', id: 'new_page' } %>
-<% end if can?(:create, Spree::CmsPage) %>
-
-<% content_for :table_filter do %>
- <div data-hook="admin_menus_sidebar">
- <%= search_form_for [:admin, @search] do |f| %>
- <%- locals = {f: f} %>
- <div class="row">
- <div class="col-12 col-lg-4">
- <div class="form-group">
- <%= f.label :title_cont, Spree.t('admin.cms.title') %>
- <%= f.text_field :title_cont, size: 15, class: "form-control js-quick-search-target js-filterable" %>
- </div>
- </div>
-
- <div class="col-12 col-lg-4">
- <div class="form-group">
- <%= label_tag :q_type_eq, Spree.t(:type) %>
- <%= f.select(:type_eq, spree_humanize_dropdown_values('Spree::CmsPage', {const: 'TYPES'}), {include_blank: true}, class: 'select2-clear js-filterable') %>
- </div>
- </div>
-
- <div class="col-12 col-lg-4">
- <div class="form-group">
- <%= label_tag :q_locale_eq, Spree.t(:language) %>
- <%= f.select :locale_eq, all_locales_options, { include_blank: true }, class: 'select2-clear js-filterable' %>
- </div>
- </div>
- </div>
-
- <div data-hook="admin_menus_index_search_buttons" class="form-actions">
- <%= button Spree.t(:search), 'search.svg' %>
- </div>
- <% end %>
- </div>
-<% end %>
-
-<% if @cms_pages.any? %>
-<div class="table-responsive">
- <table class="table" id="pagesTable">
- <thead>
- <th scope="col"><%= Spree.t('admin.cms.title') %></th>
- <th scope="col"><%= Spree.t('admin.cms.visible') %></th>
- <th scope="col"><%= Spree.t('admin.cms.page_type') %></th>
- <th scope="col"><%= Spree.t('language') %></th>
- <th scope="col"></th>
- </thead>
- <tbody>
- <% @cms_pages.each do |page| %>
- <tr>
- <td>
- <%= page.title %>
- </td>
- <td>
- <%= active_badge(page.visible?) %>
- </td>
- <td>
- <%= spree_humanize_type(page.type) %>
- </td>
- <td>
- <%= locale_full_name(page.locale) %>
- </td>
- <td class="actions" data-hook="admin_pages_index_row_actions">
- <span class="d-flex justify-content-end">
- <%= link_to_edit(page, no_text: true) %>
- <%= link_to_delete page, no_text: true, url: spree.admin_cms_page_path(page) if can?(:destroy, page) %>
- </span>
- </td>
- </tr>
- <% end %>
- </tbody>
- </table>
-</div>
-<%= render 'spree/admin/shared/index_table_options', collection: @cms_pages, simple: true %>
-<% else %>
- <div class="alert alert-info no-objects-found">
- <%= raw Spree.t('admin.cms.you_have_no_pages') %>
- </div>
-<% end %>
diff --git a/backend/app/views/spree/admin/cms_pages/new.html.erb b/backend/app/views/spree/admin/cms_pages/new.html.erb
deleted file mode 100644
index a21b82dd47..0000000000
--- a/backend/app/views/spree/admin/cms_pages/new.html.erb
+++ /dev/null
@@ -1,8 +0,0 @@
-<% content_for :page_title do %>
- <%= link_to Spree.t('admin.cms.all_pages'), spree.admin_cms_pages_path %> / <%= Spree.t('admin.cms.new_page') %>
-<% end %>
-
-<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @cms_page } %>
-<%= form_for [:admin, @cms_page] do |f| %>
- <%= render partial: 'form', locals: { f: f } %>
-<% end %>
diff --git a/backend/app/views/spree/admin/cms_sections/_form.html.erb b/backend/app/views/spree/admin/cms_sections/_form.html.erb
deleted file mode 100644
index bd24b77510..0000000000
--- a/backend/app/views/spree/admin/cms_sections/_form.html.erb
+++ /dev/null
@@ -1,69 +0,0 @@
-<div data-hook="admin_cms_section_form_fields">
- <div class="row">
- <div class="col-12 col-md-6">
- <%= f.field_container :name, class: ['form-group'] do %>
- <%= f.label :name, raw(Spree.t(:name) + required_span_tag) %>
- <%= f.text_field :name, class: 'form-control', required: true, autocomplete: false %>
- <%= f.error_message_on :name %>
- <% end %>
- </div>
- <div class="col-12 col-md-6">
- <%= f.field_container :type, class: ['form-group'] do %>
- <%= f.label :type, Spree.t('admin.cms.section_type') %>
- <%= f.select(:type, spree_humanize_dropdown_values('Spree::CmsSection', {const: 'TYPES'}), {include_blank: false}) %>
- <%= f.error_message_on :type %>
- <% end %>
- </div>
- </div>
-
- <div id="alertToClickUpdate" class="d-none">
- <div class="row">
- <div class="col-12">
- <div class="alert alert-warning mt-3">
- <% if %w[new create].include? controller.action_name %>
- <%= raw Spree.t('admin.cms.click_create_to_load_new_link') %>
- <% else %>
- <%= raw Spree.t('admin.cms.click_update_to_load_new_link') %>
- <% end %>
- </div>
- </div>
- </div>
- </div>
-
- <% if @cms_section.type.present? %>
- <div id="CmsSectionType"
- data-hook="admin_cms_section_form_fields"
- data-panel-section-type="<%= @cms_section.type %>">
- <div class="row">
- <div class="col-12">
- <div class="card mb-3">
- <div class="card-header d-flex">
- <div class="d-flex flex-grow-1">
- <h5 class="mb-0">
- <%= raw Spree.t('admin.cms.settings_for', section: spree_humanize_type(@cms_section.type)) %>
- </h5>
- </div>
- <div class="d-flex">
- <span data-show-info
- data-alert-kind="info"
- data-alert-title="<%= spree_humanize_type(@cms_section.type) %>"
- data-alert-html="<%= raw I18n.t("spree.admin.cms.info_#{spree_resource_path(@cms_section)}_body") %>">
- <%= svg_icon name: "info.svg", width: '25', height: '25' %>
- </span>
- </div>
- </div>
- <div class="card-body">
- <% if @cms_section.type.present? %>
- <div class="row pb-0">
- <div class="col-12">
- <%= render "spree/admin/cms_sections/types/#{spree_resource_path(@cms_section)}", f: f %>
- </div>
- </div>
- <% end %>
- </div>
- </div>
- </div>
- </div>
- </div>
- <% end %>
-</div>
diff --git a/backend/app/views/spree/admin/cms_sections/edit.html.erb b/backend/app/views/spree/admin/cms_sections/edit.html.erb
deleted file mode 100644
index 3608a35395..0000000000
--- a/backend/app/views/spree/admin/cms_sections/edit.html.erb
+++ /dev/null
@@ -1,19 +0,0 @@
-<% content_for :page_title do %>
- <%= link_to Spree.t('admin.cms.all_pages'), spree.admin_cms_pages_path %> /
- <%= link_to @cms_page.title, spree.edit_admin_cms_page_path(@cms_page) %> / <%= @cms_section.name %>
-<% end %>
-
-<% content_for :page_actions do %>
-<%= button_link_to(
- Spree.t('admin.cms.go_to_fullscreen_section_manager'),
- spree.edit_admin_cms_page_path(@cms_page) + '?section_editor_full_screen_mode=true',
- class: 'btn-outline-secondary', icon: 'fullscreen.svg', id: 'admin_preview_product'
- ) %>
-<% end %>
-
-<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @cms_section } %>
-
-<%= form_for [:admin, @cms_page, @cms_section], as: :cms_section, url: spree.admin_cms_page_cms_section_path(@cms_page, @cms_section) do |f| %>
- <%= render partial: 'form', locals: { f: f } %>
- <%= render partial: 'spree/admin/shared/edit_resource_links' %>
-<% end %>
diff --git a/backend/app/views/spree/admin/cms_sections/new.html.erb b/backend/app/views/spree/admin/cms_sections/new.html.erb
deleted file mode 100644
index 126d39c2a1..0000000000
--- a/backend/app/views/spree/admin/cms_sections/new.html.erb
+++ /dev/null
@@ -1,11 +0,0 @@
-<% content_for :page_title do %>
- <%= link_to Spree.t('admin.cms.all_pages'), spree.admin_cms_pages_path %> /
- <%= link_to @cms_page.title, spree.edit_admin_cms_page_path(@cms_page) %> / <%= Spree.t('admin.cms.new_section') %>
-<% end %>
-
-<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @cms_section } %>
-
-<%= form_for [:admin, @cms_page, @cms_section], url: spree.admin_cms_page_cms_sections_path do |f| %>
- <%= render partial: 'form', locals: { f: f } %>
- <%= render partial: 'spree/admin/shared/new_resource_links' %>
-<% end %>
diff --git a/backend/app/views/spree/admin/cms_sections/types/_featured_article.html.erb b/backend/app/views/spree/admin/cms_sections/types/_featured_article.html.erb
deleted file mode 100644
index b012d95d72..0000000000
--- a/backend/app/views/spree/admin/cms_sections/types/_featured_article.html.erb
+++ /dev/null
@@ -1,50 +0,0 @@
-<div class="row">
- <div class="col-12 col-md-4">
- <%= f.field_container :title, class: ['form-group'] do %>
- <%= f.label :title, Spree.t('admin.cms.title') %>
- <%= f.text_field :title, class: 'form-control' %>
- <%= f.error_message_on :title %>
- <% end %>
-
- <%= f.field_container :subtitle, class: ['form-group'] do %>
- <%= f.label :subtitle, Spree.t('admin.cms.subtitle') %>
- <%= f.text_field :subtitle, class: 'form-control' %>
- <%= f.error_message_on :subtitle %>
- <% end %>
-
- <%= f.field_container :button_text, class: ['form-group'] do %>
- <%= f.label :button_text, Spree.t('admin.cms.button_text') %>
- <%= f.text_field :button_text, class: 'form-control' %>
- <%= f.error_message_on :button_text %>
- <% end %>
-
- <%= f.field_container :gutters, class: ['form-group'] do %>
- <%= f.label :gutters, Spree.t('admin.cms.gutters') %>
- <%= f.select(:gutters, @cms_section.gutters_sizes, {include_blank: false}, class: 'select2') %>
- <%= f.error_message_on :gutters %>
- <% end %>
-
- </div>
- <div class="col-12 col-md-8">
- <%= f.field_container :rte_content, class: ['form-group'] do %>
- <%= f.label :rte_content, Spree.t('admin.cms.content') %>
- <%= f.text_area :rte_content, { rows: "20", class: 'form-control spree-rte' } %>
- <%= f.error_message_on :rte_content %>
- <% end %>
- </div>
- <div class="col-12"><hr></div>
- <div class="col-12 col-md-6">
- <%= f.field_container :linked_resource_type, class: ['form-group'] do %>
- <%= f.label :linked_resource_type, Spree.t('admin.navigation.link_to') %>
- <%= f.select(:linked_resource_type,
- spree_humanize_dropdown_values('Spree::Cms::Sections::FeaturedArticle',
- { const: 'LINKED_RESOURCE_TYPE' }),
- {include_blank: false},
- class: 'link_switcher') %>
- <%= f.error_message_on :linked_resource_type %>
- <% end %>
- </div>
- <div class="col-12 col-md-6">
- <%= render "spree/admin/shared/link_fields", resource: @cms_section, f: f %>
- </div>
-</div>
diff --git a/backend/app/views/spree/admin/cms_sections/types/_hero_image.html.erb b/backend/app/views/spree/admin/cms_sections/types/_hero_image.html.erb
deleted file mode 100644
index 3534c43bdf..0000000000
--- a/backend/app/views/spree/admin/cms_sections/types/_hero_image.html.erb
+++ /dev/null
@@ -1,61 +0,0 @@
-<div class="row pb-0">
- <div class="col-12 col-md-6">
- <%= f.field_container :title, class: ['form-group'] do %>
- <%= f.label :title, Spree.t('admin.cms.title') %>
- <%= f.text_field :title, class: 'form-control' %>
- <%= f.error_message_on :title %>
- <% end %>
-
- <%= f.field_container :button_text, class: ['form-group'] do %>
- <%= f.label :button_text, Spree.t('admin.cms.button_text') %>
- <%= f.text_field :button_text, class: 'form-control' %>
- <%= f.error_message_on :button_text %>
- <% end %>
-
- <div class="row">
- <%= f.field_container :fit, class: ['form-group col-6'] do %>
- <%= f.label :fit, Spree.t('admin.cms.fit') %>
- <%= f.select(:fit, @cms_section.boundaries, {include_blank: false}, class: 'select2') %>
- <%= f.error_message_on :fit %>
- <% end %>
-
- <%= f.field_container :gutters, class: ['form-group col-6'] do %>
- <%= f.label :gutters, Spree.t('admin.cms.gutters') %>
- <%= f.select(:gutters, @cms_section.gutters_sizes, {include_blank: false}, class: 'select2') %>
- <%= f.error_message_on :gutters %>
- <% end %>
- </div>
- </div>
- <div class="col-12 col-md-6 pt-4">
- <%= f.field_container :image_one, class: ['form-group'] do %>
- <% if @cms_section.image_one.attached? && @cms_section.image_one.variable? %>
- <figure class="admin-img-holder">
- <%= image_tag main_app.url_for(@cms_section.image_one.variant(resize: '244x104>')) %>
- </figure>
- <% elsif @cms_section.image_one.attached? && @cms_section.image_one.image? %>
- <figure class="admin-img-holder">
- <%= image_tag main_app.url_for(@cms_section.image_one) %>
- </figure>
- <% end %>
-
- <%= f.file_field :image_one %>
- <%= f.error_message_on :image_one %>
- <% end %>
- <small class="form-text text-muted"><%= Spree.t('admin.cms.hero.aspect_ratio') %></small>
- </div>
- <div class="col-12"><hr></div>
- <div class="col-12 col-md-6">
- <%= f.field_container :linked_resource_type, class: ['form-group'] do %>
- <%= f.label :linked_resource_type, Spree.t('admin.navigation.link_to') %>
- <%= f.select(:linked_resource_type,
- spree_humanize_dropdown_values('Spree::Cms::Sections::HeroImage',
- { const: 'LINKED_RESOURCE_TYPE' }),
- { include_blank: false },
- class: 'link_switcher') %>
- <%= f.error_message_on :linked_resource_type %>
- <% end %>
- </div>
- <div class="col-12 col-md-6">
- <%= render "spree/admin/shared/link_fields", resource: @cms_section, f: f %>
- </div>
-</div>
diff --git a/backend/app/views/spree/admin/cms_sections/types/_image_gallery.html.erb b/backend/app/views/spree/admin/cms_sections/types/_image_gallery.html.erb
deleted file mode 100644
index c3fd0d3b8c..0000000000
--- a/backend/app/views/spree/admin/cms_sections/types/_image_gallery.html.erb
+++ /dev/null
@@ -1,174 +0,0 @@
-<div class="row align-items-center">
- <div id="ImageGalleryLayout" class="col-12 col-md-6 text-center m-auto">
- <div id="LayoutType">
- <div id="Default" class="<% unless @cms_section.layout_style == 'Default' %>d-none<% end %>">
- <%= svg_icon name: "default-layout.svg", width: '150', height: '150' %>
- </div>
- <div id="Reversed" class="<% unless @cms_section.layout_style == 'Reversed' %>d-none<% end %>">
- <%= svg_icon name: "reversed-layout.svg", width: '150', height: '150' %>
- </div>
- </div>
-
- <%= f.field_container :layout_style, class: ['form-group'] do %>
- <%= f.label :layout_style, Spree.t('admin.cms.image_gallery.layout_style') %>
- <%= f.select(:layout_style,
- spree_humanize_dropdown_values('Spree::Cms::Sections::ImageGallery',
- { const: 'LAYOUT_OPTIONS' }),
- { include_blank: false }) %>
- <%= f.error_message_on :layout_style %>
- <% end %>
- </div>
-</div>
-
-<div class="row">
- <div class="col-12 col-md-4 mb-3">
- <div id="image_a_details" class="card p-3">
- <div class="text-center">
- <h4 class="pb-2"><%= Spree.t('admin.cms.image_gallery.image_a') %></h4>
- <%= f.field_container :image_one, class: ['form-group'] do %>
- <% if @cms_section.image_one.attached? && @cms_section.image_one.variable? %>
- <figure class="admin-img-holder">
- <%= image_tag main_app.url_for(@cms_section.image_one.variant(resize: '244x104>')) %>
- </figure>
- <% elsif @cms_section.image_one.attached? && @cms_section.image_one.image? %>
- <figure class="admin-img-holder">
- <%= image_tag main_app.url_for(@cms_section.image_one) %>
- </figure>
- <% end %>
-
- <%= f.file_field :image_one %>
- <%= f.error_message_on :image_one %>
- <% end %>
- </div>
- <small class="text-muted mb-4"><%= Spree.t('admin.cms.image_gallery.square_image') %></small>
-
- <%= f.field_container :title_one, class: ['form-group'] do %>
- <%= f.label :title_one, Spree.t('admin.cms.title') %>
- <%= f.text_field :title_one, class: 'form-control' %>
- <%= f.error_message_on :title_one %>
- <% end %>
-
- <div class="col-12"><hr></div>
- <% unless rails_5? %>
- <%= f.field_container :link_type_one, class: ['form-group'] do %>
- <%= f.label :link_type_one, Spree.t('admin.navigation.link_to') %>
- <%= f.select(:link_type_one,
- spree_humanize_dropdown_values('Spree::Cms::Sections::ImageGallery',
- { const: 'LINKED_RESOURCE_TYPE' }),
- { include_blank: false },
- class: 'link_switcher',
- data: { target_field: :link_one}) %>
- <%= f.error_message_on :link_type_one %>
- <% end %>
- <% end %>
- <%= render "spree/admin/shared/link_fields", resource: @cms_section, linked_type: @cms_section.link_type_one, save_to: :link_one, f: f %>
- </div>
- </div>
-
- <div class="col-12 col-md-4 mb-3">
- <div id="image_b_details" class="card p-3">
- <div class="text-center">
- <h4 class="pb-2"><%= Spree.t('admin.cms.image_gallery.image_b') %></h4>
- <%= f.field_container :image_two, class: ['form-group'] do %>
- <% if @cms_section.image_two.attached? && @cms_section.image_two.variable? %>
- <figure class="admin-img-holder">
- <%= image_tag main_app.url_for(@cms_section.image_two.variant(resize: '244x104>')) %>
- </figure>
- <% elsif @cms_section.image_two.attached? && @cms_section.image_two.image? %>
- <figure class="admin-img-holder">
- <%= image_tag main_app.url_for(@cms_section.image_two) %>
- </figure>
- <% end %>
-
- <%= f.file_field :image_two %>
- <%= f.error_message_on :image_two %>
- <% end %>
- </div>
- <small class="text-muted mb-4"><%= Spree.t('admin.cms.image_gallery.tall_image') %></small>
-
- <%= f.field_container :title_two, class: ['form-group'] do %>
- <%= f.label :title_two, Spree.t('admin.cms.title') %>
- <%= f.text_field :title_two, class: 'form-control' %>
- <%= f.error_message_on :title_two %>
- <% end %>
-
- <div class="col-12"><hr></div>
- <% unless rails_5? %>
- <%= f.field_container :link_type_two, class: ['form-group'] do %>
- <%= f.label :link_type_two, Spree.t('admin.navigation.link_to') %>
- <%= f.select(:link_type_two,
- spree_humanize_dropdown_values('Spree::Cms::Sections::ImageGallery',
- { const: 'LINKED_RESOURCE_TYPE' }),
- { include_blank: false },
- class: 'link_switcher',
- data: { target_field: :link_two}) %>
- <%= f.error_message_on :link_type_two %>
- <% end %>
- <% end %>
- <%= render "spree/admin/shared/link_fields", resource: @cms_section, linked_type: @cms_section.link_type_two, save_to: :link_two, f: f %>
- </div>
- </div>
-
- <div class="col-12 col-md-4 mb-3">
- <div id="image_c_details" class="card p-3">
- <div class="text-center">
- <h4 class="pb-2"><%= Spree.t('admin.cms.image_gallery.image_c') %></h4>
- <%= f.field_container :image_three, class: ['form-group'] do %>
- <% if @cms_section.image_three.attached? && @cms_section.image_three.variable? %>
- <figure class="admin-img-holder">
- <%= image_tag main_app.url_for(@cms_section.image_three.variant(resize: '244x104>')) %>
- </figure>
- <% elsif @cms_section.image_three.attached? && @cms_section.image_three.image? %>
- <figure class="admin-img-holder">
- <%= image_tag main_app.url_for(@cms_section.image_three) %>
- </figure>
- <% end %>
-
- <%= f.file_field :image_three %>
- <%= f.error_message_on :image_three %>
- <% end %>
- </div>
- <small class="text-muted mb-4"><%= Spree.t('admin.cms.image_gallery.square_image') %></small>
-
- <%= f.field_container :title_three, class: ['form-group'] do %>
- <%= f.label :title_three, Spree.t('admin.cms.title') %>
- <%= f.text_field :title_three, class: 'form-control' %>
- <%= f.error_message_on :title_three %>
- <% end %>
-
- <div class="col-12"><hr></div>
- <% unless rails_5? %>
- <%= f.field_container :link_type_three, class: ['form-group'] do %>
- <%= f.label :link_type_three, Spree.t('admin.navigation.link_to') %>
- <%= f.select(:link_type_three,
- spree_humanize_dropdown_values('Spree::Cms::Sections::ImageGallery',
- { const: 'LINKED_RESOURCE_TYPE' }),
- { include_blank: false },
- class: 'link_switcher',
- data: { target_field: :link_three}) %>
- <%= f.error_message_on :link_type_three %>
- <% end %>
- <% end %>
- <%= render "spree/admin/shared/link_fields", resource: @cms_section, linked_type: @cms_section.link_type_three, save_to: :link_three, f: f %>
- </div>
- </div>
-</div>
-
-<div class="row pb-0">
- <div class="col-12"> <hr></div>
- <%= f.field_container :fit, class: ['form-group col-6'] do %>
- <%= f.label :fit, Spree.t('admin.cms.fit') %>
- <%= f.select(:fit, @cms_section.boundaries, {include_blank: false}, class: 'select2') %>
- <%= f.error_message_on :fit %>
- <% end %>
-
- <%= f.field_container :display_labels, class: ['form-group col-6'] do %>
- <%= f.label :display_labels, Spree.t('admin.cms.image_gallery.display_labels') %>
- <%= f.select(:display_labels,
- spree_humanize_dropdown_values('Spree::Cms::Sections::ImageGallery',
- { const: 'LABEL_OPTIONS' }),
- { include_blank: false },
- class:'select2') %>
- <%= f.error_message_on :display_labels %>
- <% end %>
-</div>
diff --git a/backend/app/views/spree/admin/cms_sections/types/_product_carousel.html.erb b/backend/app/views/spree/admin/cms_sections/types/_product_carousel.html.erb
deleted file mode 100644
index 44e7c35363..0000000000
--- a/backend/app/views/spree/admin/cms_sections/types/_product_carousel.html.erb
+++ /dev/null
@@ -1,5 +0,0 @@
-<div class="row">
- <div class="col-12">
- <%= render "spree/admin/shared/link_fields", resource: @cms_section, f: f %>
- </div>
-</div>
diff --git a/backend/app/views/spree/admin/cms_sections/types/_rich_text_content.html.erb b/backend/app/views/spree/admin/cms_sections/types/_rich_text_content.html.erb
deleted file mode 100644
index 2643daf8c9..0000000000
--- a/backend/app/views/spree/admin/cms_sections/types/_rich_text_content.html.erb
+++ /dev/null
@@ -1,4 +0,0 @@
-<%= f.field_container :rte_content, class: ['form-group mb-0'] do %>
- <%= f.text_area :rte_content, { rows: "20", class: 'form-control spree-rte' } %>
- <%= f.error_message_on :rte_content %>
-<% end %>
diff --git a/backend/app/views/spree/admin/cms_sections/types/_side_by_side_images.html.erb b/backend/app/views/spree/admin/cms_sections/types/_side_by_side_images.html.erb
deleted file mode 100644
index 0ab7f96abb..0000000000
--- a/backend/app/views/spree/admin/cms_sections/types/_side_by_side_images.html.erb
+++ /dev/null
@@ -1,121 +0,0 @@
-<div class="row pb-0">
- <div class="col-12 col-md-6 mb-3">
- <div id="left_image_details" class="card p-3">
- <div class="text-center">
- <h4 class="pb-2"><%= Spree.t('admin.cms.side_by_side.left_image') %></h4>
- <%= f.field_container :image_one, class: ['form-group'] do %>
- <% if @cms_section.image_one.attached? && @cms_section.image_one.variable? %>
- <figure class="admin-img-holder">
- <%= image_tag main_app.url_for(@cms_section.image_one.variant(resize: '244x104>')) %>
- </figure>
- <% elsif @cms_section.image_one.attached? && @cms_section.image_one.image? %>
- <figure class="admin-img-holder">
- <%= image_tag main_app.url_for(@cms_section.image_one) %>
- </figure>
- <% end %>
- <%= f.field_container :image_one, class: ['form-group mb-0'] do %>
- <%= f.file_field :image_one %>
- <%= f.error_message_on :image_one %>
- <% end %>
- <small class="text-muted"><%= Spree.t('admin.cms.side_by_side.image_info') %></small>
- <% end %>
- </div>
-
- <%= f.field_container :title_one, class: ['form-group'] do %>
- <%= f.label :title_one, Spree.t('admin.cms.title') %>
- <%= f.text_field :title_one, class: 'form-control' %>
- <%= f.error_message_on :title_one %>
- <% end %>
-
- <%= f.field_container :subtitle_one, class: ['form-group'] do %>
- <%= f.label :subtitle_one, Spree.t('admin.cms.subtitle') %>
- <%= f.text_field :subtitle_one, class: 'form-control' %>
- <%= f.error_message_on :subtitle_one %>
- <% end %>
-
- <div class="col-12"><hr></div>
- <% unless rails_5? %>
- <%= f.field_container :link_type_one, class: ['form-group'] do %>
- <%= f.label :link_type_one, Spree.t('admin.navigation.link_to') %>
- <%= f.select(:link_type_one,
- spree_humanize_dropdown_values('Spree::Cms::Sections::SideBySideImages',
- { const: 'LINKED_RESOURCE_TYPE' }),
- { include_blank: false },
- class: 'link_switcher',
- data: { target_field: :link_one}) %>
- <%= f.error_message_on :link_type_one %>
- <% end %>
- <% end %>
- <%= render "spree/admin/shared/link_fields", resource: @cms_section, linked_type: @cms_section.link_type_one, save_to: :link_one, f: f %>
- </div>
- </div>
-
- <div class="col-12 col-md-6 mb-3">
- <div id="right_image_details" class="card p-3">
- <div class="text-center">
- <h4 class="pb-2"><%= Spree.t('admin.cms.side_by_side.right_image') %></h4>
- <%= f.field_container :image_two, class: ['form-group'] do %>
- <% if @cms_section.image_two.attached? && @cms_section.image_two.variable? %>
- <figure class="admin-img-holder">
- <%= image_tag main_app.url_for(@cms_section.image_two.variant(resize: '244x104>')) %>
- </figure>
- <% elsif @cms_section.image_two.attached? && @cms_section.image_two.image? %>
- <figure class="admin-img-holder">
- <%= image_tag main_app.url_for(@cms_section.image_two) %>
- </figure>
- <% end %>
- <%= f.field_container :image_two, class: ['form-group mb-0'] do %>
- <%= f.file_field :image_two %>
- <%= f.error_message_on :image_two %>
- <% end %>
- <small class="text-muted"><%= Spree.t('admin.cms.side_by_side.image_info') %></small>
- <% end %>
- </div>
-
- <%= f.field_container :title_two, class: ['form-group'] do %>
- <%= f.label :title_two, Spree.t('admin.cms.title') %>
- <%= f.text_field :title_two, class: 'form-control' %>
- <%= f.error_message_on :title_two %>
- <% end %>
-
- <%= f.field_container :subtitle_two, class: ['form-group'] do %>
- <%= f.label :subtitle_two, Spree.t('admin.cms.subtitle') %>
- <%= f.text_field :subtitle_two, class: 'form-control' %>
- <%= f.error_message_on :subtitle_two %>
- <% end %>
-
- <div class="col-12"><hr></div>
-
- <% unless rails_5? %>
- <%= f.field_container :link_type_two, class: ['form-group'] do %>
- <%= f.label :link_type_two, Spree.t('admin.navigation.link_to') %>
- <%= f.select(:link_type_two,
- spree_humanize_dropdown_values('Spree::Cms::Sections::SideBySideImages',
- { const: 'LINKED_RESOURCE_TYPE' }),
- { include_blank: false },
- class: 'link_switcher',
- data: { target_field: :link_two}) %>
- <%= f.error_message_on :link_type_two %>
- <% end %>
- <% end %>
- <%= render "spree/admin/shared/link_fields", resource: @cms_section, linked_type: @cms_section.link_type_two, save_to: :link_two, f: f %>
- </div>
- </div>
-
-<div class="col-12"><hr></div>
- <div class="col-6">
- <%= f.field_container :fit, class: ['form-group'] do %>
- <%= f.label :fit, Spree.t('admin.cms.fit') %>
- <%= f.select(:fit, @cms_section.boundaries, {include_blank: false}, class: 'select2') %>
- <%= f.error_message_on :fit %>
- <% end %>
- </div>
-
- <div class="col-6">
- <%= f.field_container :gutters, class: ['form-group'] do %>
- <%= f.label :gutters, Spree.t('admin.cms.set_gutters') %>
- <%= f.select(:gutters, @cms_section.gutters_sizes, {include_blank: false}, class: 'select2') %>
- <%= f.error_message_on :gutters %>
- <% end %>
- </div>
-</div>
diff --git a/backend/app/views/spree/admin/countries/_form.html.erb b/backend/app/views/spree/admin/countries/_form.html.erb
deleted file mode 100644
index fa75a37692..0000000000
--- a/backend/app/views/spree/admin/countries/_form.html.erb
+++ /dev/null
@@ -1,37 +0,0 @@
-<div data-hook="admin_country_form_fields">
- <%= f.field_container :name, class: ['form-group'], 'data-hook' => 'name' do %>
- <%= f.label :name, Spree.t(:name) %>
- <%= f.text_field :name, class: 'form-control' %>
- <%= f.error_message_on :name %>
- <% end %>
-
- <%= f.field_container :iso_name, class: ['form-group'], 'data-hook' => 'iso_name' do %>
- <%= f.label :iso_name, Spree.t(:iso_name) %>
- <%= f.text_field :iso_name, class: 'form-control' %>
- <%= f.error_message_on :iso_name %>
- <% end %>
-
- <%= f.field_container :iso, class: ['form-group'], 'data-hook' => 'iso' do %>
- <%= f.label :iso, Spree.t(:iso) %>
- <%= f.text_field :iso, class: 'form-control' %>
- <%= f.error_message_on :iso %>
- <% end %>
-
- <%= f.field_container :iso3, class: ['form-group'], 'data-hook' => 'iso3' do %>
- <%= f.label :iso3, Spree.t(:iso3) %>
- <%= f.text_field :iso3, class: 'form-control' %>
- <%= f.error_message_on :iso3 %>
- <% end %>
-
- <div data-hook="states_required" class="form-group checkbox">
- <%= f.check_box :states_required %>
- <%= f.label :states_required, Spree.t(:states_required) %>
- <%= f.error_message_on :states_required %>
- </div>
-
- <div data-hook="zipcode_required" class="form-group checkbox">
- <%= f.check_box :zipcode_required %>
- <%= f.label :zipcode_required, Spree.t(:zipcode_required) %>
- <%= f.error_message_on :zipcode_required %>
- </div>
-</div>
diff --git a/backend/app/views/spree/admin/countries/edit.html.erb b/backend/app/views/spree/admin/countries/edit.html.erb
deleted file mode 100644
index e730a614e2..0000000000
--- a/backend/app/views/spree/admin/countries/edit.html.erb
+++ /dev/null
@@ -1,14 +0,0 @@
-<% content_for :page_title do %>
- <%= link_to Spree.t(:countries), spree.admin_countries_url %> /
- <%= @country.name %>
-<% end %>
-
-<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @country } %>
-
-<%= form_for [:admin, @country] do |f| %>
- <fieldset>
- <%= render partial: 'form', locals: { f: f } %>
-
- <%= render partial: 'spree/admin/shared/edit_resource_links' %>
- </fieldset>
-<% end %>
diff --git a/backend/app/views/spree/admin/countries/index.html.erb b/backend/app/views/spree/admin/countries/index.html.erb
deleted file mode 100644
index fdc23840a6..0000000000
--- a/backend/app/views/spree/admin/countries/index.html.erb
+++ /dev/null
@@ -1,36 +0,0 @@
-<% content_for :page_title do %>
- <%= plural_resource_name(Spree::Country) %>
-<% end %>
-
-<% content_for :page_actions do %>
- <%= button_link_to Spree.t(:new_country), new_object_url, { class: "btn-success", icon: 'add.svg', id: 'admin_new_country' } %>
-<% end if can? :create, Spree::Country %>
-<div class="table-responsive">
- <table class="table" id='listing_countries' data-hook>
- <thead>
- <tr data-hook="tax_header">
- <th><%= Spree.t(:country_name) %></th>
- <th class="text-center"><%= Spree.t(:iso3) %></th>
- <th class="text-center"><%= Spree.t(:states_required) %></th>
- <th class="text-center"><%= Spree.t(:zipcode_required) %></th>
- <th class="actions"></th>
- </tr>
- </thead>
- <tbody>
- <% @countries.each do |country| %>
- <tr id="<%= spree_dom_id country %>" data-hook="country_row">
- <td><%= country.name %></td>
- <td class="text-center"><%= country.iso3 %></td>
- <td class="text-center"><%= active_badge(country.states_required?) %></td>
- <td class="text-center"><%= active_badge(country.zipcode_required?) %></td>
- <td class="actions">
- <span class="d-flex justify-content-end">
- <%= link_to_edit(country, no_text: true) if can? :edit, country %>
- <%= link_to_delete(country, no_text: true) if can? :delete, country %>
- </span>
- </td>
- </tr>
- <% end %>
- </tbody>
- </table>
-</div>
diff --git a/backend/app/views/spree/admin/countries/new.html.erb b/backend/app/views/spree/admin/countries/new.html.erb
deleted file mode 100644
index 986c1db11e..0000000000
--- a/backend/app/views/spree/admin/countries/new.html.erb
+++ /dev/null
@@ -1,13 +0,0 @@
-<% content_for :page_title do %>
- <%= link_to Spree.t(:countries), spree.admin_countries_url %> /
- <%= Spree.t(:new_country) %>
-<% end %>
-
-<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @country } %>
-
-<%= form_for [:admin, @country] do |f| %>
- <fieldset>
- <%= render partial: 'form', locals: { f: f } %>
- <%= render partial: 'spree/admin/shared/new_resource_links' %>
- </fieldset>
-<% end %>
diff --git a/backend/app/views/spree/admin/customer_returns/_reimbursements_table.html.erb b/backend/app/views/spree/admin/customer_returns/_reimbursements_table.html.erb
deleted file mode 100644
index 6b40eed5f0..0000000000
--- a/backend/app/views/spree/admin/customer_returns/_reimbursements_table.html.erb
+++ /dev/null
@@ -1,40 +0,0 @@
-<div class="table-responsive">
- <table class="table table-condensed table-bordered">
- <thead data-hook="customer_return_header">
- <tr>
- <th><%= Spree.t(:number) %></th>
- <th><%= Spree.t(:total) %></th>
- <th><%= Spree.t(:status) %></th>
- <th><%= "#{Spree.t('date')}/#{Spree.t('time')}" %></th>
- <th></th>
- </tr>
- </thead>
- <tbody>
- <% reimbursements.each do |reimbursement| %>
- <tr id="<%= spree_dom_id(reimbursement) %>" data-hook="reimbursement_row">
- <td>
- <% if reimbursement.reimbursed? %>
- <%= link_to reimbursement.number, url_for([:admin, @order, reimbursement]) %>
- <% else %>
- <%= reimbursement.number %>
- <% end %>
- </td>
- <td><%= reimbursement.display_total %></td>
- <td>
- <span class="state <%= reimbursement_status_color(reimbursement) %>">
- <%= reimbursement.reimbursement_status %>
- </span>
- </td>
- <td><%= pretty_time(reimbursement.created_at) %></td>
- <td class="actions">
- <span class="d-flex justify-content-end">
- <% if !reimbursement.reimbursed? %>
- <%= link_to_edit_url(url_for([:edit, :admin, @order, reimbursement]), title: "admin_edit_#{dom_id(reimbursement)}", no_text: true) if can?(:edit, reimbursement) %>
- <% end %>
- </span>
- </td>
- </tr>
- <% end %>
- </tbody>
- </table>
-</div>
diff --git a/backend/app/views/spree/admin/customer_returns/_return_item_decision.html.erb b/backend/app/views/spree/admin/customer_returns/_return_item_decision.html.erb
deleted file mode 100644
index 649e5336e7..0000000000
--- a/backend/app/views/spree/admin/customer_returns/_return_item_decision.html.erb
+++ /dev/null
@@ -1,56 +0,0 @@
-<div class="table-responsive">
- <table class="show return-items-table table table-condensed table-bordered index">
- <thead>
- <tr>
- <th><%= Spree.t(:product) %></th>
- <th><%= Spree.t(:sku) %></th>
- <th><%= Spree.t(:pre_tax_amount) %></th>
- <th><%= Spree.t(:preferred_reimbursement_type) %></th>
- <th><%= Spree.t(:exchange_for) %></th>
- <th><%= Spree.t(:acceptance_errors) %></th>
- <% if show_decision %>
- <th></th>
- <% end %>
- </tr>
- </thead>
- <tbody>
- <% return_items.each do |return_item| %>
- <tr>
- <td>
- <div class="variant-name">
- <%= link_to return_item.inventory_unit.variant.name, spree.edit_admin_product_path(return_item.inventory_unit.variant.product) %>
- </div>
- <div class="variant-options"><%= return_item.inventory_unit.variant.options_text %></div>
- </td>
- <td>
- <%= return_item.inventory_unit.variant.sku %>
- </td>
- <td>
- <%= return_item.display_pre_tax_amount %>
- </td>
- <td>
- <%= reimbursement_type_name(return_item.preferred_reimbursement_type) %>
- </td>
- <td>
- <%= return_item.exchange_variant.try(:exchange_name) %>
- </td>
- <td>
- <%= return_item.acceptance_status_errors if return_item.acceptance_status_errors.present? %>
- </td>
- <% if show_decision %>
- <td class='actions'>
- <span class="d-flex justify-content-end">
- <%= button_to [:admin, return_item], { class: 'with-tip display-inline btn btn-success btn-sm', params: { "return_item[acceptance_status]" => 'accepted' }, "data-action" => 'save', title: Spree.t(:accept), method: 'put' } do %>
- <%= Spree.t(:accept) %>
- <% end if can?(:accept, return_item) %>
- <%= button_to [:admin, return_item], { class: 'with-tip display-inline btn btn-danger btn-sm', params: { "return_item[acceptance_status]" => 'rejected' }, "data-action" => 'remove', title: Spree.t(:reject), method: 'put' } do %>
- <%= Spree.t(:reject) %>
- <% end if can?(:reject, return_item) %>
- </span>
- </td>
- <% end %>
- </tr>
- <% end %>
- </tbody>
- </table>
-</div>
diff --git a/backend/app/views/spree/admin/customer_returns/_return_item_selection.html.erb b/backend/app/views/spree/admin/customer_returns/_return_item_selection.html.erb
deleted file mode 100644
index 129f0ce044..0000000000
--- a/backend/app/views/spree/admin/customer_returns/_return_item_selection.html.erb
+++ /dev/null
@@ -1,49 +0,0 @@
-<div class="table-responsive">
- <table class="table table-condensed table-bordered">
- <thead>
- <tr>
- <th>
- <%= check_box_tag 'select-all' %>
- </th>
- <th><%= Spree.t(:product) %></th>
- <th><%= Spree.t(:sku) %></th>
- <th><%= Spree.t(:pre_tax_amount) %></th>
- <th><%= Spree.t(:exchange_for) %></th>
- <th><%= Spree.t(:resellable) %></th>
- </tr>
- </thead>
- <tbody>
- <%= f.fields_for :return_items, return_items do |item_fields| %>
- <% return_item = item_fields.object %>
- <tr>
- <td class="align-center" class="inventory-unit-checkbox">
- <div style="display:none">
- <%= item_fields.hidden_field :inventory_unit_id %>
- <%= item_fields.hidden_field :return_authorization_id %>
- <%= item_fields.hidden_field :pre_tax_amount %>
- </div>
- <%= item_fields.check_box :returned, {checked: false, class: 'add-item', "data-price" => return_item.pre_tax_amount}, '1', '0' %>
- </td>
- <td>
- <div class="variant-name">
- <%= link_to return_item.inventory_unit.variant.name, spree.edit_admin_product_path(return_item.inventory_unit.variant.product) %>
- </div>
- <div class="variant-options"><%= return_item.inventory_unit.variant.options_text %></div>
- </td>
- <td>
- <%= return_item.inventory_unit.variant.sku %>
- </td>
- <td class="align-center">
- <%= return_item.display_pre_tax_amount %>
- </td>
- <td class="align-center">
- <%= return_item.exchange_variant.try(:exchange_name) %>
- </td>
- <td class="align-center">
- <%= item_fields.check_box :resellable, { checked: return_item.resellable } %>
- </td>
- </tr>
- <% end %>
- </tbody>
- </table>
-</div>
diff --git a/backend/app/views/spree/admin/customer_returns/edit.html.erb b/backend/app/views/spree/admin/customer_returns/edit.html.erb
deleted file mode 100644
index c54bc4f54b..0000000000
--- a/backend/app/views/spree/admin/customer_returns/edit.html.erb
+++ /dev/null
@@ -1,61 +0,0 @@
-<%= render partial: 'spree/admin/shared/order_tabs', locals: { current: :customer_returns } %>
-
-<% content_for :page_title do %>
- / <%= Spree.t(:customer_return) %> #<%= @customer_return.number %>
-<% end %>
-
-<% if @manual_intervention_return_items.any? %>
- <fieldset data-hook="manual_intervention_return_items">
- <legend><%= Spree.t(:manual_intervention_required) %></legend>
- <%= render partial: 'return_item_decision', locals: {return_items: @manual_intervention_return_items, show_decision: true} %>
- </fieldset>
-<% end %>
-
-<% if @pending_return_items.any? %>
- <fieldset data-hook="accepted_return_items">
- <legend><%= Spree.t(:pending) %></legend>
- <%= render partial: 'return_item_decision', locals: {return_items: @pending_return_items, show_decision: true} %>
- </fieldset>
-<% end %>
-
-<% if @accepted_return_items.any? %>
- <fieldset data-hook="accepted_return_items">
- <legend><%= Spree.t(:accepted) %></legend>
- <%= render partial: 'return_item_decision', locals: {return_items: @accepted_return_items, show_decision: false} %>
- </fieldset>
-<% end %>
-
-<% if @rejected_return_items.any? %>
- <fieldset data-hook="rejected_return_items">
- <legend><%= Spree.t(:rejected) %></legend>
- <%= render partial: 'return_item_decision', locals: {return_items: @rejected_return_items, show_decision: false} %>
- </fieldset>
-<% end %>
-
-<fieldset data-hook="reimbursements">
- <legend><%= plural_resource_name(Spree::Reimbursement) %></legend>
- <% if @customer_return.reimbursements.any? %>
- <%= render partial: 'reimbursements_table', locals: {reimbursements: @customer_return.reimbursements} %>
- <% else %>
- <div class="alert alert-info no-objects-found">
- <%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree::Reimbursement)) %>
- </div>
- <% end %>
-</fieldset>
-
-<% if !@customer_return.fully_reimbursed? && @pending_reimbursements.empty? && can?(:create, Spree::Reimbursement) %>
- <fieldset data-hook="reimbursements" class="mb-3">
- <% if @customer_return.completely_decided? %>
- <%= form_for [:admin, @order, Spree::Reimbursement.new] do |f| %>
- <%= hidden_field_tag :build_from_customer_return_id, @customer_return.id %>
- <%= f.button class: 'btn btn-primary' do %>
- <%= Spree.t(:create_reimbursement) %>
- <% end %>
- <% end %>
- <% else %>
- <div class="alert alert-info no-objects-found">
- <%= Spree.t(:unable_to_create_reimbursements) %>
- </div>
- <% end %>
- </fieldset>
-<% end %>
diff --git a/backend/app/views/spree/admin/customer_returns/index.html.erb b/backend/app/views/spree/admin/customer_returns/index.html.erb
deleted file mode 100644
index f6061368e5..0000000000
--- a/backend/app/views/spree/admin/customer_returns/index.html.erb
+++ /dev/null
@@ -1,60 +0,0 @@
-<%= render partial: 'spree/admin/shared/order_tabs', locals: { current: :customer_returns } %>
-
-<% content_for :page_actions do %>
- <% if @order.shipments.any?(&:shipped?) && can?(:create, Spree::CustomerReturn) %>
- <%= button_link_to Spree.t(:new_customer_return), spree.new_admin_order_customer_return_path(@order), icon: 'add.svg', class: 'btn-success' %>
- <% end %>
-<% end %>
-
-<% content_for :page_title do %>
- / <%= plural_resource_name(Spree::CustomerReturn) %>
-<% end %>
-
-<% if @order.shipments.any?(&:shipped?) %>
-
- <% if @customer_returns.any? %>
- <div class="table-responsive">
- <table class="table">
- <thead data-hook="customer_return_header">
- <tr>
- <th><%= Spree.t(:return_number) %></th>
- <th><%= Spree.t(:pre_tax_total) %></th>
- <th><%= "#{Spree.t('date')}/#{Spree.t('time')}" %></th>
- <th><%= Spree.t(:reimbursement_status) %></th>
- <th></th>
- </tr>
- </thead>
- <tbody>
- <% @customer_returns.each do |customer_return| %>
- <tr id="<%= spree_dom_id(customer_return) %>" data-hook="customer_return_row">
- <td><%= link_to customer_return.number, edit_admin_order_customer_return_path(@order, customer_return) %></td>
- <td><%= customer_return.display_pre_tax_total.to_html %></td>
- <td><%= pretty_time(customer_return.created_at) %></td>
- <td>
- <% if customer_return.fully_reimbursed? %>
- <strong class="badge badge-success text-uppercase"><%= Spree.t(:reimbursed) %></strong>
- <% else %>
- <strong class="badge badge-inactive text-uppercase"><%= Spree.t(:incomplete) %></strong>
- <% end %>
- </td>
- <td class='actions' data-hook="admin_orders_customer_returns_index_row_actions">
- <span class="d-flex justify-content-end">
- <%= link_to_edit_url(edit_admin_order_customer_return_path(@order, customer_return), title: "admin_edit_#{dom_id(customer_return)}", no_text: true) if can?(:edit, customer_return) %>
- </span>
- </td>
- </tr>
- <% end %>
- </tbody>
- </table>
- </div>
- <% else %>
- <div class="alert alert-info no-objects-found">
- <%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree::CustomerReturn)) %>,
- <%= link_to(Spree.t(:add_one), spree.new_admin_order_customer_return_path(@order)) if can?(:create, Spree::CustomerReturn) %>!
- </div>
- <% end %>
-<% else %>
- <div data-hook="customer_return_cannot_create" class="alert alert-info no-objects-found">
- <%= Spree.t(:cannot_create_customer_returns) %>
- </div>
-<% end %>
diff --git a/backend/app/views/spree/admin/customer_returns/new.html.erb b/backend/app/views/spree/admin/customer_returns/new.html.erb
deleted file mode 100644
index 8f5ebffed7..0000000000
--- a/backend/app/views/spree/admin/customer_returns/new.html.erb
+++ /dev/null
@@ -1,47 +0,0 @@
-<%= render partial: 'spree/admin/shared/order_tabs', locals: { current: :customer_returns } %>
-
-<% content_for :page_title do %>
- / <%= Spree.t(:new_customer_return) %>
-<% end %>
-
-<% if @rma_return_items.any? %>
-
- <%= render partial: 'spree/admin/shared/error_messages', locals: { target: @customer_return } %>
-
- <%= form_for [:admin, @order, @customer_return] do |f| %>
- <fieldset class="no-border-top">
- <div data-hook="admin_customer_return_form_fields">
- <fieldset>
- <legend><%= Spree.t(:items_in_rmas) %></legend>
- <% if @rma_return_items.any? %>
- <%= render partial: 'return_item_selection', locals: {f: f, return_items: @rma_return_items} %>
- <% else %>
- <div class="alert alert-info no-objects-found">
- <%= Spree.t(:none) %>
- </div>
- <% end %>
- </fieldset>
-
- <%= f.field_container :stock_location, class: ['form-group'] do %>
- <%= f.label :stock_location, Spree.t(:stock_location) %> <span class="required">*</span>
- <%= f.select :stock_location_id, Spree::StockLocation.order_default.active.to_a.collect{|l|[l.name.humanize, l.id]}, {include_blank: true}, {class: 'select2-clear', "data-placeholder" => Spree.t(:select_a_stock_location)} %>
- <%= f.error_message_on :stock_location %>
- <% end %>
- </div>
-
- <div class="form-actions" data-hook="buttons">
- <%= button Spree.t(:create), 'save' %>
- <span class="or"><%= Spree.t(:or) %></span>
- <%= button_link_to Spree.t('actions.cancel'), spree.admin_order_customer_returns_url(@order), icon: 'cancel' %>
- </div>
- </fieldset>
- <% end %>
-
-<% else %>
-
- <div class="alert alert-info no-objects-found">
- <%= Spree.t(:all_items_have_been_returned) %>,
- <%= link_to Spree.t(:back_to_resource_list, resource: Spree::CustomerReturn.model_name.human), spree.admin_order_customer_returns_path(@order) %>.
- </div>
-
-<% end %>
diff --git a/backend/app/views/spree/admin/errors/forbidden.html.erb b/backend/app/views/spree/admin/errors/forbidden.html.erb
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/backend/app/views/spree/admin/general_settings/edit.html.erb b/backend/app/views/spree/admin/general_settings/edit.html.erb
deleted file mode 100644
index 8267e9d2b9..0000000000
--- a/backend/app/views/spree/admin/general_settings/edit.html.erb
+++ /dev/null
@@ -1,96 +0,0 @@
-<% content_for :page_title do %>
- <%= Spree.t(:general_settings) %>
-<% end %>
-
-<%= form_tag admin_general_settings_path, method: :put do %>
- <div id="preferences" data-hook>
-
- <fieldset class="general no-border-top">
-
- <div class="row">
- <div class="col-12 col-lg-6">
- <%#-------------------------------------------------%>
- <%# Security settings %>
- <%#-------------------------------------------------%>
- <% if @preferences_security.any? %>
- <div class="card mb-3" id="general-settings-security" data-hook="general_settings_security">
- <div class="card-header">
- <h1 class="card-title mb-0 h5">
- <%= Spree.t(:security_settings) %>
- </h1>
- </div>
-
- <div class="card-body">
- <% @preferences_security.each do |key|
- type = Spree::Config.preference_type(key) %>
- <div class="checkbox">
- <%= label_tag key do %>
- <%= preference_field_tag(key, Spree::Config[key], type: type) %>
- <%= Spree.t(key) %>
- <% end %>
- </div>
- <% end %>
- </div>
- </div>
- <% end %>
-
- <%#-------------------------------------------------%>
- <%# Clear cache %>
- <%#-------------------------------------------------%>
- <div class="card mb-3" id="general-settings-cache" data-hook="general_settings_cache">
- <div class="card-header">
- <h1 class="card-title mb-0 h5"><%= Spree.t(:clear_cache) %></h1>
- </div>
-
- <div class="card-body">
- <div class="clear-cache-warning alert alert-warning">
- <%= Spree.t(:clear_cache_warning) %>
- </div>
- <div data-hook="general_settings_clear_cache">
- <%= button Spree.t(:clear_cache), 'recycle.svg', 'button', id: "clear_cache" %>
- </div>
- </div>
- </div>
-
- </div>
- <div class="col-12 col-lg-6">
-
- <%#-------------------------------------------------%>
- <%# Currency Settings %>
- <%#-------------------------------------------------%>
- <div class="card mb-3" id="general-settings-currency" data-hook="general_settings_currency">
- <div class="card-header">
- <h1 class="card-title mb-0 h5">
- <%= Spree.t(:currency_settings) %>
- </h1>
- </div>
-
- <div class="card-body">
- <div class="alert alert-warning col-12">
- This can be overriden by individual Store settings
- </div>
- <div class="form-group">
- <%= label_tag :currency, Spree.t(:default_currency) %>
- <%= select_tag :currency, currency_options %>
- </div>
- </div>
- </div>
- </div>
- </div>
-
- <div class="form-actions" data-hook="buttons">
- <%= button Spree.t('actions.update'), 'save.svg' %>
- <span class="or"><%= Spree.t(:or) %></span>
- <%= button_link_to Spree.t('actions.cancel'), edit_admin_general_settings_url, icon: 'cancel.svg' %>
- </div>
-
- </fieldset>
-
- </div>
-
-<% end %>
-
-<script>
- $('#store_default_currency').select2();
- $('#currency').select2();
-</script>
diff --git a/backend/app/views/spree/admin/images/_form.html.erb b/backend/app/views/spree/admin/images/_form.html.erb
deleted file mode 100644
index 4d31f02642..0000000000
--- a/backend/app/views/spree/admin/images/_form.html.erb
+++ /dev/null
@@ -1,18 +0,0 @@
-<div data-hook="admin_image_form_fields" class="row">
- <div class="col-12 col-md-6">
- <div data-hook="file" class="form-group">
- <%= f.label :attachment, Spree.t(:filename) %>
- <%= f.file_field :attachment %>
- </div>
- <div data-hook="variant" class="form-group">
- <%= f.label :viewable_id, Spree::Variant.model_name.human %>
- <%= f.select :viewable_id, @variants, {}, {class: 'select2'} %>
- </div>
- </div>
- <div data-hook="alt_text" class="col-12 col-md-6">
- <div class="form-group">
- <%= f.label :alt, Spree.t(:alt_text) %>
- <%= f.text_area :alt, rows: 4, class: 'form-control' %>
- </div>
- </div>
-</div>
diff --git a/backend/app/views/spree/admin/images/edit.html.erb b/backend/app/views/spree/admin/images/edit.html.erb
deleted file mode 100644
index 8e77052118..0000000000
--- a/backend/app/views/spree/admin/images/edit.html.erb
+++ /dev/null
@@ -1,30 +0,0 @@
-<%= render partial: 'spree/admin/shared/product_tabs', locals: { current: :images } %>
-
-<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @image } %>
-
-<%= form_for [:admin, @product, @image], html: { multipart: true } do |f| %>
- <div data-hook="edit_image" class="card mb-3">
- <div class="card-header">
- <h1 class="card-title mb-0 h5">
- <%= @image.attachment_file_name %>
- </h1>
- </div>
- <div class="card-body">
- <div class="form-group">
- <div data-hook="thumbnail" class="col-12 col-lg-3 text-center">
- <%= f.label Spree.t(:thumbnail) %>
- <%= link_to image_tag(main_app.url_for(@image.url(:small))), main_app.rails_blob_url(@image.attachment) %>
- </div>
- <div class="col-12 col-lg-9">
- <%= render partial: 'form', locals: { f: f } %>
- </div>
-
- <div class="form-actions" data-hook="buttons">
- <%= button Spree.t('actions.update'), 'save.svg' %>
- <span class="or"><%= Spree.t(:or) %></span>
- <%= button_link_to Spree.t('actions.cancel'), spree.admin_product_images_url(@product), id: 'cancel_link', icon: 'cancel.svg' %>
- </div>
- </div>
- </div>
- </div>
-<% end %>
diff --git a/backend/app/views/spree/admin/images/index.html.erb b/backend/app/views/spree/admin/images/index.html.erb
deleted file mode 100644
index e98db044eb..0000000000
--- a/backend/app/views/spree/admin/images/index.html.erb
+++ /dev/null
@@ -1,63 +0,0 @@
-<%= render partial: 'spree/admin/shared/product_tabs', locals: { current: :images } %>
-
-<% content_for :page_actions do %>
- <%= yield :page_actions %>
- <%= product_preview_link(@product) %>
- <%= button_link_to(Spree.t(:new_image), spree.new_admin_product_image_url(@product), { class: "btn-success", icon: 'add.svg', id: 'new_image_link' }) if can? :create, Spree::Image %>
-<% end %>
-
-<% has_variants = @product.has_variants? %>
-
-<% unless @product.variant_images.any? %>
- <div class="alert alert-warning">
- <%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree::Image)) %>.
- </div>
-<% else %>
-<div class="table-responsive">
- <table class="table sortable" data-hook="images_table" data-sortable-link="<%= update_positions_admin_product_images_url(@product) %>">
- <thead>
- <tr data-hook="images_header">
- <th colspan="2">
- <%= Spree.t(:thumbnail) %>
- </th>
- <% if has_variants %>
- <th>
- <%= Spree::Variant.model_name.human %>
- </th>
- <% end %>
- <th>
- <%= Spree.t(:alt_text) %>
- </th>
- <th class="actions"></th>
- </tr>
- </thead>
-
- <tbody id="sortVert">
- <% (@product.variant_images).each do |image| %>
- <tr id="<%= spree_dom_id image %>" data-hook="images_row">
- <td class="move-handle text-center">
- <% if can? :edit, image %>
- <%= svg_icon name: "sort.svg", width: '18', height: '18' %>
- <% end %>
- </td>
- <td class="image">
- <div class="admin-product-image-container small-img">
- <%= link_to image_tag(main_app.url_for(image.url(:product))), main_app.rails_blob_url(image.attachment) %>
- </div>
- </td>
- <% if has_variants %>
- <td><%= options_text_for(image) %></td>
- <% end %>
- <td><%= image.alt %></td>
- <td class="actions">
- <span class="d-flex justify-content-end">
- <%= link_to_with_icon('edit.svg', Spree.t(:edit), spree.edit_admin_product_image_url(@product, image), class: 'btn btn-primary btn-sm', no_text: true, data: { action: 'edit' }) if can? :edit, image %>
- <%= link_to_delete(image, { url: spree.admin_product_image_url(@product, image), no_text: true }) if can? :destroy, image %>
- </span>
- </td>
- </tr>
- <% end %>
- </tbody>
- </table>
-</div>
-<% end %>
diff --git a/backend/app/views/spree/admin/images/new.html.erb b/backend/app/views/spree/admin/images/new.html.erb
deleted file mode 100644
index 0a62c4957d..0000000000
--- a/backend/app/views/spree/admin/images/new.html.erb
+++ /dev/null
@@ -1,19 +0,0 @@
-<%= render partial: 'spree/admin/shared/product_tabs', locals: { current: :images } %>
-
-<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @object } %>
-
-<% content_for :page_title do %>
- <%= Spree.t(:new_image) %>
-<% end %>
-
-<%= form_for [:admin, @product, @image], html: { multipart: true } do |f| %>
- <fieldset data-hook="new_image">
- <%= render partial: 'form', locals: { f: f } %>
-
- <div class="form-actions" data-hook="buttons">
- <%= button Spree.t('actions.create'), 'save.svg' %>
- <span class="or"><%= Spree.t(:or) %></span>
- <%= button_link_to Spree.t('actions.cancel'), spree.admin_product_images_url(@product), icon: 'delete.svg', id: 'cancel_link' %>
- </div>
- </fieldset>
-<% end %>
diff --git a/backend/app/views/spree/admin/log_entries/index.html.erb b/backend/app/views/spree/admin/log_entries/index.html.erb
deleted file mode 100644
index 2d2b1e5fd6..0000000000
--- a/backend/app/views/spree/admin/log_entries/index.html.erb
+++ /dev/null
@@ -1,34 +0,0 @@
-<%= render partial: 'spree/admin/shared/order_tabs', locals: { current: :payments } %>
-
-<% content_for :page_title do %>
- /
- <%= I18n.t(:one, scope: "activerecord.models.spree/payment") %>
- /
- <%= Spree.t(:log_entries) %>
-<% end %>
-
-<% content_for :page_actions do %>
- <%= button_link_to Spree.t(:logs), spree.admin_order_payment_log_entries_url(@order, @payment), icon: 'file.svg' %>
-<% end %>
-<div class="table-responsive">
-<table class="table" id='listing_log_entries'>
- <% @log_entries.each do |entry| %>
- <thead>
- <tr class="log_entry <%= entry.parsed_details.success? ? 'success' : 'fail' %>">
- <td colspan="2">
- <h4>
- <i class="icon icon-<%= entry.parsed_details.success? ? 'save' : 'cancel' %>"></i>
- <%= pretty_time(entry.created_at) %>
- </h4>
- </td>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>Message</td>
- <td><%= entry.parsed_details.message %></td>
- </tr>
- </tbody>
- <% end %>
-</table>
-</div>
diff --git a/backend/app/views/spree/admin/menu_items/_form.html.erb b/backend/app/views/spree/admin/menu_items/_form.html.erb
deleted file mode 100644
index e505ebb90a..0000000000
--- a/backend/app/views/spree/admin/menu_items/_form.html.erb
+++ /dev/null
@@ -1,115 +0,0 @@
-<div data-hook="admin_menu_item_form_fields">
- <div class="row">
- <div class="col-12 col-md-6">
- <div class="card mb-3">
- <div class="card-header">
- <h5 class="mb-0"><%= Spree.t('admin.navigation.settings') %></h5>
- </div>
- <div class="card-body">
- <%= f.field_container :item_type, class: ['form-group'] do %>
- <%= f.label :item_type, Spree.t('admin.navigation.item_type') %>
- <%= f.select(:item_type, @menu_item_types, {include_blank: false}) %>
- <%= f.error_message_on :item_type %>
- <% end %>
-
- <%= f.field_container :code, class: ['form-group'] do %>
- <%= f.label :code, Spree.t('admin.navigation.code') %>
- <%= f.text_field :code, class: 'form-control' %>
- <%= f.error_message_on :code %>
- <small class="form-text text-muted">
- <%= raw Spree.t('admin.navigation.set_a_code') %>
- </small>
- <% end %>
-
- <%= f.field_container :parent_id, class: ['form-group'] do %>
- <%= f.label :parent_id, Spree.t('admin.navigation.nested_under') %>
- <%= f.select :parent_id, nested_set_options(@menu.menu_items, @menu_item) {|i| "#{'-' * i.level} #{i.name}" }, {include_blank: false}, {class: 'select2'} %>
- <%= f.error_message_on :parent_id %>
- <small class="form-text text-muted">
- <%= Spree.t('admin.navigation.nested_under_info') %>
- </small>
- <% end %>
- </div>
- </div>
- </div>
-
- <div class="col-12 col-md-6">
- <div class="card mb-3">
- <div class="card-header">
- <h5 class="mb-0"><%= Spree.t('admin.navigation.public_details') %></h5>
- </div>
- <div class="card-body">
- <%= f.field_container :name, class: ['form-group'] do %>
- <%= f.label :name, raw(Spree.t(:name) + required_span_tag) %>
- <%= f.text_field :name, class: 'form-control', required: true %>
- <%= f.error_message_on :name %>
- <% end %>
-
- <%= f.field_container :subtitle, class: ['form-group'] do %>
- <%= f.label :subtitle, Spree.t('admin.navigation.subtitle') %>
- <%= f.text_field :subtitle, class: 'form-control' %>
- <%= f.error_message_on :subtitle %>
- <% end %>
-
- <% @menu_item.build_icon unless @menu_item.icon %>
- <%= f.fields_for :icon do |icon_field| %>
- <%= f.field_container :icon_attachment do %>
- <% unless @menu_item.icon.new_record? %>
- <div id="menuItemImgContainer" class="my-3 ">
- <%= image_tag(main_app.url_for(@menu_item.icon.attachment)) %>
- <%= link_to Spree.t(:remove_image), remove_icon_admin_menu_menu_item_path(@menu, @menu_item), method: :delete %>
- </div>
- <% end %>
- <div id="<% unless @menu_item.icon.new_record? %>MenuItemImageButton<% end %>">
- <%= icon_field.file_field :attachment %>
- </div>
- <small class="form-text text-muted">
- <%= raw Spree.t('admin.navigation.image_info') %>
- </small>
- <% end %>
-
- <%= f.field_container :icon_alt do %>
- <% unless @menu_item.icon.new_record? %>
- <div class="form-group my-3">
- <%= icon_field.label :alt, Spree.t('admin.navigation.image_alt_text') %>
- <%= icon_field.text_field :alt, class: 'form-control' %>
- </div>
- <% end %>
- <% end %>
- <% end %>
- </div>
- </div>
- </div>
- </div>
-
- <div class="row">
- <div class="col-12">
-
- <div id="LinkSettings">
- <div class="card mb-3">
- <div class="card-header">
- <h5 class="mb-0"><%= Spree.t('admin.navigation.link_settings') %></h5>
- </div>
- <div class="card-body">
- <div class="row">
- <div class="col-12 col-md-6">
- <%= f.field_container :linked_resource_type, class: ['form-group'] do %>
- <%= f.label :linked_resource_type, Spree.t('admin.navigation.link_to') %>
- <%= f.select(:linked_resource_type, spree_humanize_dropdown_values('Spree::MenuItem', {const: 'LINKED_RESOURCE_TYPE'}), {include_blank: false}, class: 'link_switcher') %>
- <%= f.error_message_on :linked_resource_type %>
- <% end %>
- </div>
- <div class="col-12 col-md-6">
- <%= render "spree/admin/shared/link_fields", resource: @menu_item, f: f %>
- </div>
- </div>
- </div>
- </div>
- </div>
-
- <div id="usingContainerInfo" class="alert alert-info">
- <%= raw Spree.t('admin.navigation.menu_item_type_container_message') %>
- </div>
- </div>
- </div>
-</div>
diff --git a/backend/app/views/spree/admin/menu_items/edit.html.erb b/backend/app/views/spree/admin/menu_items/edit.html.erb
deleted file mode 100644
index 36317d8b24..0000000000
--- a/backend/app/views/spree/admin/menu_items/edit.html.erb
+++ /dev/null
@@ -1,11 +0,0 @@
-<% content_for :page_title do %>
- <%= link_to Spree.t('admin.navigation.all_menus'), spree.admin_menus_path %> /
- <%= link_to @menu.name, spree.edit_admin_menu_path(@menu) %> / <%= @menu_item.name %>
-<% end %>
-
-<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @menu_item } %>
-
-<%= form_for [:admin, @menu, @menu_item] do |f| %>
- <%= render partial: 'form', locals: { f: f } %>
- <%= render partial: 'spree/admin/shared/edit_resource_links' %>
-<% end %>
diff --git a/backend/app/views/spree/admin/menu_items/new.html.erb b/backend/app/views/spree/admin/menu_items/new.html.erb
deleted file mode 100644
index b08df78fa7..0000000000
--- a/backend/app/views/spree/admin/menu_items/new.html.erb
+++ /dev/null
@@ -1,11 +0,0 @@
-<% content_for :page_title do %>
- <%= link_to Spree.t('admin.navigation.all_menus'), spree.admin_menus_path %> /
- <%= link_to @menu.name, spree.edit_admin_menu_path(@menu) %> / <%= Spree.t('admin.navigation.new_menu_item') %>
-<% end %>
-
-<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @menu_item } %>
-
-<%= form_for [:admin, @menu, @menu_item] do |f| %>
- <%= render partial: 'form', locals: { f: f } %>
- <%= render partial: 'spree/admin/shared/new_resource_links' %>
-<% end %>
diff --git a/backend/app/views/spree/admin/menus/_form.html.erb b/backend/app/views/spree/admin/menus/_form.html.erb
deleted file mode 100644
index 684deeab2d..0000000000
--- a/backend/app/views/spree/admin/menus/_form.html.erb
+++ /dev/null
@@ -1,19 +0,0 @@
-<div data-hook="admin_menu_form_fields" class="row">
- <%= f.field_container :name, class: ['form-group col-12 col-md-4'] do %>
- <%= f.label :name, raw(Spree.t(:name) + required_span_tag) %>
- <%= f.text_field :name, class: 'form-control', required: true %>
- <%= f.error_message_on :name %>
- <% end %>
-
- <%= f.field_container :location, class: ['form-group col-12 col-md-4'] do %>
- <%= f.label :location, Spree.t('location') %>
- <%= f.select(:location, spree_humanize_dropdown_values('Spree::Menu', { const: 'MENU_LOCATIONS', paramterize_values: true }), {include_blank: false}, class: 'select2') %>
- <%= f.error_message_on :location %>
- <% end %>
-
- <%= f.field_container :locale, class: ['form-group col-12 col-md-4'] do %>
- <%= f.label :language %>
- <%= f.select :locale, options_from_collection_for_select(all_locales_options, :last, :first, @menu.locale || I18n.locale), {}, { class: 'select2' } %>
- <%= f.error_message_on :default_locale %>
- <% end %>
-</div>
diff --git a/backend/app/views/spree/admin/menus/edit.html.erb b/backend/app/views/spree/admin/menus/edit.html.erb
deleted file mode 100644
index e695f20d2f..0000000000
--- a/backend/app/views/spree/admin/menus/edit.html.erb
+++ /dev/null
@@ -1,57 +0,0 @@
-<% content_for :page_title do %>
- <%= link_to Spree.t('admin.navigation.all_menus'), spree.admin_menus_path %> / <%= @menu.name %>
-<% end %>
-
-<div class="row">
- <div class="col-12">
- <div class="card mb-3">
- <div class="card-header">
- <h5 class="mb-0"><%= Spree.t('settings') %></h5>
- </div>
- <div class="card-body">
- <%= render partial: 'spree/admin/shared/error_messages', locals: { target: @menu } %>
- <%= form_for [:admin, @menu] do |f| %>
- <%= render partial: 'form', locals: { f: f } %>
- <div class="d-flex ">
- <%= render partial: 'spree/admin/shared/edit_resource_links' %>
- </div>
- <% end %>
- </div>
- </div>
- </div>
-</div>
-
-<div id="menuArea">
- <div class="row mt-2">
- <div class="col-12">
- <div class="card mb-3">
- <div class="card-header">
- <div class="row pb-0">
- <div class="col d-flex">
- <h5 class="mb-0 align-self-center"><%= Spree.t('admin.navigation.menu_items', menu_name: @menu.name) %></h5>
- </div>
- <div class="col d-flex justify-content-end">
- <%= button_link_to Spree.t('admin.navigation.add_new_item', menu: @menu.name), spree.new_admin_menu_menu_item_path(@menu), icon: 'add.svg', class: 'no-wrap btn btn-success align-self-center' %>
- </div>
- </div>
- </div>
-
- <% if @menu.root.present? %>
- <div class="card-body p-0 bg-light">
- <div id="primaryMenuContainer" class="menu-container" data-parent-id="<%= @menu.root.id %>">
- <% if @menu.root.children.present? %>
- <% @menu.root.children.each do |root_children| %>
- <%= build_menu_item(@menu, root_children) %>
- <% end %>
- <% else %>
- <div class="alert alert-info no-objects-found m-5">
- <%= raw Spree.t('admin.navigation.no_menu_items', menu: @menu.root.name) %>
- </div>
- <% end %>
- </div>
- </div>
- <% end %>
- </div>
- </div>
- </div>
-</div>
diff --git a/backend/app/views/spree/admin/menus/index.html.erb b/backend/app/views/spree/admin/menus/index.html.erb
deleted file mode 100644
index f3a56f9b29..0000000000
--- a/backend/app/views/spree/admin/menus/index.html.erb
+++ /dev/null
@@ -1,90 +0,0 @@
-<% content_for :page_title do %>
- <%= Spree.t('admin.navigation.menus') %>
-<% end %>
-
-<% content_for :page_actions do %>
- <%= button_link_to Spree.t('admin.navigation.add_new_menu'), new_object_url, { class: "btn-success", icon: 'add.svg', id: 'new_menu' } %>
-<% end if can?(:create, Spree::Menu) %>
-
-<% content_for :table_filter do %>
- <div data-hook="admin_menus_sidebar">
- <%= search_form_for [:admin, @search] do |f| %>
- <%- locals = {f: f} %>
- <div class="row">
-
- <div class="col-12 col-lg-4">
- <div class="form-group">
- <%= f.label :name_cont, Spree.t('name') %>
- <%= f.text_field :name_cont, size: 15, class: "form-control js-quick-search-target js-filterable" %>
- </div>
- </div>
- <div class="col-12 col-lg-4">
- <div class="form-group">
- <%= label_tag :q_location_eq, Spree.t(:location) %><%= f.select :location_eq, spree_humanize_dropdown_values('Spree::Menu', { const: 'MENU_LOCATIONS', paramterize_values: true }), { include_blank: true }, class: 'select2-clear js-filterable' %>
- </div>
- </div>
-
- <div class="col-12 col-lg-4">
- <div class="form-group">
- <%= label_tag :q_locale_eq, Spree.t(:language) %>
- <%= f.select :locale_eq, all_locales_options, { include_blank: true }, class: 'select2-clear js-filterable' %>
- </div>
- </div>
- </div>
-
- <div data-hook="admin_menus_index_search_buttons" class="form-actions">
- <%= button Spree.t(:search), 'search.svg' %>
- </div>
- <% end %>
- </div>
-<% end %>
-
-<% if @menus.any? %>
-<div class="table-responsive">
- <table class="table" id="menusTable">
- <thead>
- <th scope="col"><%= Spree.t(:name) %></th>
- <th scope="col"><%= Spree.t('location') %></th>
- <th scope="col"><%= Spree.t('language') %></th>
- <th class="text-center" scope="col"><%= Spree.t('default') %>
- <span data-show-info
- data-alert-kind="info"
- data-alert-title="<%= Spree.t('admin.navigation.default_menus_info.title') %>"
- data-alert-html="<%= Spree.t('admin.navigation.default_menus_info.body') %>">
- <%= svg_icon name: "info.svg", width: '15', height: '15' %>
- </span>
- </th>
- <th scope="col"></th>
- </thead>
- <tbody>
- <% @menus.each do |menu| %>
- <tr>
- <td>
- <%= menu.name %>
- </td>
- <td>
- <%= menu.location.titleize %>
- </td>
- <td>
- <%= locale_full_name(menu.locale) %>
- </td>
- <td class="text-center">
- <%= active_badge(default_menu_for_store?(menu)) %>
- </td>
- <td class="actions" data-hook="admin_menus_index_row_actions">
- <span class="d-flex justify-content-end">
- <%= link_to_edit(menu, no_text: true) %>
- <%= link_to_delete menu, no_text: true, url: spree.admin_menu_path(menu) if can?(:destroy, menu) %>
- </span>
- </td>
- </tr>
- <% end %>
- </tbody>
- </table>
-</div>
-<%= render 'spree/admin/shared/index_table_options', collection: @menus, simple: true %>
-<% else %>
- <div class="alert alert-info no-objects-found">
- <%= Spree.t('admin.navigation.you_have_no_menus') %>
- </div>
-<% end %>
diff --git a/backend/app/views/spree/admin/menus/nested_menu_items/_item_bar.html.erb b/backend/app/views/spree/admin/menus/nested_menu_items/_item_bar.html.erb
deleted file mode 100644
index 3f46b2ad64..0000000000
--- a/backend/app/views/spree/admin/menus/nested_menu_items/_item_bar.html.erb
+++ /dev/null
@@ -1,30 +0,0 @@
-<div class="container-item-row d-flex flex-nowrap">
- <div class="move-handle d-flex align-items-center p-3">
- <%= svg_icon(name: 'sort.svg', width: '20', height: '20') %>
- </div>
-
- <div class="d-flex align-items-center overflow-hidden w-100">
- <div class="overflow-hidden">
- <%= item.name %>
- <% if item.link.present? %>
- <span class="badge badge-light badge-light-muted-text">-> <%= item.link %></span>
- <% end %>
- <small class="form-text text-muted mt-0">
- <%= "#{Spree.t('admin.navigation.type')}: #{item.item_type}" %>
- <%= "| #{Spree.t('admin.navigation.code')}: #{item.code}" if item.code.present? %>
- </small>
- </div>
- <% if item.icon.present? %>
- <div class="ml-2">
- <div class="menu_items_image_holder">
- <%= image_tag main_app.url_for(item.icon.attachment) %>
- </div>
- </div>
- <% end %>
- </div>
-
- <div class="d-flex align-items-center space-buttons px-2">
- <%= link_to_edit(item, no_text: true, url: spree.edit_admin_menu_menu_item_path(menu, item)) %>
- <%= link_to_delete(item, no_text: true, url: spree.admin_menu_menu_item_path(menu, item)) if can?(:destroy, item) %>
- </div>
-</div>
diff --git a/backend/app/views/spree/admin/menus/new.html.erb b/backend/app/views/spree/admin/menus/new.html.erb
deleted file mode 100644
index 251da4a221..0000000000
--- a/backend/app/views/spree/admin/menus/new.html.erb
+++ /dev/null
@@ -1,22 +0,0 @@
-<% content_for :page_title do %>
- <%= link_to Spree.t('admin.navigation.all_menus'), spree.admin_menus_path %> / <%= Spree.t('admin.navigation.new_menu') %>
-<% end %>
-
-<div class="row">
- <div class="col-12">
- <div class="card mb-3">
- <div class="card-header">
- <h5 class="mb-0"><%= Spree.t('settings') %></h5>
- </div>
- <div class="card-body">
- <%= render partial: 'spree/admin/shared/error_messages', locals: { target: @menu } %>
- <%= form_for [:admin, @menu] do |f| %>
- <%= render partial: 'form', locals: { f: f } %>
- <div class="d-flex ">
- <%= render partial: 'spree/admin/shared/new_resource_links' %>
- </div>
- <% end %>
- </div>
- </div>
- </div>
-</div>
diff --git a/backend/app/views/spree/admin/option_types/_form.html.erb b/backend/app/views/spree/admin/option_types/_form.html.erb
deleted file mode 100644
index 43809b506b..0000000000
--- a/backend/app/views/spree/admin/option_types/_form.html.erb
+++ /dev/null
@@ -1,29 +0,0 @@
-<div data-hook="admin_option_type_form_fields" class="row">
- <div class="col-12 col-md-6">
- <%= f.field_container :name, class: ['form-group'] do %>
- <%= f.label :name, Spree.t(:name) %> <span class="required">*</span>
- <%= f.text_field :name, class: "form-control" %>
- <%= f.error_message_on :name %>
- <% end %>
- </div>
-
- <div class="col-12 col-md-6">
- <%= f.field_container :presentation, class: ['form-group'] do %>
- <%= f.label :presentation, Spree.t(:presentation) %> <span class="required">*</span>
- <%= f.text_field :presentation, class: "form-control" %>
- <%= f.error_message_on :presentation %>
- <% end %>
- </div>
-
- <div class="col-12 col-md-6">
- <%= f.field_container :filterable, class: ['form-group'] do %>
- <%= label_tag :option_type_filterable do %>
- <%= f.check_box :filterable %>
- <%= Spree.t(:filterable) %>
- <% end %>
- <small class="form-text text-muted">
- <%= raw Spree.t('option_type_filterable_info') %>
- </small>
- <% end %>
- </div>
-</div>
diff --git a/backend/app/views/spree/admin/option_types/_option_value_fields.html.erb b/backend/app/views/spree/admin/option_types/_option_value_fields.html.erb
deleted file mode 100644
index e3f628ad20..0000000000
--- a/backend/app/views/spree/admin/option_types/_option_value_fields.html.erb
+++ /dev/null
@@ -1,13 +0,0 @@
-<tr class="option_value fields" id="spree_<%= dom_id(f.object) %>" data-hook="option_value">
- <td class="move-handle text-center">
- <%= svg_icon name: "sort.svg", width: '18', height: '18' %>
- <%= f.hidden_field :id %>
- </td>
- <td class="name"><%= f.text_field :name, class: "form-control" %></td>
- <td class="presentation"><%= f.text_field :presentation, class: "form-control" %></td>
- <td class="actions">
- <span class="d-flex justify-content-end">
- <%= link_to_icon_remove_fields f %>
- </span>
- </td>
-</tr>
diff --git a/backend/app/views/spree/admin/option_types/edit.html.erb b/backend/app/views/spree/admin/option_types/edit.html.erb
deleted file mode 100644
index 7e6d56ad3e..0000000000
--- a/backend/app/views/spree/admin/option_types/edit.html.erb
+++ /dev/null
@@ -1,51 +0,0 @@
-<% content_for :page_title do %>
- <%= link_to Spree.t(:option_types), spree.admin_option_types_url %> /
- <%= @option_type.name %>
-<% end %>
-
-<% content_for :page_actions do %>
- <span id="new_add_option_value" data-hook>
- <%= button_link_to Spree.t(:add_option_value), "javascript:;", { icon: 'add.svg', :'data-target' => "tbody#sortVert", class: 'btn-success spree_add_fields' } %>
- </span>
-<% end %>
-
-<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @option_type } %>
-
-<%= form_for [:admin, @option_type] do |f| %>
- <div class="card mb-3">
- <div class="card-header">
- <h1 class="card-title mb-0 h5">
- <%= Spree.t(:option_values) %>
- </h1>
- </div>
- <div class="card-body">
- <%= render partial: 'form', locals: { f: f } %>
- </div>
- <div class="table-responsive">
- <table class="table table-condensed sortable" data-hook data-sortable-link="<%= update_values_positions_admin_option_types_url %>">
- <thead data-hook="option_header">
- <tr>
- <th colspan="2"><%= Spree.t(:name) %> <span class="required">*</span></th>
- <th><%= Spree.t(:display) %> <span class="required">*</span></th>
- <th class="actions"></th>
- </tr>
- </thead>
- <tbody id="sortVert">
- <% if @option_type.option_values.empty? %>
- <tr id="none" data-hook="option_none">
- <td colspan="2"><%= Spree.t(:none) %></td>
- <td class="actions text-center"></td>
- </tr>
- <% else %>
- <%= f.fields_for :option_values do |option_value_form| %>
- <%= render partial: 'option_value_fields', locals: { f: option_value_form } %>
- <% end %>
- <% end %>
- </tbody>
- </table>
- </div>
- <div class="card-footer text-center">
- <%= render partial: 'spree/admin/shared/edit_resource_links' %>
- </div>
- </div>
-<% end %>
diff --git a/backend/app/views/spree/admin/option_types/index.html.erb b/backend/app/views/spree/admin/option_types/index.html.erb
deleted file mode 100644
index b4f293d22b..0000000000
--- a/backend/app/views/spree/admin/option_types/index.html.erb
+++ /dev/null
@@ -1,50 +0,0 @@
-<% content_for :page_title do %>
- <%= plural_resource_name(Spree::OptionType) %>
-<% end %>
-
-<% content_for :page_actions do %>
- <span id="new_ot_link">
- <%= button_link_to Spree.t(:new_option_type), new_object_url, { class: "btn-success", icon: 'add.svg', id: 'new_option_type_link' } %>
- </span>
-<% end if can?(:create, Spree::OptionType) %>
-
-<div id="new_option_type"></div>
-
-<% if @option_types.any? %>
-<div class="table-responsive">
- <table class="table sortable" id="listing_option_types" data-hook data-sortable-link="<%= update_positions_admin_option_types_url %>">
- <thead>
- <tr data-hook="option_header">
- <th class="no-border handel-head"></th>
- <th><%= Spree.t(:name) %></th>
- <th><%= Spree.t(:presentation) %></th>
- <th><%= Spree.t(:filterable) %></th>
- <th class="actions"></th>
- </tr>
- </thead>
- <tbody id="sortVert">
- <% @option_types.each do |option_type| %>
- <tr class="spree_option_type <%= cycle('odd', 'even') %>" id="<%= spree_dom_id option_type %>" data-hook="option_row">
- <td class="move-handle text-center">
- <%= svg_icon name: "sort.svg", width: '18', height: '18' %>
- </td>
- <td><%= option_type.name %></td>
- <td class="presentation"><%= option_type.presentation %></td>
- <td><%= active_badge(option_type.filterable) %></td>
- <td class="actions">
- <span class="d-flex justify-content-end">
- <%= link_to_edit(option_type, class: 'admin_edit_option_type', no_text: true) if can?(:edit, option_type) %>
- <%= link_to_delete(option_type, no_text: true) if can?(:delete, option_type) %>
- </span>
- </td>
- </tr>
- <% end %>
- </tbody>
- </table>
-</div>
-<% else %>
- <div class="alert alert-info no-objects-found">
- <%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree::OptionType)) %>,
- <%= link_to Spree.t(:add_one), new_object_url if can?(:create, Spree::OptionType) %>!
- </div>
-<% end %>
diff --git a/backend/app/views/spree/admin/option_types/new.html.erb b/backend/app/views/spree/admin/option_types/new.html.erb
deleted file mode 100644
index 993286541a..0000000000
--- a/backend/app/views/spree/admin/option_types/new.html.erb
+++ /dev/null
@@ -1,13 +0,0 @@
-<% content_for :page_title do %>
- <%= link_to Spree.t(:option_types), spree.admin_option_types_url %> /
- <%= Spree.t(:new_option_type) %>
-<% end %>
-
-<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @option_type } %>
-
-<%= form_for [:admin, @option_type] do |f| %>
- <fieldset>
- <%= render partial: 'form', locals: { f: f } %>
- <%= render partial: 'spree/admin/shared/new_resource_links' %>
- </fieldset>
-<% end %>
diff --git a/backend/app/views/spree/admin/orders/_add_line_item.html.erb b/backend/app/views/spree/admin/orders/_add_line_item.html.erb
deleted file mode 100644
index 23f2c4c3b2..0000000000
--- a/backend/app/views/spree/admin/orders/_add_line_item.html.erb
+++ /dev/null
@@ -1,17 +0,0 @@
-<%= render partial: "spree/admin/variants/autocomplete", formats: :js %>
-
-<%= render partial: "spree/admin/variants/autocomplete_line_items_stock", formats: :js %>
-
-<div id="add-line-item" data-hook class="card mb-3">
- <div class="card-header">
- <h1 class="card-title mb-0 h5"><%= Spree.t(:add_product) %></h1>
- </div>
- <div class="card-body">
- <div data-hook="add_product_name" class="form-group">
- <%= label_tag :add_line_item_variant_id, Spree.t(:name_or_sku) %>
- <%= select_tag 'add_line_item_variant_id', nil , class: 'variant_autocomplete d-block w-100' %>
- </div>
-
- <div id="stock_details"></div>
- </div>
-</div>
diff --git a/backend/app/views/spree/admin/orders/_add_product.html.erb b/backend/app/views/spree/admin/orders/_add_product.html.erb
deleted file mode 100644
index 77658d1959..0000000000
--- a/backend/app/views/spree/admin/orders/_add_product.html.erb
+++ /dev/null
@@ -1,18 +0,0 @@
-<%= render partial: "spree/admin/variants/autocomplete", formats: :js %>
-<%= render partial: "spree/admin/variants/autocomplete_stock", formats: :js %>
-
-<div class="card mb-3" id="add-line-item" data-hook>
- <div class="card-header">
- <h1 class="card-title mb-0 h5">
- <%= Spree.t(:add_product) %>
- </h1>
- </div>
- <div class="card-body">
- <div data-hook="add_product_name">
- <%= label_tag :add_variant_id, Spree.t(:name_or_sku) %>
- <%= select_tag 'variants', nil, id: :add_variant_id, class: 'variant_autocomplete d-block w-100' %>
- </div>
-
- <div id="stock_details"></div>
- </div>
-</div>
diff --git a/backend/app/views/spree/admin/orders/_adjustments.html.erb b/backend/app/views/spree/admin/orders/_adjustments.html.erb
deleted file mode 100644
index 95b863f259..0000000000
--- a/backend/app/views/spree/admin/orders/_adjustments.html.erb
+++ /dev/null
@@ -1,36 +0,0 @@
-<% if adjustments.eligible.exists? %>
- <div class="card mb-3">
- <div class="card-header">
- <h1 class="card-title mb-0 h5">
- <%= title %>
- </h1>
- </div>
- <div class="table-responsive">
- <table class="table table-bordered">
- <thead>
- <tr>
- <th><%= Spree.t('name') %></th>
- <th><%= Spree.t('amount') %></th>
- </tr>
- </thead>
- <tbody id="order-charges" data-hook="order_details_adjustments">
- <% adjustments.eligible.group_by(&:label).each do |label, adjustments| %>
- <tr class="total">
- <td>
- <strong><%= label %>:</strong>
- </td>
- <td class="total">
- <span>
- <%= Spree::Money.new(
- adjustments.sum(&:amount),
- currency: adjustments.first.order.try(:currency)
- ) %>
- </span>
- </td>
- </tr>
- <% end %>
- </tbody>
- </table>
- </div>
- </div>
-<% end %>
diff --git a/backend/app/views/spree/admin/orders/_channel_form.html.erb b/backend/app/views/spree/admin/orders/_channel_form.html.erb
deleted file mode 100644
index 88cea30ba4..0000000000
--- a/backend/app/views/spree/admin/orders/_channel_form.html.erb
+++ /dev/null
@@ -1,18 +0,0 @@
-<div data-hook="channel-form-container">
- <%= form_for [:admin, order], method: :put, url: set_channel_admin_order_url do |f| %>
- <fieldset>
- <div data-hook="admin_order_channel_field">
- <%= f.field_container :channel, class: %w[form-group] do %>
- <%= f.label :channel, Spree.t(:channel) %>
- <%= f.text_field :channel, name: 'channel', class: 'form-control' %>
- <%= f.error_message_on :channel %>
- <% end %>
- </div>
- <div class="form-actions" data-hook="buttons">
- <%= button Spree.t('actions.update'), 'recycle.svg', 'submit', { class: 'btn-success', data: { disable_with: "#{ Spree.t(:saving) }..." }} %>
- <span class="or"><%= Spree.t(:or) %></span>
- <%= button_link_to Spree.t('actions.cancel'), edit_admin_order_url(order), icon: 'cancel.svg' %>
- </div>
- <fieldset>
- <% end %>
-</div>
diff --git a/backend/app/views/spree/admin/orders/_form.html.erb b/backend/app/views/spree/admin/orders/_form.html.erb
deleted file mode 100644
index 6b3560fc8b..0000000000
--- a/backend/app/views/spree/admin/orders/_form.html.erb
+++ /dev/null
@@ -1,52 +0,0 @@
- <div data-hook="admin_order_form_fields">
- <% if @line_item.try(:errors).present? %>
- <%= render 'spree/admin/shared/error_messages', target: @line_item %>
- <% end %>
-
- <% if Spree::Order.checkout_step_names.include?(:delivery) %>
- <%= render partial: "spree/admin/orders/shipment", collection: @order.shipments.order(:created_at), locals: {order: order} %>
- <% else %>
- <%= render "spree/admin/orders/line_items", order: order %>
- <% end %>
-
- <%= render "spree/admin/orders/adjustments",
- adjustments: @order.line_item_adjustments,
- order: order,
- title: Spree.t(:line_item_adjustments) %>
- <%= render "spree/admin/orders/adjustments",
- adjustments: @order.shipment_adjustments,
- order: order,
- title: Spree.t(:shipment_adjustments) %>
- <%= render "spree/admin/orders/adjustments",
- adjustments: @order.adjustments,
- order: order,
- title: Spree.t(:order_adjustments) %>
-
- <% if order.line_items.exists? %>
- <div class="alert alert-success" id="order-total" data-hook="order_details_total">
- <%= Spree.t(:order_total) %>:
- <strong class="order-total">
- <%= order.display_total %>
- </strong>
- </div>
- <% end %>
-
- <script>
- var order_number = '<%= @order.number %>';
- var shipments = [];
-
- <% @order.shipments.each do |shipment| %>
- shipments.push(
- <%== shipment.as_json(
- root: false,
- only: [
- :id, :tracking, :number, :state, :stock_location_id
- ], include: [
- :inventory_units, :stock_location
- ]).to_json %>
- );
- <% end %>
-
- <%= render partial: 'spree/admin/shared/update_order_state', formats: [:js], handlers: [:erb] %>
- </script>
-</div>
diff --git a/backend/app/views/spree/admin/orders/_line_items.html.erb b/backend/app/views/spree/admin/orders/_line_items.html.erb
deleted file mode 100644
index 95b2c16dd3..0000000000
--- a/backend/app/views/spree/admin/orders/_line_items.html.erb
+++ /dev/null
@@ -1,54 +0,0 @@
-<% if order.line_items.exists? %>
- <div class="card mb-3">
- <div class="card-header">
- <h1 class="card-title mb-0 h5">
- <%= Spree.t(:order_line_items) %>
- </h1>
- </div>
- <div class="table-responsive">
- <table class="table table-bordered line-items" data-hook="line-items">
- <thead>
- <tr>
- <th colspan="2"><%= Spree.t(:name) %></th>
- <th class="text-center"><%= Spree.t(:price) %></th>
- <th class="text-center"><%= Spree.t(:quantity) %></th>
- <th class="text-center"><%= Spree.t(:total_price) %></th>
- <th class="orders-actions text-center" data-hook="admin_order_form_line_items_header_actions"></th>
- </tr>
- </thead>
- <tbody>
- <% order.line_items.each do |item| %>
- <tr class="line-item" id="line-item-<%= item.id %>">
- <td class="line-item-image image text-center">
- <%= link_to small_image(item.variant), edit_admin_product_path(item.variant.product) %>
- </td>
- <td class="line-item-name text-center">
- <%= link_to item.name, edit_admin_product_path(item.variant.product) %>
- <br>
- <%= "(#{item.options_text})" if item.options_text.present? %>
- </td>
- <td class="line-item-price text-center"><%= item.single_money.to_html %></td>
- <td class="line-item-qty-show text-center" style="width:120px;">
- <%= item.quantity %>
- </td>
- <td class="line-item-qty-edit is-hidden" style="width:120px;">
- <%= number_field_tag :quantity, item.quantity, min: 0, class: "line_item_quantity form-control", size: 5 %>
- </td>
- <td class="line-item-total text-center"><%= line_item_shipment_price(item, item.quantity) %></td>
- <td class="cart-line-item-delete actions" data-hook="cart_line_item_delete">
- <span class="d-flex justify-content-center">
- <% if can? :update, item %>
- <%= link_to_with_icon 'cancel.svg', Spree.t('actions.cancel'), "#", class: 'cancel-line-item btn btn-outline-secondary btn-sm', data: {action: 'cancel'}, title: Spree.t('actions.cancel'), style: 'display: none', no_text: true %>
- <%= link_to_with_icon 'save.svg', Spree.t('actions.save'), "#", class: 'save-line-item btn btn-success btn-sm', no_text: true, data: { :'line-item-id' => item.id, action: 'save'}, title: Spree.t('actions.save'), style: 'display: none' %>
- <%= link_to_with_icon 'edit.svg', Spree.t('edit'), "#", class: 'edit-line-item btn btn-outline-secondary btn-sm', data: {action: 'edit'}, title: Spree.t('edit'), no_text: true %>
- <%= link_to_with_icon 'delete.svg', Spree.t('delete'), "#", class: 'delete-line-item btn btn-danger btn-sm', data: { 'line-item-id' => item.id, action: 'remove'}, title: Spree.t('delete'), no_text: true %>
- <% end %>
- </span>
- </td>
- </tr>
- <% end %>
- </tbody>
- </table>
- </div>
- </div>
-<% end %>
diff --git a/backend/app/views/spree/admin/orders/_line_items_edit_form.html.erb b/backend/app/views/spree/admin/orders/_line_items_edit_form.html.erb
deleted file mode 100644
index 410530530e..0000000000
--- a/backend/app/views/spree/admin/orders/_line_items_edit_form.html.erb
+++ /dev/null
@@ -1,36 +0,0 @@
-<div data-hook="admin_order_form_fields">
- <% if @line_item.try(:errors).present? %>
- <%= render 'spree/admin/shared/error_messages', target: @line_item %>
- <% end %>
-
- <%= render "spree/admin/orders/line_items", order: order %>
- <%= render "spree/admin/orders/adjustments",
- adjustments: @order.line_item_adjustments,
- order: order,
- title: Spree.t(:line_item_adjustments) %>
- <%= render "spree/admin/orders/adjustments",
- adjustments: @order.shipment_adjustments,
- order: order,
- title: Spree.t(:shipment_adjustments) %>
- <%= render "spree/admin/orders/adjustments",
- adjustments: @order.adjustments,
- order: order,
- title: Spree.t(:order_adjustments) %>
-
- <% if order.line_items.exists? %>
- <div class="alert alert-success" id="order-total" data-hook="order_details_total">
- <%= Spree.t(:order_total) %>: <strong class="order-total"><%= order.display_total %></strong>
- </div>
- <% end %>
-
- <script>
- var order_number = '<%= @order.number %>';
- var shipments = [];
-
- <% @order.shipments.each do |shipment| %>
- shipments.push(<%== shipment.as_json(root: false, only: [:id, :tracking, :number, :state, :stock_location_id], include: [:inventory_units, :stock_location]).to_json %>);
- <% end %>
-
- <%= render partial: 'spree/admin/shared/update_order_state', formats: [:js], handlers: [:erb] %>
- </script>
-</div>
diff --git a/backend/app/views/spree/admin/orders/_order_actions.html.erb b/backend/app/views/spree/admin/orders/_order_actions.html.erb
deleted file mode 100644
index b58d0f8eda..0000000000
--- a/backend/app/views/spree/admin/orders/_order_actions.html.erb
+++ /dev/null
@@ -1,11 +0,0 @@
-<% content_for :page_actions do %>
- <% if can?(:fire, order) %>
- <%= event_links(order, events) %>
- <% end %>
- <% if can?(:resend, order) %>
- <%= button_link_to Spree.t(:resend, scope: 'admin.order.events', default: Spree.t(:resend)),
- resend_admin_order_url(order),
- method: :post,
- icon: 'envelope.svg' %>
- <% end %>
-<% end %>
diff --git a/backend/app/views/spree/admin/orders/_risk_analysis.html.erb b/backend/app/views/spree/admin/orders/_risk_analysis.html.erb
deleted file mode 100644
index 78a90acc60..0000000000
--- a/backend/app/views/spree/admin/orders/_risk_analysis.html.erb
+++ /dev/null
@@ -1,49 +0,0 @@
-<fieldset id="risk_analysis">
- <legend><%= "#{Spree.t(:risk_analysis)}: #{Spree.t(:not) unless @order.is_risky?} #{Spree.t(:risky)}" %></legend>
- <div class="table-responsive">
- <table class="table table-condensed table-bordered">
- <thead>
- <th><%= Spree.t('risk') %></th>
- <th><%= Spree.t('status') %></th>
- </thead>
- <tbody id="risk-analysis" data-hook="order_details_adjustments" class="with-border">
- <tr class="">
- <td>
- <strong><%= Spree.t(:failed_payment_attempts) %>:</strong>
- </td>
- <td>
- <span class="badge badge-<%= @order.payments.failed.size > 0 ? 'void' : 'complete' %>">
- <%= link_to "#{Spree.t 'payments_count', count: @order.payments.failed.size, default: pluralize(@order.payments.failed.size, Spree.t(:payment))}", spree.admin_order_payments_path(@order) %>
- </span>
- </td>
- </tr>
-
- <tr>
- <td><strong><%= Spree.t(:avs_response) %>:</strong></td>
- <td>
- <span class="badge badge-<%= latest_payment.is_avs_risky? ? 'void' : 'complete' %>">
- <% if latest_payment.is_avs_risky? %>
- <%= "#{Spree.t(:error)}: #{avs_response_code[latest_payment.avs_response]}" %>
- <% else %>
- <%= Spree.t(:success) %>
- <% end %>
- </span>
- </td>
- </tr>
-
- <tr>
- <td><strong><%= Spree.t(:cvv_response) %>:</strong></td>
- <td>
- <span class="badge badge-<%= latest_payment.is_cvv_risky? ? 'void' : 'complete' %>">
- <% if latest_payment.is_cvv_risky? %>
- <%= "#{Spree.t(:error)}: #{cvv_response_code[latest_payment.cvv_response_code]}" %>
- <% else %>
- <%= Spree.t(:success) %>
- <% end %>
- </span>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
-</fieldset>
diff --git a/backend/app/views/spree/admin/orders/_shipment.html.erb b/backend/app/views/spree/admin/orders/_shipment.html.erb
deleted file mode 100644
index 61ebb2c1f1..0000000000
--- a/backend/app/views/spree/admin/orders/_shipment.html.erb
+++ /dev/null
@@ -1,120 +0,0 @@
-<div id="<%= "shipment_#{shipment.id}" %>" data-hook="admin_shipment_form" class="card mb-3">
-
- <%= render partial: "spree/admin/variants/split", formats: :js %>
-
- <div class="card-header stock-location no-borderb" data-hook="stock-location">
- <h1 class="flex-wrap align-items-center card-title mb-0 h5">
- <span class="shipment-number"><%= shipment.number %></span>
- -
- <span class="shipment-state"><%= Spree.t("shipment_states.#{shipment.state}") %></span>
- <%= Spree.t(:package_from) %>
- <strong class="stock-location-name" data-hook="stock-location-name">
- <%= link_to shipment.stock_location.name, spree.edit_admin_stock_location_url(shipment.stock_location) %>
- </strong>
- <% if shipment.ready? and can? :update, shipment %>
- <%= link_to Spree.t(:ship), 'javascript:;', class: 'ship ml-auto btn btn-success', data: { 'shipment-number' => shipment.number } %>
- <div class='clearfix'></div>
- <% end %>
- </h1>
- </div>
-
- <div class="table-responsive">
- <table class="table table-bordered stock-contents" data-hook="stock-contents">
- <thead>
- <tr>
- <th colspan="2"><%= Spree.t(:item_description) %></th>
- <th width="15%" class="text-center"><%= Spree.t(:price) %></th>
- <th width="15%" class="text-center"><%= Spree.t(:quantity) %></th>
- <th width="15%" class="text-center"><%= Spree.t(:total) %></th>
- <th class="orders-actions actions text-center" data-hook="admin_order_form_line_items_header_actions"></th>
- </tr>
- </thead>
-
- <tbody data-shipment-number="<%= shipment.number %>" data-order-number="<%= order.number %>">
- <%= render 'spree/admin/orders/shipment_manifest', shipment: shipment %>
-
- <% unless shipment.shipped? %>
- <tr class="edit-method is-hidden total">
- <td colspan="5">
- <div class="field alpha five columns">
- <%= label_tag 'selected_shipping_rate_id', Spree.t(:shipping_method) %>
- <%= select_tag :selected_shipping_rate_id,
- options_for_select(shipment.shipping_rates.map {|sr| ["#{sr.name} #{sr.display_price}", sr.id] }, shipment.selected_shipping_rate_id),
- { class: 'select2', data: {'shipment-number' => shipment.number } } %>
- </div>
- </td>
- <td class="actions">
- <span class="d-flex justify-content-center">
- <% if can? :update, shipment %>
- <%= link_to_with_icon 'cancel.svg', Spree.t('actions.cancel'), "#", class: 'cancel-method btn btn-outline-secondary btn-sm', data: {action: 'cancel'}, title: Spree.t('actions.cancel'), no_text: true %>
- <%= link_to_with_icon 'save.svg', Spree.t('actions.save'), "#", class: 'save-method btn btn-success btn-sm', data: {'shipment-number' => shipment.number, action: 'save'}, title: Spree.t('actions.save'), no_text: true %>
- <% end %>
- </span>
- </td>
- </tr>
- <% end %>
-
- <tr class="show-method total">
- <% if rate = shipment.selected_shipping_rate %>
- <td colspan="4">
- <strong><%= rate.name %></strong>
- </td>
- <td class="total text-center">
- <%= shipment.display_cost %>
- </td>
- <% else %>
- <td colspan='5'><%= Spree.t(:no_shipping_method_selected) %></td>
- <% end %>
-
- <td class="actions">
- <span class="d-flex justify-content-center">
- <% if( (can? :update, shipment) and !shipment.shipped?) %>
- <%= link_to_with_icon 'edit.svg', Spree.t('edit'), "javascript:;", class: 'edit-method with-tip btn btn-sm btn-outline-secondary', data: {action: 'edit'}, no_text: true %>
- <% end %>
- </span>
- </td>
- </tr>
-
- <tr class="edit-tracking is-hidden total">
- <td colspan="5">
- <label><%= Spree.t(:tracking_number) %>:</label>
- <%= text_field_tag :tracking, shipment.tracking, class: "form-control" %>
- </td>
- <td class="actions">
- <span class="d-flex justify-content-center">
- <% if can? :update, shipment %>
- <%= link_to_with_icon 'cancel.svg', Spree.t('actions.cancel'), "#", class: 'cancel-tracking btn btn-outline-secondary btn-sm', data: {action: 'cancel'}, title: Spree.t('actions.cancel'), no_text: true %>
- <%= link_to_with_icon 'save.svg', Spree.t('actions.save'), "#", class: 'save-tracking btn btn-success btn-sm', data: {'shipment-number' => shipment.number, action: 'save'}, title: Spree.t('actions.save'), no_text: true %>
- <% end %>
- </span>
- </td>
- </tr>
-
- <% if order.special_instructions.present? %>
- <tr class='special_instructions'>
- <td colspan="5">
- <strong><%= Spree.t(:special_instructions) %>:&nbsp;</strong><%= order.special_instructions %>
- </td>
- </tr>
- <% end %>
-
- <tr class="show-tracking total">
- <td colspan="5" class="tracking-value">
- <% if shipment.tracking.present? %>
- <strong><%= Spree.t(:tracking) %>:</strong> <%= link_to_tracking(shipment, target: '_blank') %>
- <% else %>
- <%= Spree.t(:no_tracking_present) %>
- <% end %>
- </td>
- <td class="actions">
- <span class="d-flex justify-content-center">
- <% if can? :update, shipment %>
- <%= link_to_with_icon 'edit.svg', Spree.t('edit'), "#", class: 'edit-tracking btn btn-outline-secondary btn-sm', data: {action: 'edit'}, title: Spree.t('edit'), no_text: true %>
- <% end %>
- </span>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
-</div>
diff --git a/backend/app/views/spree/admin/orders/_shipment_manifest.html.erb b/backend/app/views/spree/admin/orders/_shipment_manifest.html.erb
deleted file mode 100644
index 9ac946066f..0000000000
--- a/backend/app/views/spree/admin/orders/_shipment_manifest.html.erb
+++ /dev/null
@@ -1,46 +0,0 @@
-<% shipment.manifest.each do |item| %>
- <tr class="stock-item" data-item-quantity="<%= item.quantity %>">
- <td class="item-image image text-center">
- <%= link_to small_image(item.variant), edit_admin_product_path(item.variant.product) %>
- </td>
-
- <td class="item-name">
- <%= link_to item.variant.product.name, edit_admin_product_path(item.variant.product) %>
- <br>
- <%= "(#{item.variant.options_text})" if item.variant.options_text.present? %>
- <% if item.variant.sku.present? %>
- <strong><%= Spree.t(:sku) %>:</strong> <%= item.variant.sku %>
- <% end %>
- </td>
-
- <td class="item-price text-center"><%= item.line_item.single_money.to_html %></td>
-
- <td class="item-qty-show text-center">
- <% item.states.each do |state,count| %>
- <%= count %> x <%= Spree.t(state).downcase %>
- <% end %>
- </td>
-
- <% unless shipment.shipped? %>
- <td class="item-qty-edit is-hidden">
- <%= number_field_tag :quantity, item.quantity, min: 0, class: "line_item_quantity form-control", size: 5 %>
- </td>
- <% end %>
-
- <td class="item-total text-center">
- <%= line_item_shipment_price(item.line_item, item.quantity) %>
- </td>
-
- <td class="cart-item-delete actions" data-hook="cart_item_delete">
- <span class="d-flex justify-content-center">
- <% if((!shipment.shipped?) && can?(:update, item.line_item)) %>
- <%= link_to_with_icon 'edit.svg', Spree.t('actions.edit'), "#", class: 'edit-item btn btn-outline-secondary btn-sm', title: Spree.t('actions.edit'), no_text: true %>
- <%= link_to_with_icon 'cancel.svg', Spree.t('actions.cancel'), "#", class: 'cancel-item btn btn-outline-secondary btn-sm', data: { action: 'cancel' }, title: Spree.t('actions.cancel'), style: 'display: none', no_text: true %>
- <%= link_to_with_icon 'save.svg', Spree.t('actions.save'), "#", class: 'save-item btn btn-success btn-sm', data: {'shipment-number' => shipment.number, 'variant-id' => item.variant.id, action: 'save'}, title: Spree.t('actions.save'), style: 'display: none', no_text: true %>
- <%= link_to_with_icon 'split.svg', Spree.t('split'), "#", class: 'split-item btn btn-outline-secondary btn-sm', data: {action: 'split', 'variant-id' => item.variant.id}, title: Spree.t('split'), no_text: true %>
- <%= link_to_with_icon 'delete.svg', Spree.t('delete'), "#", class: 'delete-item btn btn-danger btn-sm', data: { 'shipment-number' => shipment.number, 'variant-id' => item.variant.id, action: 'remove'}, title: Spree.t('delete'), no_text: true %>
- <% end %>
- </span>
- </td>
- </tr>
-<% end %>
diff --git a/backend/app/views/spree/admin/orders/cart.html.erb b/backend/app/views/spree/admin/orders/cart.html.erb
deleted file mode 100644
index 4ab274581a..0000000000
--- a/backend/app/views/spree/admin/orders/cart.html.erb
+++ /dev/null
@@ -1,27 +0,0 @@
-<%= render 'order_actions', order: @order, events: @order_events %>
-
-<%= render 'spree/admin/shared/order_tabs', current: :cart %>
-
-<div data-hook="admin_order_edit_header">
- <%= render 'spree/admin/shared/error_messages', target: @order %>
-</div>
-
-<% if @order.payments.exists? && @order.considered_risky? %>
- <%= render 'spree/admin/orders/risk_analysis', latest_payment: @order.payments.order("created_at DESC").first %>
-<% end %>
-
-<%= render 'add_line_item' if can?(:update, @order) %>
-
-<% if @order.line_items.empty? %>
- <div class="alert alert-warning">
- <%= Spree.t(:your_order_is_empty_add_product) %>
- </div>
-<% end %>
-
-<div data-hook="admin_order_edit_form">
- <div id="order-form-wrapper">
- <%= render 'line_items_edit_form', order: @order %>
- </div>
-</div>
-
-<%= render 'spree/admin/shared/order_summary' %>
diff --git a/backend/app/views/spree/admin/orders/channel.html.erb b/backend/app/views/spree/admin/orders/channel.html.erb
deleted file mode 100644
index 247f7d3b2a..0000000000
--- a/backend/app/views/spree/admin/orders/channel.html.erb
+++ /dev/null
@@ -1,7 +0,0 @@
-<%= render 'spree/admin/shared/order_tabs', current: :channel %>
-
-<div data-hook="admin_order_edit_header">
- <%= render 'spree/admin/shared/error_messages', target: @order %>
-</div>
-
-<%= render 'channel_form', order: @order if can?(:update, @order) %>
diff --git a/backend/app/views/spree/admin/orders/customer_details/_autocomplete.js.erb b/backend/app/views/spree/admin/orders/customer_details/_autocomplete.js.erb
deleted file mode 100644
index 683fc72172..0000000000
--- a/backend/app/views/spree/admin/orders/customer_details/_autocomplete.js.erb
+++ /dev/null
@@ -1,42 +0,0 @@
-<script type='text/template' id='customer_autocomplete_template'>
- <div class='customer-autocomplete-item container'>
- <div class="row">
- <div class="col">
- <h5><strong>Email:</strong> {{customer.email}}</h5>
- </div>
- </div>
-
- <div class="row">
- <div class='customer-details col-6'>
- {{#if bill_address.firstname }}
- <strong>{{t 'bill_address' }}</strong><br>
- {{bill_address.firstname}} {{bill_address.lastname}}<br>
- {{bill_address.address1}}, {{bill_address.address2}}<br>
- {{bill_address.city}}<br>
- {{#if bill_address.state }}
- {{bill_address.state.name}}
- {{else}}
- {{bill_address.state_name}}
- {{/if}}
- {{bill_address.country.name}}
- {{/if}}
- </div>
-
- <div class='customer-details col-6'>
- {{#if ship_address.firstname }}
- <strong>Shipping Address</strong><br>
- {{ship_address.firstname}} {{ship_address.lastname}}<br>
- {{ship_address.address1}}, {{ship_address.address2}}<br>
- {{ship_address.city}}<br>
- {{#if ship_address.state }}
- {{ship_address.state.name}}
- {{else}}
- {{ship_address.state_name}}
- {{/if}}
- {{ship_address.country.name}}
- {{/if}}
- </div>
-
- </div>
-</div>
-</script>
diff --git a/backend/app/views/spree/admin/orders/customer_details/_form.html.erb b/backend/app/views/spree/admin/orders/customer_details/_form.html.erb
deleted file mode 100644
index 5b0842b1be..0000000000
--- a/backend/app/views/spree/admin/orders/customer_details/_form.html.erb
+++ /dev/null
@@ -1,106 +0,0 @@
-<div data-hook="admin_customer_detail_form_fields">
-
- <div class="card mb-3" data-hook="customer_guest">
-
- <div class="card-header">
- <h1 class="card-title mb-0 h5">
- <%= Spree.t(:account) %>
- </h1>
- </div>
-
- <div class="card-body">
- <div data-hook="customer_fields" class="row">
- <div class="col-12 col-lg-8">
- <div class="form-group">
- <%= f.label :email, Spree.t(:email) %>
- <% if can? :edit, @order.user %>
- <%= f.email_field :email, class: 'form-control' %>
- <% else %>
- <p><%= @order.user.try(:email) || @order.email %></p>
- <% end %>
- </div>
- </div>
- <div class="col-12 col-lg-4">
- <div class="form-group">
- <strong><%= label_tag nil, Spree.t(:guest_checkout) %></strong>
- <% guest = @order.user.nil? %>
-
- <% if @order.completed? %>
- <div>
- <span class="badge badge-secondary">
- <%= guest ? Spree.t(:say_yes) : Spree.t(:say_no) %>
- <%= hidden_field_tag :guest_checkout, guest %>
- </span>
- </div>
- <% else %>
- <div class="radio mt-0">
- <%= label_tag :guest_checkout_true do %>
- <%= radio_button_tag :guest_checkout, true, guest %>
- <%= Spree.t(:say_yes) %>
- <% end %>
- </div>
- <div class="radio">
- <%= label_tag :guest_checkout_false do %>
- <%= radio_button_tag :guest_checkout, false, !guest, disabled: @order.cart? %>
- <%= Spree.t(:say_no) %>
- <% end %>
- </div>
- <%= f.hidden_field :user_id, value: @order.user_id %>
- <% end %>
- </div>
- </div>
- </div>
- </div>
-
- </div>
-
- <div class="row">
- <div data-hook="bill_address_wrapper" class="col-12 col-lg-6">
- <div class="card mb-3">
- <div class="card-header">
- <h1 class="card-title mb-0 h5"><%= Spree.t(:billing_address) %></h1>
- </div>
-
- <div class="card-body">
- <% if can? :edit, @order.user %>
- <%= f.fields_for :bill_address do |ba_form| %>
- <%= render 'spree/admin/shared/address_form', f: ba_form, type: "billing" %>
- <% end %>
- <% else %>
- <%= render 'spree/admin/shared/address', address: @order.bill_address %>
- <% end %>
- </div>
- </div>
- </div>
-
- <div class="col-12 col-lg-6" data-hook="ship_address_wrapper">
- <div class="card mb-3">
- <div class="card-header">
- <h1 class="card-title mb-0 h5"><%= Spree.t(:shipping_address) %></h1>
- </div>
- <div class="card-body">
- <% if can? :edit, @order.user %>
- <%= f.fields_for :ship_address do |sa_form| %>
- <div class="form-group">
- <span data-hook="use_billing">
- <%= check_box_tag 'order[use_billing]', '1', @order.shipping_eq_billing_address?, class: 'checkbox' %>
- <%= label_tag 'order[use_billing]', Spree.t(:use_billing_address), class: 'form-check-label' %>
- </span>
- </div>
-
- <%= render 'spree/admin/shared/address_form', f: sa_form, type: 'shipping' %>
- <% end %>
- <% else %>
- <%= render 'spree/admin/shared/address', address: @order.ship_address %>
- <% end %>
- </div>
- </div>
- </div>
- </div>
-
- <% if can? :edit, @order.user %>
- <div class="form-actions" data-hook="buttons">
- <%= button Spree.t('actions.update'), 'save.svg' %>
- </div>
- <% end %>
-</div>
diff --git a/backend/app/views/spree/admin/orders/customer_details/edit.html.erb b/backend/app/views/spree/admin/orders/customer_details/edit.html.erb
deleted file mode 100644
index 190715c0d6..0000000000
--- a/backend/app/views/spree/admin/orders/customer_details/edit.html.erb
+++ /dev/null
@@ -1,29 +0,0 @@
-<%= render 'spree/admin/shared/order_tabs', current: :customer_details %>
-
-<% content_for :page_title do %>
- / <%= Spree.t(:customer_details) %>
-<% end %>
-
-<% if can? :edit, @order.user %>
- <div id="select-customer" class="card mb-3" data-hook>
- <div class="card-header">
- <h1 class="card-title mb-0 h5">
- <%= Spree.t(:customer_search) %>
- </h1>
- </div>
- <div class="card-body" id="customer-search-field">
- <%= select_tag :customer_search, nil, class: 'd-block w-100' %>
- <%= render partial: "spree/admin/orders/customer_details/autocomplete", formats: :js %>
- </div>
- </div>
-<% end %>
-
-<%= render 'spree/admin/shared/error_messages', target: @order %>
-
-<%= form_for @order, url: spree.admin_order_customer_url(@order) do |f| %>
- <%= render 'form', f: f %>
-<% end %>
-
-<br>
-
-<%= render 'spree/admin/shared/order_summary' %>
diff --git a/backend/app/views/spree/admin/orders/edit.html.erb b/backend/app/views/spree/admin/orders/edit.html.erb
deleted file mode 100644
index 14218eefa5..0000000000
--- a/backend/app/views/spree/admin/orders/edit.html.erb
+++ /dev/null
@@ -1,31 +0,0 @@
-<%= render 'order_actions', order: @order, events: @order_events %>
-
-<%= render 'spree/admin/shared/order_tabs', current: :shipments %>
-
-<% content_for :page_title do %>
- / <%= plural_resource_name(Spree::Shipment) %>
-<% end %>
-
-<div data-hook="admin_order_edit_header">
- <%= render 'spree/admin/shared/error_messages', target: @order %>
-</div>
-
-<% if @order.payments.valid.any? && @order.considered_risky? %>
- <%= render 'spree/admin/orders/risk_analysis', latest_payment: @order.payments.valid.last %>
-<% end %>
-
-<%= render 'add_product' if @order.shipment_state != 'shipped' && can?(:update, @order) %>
-
-<% if @order.line_items.empty? %>
- <div class="alert alert-warning">
- <%= Spree.t(:your_order_is_empty_add_product) %>
- </div>
-<% end %>
-
-<div data-hook="admin_order_edit_form">
- <div id="order-form-wrapper">
- <%= render partial: 'form', locals: { order: @order } %>
- </div>
-</div>
-
-<%= render 'spree/admin/shared/order_summary' %>
diff --git a/backend/app/views/spree/admin/orders/index.html.erb b/backend/app/views/spree/admin/orders/index.html.erb
deleted file mode 100644
index e6f3ab2f59..0000000000
--- a/backend/app/views/spree/admin/orders/index.html.erb
+++ /dev/null
@@ -1,271 +0,0 @@
-<% content_for :page_title do %>
- <%= plural_resource_name(Spree::Order) %>
-<% end %>
-
-<% content_for :page_actions do %>
- <%= button_link_to Spree.t(:new_order),
- new_admin_order_url,
- class: "btn-success",
- icon: 'add.svg',
- id: 'admin_new_order' %>
-<% end if can? :create, Spree::Order %>
-
-<% content_for :table_filter do %>
- <div data-hook="admin_orders_index_search">
-
- <%= search_form_for [:admin, @search] do |f| %>
- <div class="row">
-
- <div class="date-range-filter col-12 col-lg-8">
- <div class="form-group">
- <%= label_tag :q_created_at_gt, Spree.t(:date_range) %>
- <div class="row pb-0">
- <div class="col-12 col-md-6 mb-3 mb-md-0">
- <div class="input-group datePickerFrom"
- data-wrap="true"
- data-alt-format="<%= Spree.t(:fpr_human_friendly_date_format, scope: 'date_picker', default: 'M j, Y') %>"
- data-max-date="<%= params[:q][:created_at_lt] %>">
- <%= f.text_field :created_at_gt,
- class: 'form-control js-filterable shadow-none',
- value: params[:q][:created_at_gt],
- placeholder: Spree.t(:starting_from),
- 'data-input':'' %>
- <%= render partial: 'spree/admin/shared/cal_close' %>
- </div>
- </div>
- <div class="col-12 col-md-6 mt-3 mt-md-0">
- <div class="input-group datePickerTo"
- data-wrap="true"
- data-alt-format="<%= Spree.t(:fpr_human_friendly_date_format, scope: 'date_picker', default: 'M j, Y') %>"
- data-min-date="<%= params[:q][:created_at_gt] %>">
-
- <%= f.text_field :created_at_lt,
- class: 'form-control js-filterable shadow-none',
- value: params[:q][:created_at_lt],
- placeholder: Spree.t(:ending_at),
- 'data-input':'' %>
- <%= render partial: 'spree/admin/shared/cal_close' %>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="col-12 col-lg-4">
- <div class="form-group">
- <%= label_tag :q_number_cont, Spree.t(:search_order_number) %>
- <%= f.text_field :number_cont, class: 'form-control js-quick-search-target js-filterable' %>
- </div>
- </div>
-
- </div>
-
- <div class="row">
-
- <div class="col-12 col-lg-4">
- <div class="form-group">
- <%= label_tag :q_state_eq, Spree.t(:status) %>
- <%= f.select :state_eq,
- Spree::Order.state_machines[:state].states.map {|s| [Spree.t("order_state.#{s.name}"), s.value]},
- { include_blank: true },
- class: 'select2-clear js-filterable' %>
- </div>
- </div>
-
- <div class="col-12 col-lg-4">
- <div class="form-group">
- <%= label_tag :q_payment_state_eq, Spree.t(:payment_state) %>
- <%= f.select :payment_state_eq, Spree::Order::PAYMENT_STATES.map {|s| [Spree.t("payment_states.#{s}"), s]}, { include_blank: true }, class: 'select2-clear js-filterable' %>
- </div>
- </div>
-
- <div class="col-12 col-lg-4">
- <div class="form-group">
- <%= label_tag :q_shipment_state_eq, Spree.t(:shipment_state) %>
- <%= f.select :shipment_state_eq, Spree::Order::SHIPMENT_STATES.map {|s| [Spree.t("shipment_states.#{s}"), s]}, { include_blank: true }, class: 'select2-clear js-filterable' %>
- </div>
- </div>
-
- </div>
-
- <div class="row">
-
- <div class="col-12 col-lg-4">
- <div class="form-group">
- <%= label_tag :q_bill_address_firstname_start, Spree.t(:first_name_begins_with) %>
- <%= f.text_field :bill_address_firstname_start, class: 'form-control js-filterable' %>
- </div>
- </div>
-
- <div class="col-12 col-lg-4">
- <div class="form-group">
- <%= label_tag :q_bill_address_lastname_start, Spree.t(:last_name_begins_with) %>
- <%= f.text_field :bill_address_lastname_start, class: 'form-control js-filterable' %>
- </div>
- </div>
-
- <div class="col-12 col-lg-4">
- <div class="form-group">
- <%= label_tag :q_email_cont, Spree.t(:email) %>
- <%= f.text_field :email_cont, class: 'form-control js-filterable' %>
- </div>
- </div>
-
- </div>
-
- <div class="row">
-
- <div class="col-12 col-lg-4">
- <div class="form-group">
- <%= label_tag :q_line_items_variant_sku_eq, Spree.t(:sku) %>
- <%= f.text_field :line_items_variant_sku_eq, class: 'form-control js-filterable' %>
- </div>
- </div>
-
- <div class="col-12 col-lg-4">
- <div class="form-group">
- <%= label_tag :q_promotions_id_in, Spree.t(:promotion) %>
- <%= f.select :promotions_id_in, Spree::Promotion.applied.pluck(:name, :id), { include_blank: true }, class: 'select2-clear js-filterable' %>
- </div>
- </div>
-
- <div class="col-12 col-lg-4">
- <div class="form-group">
- <%= label_tag :q_channel_eq, Spree.t(:channel) %>
- <%= f.select :channel_eq, Spree::Order.distinct.pluck(:channel), { include_blank: true }, class: 'select2-clear js-filterable' %>
- </div>
- </div>
-
- <div class="col-12">
- <%= f.field_container :completed_at_not_null do %>
- <div class="custom-control custom-checkbox">
- <%= f.check_box :completed_at_not_null, {checked: @show_only_completed, class: 'custom-control-input'}, '1', '0' %>
- <%= f.label :completed_at_not_null, Spree.t(:show_only_complete_orders), class: 'custom-control-label' %>
- </div>
- <% end %>
-
- <%= f.field_container :considered_risky_eq do %>
- <div class="custom-control custom-checkbox">
- <%= f.check_box :considered_risky_eq, {checked: params[:q][:considered_risky_eq] == '1', class: 'custom-control-input'}, '1', '' %>
- <%= f.label :considered_risky_eq, Spree.t(:show_only_considered_risky), class: 'custom-control-label' %>
- </div>
- <% end %>
- </div>
- </div>
-
- <div data-hook="admin_orders_index_search_buttons" class="form-actions">
- <%= button Spree.t(:filter_results), 'search.svg' %>
- </div>
-
- <% end %>
-
- </div>
-
-<% end %>
-
-<% if @orders.any? %>
-<div data-nav-x-wrapper>
- <div data-nav-x-container>
- <table class="table" id="listing_orders" data-hook data-nav-x-content>
- <thead>
- <tr data-hook="admin_orders_index_headers">
- <th><%= sort_link @search, :number, I18n.t(:number, scope: 'activerecord.attributes.spree/order') %></th>
- <% if @show_only_completed %>
- <th><%= sort_link @search, :completed_at, I18n.t(:completed_at, scope: 'activerecord.attributes.spree/order') %></th>
- <% else %>
- <th><%= sort_link @search, :created_at, I18n.t(:created_at, scope: 'activerecord.attributes.spree/order') %></th>
- <% end %>
- <th><%= sort_link @search, :considered_risky, I18n.t(:considered_risky, scope: 'activerecord.attributes.spree/order') %></th>
- <th><%= sort_link @search, :state, I18n.t(:state, scope: 'activerecord.attributes.spree/order') %></th>
- <th><%= sort_link @search, :payment_state, I18n.t(:payment_state, scope: 'activerecord.attributes.spree/order') %></th>
- <% if Spree::Order.checkout_step_names.include?(:delivery) %>
- <th><%= sort_link @search, :shipment_state, I18n.t(:shipment_state, scope: 'activerecord.attributes.spree/order') %></th>
- <% end %>
- <th><%= sort_link @search, :email, I18n.t(:email, scope: 'activerecord.attributes.spree/order') %></th>
- <th><%= sort_link @search, :total, I18n.t(:total, scope: 'activerecord.attributes.spree/order') %></th>
- <th data-hook="admin_orders_index_header_actions" class="actions"></th>
- </tr>
- </thead>
- <tbody>
- <% @orders.each do |order| %>
- <tr data-hook="admin_orders_index_rows" class="state-<%= order.state.downcase %> <%= cycle('odd', 'even') %>">
- <td><%= link_to order.number, edit_admin_order_path(order) %></td>
- <td>
- <%= order_time(@show_only_completed ? order.completed_at : order.created_at) %>
- </td>
- <td>
- <span class="badge badge-<%= order.considered_risky ? 'considered_risky' : 'considered_safe' %> text-uppercase">
- <%= order.considered_risky ? Spree.t("risky") : Spree.t("safe") %>
- </span>
- </td>
- <td class="no-wrap">
- <span class="badge badge-<%= order.state.downcase %> text-uppercase"><%= Spree.t("order_state.#{order.state}") %></span>
- <span class="filterable js-add-filter" data-ransack-field="q_state_eq" data-ransack-value="<%= order.state %>">
- <%= svg_icon name: "filter.svg", width: '14', height: '14' %>
- </span>
- </td>
- <td class="no-wrap">
- <% if order.payment_state %>
- <%= link_to Spree.t("payment_states.#{order.payment_state}"),
- admin_order_payments_path(order),
- class: "badge badge-#{order.payment_state} text-uppercase" %>
-
- <span class="filterable js-add-filter"
- data-ransack-field="q_payment_state_eq"
- data-ransack-value="<%= order.payment_state %>">
- <%= svg_icon name: "filter.svg", width: '14', height: '14' %>
- </span>
- <% end %>
- </td>
- <% if Spree::Order.checkout_step_names.include?(:delivery) %>
- <td class="no-wrap">
- <% if order.shipment_state %>
- <span class="badge badge-<%= order.shipment_state %> text-uppercase"><%= Spree.t("shipment_states.#{order.shipment_state}") %></span>
- <span class="filterable js-add-filter" data-ransack-field="q_shipment_state_eq" data-ransack-value="<%= order.shipment_state %>">
- <%= svg_icon name: "filter.svg", width: '14', height: '14' %>
- </span>
- <% end %>
- </td>
- <% end %>
- <td class="no-wrap">
- <% if order.user %>
- <%= link_to order.email, edit_admin_user_path(order.user) %>
- <% else %>
- <%= mail_to order.email %>
- <% end %>
- <% if order.user || order.email %>
- <span class="filterable js-add-filter" data-ransack-field="q_email_cont" data-ransack-value="<%= order.email %>">
- <%= svg_icon name: "filter.svg", width: '14', height: '14' %>
- </span>
- <% end %>
- </td>
- <td><%= order.display_total.to_html %></td>
- <td class='actions' data-hook="admin_orders_index_row_actions">
- <span class="d-flex justify-content-end">
- <%= link_to_edit_url edit_admin_order_path(order), title: "admin_edit_#{dom_id(order)}", no_text: true if can?(:edit, order) %>
- </span>
- </td>
- </tr>
- <% end %>
- </tbody>
- </table>
- </div>
- <button class="nav-x_Advancer nav-x_Advancer_Left" type="button">
- <svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" class="bi bi-chevron-left" viewBox="0 0 16 16">
- <path fill-rule="evenodd" d="M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z" />
- </svg>
- </button>
-
- <button class="nav-x_Advancer nav-x_Advancer_Right" type="button">
- <svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" class="bi bi-chevron-right" viewBox="0 0 16 16">
- <path fill-rule="evenodd" d="M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z" />
- </svg>
- </button>
-</div>
-<% else %>
- <div class="alert alert-info no-objects-found">
- <%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree::Order)) %>,
- <%= link_to(Spree.t(:add_one), new_admin_order_url) if can? :create, Spree::Order %>!
- </div>
-<% end %>
-
-<%= render 'spree/admin/shared/index_table_options', collection: @orders, simple: true %>
diff --git a/backend/app/views/spree/admin/orders/store.html.erb b/backend/app/views/spree/admin/orders/store.html.erb
deleted file mode 100644
index 374f2eb008..0000000000
--- a/backend/app/views/spree/admin/orders/store.html.erb
+++ /dev/null
@@ -1,7 +0,0 @@
-<%= render 'spree/admin/shared/order_tabs', current: :store %>
-
-<div data-hook="admin_order_edit_header">
- <%= render 'spree/admin/shared/error_messages', target: @order %>
-</div>
-
-<%= render 'store_form', order: @order if can?(:update, @order) %>
diff --git a/backend/app/views/spree/admin/payment_methods/_form.html.erb b/backend/app/views/spree/admin/payment_methods/_form.html.erb
deleted file mode 100644
index 065a77b700..0000000000
--- a/backend/app/views/spree/admin/payment_methods/_form.html.erb
+++ /dev/null
@@ -1,81 +0,0 @@
-<div data-hook="admin_payment_method_form_fields">
-
- <div data-hook="payment_method" class="row">
-
- <div class="col-12 col-md-6">
- <div class="card mb-3">
- <div class="card-header">
- <h5 class="mb-0"><%= Spree.t(:settings) %></h5>
- </div>
- <div class="card-body">
- <div class="form-group">
- <%= f.label :type, Spree.t(:provider) %>
- <%= collection_select(:payment_method, :type, @providers, :to_s, :name, {}, {id: 'gtwy-type', class: 'select2'}) %>
- </div>
- <hr class="my-4">
- <%= field_container :payment_method, :name, class: ['form-group'], 'data-hook' => 'name' do %>
- <%= label_tag :payment_method_name, Spree.t(:name) %>
- <%= text_field :payment_method, :name, class: 'form-control' %>
- <%= error_message_on :payment_method, :name %>
- <% end %>
-
- <%= field_container :payment_method, :description, class: ['form-group'], 'data-hook' => 'description' do %>
- <%= label_tag :payment_method_description, Spree.t(:description) %>
- <%= text_area :payment_method, :description, { cols: 60, rows: 6, class: 'form-control' } %>
- <% end %>
-
- <% if @stores.count > 1 %>
- <div data-hook="store" class="form-group">
- <%= label_tag :payment_method_stores, Spree.t(:stores) %>
- <%= collection_select(:payment_method, :store_ids, @stores, :id, :unique_name, {}, { multiple: true, class: 'select2' }) %>
- </div>
- <% end %>
-
- <div data-hook="display" class="form-group">
- <%= label_tag :payment_method_display_on, Spree.t(:display) %>
- <%= select(:payment_method, :display_on, Spree::PaymentMethod::DISPLAY.collect { |display| [Spree.t(display), display.to_s] }, {}, {class: 'select2'}) %>
- </div>
- <div data-hook="auto_capture" class="form-group">
- <%= label_tag :payment_method_auto_capture, Spree.t(:auto_capture) %>
- <%= select(:payment_method, :auto_capture, [["#{Spree.t(:use_app_default)} (#{Spree::Config[:auto_capture]})", ''], [Spree.t(:say_yes), true], [Spree.t(:say_no), false]], {}, {class: 'select2'}) %>
- </div>
-
- <div data-hook="active" class="form-group">
- <strong><%= Spree.t(:active) %></strong>
- <div class="radio my-2 form-check">
- <%= radio_button :payment_method, :active, true, class: 'form-check-input' %>
- <%= label_tag :payment_method_active_true, Spree.t(:say_yes), class: 'form-check-label' %>
- </div>
-
- <div class="radio my-2 form-check">
- <%= radio_button :payment_method, :active, false, class: 'form-check-input' %>
- <%= label_tag :payment_method_active_false, Spree.t(:say_no), class: 'form-check-label' %>
- </div>
- </div>
- </div>
- </div>
- </div>
-
- <div class="col-12 col-md-6">
- <div class="card mb-3">
- <div class="card-header">
- <h5 class="mb-0"><%= Spree.t(:payment_provider_settings) %></h5>
- </div>
- <div class="card-body">
- <div id="preference-settings" data-hook class="form-group">
- <% unless @object.new_record? %>
- <% if preference_fields(@object, f).empty? %>
- <%= Spree.t('no_payment_provider_settings_message') %>
- <% end %>
- <%= preference_fields(@object, f) %>
-
- <% if @object.respond_to?(:preferences) %>
- <div id="gateway-settings-warning" class="info warning"><%= Spree.t(:provider_settings_warning) %></div>
- <% end %>
- <% end %>
- </div>
- </div>
- </div>
- </div>
- </div>
-</div>
diff --git a/backend/app/views/spree/admin/payment_methods/edit.html.erb b/backend/app/views/spree/admin/payment_methods/edit.html.erb
deleted file mode 100644
index 0d8e4a7f91..0000000000
--- a/backend/app/views/spree/admin/payment_methods/edit.html.erb
+++ /dev/null
@@ -1,13 +0,0 @@
-<% content_for :page_title do %>
- <%= link_to Spree.t(:payment_methods), spree.admin_payment_methods_path %> /
- <%= @payment_method.name %>
-<% end %>
-
-<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @payment_method } %>
-
-<%= form_for @payment_method, url: admin_payment_method_path(@payment_method) do |f| %>
- <fieldset>
- <%= render partial: 'form', locals: { f: f } %>
- <%= render partial: 'spree/admin/shared/edit_resource_links' %>
- </fieldset>
-<% end %>
diff --git a/backend/app/views/spree/admin/payment_methods/index.html.erb b/backend/app/views/spree/admin/payment_methods/index.html.erb
deleted file mode 100644
index 310f87cdf4..0000000000
--- a/backend/app/views/spree/admin/payment_methods/index.html.erb
+++ /dev/null
@@ -1,67 +0,0 @@
-<% content_for :page_title do %>
- <%= plural_resource_name(Spree::PaymentMethod) %>
-<% end %>
-
-<% content_for :page_actions do %>
- <%= button_link_to Spree.t(:new_payment_method), new_object_url, class: "btn-success", icon: 'add.svg', id: 'admin_new_payment_methods_link' %>
-<% end if can? :create, Spree::PaymentMethod %>
-
-<% content_for :table_filter do %>
- <div data-hook="admin_payment_methods_filter_table">
- <%= search_form_for [:admin, @search] do |f| %>
- <%- locals = {f: f} %>
- <div data-hook="admin_payment_methods_index_search" class="row">
- <div class="form-group">
- <%= f.label :name_cont, Spree.t('name') %>
- <%= f.text_field :name_cont, size: 15, class: "form-control js-quick-search-target js-filterable" %>
- </div>
- </div>
- <div data-hook="admin_products_index_search_buttons" class="form-actions">
- <%= button Spree.t(:search), 'search.svg' %>
- </div>
- <% end %>
- </div>
-<% end %>
-
-<% if @payment_methods.any? %>
-<div class="table-responsive">
- <table class="table sortable" id='listing_payment_methods' data-hook data-sortable-link="<%= update_positions_admin_payment_methods_url %>">
- <thead>
- <tr data-hook="admin_payment_methods_index_headers">
- <th></th>
- <th><%= Spree.t(:name) %></th>
- <th><%= Spree.t(:provider) %></th>
- <th class="text-center"><%= Spree.t(:display) %></th>
- <th class="text-center"><%= Spree.t(:active) %></th>
- <th data-hook="admin_payment_methods_index_header_actions" class="actions"></th>
- </tr>
- </thead>
- <tbody id="sortVert">
- <% @payment_methods.each do |method| %>
- <tr id="<%= spree_dom_id method %>" data-hook="admin_payment_methods_index_rows">
- <td class="move-handle text-center">
- <% if can?(:edit, method) %>
- <%= svg_icon name: "sort.svg", width: '18', height: '18' %>
- <% end %>
- </td>
- <td><%= method.name %></td>
- <td><%= method.type.split('::', 3).last %></td>
- <td class="text-center"><%= Spree.t(method.display_on) %></td>
- <td class="text-center"><%= active_badge(method.active) %></td>
- <td data-hook="admin_payment_methods_index_row_actions" class="actions">
- <span class="d-flex justify-content-end">
- <%= link_to_edit(method, no_text: true) if can? :edit, method %>
- <%= link_to_delete(method, no_text: true) if can? :delete, method %>
- </span>
- </td>
- </tr>
- <% end %>
- </tbody>
- </table>
- </div>
-<% else %>
- <div class="alert alert-info no-objects-found">
- <%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree::PaymentMethod)) %>,
- <%= link_to(Spree.t(:add_one), new_object_url) if can? :create, Spree::PaymentMethod %>!
- </div>
-<% end %>
diff --git a/backend/app/views/spree/admin/payment_methods/new.html.erb b/backend/app/views/spree/admin/payment_methods/new.html.erb
deleted file mode 100644
index 7a4288b4d8..0000000000
--- a/backend/app/views/spree/admin/payment_methods/new.html.erb
+++ /dev/null
@@ -1,13 +0,0 @@
-<% content_for :page_title do %>
- <%= link_to Spree.t(:payment_methods), spree.admin_payment_methods_path %> /
- <%= Spree.t(:new_payment_method) %>
-<% end %>
-
-<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @payment_method } %>
-
-<%= form_for @payment_method, url: collection_url do |f| %>
- <fieldset>
- <%= render partial: 'form', locals: { f: f } %>
- <%= render partial: 'spree/admin/shared/new_resource_links' %>
- </fieldset>
-<% end %>
diff --git a/backend/app/views/spree/admin/payments/_capture_events.html.erb b/backend/app/views/spree/admin/payments/_capture_events.html.erb
deleted file mode 100644
index a91964858e..0000000000
--- a/backend/app/views/spree/admin/payments/_capture_events.html.erb
+++ /dev/null
@@ -1,21 +0,0 @@
-<% if @payment.capture_events.exists? %>
- <h3><%= Spree.t(:capture_events) %></h3>
- <div class="table-responsive">
- <table class="table table-condensed table-bordered" id="capture_events">
- <thead>
- <tr data-hook="payments_header">
- <th><%= "#{Spree.t('date')}/#{Spree.t('time')}" %></th>
- <th><%= Spree.t(:amount) %></th>
- </tr>
- </thead>
- <tbody>
- <% @payment.capture_events.each do |capture_event| %>
- <tr id="<%= dom_id(capture_event) %>" data-hook="capture_events_row">
- <td><%= pretty_time(capture_event.created_at) %></td>
- <td><%= capture_event.display_amount %></td>
- </tr>
- <% end %>
- </tbody>
- </table>
- </div>
-<% end %>
diff --git a/backend/app/views/spree/admin/payments/_form.html.erb b/backend/app/views/spree/admin/payments/_form.html.erb
deleted file mode 100644
index 1ecbb336d6..0000000000
--- a/backend/app/views/spree/admin/payments/_form.html.erb
+++ /dev/null
@@ -1,32 +0,0 @@
-<div data-hook="admin_payment_form_fields">
- <div class="form-group">
- <%= f.label :amount, Spree.t(:amount) %>
- <%= f.text_field :amount, value: @order.display_outstanding_balance.money, class: 'form-control' %>
- </div>
- <div class="form-group">
- <strong><%= Spree.t(:payment_method) %></strong>
- <% @payment_methods.each do |method| %>
- <div class="radio" data-id="<%= Spree.t(method.name, scope: :payment_methods, default: method.name).parameterize %>">
- <label data-hook="payment_method_field">
- <%= radio_button_tag 'payment[payment_method_id]', method.id, method == @payment_method, { class: "payment_methods_radios" } %>
- <%= Spree.t(method.name, scope: :payment_methods, default: method.name) %>
- </label>
- </div>
- <% end %>
-
- <div class="payment-method-settings">
- <% @payment_methods.each do |method| %>
-
- <div class="payment-methods my-3" id="payment_method_<%= method.id %>">
- <% if method.source_required? %>
- <%= render partial: "spree/admin/payments/source_forms/#{method.method_type}",
- locals: {
- payment_method: method,
- previous_cards: method.reusable_sources(@order)
- } %>
- <% end %>
- </div>
- <% end %>
- </div>
- </div>
-</div>
diff --git a/backend/app/views/spree/admin/payments/_list.html.erb b/backend/app/views/spree/admin/payments/_list.html.erb
deleted file mode 100644
index 8c6de84d2a..0000000000
--- a/backend/app/views/spree/admin/payments/_list.html.erb
+++ /dev/null
@@ -1,42 +0,0 @@
-<div class="table-responsive">
- <table class="table table-bordered" id='payments' data-order-id='<%= @order.number %>'>
- <thead>
- <tr data-hook="payments_header">
- <th><%= Spree::Payment.human_attribute_name(:number) %></th>
- <th><%= "#{Spree.t('date')}/#{Spree.t('time')}" %></th>
- <th class="text-center"><%= Spree.t(:amount) %></th>
- <th class="text-center"><%= Spree.t(:payment_method) %></th>
- <th class="text-center"><%= Spree.t(:transaction_id) %></th>
- <th class="text-center"><%= Spree.t(:payment_state) %></th>
- <th class="actions text-center"></th>
- </tr>
- </thead>
- <tbody>
- <% payments.each do |payment| %>
- <tr id="<%= dom_id(payment) %>" data-hook="payments_row" data-number="<%= payment.number %>">
- <td><%= link_to payment.number, spree.admin_order_payment_path(@order, payment) %></td>
- <td><%= pretty_time(payment.created_at) %></td>
- <td class="amount text-center"><%= payment.display_amount %></td>
- <td class="text-center"><%= payment_method_name(payment) %></td>
- <td class="text-center"><%= payment.transaction_id %></td>
- <td class="text-center">
- <span class="badge badge-<%= payment.state %>">
- <%= Spree.t(payment.state, scope: :payment_states, default: payment.state.capitalize) %>
- </span>
- </td>
- <td class="actions">
- <span class="d-flex justify-content-center payment-action-buttons">
- <% payment.actions.each do |action| %>
- <% if action == 'credit' %>
- <%= link_to_with_icon('exit.svg', Spree.t(:refund), new_admin_order_payment_refund_path(@order, payment), no_text: true, class: "btn btn-outline-secondary btn-sm") if can?(:create, Spree::Refund) %>
- <% else %>
- <%= link_to_with_icon(action + '.svg', Spree.t(action), fire_admin_order_payment_path(@order, payment, e: action), method: :put, no_text: true, data: { action: action }, class: "btn btn-outline-secondary btn-sm") if can?(action.to_sym, payment) %>
- <% end %>
- <% end %>
- </span>
- </td>
- </tr>
- <% end %>
- </tbody>
- </table>
-</div>
diff --git a/backend/app/views/spree/admin/payments/credit.html.erb b/backend/app/views/spree/admin/payments/credit.html.erb
deleted file mode 100644
index a9863a5c60..0000000000
--- a/backend/app/views/spree/admin/payments/credit.html.erb
+++ /dev/null
@@ -1,18 +0,0 @@
-<%= render partial: 'spree/admin/shared/order_tabs', locals: { current: :credit_cards } %>
-
-<% content_for :page_title do %>
- / <%= Spree.t(:refund) %>
-<% end %>
-
-<%= form_tag do %>
- <h3><%= Spree.t(:refund) %></h3>
- <fieldset data-hook="credit">
- <p>
- <%= label_tag :amount, Spree.t(:amount) %>
- <%= text_field_tag :amount, @payment.amount %>
- </p>
- <p class="form-actions">
- <%= button Spree.t(:make_refund) %>
- </p>
- </fieldset>
-<% end %>
diff --git a/backend/app/views/spree/admin/payments/index.html.erb b/backend/app/views/spree/admin/payments/index.html.erb
deleted file mode 100644
index d10e9bdc74..0000000000
--- a/backend/app/views/spree/admin/payments/index.html.erb
+++ /dev/null
@@ -1,37 +0,0 @@
-<%= render partial: 'spree/admin/shared/order_tabs', locals: { current: :payments } %>
-
-<% content_for :page_actions do %>
- <% if @order.outstanding_balance? && can?(:create, Spree::Payment) %>
- <span id="new_payment_section">
- <%= button_link_to Spree.t(:new_payment), new_admin_order_payment_url(@order), class: "btn-success", icon: 'add.svg' %>
- </span>
- <% end %>
-<% end %>
-
-<% content_for :page_title do %>
- / <%= Spree.t(:payments) %>
-<% end %>
-
-<% if @order.outstanding_balance? %>
- <div class="alert alert-info outstanding-balance">
- <%= @order.outstanding_balance < 0 ? Spree.t(:credit_owed) : Spree.t(:balance_due) %>: <strong><%= @order.display_outstanding_balance %></strong>
- </div>
-<% end %>
-
-<% if @payments.any? %>
- <div data-hook="payment_list" class="mb-3 table-responsive">
- <%= render partial: 'list', locals: { payments: @payments } %>
- </div>
-
- <% if @refunds.any? %>
- <fieldset data-hook="payment_list" class="no-border-bottom">
- <legend><%= Spree.t(:refunds) %></legend>
- <%= render partial: 'spree/admin/shared/refunds', locals: { refunds: @refunds, show_actions: true } %>
- </fieldset>
- <% end %>
-
-<% else %>
- <div class="alert alert-info no-objects-found"><%= Spree.t(:order_has_no_payments) %></div>
-<% end %>
-
-<%= render partial: 'spree/admin/shared/order_summary' %>
diff --git a/backend/app/views/spree/admin/payments/new.html.erb b/backend/app/views/spree/admin/payments/new.html.erb
deleted file mode 100644
index 623c8f75a8..0000000000
--- a/backend/app/views/spree/admin/payments/new.html.erb
+++ /dev/null
@@ -1,25 +0,0 @@
-<%= render partial: 'spree/admin/shared/order_tabs', locals: { current: :payments } %>
-
-<% content_for :page_title do %>
- / <%= Spree.t(:new_payment) %>
-<% end %>
-
-<% if @payment_methods.any? %>
- <%= render partial: 'spree/admin/shared/error_messages', locals: { target: @payment } %>
-
- <%= form_for @payment, url: admin_order_payments_path(@order) do |f| %>
- <fieldset>
- <%= render partial: 'form', locals: { f: f } %>
-
- <div class="form-actions" data-hook="buttons">
- <%= button @order.cart? ? Spree.t('actions.continue') : Spree.t('actions.update'), @order.cart? ? 'arrow-right.svg' : 'save.svg' %>
- </div>
- </fieldset>
- <% end %>
-
-<% else %>
- <div class="alert alert-info">
- <%= Spree.t(:cannot_create_payment_without_payment_methods) %>
- <%= link_to Spree.t(:please_define_payment_methods), spree.admin_payment_methods_url %>
- </div>
-<% end %>
diff --git a/backend/app/views/spree/admin/payments/show.html.erb b/backend/app/views/spree/admin/payments/show.html.erb
deleted file mode 100644
index 8c03815675..0000000000
--- a/backend/app/views/spree/admin/payments/show.html.erb
+++ /dev/null
@@ -1,27 +0,0 @@
-<%= render partial: 'spree/admin/shared/order_tabs', locals: { current: :payments } %>
-
-<% content_for :page_title do %>
- /
- <%= I18n.t(:one, scope: "activerecord.models.spree/payment") %>
- /
- <%= payment_method_name(@payment) %>
- /
- <span class="state <%= @payment.state %>">
- <%= Spree.t(@payment.state, scope: :payment_states, default: @payment.state.capitalize) %>
- </span>
-<% end %>
-
-<% content_for :page_actions do %>
- <%= button_link_to Spree.t(:logs), spree.admin_order_payment_log_entries_url(@order, @payment), icon: 'file.svg' %>
-<% end %>
-
-<%= render partial: "spree/admin/payments/source_views/#{@payment.payment_method.method_type}",
- locals: {
- payment: @payment.source.is_a?(Spree::Payment) ? @payment.source : @payment
- } %>
-
-<div class="alert alert-success" data-hook="amount">
- <%= Spree.t(:amount) %>: <%= @payment.display_amount.to_html %>
-</div>
-
-<%= render 'spree/admin/payments/capture_events' %>
diff --git a/backend/app/views/spree/admin/payments/source_forms/_gateway.html.erb b/backend/app/views/spree/admin/payments/source_forms/_gateway.html.erb
deleted file mode 100644
index 42f36001d6..0000000000
--- a/backend/app/views/spree/admin/payments/source_forms/_gateway.html.erb
+++ /dev/null
@@ -1,55 +0,0 @@
-<fieldset data-id="credit-card">
-<% if previous_cards.any? %>
- <div class="card my-3">
- <div class="card-header">
- <h1 class="card-title mb-0 h5"><%= Spree.t(:previously_used_card) %></h1>
- </div>
- <div class="form-group previous_cards card-body mb-0" data-hook="previous_cards">
- <ul class="m-0 p-0">
- <% previous_cards.each do |card| %>
- <li>
- <label>
- <%= radio_button_tag :card, card.id, card == previous_cards.first %> <%= card.display_brand + ' - ' + card.display_number %>
- </label>
- </li>
- <% end %>
- <li>
- <hr>
- <label>
- <%= radio_button_tag :card, 'new', false, { id: "card_new#{payment_method.id}" } %> <%= Spree.t(:use_new_cc) %>
- </label>
- </li>
- </ul>
- </div>
- </div>
-<% end %>
- <div id="card_form<%= payment_method.id %>" class="mt-3 row" data-hook>
- <% param_prefix = "payment_source[#{payment_method.id}]" %>
-
- <div data-hook="card_number" class="form-group col-12">
- <%= hidden_field_tag "#{param_prefix}[cc_type]", '', {class: 'ccType'} %>
- <%= label_tag "card_number#{payment_method.id}", raw(Spree.t(:card_number) + required_span_tag) %>
- <%= text_field_tag "#{param_prefix}[number]", '', class: 'required form-control cardNumber', id: "card_number#{payment_method.id}", maxlength: 19 %>
- <span id="card_type" style="display:none;">
- ( <span id="looks_like"><%= Spree.t(:card_type_is) %> <span id="type"></span></span>
- <span id="unrecognized"><%= Spree.t(:unrecognized_card_type) %></span>
- )
- </span>
- </div>
-
- <div data-hook="card_name" class="form-group col-12">
- <%= label_tag "card_name#{payment_method.id}", raw(Spree.t(:name) + required_span_tag) %>
- <%= text_field_tag "#{param_prefix}[name]", '', id: "card_name#{payment_method.id}", class: 'required form-control', maxlength: 19 %>
- </div>
-
- <div data-hook="card_expiration" class="form-group col-6">
- <%= label_tag "card_expiry#{payment_method.id}", raw(Spree.t(:expiration) + required_span_tag) %><br>
- <%= text_field_tag "#{param_prefix}[expiry]", '', id: "card_expiry#{payment_method.id}", class: "required cardExpiry form-control", placeholder: "MM/YYYY" %>
- </div>
-
- <div data-hook="card_code" class="form-group col-6">
- <%= label_tag "card_code#{payment_method.id}", raw(Spree.t(:card_code) + required_span_tag) %>
- <%= text_field_tag "#{param_prefix}[verification_value]", '', id: "card_code#{payment_method.id}", class: 'required form-control cardCode', size: 5 %>
- </div>
- </div>
-</fieldset>
diff --git a/backend/app/views/spree/admin/payments/source_forms/_storecredit.html.erb b/backend/app/views/spree/admin/payments/source_forms/_storecredit.html.erb
deleted file mode 100644
index 781fe757eb..0000000000
--- a/backend/app/views/spree/admin/payments/source_forms/_storecredit.html.erb
+++ /dev/null
@@ -1,9 +0,0 @@
-<% if @order.could_use_store_credit? %>
- <div class="alert alert-info text-center" data-hook="admin_payment_store_credit_available">
- <h4><%= Spree.t('admin.user.available_store_credit', amount: @order.display_total_available_store_credit) %></h4>
- </div>
-<% else %>
- <div class="alert alert-danger text-center" data-hook="admin_payment_no_store_credit">
- <h4><strong><%= Spree.t('admin.user.no_store_credit') %></strong></h4>
- </div>
-<% end %>
diff --git a/backend/app/views/spree/admin/payments/source_views/_check.html.erb b/backend/app/views/spree/admin/payments/source_views/_check.html.erb
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/backend/app/views/spree/admin/payments/source_views/_gateway.html.erb b/backend/app/views/spree/admin/payments/source_views/_gateway.html.erb
deleted file mode 100644
index c5a99d88b1..0000000000
--- a/backend/app/views/spree/admin/payments/source_views/_gateway.html.erb
+++ /dev/null
@@ -1,23 +0,0 @@
-<fieldset data-hook="credit_card">
- <legend><%= Spree.t(:credit_card) %></legend>
- <div class="table-responsive">
- <table class="table table-condensed table-bordered">
- <tr>
- <th width="20%"><%= Spree.t(:name_on_card) %>:</th>
- <td><%= payment.source.name %></td>
- </tr>
- <tr>
- <th><%= Spree.t(:card_type) %>:</th>
- <td><%= payment.source.display_brand %></td>
- </tr>
- <tr>
- <th><%= Spree.t(:card_number) %>:</th>
- <td><%= payment.source.display_number %></td>
- </tr>
- <tr>
- <th><%= Spree.t(:expiration) %>:</th>
- <td><%= payment.source.month %>/<%= payment.source.year %></td>
- </tr>
- </table>
- </div>
-</fieldset>
diff --git a/backend/app/views/spree/admin/payments/source_views/_storecredit.html.erb b/backend/app/views/spree/admin/payments/source_views/_storecredit.html.erb
deleted file mode 100644
index 140a1ea739..0000000000
--- a/backend/app/views/spree/admin/payments/source_views/_storecredit.html.erb
+++ /dev/null
@@ -1,31 +0,0 @@
-<fieldset data-hook="store_credit">
- <legend><%= Spree.t(:store_credit_name) %></legend>
- <div class="table-responsive">
- <table class="table table-condensed table-bordered">
- <tr>
- <th width="20%"><%= Spree.t(:used) %>:</th>
- <td><%= payment.source.display_amount_used %></td>
- </tr>
- <tr>
- <th><%= Spree.t(:amount) %>:</th>
- <td><%= payment.source.display_amount %></td>
- </tr>
- <tr>
- <th><%= Spree.t(:memo) %>:</th>
- <td><%= payment.source.memo %></td>
- </tr>
- <tr>
- <th><%= Spree.t(:type) %>:</th>
- <td><%= payment.source.category_name %></td>
- </tr>
- <tr>
- <th><%= Spree.t(:created_by) %>:</th>
- <td><%= payment.source.created_by_email %></td>
- </tr>
- <tr>
- <th><%= Spree.t(:issued_on) %>:</th>
- <td><%= pretty_time(payment.source.created_at) %></td>
- </tr>
- </table>
- </div>
-</fieldset>
diff --git a/backend/app/views/spree/admin/prices/_variant_prices.html.erb b/backend/app/views/spree/admin/prices/_variant_prices.html.erb
deleted file mode 100644
index d7762f3ef6..0000000000
--- a/backend/app/views/spree/admin/prices/_variant_prices.html.erb
+++ /dev/null
@@ -1,36 +0,0 @@
-<div class="table-responsive">
- <div id="variant_prices-table-wrapper">
- <table class="table">
- <thead>
- <tr data-hook="variant_prices_header">
- <th scope="col"><%= Spree.t(:options) %></th>
- <th scope="col"><%= Spree.t(:sku) %></th>
- <th scope="col"><%= Spree.t(:currency) %></th>
- <th scope="col" style="min-width: 150px;"><%= Spree.t(:price) %></th>
- <th scope="col" style="min-width: 150px;"><%= Spree.t(:compare_at_price) %></th>
- </tr>
- </thead>
- <tbody id="variant-prices" data-hook="variant_prices_body">
- <% supported_currencies_for_all_stores.each do |currency| %>
- <% code = currency.iso_code %>
- <% @product.variants_including_master.each do |variant| %>
- <% price = variant.price_in(code) %>
- <tr id="variant_prices_row" data-hook="variant_prices_row">
- <td class="panel">
- <%= variant.is_master? ? Spree.t(:master) : variant.options_text.blank? ? Spree.t(:variant) : variant.options_text %>
- </td>
- <td class="panel-title"><%= variant.sku %></td>
- <td><%= label_tag "vp[#{variant.id}][#{code}]", code %></td>
- <td>
- <%= text_field_tag "vp[#{variant.id}][#{code}][price]", (price && price.price ? price.display_amount.money : ''), class: 'form-control' %>
- </td>
- <td>
- <%= text_field_tag "vp[#{variant.id}][#{code}][compare_at_price]", (price && price.compare_at_price ? price.display_compare_at_amount.money : ''), class: 'form-control' %>
- </td>
- </tr>
- <% end %>
- <% end %>
- </tbody>
- </table>
- </div>
-</div>
diff --git a/backend/app/views/spree/admin/prices/index.html.erb b/backend/app/views/spree/admin/prices/index.html.erb
deleted file mode 100644
index 3e9c0491d2..0000000000
--- a/backend/app/views/spree/admin/prices/index.html.erb
+++ /dev/null
@@ -1,21 +0,0 @@
-<%= render partial: 'spree/admin/shared/product_tabs', locals: { current: :prices } %>
-
-<% content_for :page_actions do %>
- <%= yield :page_actions %>
- <%= product_preview_link(@product) %>
-<% end %>
-
-<form>
- <input class="form-control" placeholder="<%= Spree.t('variant_prices_search_placeholder') %>" type="text" id="variant-price-search">
-</form>
-
-<%= form_tag nil, { class: 'form-horizontal' } do %>
- <div class="my-3">
- <%= render 'variant_prices', variant: @product.master %>
- </div>
- <div class="form-actions" data-hook="buttons">
- <%= button Spree.t('actions.update'), 'update.svg' %>
- <span class="or"><%= Spree.t(:or) %></span>
- <%= button_link_to Spree.t('actions.cancel'), admin_product_path(@product), icon: 'delete.svg' %>
- </div>
-<% end %>
diff --git a/backend/app/views/spree/admin/product_properties/_product_property_fields.html.erb b/backend/app/views/spree/admin/product_properties/_product_property_fields.html.erb
deleted file mode 100644
index beebc65556..0000000000
--- a/backend/app/views/spree/admin/product_properties/_product_property_fields.html.erb
+++ /dev/null
@@ -1,33 +0,0 @@
-<tr class="product_property fields" id="spree_<%= dom_id(f.object) %>" data-hook="product_property">
- <% if f.object.persisted? && can?(:edit, f.object) %>
- <td class="move-handle">
- <%= svg_icon name: "sort.svg", width: '18', height: '18' %>
- <%= f.hidden_field :id %>
- </td>
- <% else %>
- <td style="opacity:0.2;">
- <%= svg_icon name: "sort.svg", width: '18', height: '18' %>
- <%= f.hidden_field :id %>
- </td>
- <% end %>
- <td class='property_name'>
- <%= f.text_field :property_name, class: 'autocomplete form-control' %>
- </td>
- <td class='value'>
- <%= f.text_field :value, class: 'form-control' %>
- </td>
- <td class="show_property">
- <%= f.check_box :show_property %>
- </td>
- <td class="actions">
- <span class="d-flex justify-content-end">
- <% if f.object.persisted? && can?(:destroy, f.object) %>
- <%= link_to_delete f.object, no_text: true %>
- <% else %>
- <span class="btn btn-danger btn-sm icon-link disabled" style="opacity:0.2;">
- <%= svg_icon name: "delete.svg", width: '18', height: '18' %>
- </span>
- <% end %>
- </span>
- </td>
-</tr>
diff --git a/backend/app/views/spree/admin/product_properties/index.html.erb b/backend/app/views/spree/admin/product_properties/index.html.erb
deleted file mode 100644
index c043ebcdc6..0000000000
--- a/backend/app/views/spree/admin/product_properties/index.html.erb
+++ /dev/null
@@ -1,57 +0,0 @@
-<%= render 'spree/admin/shared/product_tabs', current: :properties %>
-<%= render 'spree/admin/shared/error_messages', target: @product %>
-
-<% content_for :page_actions do %>
- <%= product_preview_link(@product) %>
-
- <%= button_link_to(
- Spree.t(:add_product_properties),
- "javascript:;",
- { icon: 'add.svg', :'data-target' => "tbody#sortVert", class: 'btn-success spree_add_fields' }) %>
-
- <span class="js-new-ptype-link">
- <%= button_link_to Spree.t(:select_from_prototype),
- available_admin_prototypes_url,
- { icon: 'list.svg', remote: true, 'data-update' => 'prototypes', class: 'btn-outline-secondary' } %>
- </span>
-<% end if can? :create, Spree::ProductProperty %>
-
-<%= form_for @product, url: spree.admin_product_url(@product), method: :put do |f| %>
- <fieldset>
- <div id="prototypes" data-hook></div>
- <div class=" table-responsive mb-3">
- <table id="product_properties" class="table sortable" data-hook data-sortable-link="<%= update_positions_admin_product_product_properties_url %>">
- <thead>
- <tr data-hook="product_properties_header">
- <th colspan="2"><%= Spree.t(:property) %></th>
- <th><%= Spree.t(:value) %></th>
- <th><%= Spree.t(:show_property) %></th>
- <th class="actions"></th>
- </tr>
- </thead>
- <tbody id="sortVert">
- <%= f.fields_for :product_properties do |pp_form| %>
- <%= render 'product_property_fields', f: pp_form %>
- <% end %>
- </tbody>
- </table>
- </div>
- <%= render('spree/admin/shared/edit_resource_links') if can? :update, Spree::ProductProperty %>
- <%= hidden_field_tag 'clear_product_properties', 'true' %>
- </fieldset>
-<% end %>
-
-<script>
- var properties = <%= raw(@properties.to_json) %>;
- $('#product_properties').on('keydown', 'input.autocomplete', function() {
- already_auto_completed = $(this).is('ac_input');
- if (!already_auto_completed) {
- $(this).autocomplete({source: properties});
- $(this).focus();
- }
- });
-</script>
-
-<style>
- div.ui-helper-hidden-accessible {display:none;}
-</style>
diff --git a/backend/app/views/spree/admin/products/_add_stock_form.html.erb b/backend/app/views/spree/admin/products/_add_stock_form.html.erb
deleted file mode 100644
index 47d90b924a..0000000000
--- a/backend/app/views/spree/admin/products/_add_stock_form.html.erb
+++ /dev/null
@@ -1,45 +0,0 @@
-<div class="card-header">
- <h1 class="card-title mb-0 h5">
- <%= Spree.t(:add_stock) %>
- </h1>
-</div>
-<% content_for :page_actions do %>
- <%= product_preview_link(@product) %>
-<% end %>
-<div class="card-body">
- <%= form_for [:admin, Spree::StockMovement.new], url: admin_stock_items_path do |f| %>
- <div data-hook="admin_stock_movements_form_fields" class="row">
- <div class="col-12 col-lg-2">
- <div class="form-group">
- <%= f.field_container :quantity do %>
- <%= f.label :quantity, Spree.t(:quantity) %>
- <%= f.number_field :quantity, class: 'form-control', value: 1 %>
- <% end %>
- </div>
- </div>
- <div class="col-12 col-lg-5">
- <div class="form-group">
- <%= f.field_container :stock_location do %>
- <%= label_tag :stock_location_id, Spree.t(:stock_location) %>
- <%= select_tag 'stock_location_id', options_from_collection_for_select(@stock_locations, :id, :name),
- class: 'select2' %>
- <% end %>
- </div>
- </div>
-
- <div class="col-12 col-lg-5">
- <div class="form-group">
- <%= f.field_container :variant_id do %>
- <%= label_tag 'variant_id', Spree.t(:variant) %>
- <%= select_tag 'variant_id', options_from_collection_for_select(@variants, :id, :sku_and_options_text),
- class: 'select2' %>
- <% end %>
- </div>
- </div>
- </div>
-
- <div class="form-actions text-center" data-hook="buttons">
- <%= button Spree.t(:add_stock), 'add.svg' %>
- </div>
- <% end %>
-</div>
diff --git a/backend/app/views/spree/admin/products/_autocomplete.js.erb b/backend/app/views/spree/admin/products/_autocomplete.js.erb
deleted file mode 100644
index f232f01434..0000000000
--- a/backend/app/views/spree/admin/products/_autocomplete.js.erb
+++ /dev/null
@@ -1,35 +0,0 @@
-<script type='text/template' id='product_template'>
- <li id="product_{{ product.id }}" data-classification-id='{{ classification.id }}' data-product-id='{{ product.id }}' class="product p-2 col-6 col-md-3 col-lg-2">
- <div class="m-1 p-2 card bg-light">
- <nav class="navbar navbar-light bg-light justify-content-between px-0 pt-0" style="background-color:transparent !important;">
- <a class=" sort-handle js-sort-handle">
- <%= svg_icon name: "move.svg", width: '22', height: '22' %>
- </a>
- <div class="dropdown ">
- <button class="btn btn-outline-secondary dropdown-toggle products-ddb btn-sm" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
- <%= svg_icon name: "chevron-down.svg", width: '18', height: '18' %>
- </button>
- <div class="dropdown-menu dropdown-menu-right p-0 mt-1" aria-labelledby="dropdownMenuButton">
- <a href="{{ edit_product_url product.id }}" class="edit-product js-edit-product dropdown-item p-1"><%= Spree.t(:edit) %></a>
- <a href="javascript:;" class="delete-product js-delete-product dropdown-item p-1"><%= Spree.t(:remove) %></a>
- </div>
- </div>
- </nav>
- <div class='image'>
- {{#if image }}
- <div class="admin-product-image-container small-img">
- <img src='{{image}}' alt='{{ product.attributes.name }}' class='thumbnail rounded border border' />
- </div>
- {{ else }}
- <div class="admin-product-image-container small-img">
- <%= inline_svg_tag "noimage/backend-missing-image.svg", class: "noimage", size: "60%*60%" %>
- </div>
- {{/if}}
- </div>
- <div class="p-0 pt-1 text-center product-info">
- <p class="name card-text">{{ product.attributes.name }}</p>
- <p class="price card-text">{{ product.attributes.display_price }}</p>
- </div>
- </div>
- </li>
-</script>
diff --git a/backend/app/views/spree/admin/products/_form.html.erb b/backend/app/views/spree/admin/products/_form.html.erb
deleted file mode 100644
index 23d9f56786..0000000000
--- a/backend/app/views/spree/admin/products/_form.html.erb
+++ /dev/null
@@ -1,285 +0,0 @@
-<div data-hook="admin_product_form_fields">
- <div class="row">
-
- <div class="col-12 col-md-8" data-hook="admin_product_form_left">
- <div data-hook="admin_product_form_name">
- <%= f.field_container :name, class: ['form-group'] do %>
- <%= f.label :name, raw(Spree.t(:name) + required_span_tag) %>
- <%= f.text_field :name, class: 'form-control title' %>
- <%= f.error_message_on :name %>
- <% end %>
- </div>
-
- <div data-hook="admin_product_form_slug">
- <%= f.field_container :slug, class: ['form-group'] do %>
- <%= f.label :slug, raw(Spree.t(:slug) + required_span_tag) %>
- <%= f.text_field :slug, class: 'form-control title' %>
- <%= f.error_message_on :slug %>
- <% end %>
- </div>
-
- <div data-hook="admin_product_form_description">
- <%= f.field_container :description, class: ['form-group'] do %>
- <%= f.label :description, Spree.t(:description) %>
- <%= f.text_area :description, { rows: "#{unless @product.has_variants? then '29' else '30' end}", class: "form-control #{"spree-rte" if product_wysiwyg_editor_enabled? }" } %>
- <%= f.error_message_on :description %>
- <% end %>
- </div>
- </div>
-
- <div class="col-12 col-md-4" data-hook="admin_product_form_right">
- <div data-hook="admin_product_form_price">
- <%= f.field_container :price, class: ['form-group'] do %>
- <%= f.label :price, raw(Spree.t(:master_price) + required_span_tag) %>
- <div class="input-group">
- <div class="input-group-prepend">
- <span class="input-group-text"><%= currency_symbol(current_currency) %></span>
- </div>
- <%= f.text_field :price, value: number_to_currency(@product.amount_in(current_currency), unit: ''), class: 'form-control', disabled: (cannot? :update, @product.master.default_price) %>
- </div>
- <%= f.error_message_on :price %>
- <% end %>
- </div>
-
- <div>
- <%= f.field_container :compare_at_price, class: ['form-group'] do %>
- <%= f.label :compare_at_price, Spree.t(:compare_at_price) %>
- <div class="input-group">
- <div class="input-group-prepend">
- <span class="input-group-text"><%= currency_symbol(current_currency) %></span>
- </div>
- <%= f.text_field :compare_at_price, value: number_to_currency(@product.compare_at_amount_in(current_currency), unit: ''), class: 'form-control' %>
- </div>
- <%= f.error_message_on :compare_at_price %>
- <% end %>
- </div>
-
- <div data-hook="admin_product_form_cost_price" class="alpha two columns">
- <%= f.field_container :cost_price, class: ['form-group'] do %>
- <%= f.label :cost_price, Spree.t(:cost_price) %>
- <%= f.text_field :cost_price, value: number_to_currency(@product.cost_price, unit: ''), class: 'form-control' %>
- <%= f.error_message_on :cost_price %>
- <% end %>
- </div>
- <div data-hook="admin_product_form_cost_currency" class="omega two columns">
- <%= f.field_container :cost_currency, class: ['form-group'] do %>
- <%= f.label :cost_currency, Spree.t(:cost_currency) %>
- <%= f.select :cost_currency, currency_options(@product.cost_currency), {}, { class: 'select2' } %>
- <%= f.error_message_on :cost_currency %>
- <% end %>
- </div>
-
- <div data-hook="admin_product_form_available_on">
- <%= f.field_container :available_on, class: ['form-group'] do %>
- <%= f.label :available_on, Spree.t(:available_on) %>
- <%= f.error_message_on :available_on %>
-
- <div class="input-group datePickerFrom"
- data-wrap="true"
- data-alt-format="<%= Spree.t(:fpr_human_friendly_date_format, scope: 'date_picker', default: 'M j, Y') %>"
- data-max-date="<%= @product.discontinue_on %>">
-
- <%= f.text_field :available_on,
- value: datepicker_field_value(@product.available_on),
- placeholder: Spree.t(:select_a_date),
- class: 'form-control shadow-none ',
- 'data-input':'' %>
-
- <%= render partial: 'spree/admin/shared/cal_close' %>
- </div>
- <% end %>
- </div>
-
- <div data-hook="admin_product_form_discontinue_on">
- <%= f.field_container :discontinue_on, class: ['form-group'] do %>
- <%= f.label :discontinue_on, Spree.t(:discontinue_on) %>
- <%= f.error_message_on :discontinue_on %>
-
- <div class="input-group datePickerTo"
- data-wrap="true"
- data-alt-format="<%= Spree.t(:fpr_human_friendly_date_format, scope: 'date_picker', default: 'M j, Y') %>"
- data-min-date="<%= @product.available_on %>">
-
- <%= f.text_field :discontinue_on,
- value: datepicker_field_value(@product.discontinue_on),
- placeholder: Spree.t(:select_a_date),
- class: 'form-control shadow-none ',
- 'data-input':'' %>
-
- <%= render partial: 'spree/admin/shared/cal_close' %>
- </div>
- <% end %>
- </div>
-
- <div data-hook="admin_product_form_promotionable">
- <%= f.field_container :promotionable, class: ['form-group'] do %>
- <%= f.check_box :promotionable %>
- <%= f.label :promotionable, Spree.t(:promotionable) %>
- <%= f.error_message_on :promotionable %>
- <% end %>
- </div>
-
- <div data-hook="admin_product_form_sku">
- <%= f.field_container :master_sku, class: ['form-group'] do %>
- <%= f.label :master_sku, Spree.t(:master_sku) %>
- <%= f.text_field :sku, size: 16, class: 'form-control' %>
- <% end %>
- </div>
-
- <% if @product.has_variants? %>
- <div data-hook="admin_product_form_multiple_variants" class="card bg-light mb-3">
- <div class="card-body">
- <h5 class="card-title"><%= f.label :skus, Spree.t(:sku).pluralize %></h5>
- <h6 class="card-subtitle mb-2 text-muted"><%= Spree.t(:info_product_has_multiple_skus, count: @product.variants.size) %> </h6>
- <ul class="list-unstyled">
- <% @product.variants.first(5).each do |variant| %>
- <li><%= variant.sku %></li>
- <% end %>
- </ul>
- <% if @product.variants.size > 5 %>
- <em>
- <%= Spree.t(:info_number_of_skus_not_shown, count: @product.variants.size - 5) %>
- </em>
- <% end %>
- <div class="info-actions">
- <% if can?(:admin, Spree::Variant) %>
- <%= link_to_with_icon 'adjust.svg', Spree.t(:manage_variants), spree.admin_product_variants_url(@product), class: "btn btn-outline-secondary" %>
- <% end %>
- </div>
- </div>
- </div>
- <% else %>
- <div id="shipping_specs" class="row">
- <div class="col-12 col-md-6">
- <div id="shipping_specs_weight_field" data-hook="admin_product_form_weight" class="form-group">
- <%= f.label :weight, Spree.t(:weight) %>
- <%= f.text_field :weight, value: number_with_precision(@product.weight, precision: 2), size: 4, class: 'form-control' %>
- </div>
- </div>
-
- <div class="col-12 col-md-6">
- <div id="shipping_specs_height_field" data-hook="admin_product_form_height" class="form-group">
- <%= f.label :height, Spree.t(:height) %>
- <%= f.text_field :height, value: number_with_precision(@product.height, precision: 2), size: 4, class: 'form-control' %>
- </div>
- </div>
-
- <div class="col-12 col-md-6">
- <div id="shipping_specs_width_field" data-hook="admin_product_form_width" class="form-group">
- <%= f.label :width, Spree.t(:width) %>
- <%= f.text_field :width, value: number_with_precision(@product.width, precision: 2), size: 4, class: 'form-control' %>
- </div>
- </div>
-
- <div class="col-12 col-md-6">
- <div id="shipping_specs_depth_field" data-hook="admin_product_form_depth" class="form-group">
- <%= f.label :depth, Spree.t(:depth) %>
- <%= f.text_field :depth, value: number_with_precision(@product.depth, precision: 2), size: 4, class: 'form-control' %>
- </div>
- </div>
- </div>
- <% end %>
-
- <div data-hook="admin_product_form_shipping_categories">
- <%= f.field_container :shipping_category, class: ['form-group'] do %>
- <%= f.label :shipping_category_id, Spree.t(:shipping_category) %>
- <%= f.collection_select(:shipping_category_id, @shipping_categories, :id, :name, { include_blank: Spree.t('match_choices.none') }, { class: 'select2' }) %>
- <%= f.error_message_on :shipping_category %>
- <% end %>
- </div>
-
- <div data-hook="admin_product_form_tax_category">
- <%= f.field_container :tax_category, class: ['form-group'] do %>
- <%= f.label :tax_category_id, Spree.t(:tax_category) %>
- <%= f.collection_select(:tax_category_id, @tax_categories, :id, :name, { include_blank: Spree.t('match_choices.none') }, { class: 'select2' }) %>
- <%= f.error_message_on :tax_category %>
- <% end %>
- </div>
- </div>
-
- </div>
-
- <div data-hook="admin_product_form_taxons">
- <%= f.field_container :taxons, class: ['form-group'] do %>
- <%= f.label :taxon_ids, Spree.t(:taxons) %>
-
- <% if can? :modify, Spree::Classification %>
- <%= f.select :taxon_ids, options_from_collection_for_select(@product.taxons, :id, :pretty_name, @product.taxon_ids),
- { include_hidden: true },
- multiple: true,
- data: { autocomplete_url_value: 'taxons_api_v2',
- autocomplete_return_attr_value: 'pretty_name',
- autocomplete_multiple_value: true } %>
- <% elsif @product.taxons.any? %>
- <ul class="text_list">
- <% @product.taxons.each do |taxon| %>
- <li><%= taxon.name %></li>
- <% end %>
- </ul>
- <% else %>
- <div class="alert alert-info"><%= Spree.t(:no_resource_found, resource: :taxons) %></div>
- <% end %>
-
- <% end %>
- </div>
-
- <div data-hook="admin_product_form_option_types">
- <%= f.field_container :option_types, class: ['form-group'] do %>
- <%= f.label :option_type_ids, Spree.t(:option_types) %>
-
- <% if can? :modify, Spree::ProductOptionType %>
- <%= f.select :option_type_ids, options_from_collection_for_select(@product.option_types, :id, :name, @product.option_type_ids),
- { include_hidden: true },
- multiple: true,
- class: 'select2-hidden-accessible',
- data: { autocomplete_url_value: 'option_types_api_v2',
- autocomplete_return_attr_value: 'name',
- autocomplete_multiple_value: true } %>
- <% elsif @product.option_types.any? %>
- <ul class="text_list">
- <% @product.option_types.each do |type| %>
- <li><%= type.presentation %> (<%= type.name %>)</li>
- <% end %>
- </ul>
- <% else %>
- <div class="alert alert-info"><%= Spree.t(:no_resource_found, resource: :option_types) %></div>
- <% end %>
-
- <% end %>
- </div>
-
- <% if @stores.count > 1 %>
- <div data-hook="admin_product_form_stores">
- <%= f.field_container :stores, class: ['form-group'] do %>
- <%= f.label :product_stores, Spree.t(:stores) %>
- <%= collection_select(:product, :store_ids, @stores, :id, :unique_name, {}, { multiple: true, class: 'select2' }) %>
- <% end %>
- </div>
- <% end %>
-
- <div data-hook="admin_product_form_meta">
- <div data-hook="admin_product_form_meta_title">
- <%= f.field_container :meta_title, class: ['form-group'] do %>
- <%= f.label :meta_title, Spree.t(:meta_title) %>
- <%= f.text_field :meta_title, class: 'form-control' %>
- <% end %>
- </div>
-
- <div data-hook="admin_product_form_meta_keywords">
- <%= f.field_container :meta_keywords, class: ['form-group'] do %>
- <%= f.label :meta_keywords, Spree.t(:meta_keywords) %>
- <%= f.text_field :meta_keywords, class: 'form-control' %>
- <% end %>
- </div>
-
- <div data-hook="admin_product_form_meta_description">
- <%= f.field_container :meta_description, class: ['form-group'] do %>
- <%= f.label :meta_description, Spree.t(:meta_description) %>
- <%= f.text_area :meta_description, class: 'form-control' %>
- <% end %>
- </div>
-
- <div data-hook="admin_product_form_additional_fields"></div>
-
- </div>
-</div>
diff --git a/backend/app/views/spree/admin/products/edit.html.erb b/backend/app/views/spree/admin/products/edit.html.erb
deleted file mode 100644
index 7c1bd4b6b4..0000000000
--- a/backend/app/views/spree/admin/products/edit.html.erb
+++ /dev/null
@@ -1,16 +0,0 @@
-<% content_for :page_actions do %>
- <%= product_preview_link(@product) %>
- <% if can?(:create, Spree::Product) %>
- <%= button_link_to Spree.t(:new_product), new_object_url, { class: "btn-success", icon: 'add.svg', id: 'admin_new_product' } %>
- <% end %>
-<% end %>
-
-<%= render partial: 'spree/admin/shared/product_tabs', locals: {current: :details} %>
-<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @product } %>
-
-<%= form_for [:admin, @product], method: :put, html: { multipart: true } do |f| %>
- <fieldset>
- <%= render partial: 'form', locals: { f: f } %>
- <%= render partial: 'spree/admin/shared/edit_resource_links' %>
- </fieldset>
-<% end %>
diff --git a/backend/app/views/spree/admin/products/index.html.erb b/backend/app/views/spree/admin/products/index.html.erb
deleted file mode 100644
index 3aa1a38ed1..0000000000
--- a/backend/app/views/spree/admin/products/index.html.erb
+++ /dev/null
@@ -1,98 +0,0 @@
-<% content_for :page_title do %>
- <%= plural_resource_name(Spree::Product) %>
-<% end %>
-
-<% content_for :page_actions do %>
- <%= button_link_to Spree.t(:new_product), new_object_url, { class: "btn-success", icon: 'add.svg', id: 'admin_new_product' } %>
-<% end if can?(:create, Spree::Product) %>
-
-<% content_for :table_filter do %>
- <div data-hook="admin_products_sidebar">
-
- <%= search_form_for [:admin, @search] do |f| %>
- <%- locals = {f: f} %>
- <div data-hook="admin_products_index_search" class="row">
- <div class="col-12 col-lg-6">
- <div class="form-group">
- <%= f.label :search_by_name, Spree.t(:product_name) %>
- <%= f.text_field :search_by_name, size: 15, class: "form-control js-quick-search-target js-filterable" %>
- </div>
- </div>
- <div class="col-12 col-lg-6">
- <div class="form-group">
- <%= f.label :variants_including_master_sku_cont, Spree.t(:sku) %>
- <%= f.text_field :variants_including_master_sku_cont, size: 15, class: "form-control js-filterable" %>
- </div>
- </div>
- <div class="col-12">
- <%= f.field_container :deleted_at_null do %>
- <div class="custom-control custom-checkbox">
- <%= f.check_box :deleted_at_null, {checked: params[:q][:deleted_at_null] == '0', class: 'custom-control-input'}, '0', '1' %>
- <%= f.label :deleted_at_null, Spree.t(:show_deleted), class: 'custom-control-label' %>
- </div>
- <% end %>
-
- <%= f.field_container :not_discontinued do %>
- <div class="custom-control custom-checkbox">
- <%= f.check_box :not_discontinued, {checked: params[:q][:not_discontinued] == '0', class: 'custom-control-input'}, '0', '1' %>
- <%= f.label :not_discontinued, Spree.t(:show_discontinued ), class: 'custom-control-label' %>
- </div>
- <% end %>
- </div>
- </div>
- <div data-hook="admin_products_index_search_buttons" class="form-actions">
- <%= button Spree.t(:search), 'search.svg' %>
- </div>
- <% end %>
-
- </div>
-<% end %>
-
-<% if @collection.any? %>
-<div class="table-responsive">
- <table class="table" id="listing_products">
- <thead>
- <tr data-hook="admin_products_index_headers">
- <th scope="col" colspan="2"><%= sort_link @search,:name, Spree.t(:name), { default_order: "desc" }, {title: 'admin_products_listing_name_title'} %></th>
- <th scope="col"><%= Spree.t(:sku) %></th>
- <th scope="col"><%= Spree.t(:status) %></th>
- <th scope="col" class="text-center">
- <%= sort_link @search, :master_default_price_amount, Spree.t(:master_price), {}, {title: 'admin_products_listing_price_title'} %>
- </th>
- <th scope="col" data-hook="admin_products_index_header_actions" class="actions"></th>
- </tr>
- </thead>
- <tbody>
- <% @collection.each do |product| %>
- <% available_status = available_status(product) %>
- <tr <%== "style='color: red;'" if product.deleted? %> id="<%= spree_dom_id product %>" data-hook="admin_products_index_rows" class="<%= cycle('odd', 'even') %>">
- <td scope="row" class="image">
- <%= link_to edit_admin_product_path(product) do %>
- <%= small_image product %>
- <% end %>
- </td>
- <td><%= link_to product.try(:name), edit_admin_product_path(product) %></td>
- <td class="sku"><%= product.sku rescue '' %></td>
- <td class="status"><%= active_badge(available_status == Spree.t(:available), label: available_status) %></td>
- <td class="text-center"><%= display_price(product) %></td>
-
- <td class="actions " data-hook="admin_products_index_row_actions">
- <span class="d-flex justify-content-end">
- <%= link_to_edit product, no_text: true, class: 'edit' if can?(:edit, product) && !product.deleted? %>
- <%= link_to_clone product, no_text: true, class: 'clone' if can?(:clone, product) %>
- <%= link_to_delete product, no_text: true if can?(:delete, product) && !product.deleted? %>
- </span>
- </td>
- </tr>
- <% end %>
- </tbody>
- </table>
-</div>
-<% else %>
- <div class="alert alert-info no-objects-found">
- <%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree::Product)) %>,
- <%= link_to Spree.t(:add_one), new_object_url if can?(:create, Spree::Product) %>!
- </div>
-<% end %>
-
-<%= render partial: 'spree/admin/shared/index_table_options', locals: { collection: @collection } %>
diff --git a/backend/app/views/spree/admin/products/new.html.erb b/backend/app/views/spree/admin/products/new.html.erb
deleted file mode 100644
index 97d40b273c..0000000000
--- a/backend/app/views/spree/admin/products/new.html.erb
+++ /dev/null
@@ -1,105 +0,0 @@
-<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @product } %>
-
-<% content_for :page_title do %>
- <%= link_to Spree.t(:products), spree.admin_products_url %> /
- <%= Spree.t(:new_product) %>
-<% end %>
-
-<%= form_for [:admin, @product], html: { multipart: true } do |f| %>
- <fieldset data-hook="new_product">
- <%= f.field_container :name, class: ['form-group'] do %>
- <%= f.label :name, Spree.t(:name) %> <span class="required">*</span>
- <%= f.text_field :name, class: 'form-control title', required: :required %>
- <%= f.error_message_on :name %>
- <% end %>
-
- <div data-hook="new_product_attrs" class="row">
- <% unless @product.has_variants? %>
- <div data-hook="new_product_sku" class="col-12 col-md-4">
- <%= f.field_container :sku, class: ['form-group'] do %>
- <%= f.label :sku, Spree.t(:sku) %>
- <%= f.text_field :sku, size: 16, class: 'form-control' %>
- <%= f.error_message_on :sku %>
- <% end %>
- </div>
- <% end %>
-
- <div data-hook="new_product_prototype" class="col-12 col-md-4">
- <%= f.field_container :prototype, class: ['form-group'] do %>
- <%= f.label :prototype_id, Spree.t(:prototype) %>
- <%= f.collection_select :prototype_id, Spree::Prototype.all, :id, :name, { include_blank: true }, { class: 'select2-clear w-100' } %>
- <% end %>
- </div>
-
- <div data-hook="new_product_price" class="col-12 col-md-4">
- <%= f.field_container :price, class: ['form-group'] do %>
- <%= f.label :price, Spree.t(:master_price) %> <span class="required">*</span>
- <div class="input-group">
- <div class="input-group-prepend">
- <span class="input-group-text"><%= currency_symbol(current_currency) %></span>
- </div>
- <%= f.text_field :price, value: number_to_currency(@product.price, unit: ''), class: 'form-control', required: :required %>
- </div>
- <%= f.error_message_on :price %>
- <% end %>
- </div>
-
- <div data-hook="new_product_available_on" class="col-12 col-md-4">
- <%= f.field_container :available_on, class: ['form-group'] do %>
- <%= f.label :available_on, Spree.t(:available_on) %>
- <%= f.error_message_on :available_on %>
-
- <div class="input-group datepicker"
- data-wrap="true"
- data-alt-format="<%= Spree.t(:fpr_human_friendly_date_format, scope: 'date_picker', default: 'M j, Y') %>">
- <%= f.text_field :available_on,
- value: datepicker_field_value(@product.available_on),
- placeholder: Spree.t(:select_a_date),
- class: 'form-control shadow-none',
- 'data-input':'' %>
-
- <%= render partial: 'spree/admin/shared/cal_close' %>
- </div>
- <% end %>
- </div>
-
- <div data-hook="new_product_shipping_category" class="col-12 col-md-4">
- <%= f.field_container :shipping_category, class: ['form-group'] do %>
- <%= f.label :shipping_category_id, Spree.t(:shipping_categories) %><span class="required">*</span>
- <%= f.collection_select(:shipping_category_id, @shipping_categories, :id, :name, { include_blank: Spree.t('match_choices.none') }, { class: 'select2 w-100' }) %>
- <%= f.error_message_on :shipping_category_id %>
- <% end %>
- </div>
-
- </div>
-
- <div data-hook="product-from-prototype" id="product-from-prototype">
- <%= render template: 'spree/admin/prototypes/show' if @prototype %>
- </div>
-
- <%= render partial: 'spree/admin/shared/new_resource_links' %>
-
- </fieldset>
-<% end %>
-
-<script type="text/javascript">
-//<![CDATA[
- (function($){
- var base_url = "<%= spree.admin_prototypes_url %>";
- var prototype_select = $('#product_prototype_id');
- prototype_select.change(function() {
- var id = prototype_select.val();
- if (id.length) {
- var url = new Uri(base_url);
- url.setPath(url.path() + '/' + id);
- $('#product-from-prototype').load(url.toString());
- } else {
- $('#product-from-prototype').empty();
- }
- })
- if (prototype_select.html() == "") {
- prototype_select.change();
- }
- })(jQuery);
-//]]>
-</script>
diff --git a/backend/app/views/spree/admin/products/stock.html.erb b/backend/app/views/spree/admin/products/stock.html.erb
deleted file mode 100644
index af228f9582..0000000000
--- a/backend/app/views/spree/admin/products/stock.html.erb
+++ /dev/null
@@ -1,81 +0,0 @@
-<%= render partial: 'spree/admin/shared/product_tabs', locals: {current: :stock} %>
-<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @product } %>
-
-<% if can? :create, Spree::StockMovement %>
- <div id="add_stock_form" class="card mb-3">
- <%= render 'add_stock_form' %>
- </div>
-<% end %>
-<div class="card mb-3">
- <div class="table-responsive">
- <table class="table" id="listing_product_stock">
- <thead>
- <tr data-hook="admin_product_stock_management_index_headers">
- <th colspan="2"><%= Spree.t(:variant) %></th>
- <th colspan="3"><%= Spree.t(:stock_location_info) %></th>
- </tr>
- </thead>
- <tbody>
- <% @variants.each do |variant| %>
- <% if variant.stock_items.present? %>
- <tr id="<%= spree_dom_id variant %>" data-hook="admin_product_stock_management_index_rows">
- <td class="image text-center">
- <% if variant.images.present? %>
- <%= image_tag main_app.url_for(variant.images.first.url(:mini)) %>
- <% end %>
- </td>
- <td>
- <%= variant.sku_and_options_text %>
- <%= form_tag admin_product_variants_including_master_path(@product, variant, format: :js), method: :put, class: 'toggle_variant_track_inventory' do %>
- <div class="checkbox">
- <%= label_tag "track_inventory_#{ variant.id }" do %>
- <%= check_box_tag 'track_inventory', 1, variant.track_inventory?,
- class: 'track_inventory_checkbox', id: "track_inventory_#{ variant.id }" %>
- <%= Spree.t(:track_inventory) %>
- <%= hidden_field_tag 'variant[track_inventory]', variant.track_inventory?,
- class: 'variant_track_inventory',
- id: "variant_track_inventory_#{variant.id}" %>
- <% end %>
- </div>
- <% end if can?(:update, @product) && can?(:update, variant) %>
- </td>
-
- <td colspan="3" class="stock_location_info">
- <table class="table table-bordered mb-0">
- <thead>
- <th><%= Spree.t(:stock_location) %></th>
- <th class="text-center"><%= Spree.t(:count_on_hand) %></th>
- <th class="text-center"><%= Spree.t(:backorderable) %></th>
- <th class="actions text-center"></th>
- </thead>
- <tbody>
- <% variant.stock_items.each do |item| %>
- <% next unless @stock_locations.include?(item.stock_location) %>
- <tr id="stock-item-<%= item.id %>">
- <td><%= item.stock_location.name %></td>
- <td class="text-center"><%= item.count_on_hand %></td>
- <td class="text-center">
- <%= form_tag admin_stock_item_path(item), method: :put, class: 'toggle_stock_item_backorderable' do %>
- <%= check_box_tag 'stock_item[backorderable]', true,
- item.backorderable?,
- class: 'stock_item_backorderable',
- id: "stock_item_backorderable_#{item.stock_location.id}" %>
- <% end if can? :update, item %>
- </td>
- <td class="actions">
- <span class="d-flex justify-content-center">
- <%= link_to_with_icon('delete.svg', Spree.t(:remove), [:admin, item], method: :delete, remote: true, class: 'icon_link btn btn-danger btn-sm', data: { action: :remove, confirm: Spree.t(:are_you_sure) }, no_text: true) if can? :destroy, item %>
- </span>
- </td>
- </tr>
- <% end %>
- </tbody>
- </table>
- </td>
- <% end %>
- </tr>
- <% end %>
- </tbody>
- </table>
- </div>
-</div>
diff --git a/backend/app/views/spree/admin/promotion_actions/create.js.erb b/backend/app/views/spree/admin/promotion_actions/create.js.erb
deleted file mode 100644
index 058a5501dc..0000000000
--- a/backend/app/views/spree/admin/promotion_actions/create.js.erb
+++ /dev/null
@@ -1,12 +0,0 @@
-$('#actions').append('<%= escape_javascript( render(partial: 'spree/admin/promotions/promotion_action', object: @promotion_action) ) %>');
-$('#actions .no-objects-found').hide();
-$(document).ready(function(){
- $(".variant_autocomplete").variantAutocomplete();
- //enable select2 functions for recently added box
- $('.type-select.select2').last().select2();
-});
-initProductActions();
-
-
-$('#<%= dom_id @promotion_action %>').hide();
-$('#<%= dom_id @promotion_action %>').fadeIn();
diff --git a/backend/app/views/spree/admin/promotion_actions/destroy.js.erb b/backend/app/views/spree/admin/promotion_actions/destroy.js.erb
deleted file mode 100644
index a6120db69e..0000000000
--- a/backend/app/views/spree/admin/promotion_actions/destroy.js.erb
+++ /dev/null
@@ -1 +0,0 @@
-$('#<%= dom_id @promotion_action %>').fadeOut().remove();
diff --git a/backend/app/views/spree/admin/promotion_categories/_form.html.erb b/backend/app/views/spree/admin/promotion_categories/_form.html.erb
deleted file mode 100644
index 4459aba5e9..0000000000
--- a/backend/app/views/spree/admin/promotion_categories/_form.html.erb
+++ /dev/null
@@ -1,11 +0,0 @@
-<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @promotion_category } %>
-
-<%= f.field_container :name, class: ['form-group'] do %>
- <%= f.label :name %>
- <%= f.text_field :name, class: 'form-control' %>
- <%= f.error_message_on :name %>
-<% end %>
-<%= f.field_container :code, class: ['form-group'] do %>
- <%= f.label :code %>
- <%= f.text_field :code, class: 'form-control' %>
-<% end %>
diff --git a/backend/app/views/spree/admin/promotion_categories/edit.html.erb b/backend/app/views/spree/admin/promotion_categories/edit.html.erb
deleted file mode 100644
index 88ac2065e8..0000000000
--- a/backend/app/views/spree/admin/promotion_categories/edit.html.erb
+++ /dev/null
@@ -1,11 +0,0 @@
-<% content_for :page_title do %>
- <%= link_to Spree.t(:promotion_categories), spree.admin_promotion_categories_url %> /
- <%= @promotion_category.name %>
-<% end %>
-
-<%= form_for @promotion_category, url: object_url, method: :put do |f| %>
- <fieldset>
- <%= render partial: 'form', locals: { f: f } %>
- <%= render partial: 'spree/admin/shared/edit_resource_links' %>
- </fieldset>
-<% end %>
diff --git a/backend/app/views/spree/admin/promotion_categories/index.html.erb b/backend/app/views/spree/admin/promotion_categories/index.html.erb
deleted file mode 100644
index ba149f797b..0000000000
--- a/backend/app/views/spree/admin/promotion_categories/index.html.erb
+++ /dev/null
@@ -1,39 +0,0 @@
-<% content_for :page_title do %>
- <%= plural_resource_name(Spree::PromotionCategory) %>
-<% end %>
-
-<% content_for :page_actions do %>
- <%= button_link_to Spree.t(:new_promotion_category), new_object_url, icon: 'add.svg', class: 'btn-success' %>
-<% end if can?(:create, Spree::PromotionCategory) %>
-
-<% if @promotion_categories.any? %>
-
-<div class="table-responsive">
- <table class="table">
- <thead>
- <th><%= Spree::PromotionCategory.human_attribute_name :name %></th>
- <th><%= Spree::PromotionCategory.human_attribute_name :code %></th>
- <th></th>
- </thead>
- <tbody>
- <% @promotion_categories.each do |promotion_category| %>
- <tr>
- <td><%= promotion_category.name %></td>
- <td><%= promotion_category.code %></td>
- <td class="actions">
- <span class="d-flex justify-content-end">
- <%= link_to_edit promotion_category, no_text: true if can?(:edit, promotion_category) %>
- <%= link_to_delete promotion_category, no_text: true if can?(:delete, promotion_category) %>
- </span>
- </td>
- </tr>
- <% end %>
- </tbody>
- </table>
-</div>
-<% else %>
- <div class="alert alert-info no-objects-found">
- <%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree::PromotionCategory)) %>,
- <%= link_to Spree.t(:add_one), new_object_url %>!
- </div>
-<% end %>
diff --git a/backend/app/views/spree/admin/promotion_categories/new.html.erb b/backend/app/views/spree/admin/promotion_categories/new.html.erb
deleted file mode 100644
index 56d6ce994d..0000000000
--- a/backend/app/views/spree/admin/promotion_categories/new.html.erb
+++ /dev/null
@@ -1,11 +0,0 @@
-<% content_for :page_title do %>
- <%= link_to plural_resource_name(Spree::PromotionCategory), spree.admin_promotion_categories_url %> /
- <%= Spree.t(:new_promotion_category) %>
-<% end %>
-
-<%= form_for :promotion_category, url: collection_url do |f| %>
- <fieldset>
- <%= render partial: 'form', locals: { f: f } %>
- <%= render partial: 'spree/admin/shared/new_resource_links' %>
- </fieldset>
-<% end %>
diff --git a/backend/app/views/spree/admin/promotion_rules/create.js.erb b/backend/app/views/spree/admin/promotion_rules/create.js.erb
deleted file mode 100644
index a82b55a6b2..0000000000
--- a/backend/app/views/spree/admin/promotion_rules/create.js.erb
+++ /dev/null
@@ -1,10 +0,0 @@
-$('#rules').append('<%= escape_javascript( render(partial: 'spree/admin/promotions/promotion_rule', object: @promotion_rule) ) %>');
-$('#rules .no-objects-found').hide();
-
-$('.product_picker').productAutocomplete();
-$('.user_picker').userAutocomplete();
-
-$('#promotion_rule_type').html('<%= escape_javascript options_for_promotion_rule_types(@promotion) %>');
-$('#promotion_rule_type').select2();
-
-$('#product_taxon_ids').taxonAutocomplete()
diff --git a/backend/app/views/spree/admin/promotion_rules/destroy.js.erb b/backend/app/views/spree/admin/promotion_rules/destroy.js.erb
deleted file mode 100644
index 68d2b3f7e1..0000000000
--- a/backend/app/views/spree/admin/promotion_rules/destroy.js.erb
+++ /dev/null
@@ -1,3 +0,0 @@
-$('#<%= dom_id @promotion_rule %>').fadeOut().remove();
-
-$('#promotion_rule_type').html('<%= escape_javascript options_for_promotion_rule_types(@promotion) %>');
diff --git a/backend/app/views/spree/admin/promotions/_actions.html.erb b/backend/app/views/spree/admin/promotions/_actions.html.erb
deleted file mode 100644
index 90145b15b5..0000000000
--- a/backend/app/views/spree/admin/promotions/_actions.html.erb
+++ /dev/null
@@ -1,34 +0,0 @@
-<div class="card-header">
- <h1 class="card-title mb-0 h5">
- <%= Spree.t(:promotion_actions) %>
- </h1>
-</div>
-<div id="action_fields" class="card-body">
- <%= form_tag spree.admin_promotion_promotion_actions_path(@promotion), remote: true, id: 'new_promotion_action_form', class: 'mb-3' do %>
- <% options = options_for_select( Rails.application.config.spree.promotions.actions.map(&:name).map {|name| [ Spree.t("promotion_action_types.#{name.demodulize.underscore}.name"), name] } ) %>
-
- <div class="form-group">
- <%= label_tag :action_type, Spree.t(:add_action_of_type) %>
- <%= select_tag 'action_type', options, class: 'select2' %>
- </div>
- <div class="form-actions">
- <%= button Spree.t(:add), 'add.svg', 'submit', class: "btn-success" %>
- </div>
-
- <% end %>
-
- <%= form_for @promotion, url: spree.admin_promotion_path(@promotion), method: :put do |f| %>
- <div id="actions" class="filter_list mt-3">
- <% if @promotion.actions.any? %>
- <%= render partial: 'promotion_action', collection: @promotion.actions %>
- <% else %>
- <div class="alert alert-warning">
- <%= Spree.t(:no_actions_added) %>
- </div>
- <% end %>
- </div>
- <div class="actions promotion-update">
- <%= button Spree.t('actions.update'), 'save.svg' %>
- </div>
- <% end %>
-</div>
diff --git a/backend/app/views/spree/admin/promotions/_form.html.erb b/backend/app/views/spree/admin/promotions/_form.html.erb
deleted file mode 100644
index ec2c05454c..0000000000
--- a/backend/app/views/spree/admin/promotions/_form.html.erb
+++ /dev/null
@@ -1,100 +0,0 @@
-<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @promotion } %>
-
-<div class="row" id="general_fields">
- <div class="col-12 col-lg-4">
- <%= f.field_container :name, class: ['form-group'] do %>
- <%= f.label :name %>
- <%= f.text_field :name, class: 'form-control' %>
- <%= f.error_message_on :name %>
- <% end %>
-
- <div class="form-group">
- <%= f.field_container :code do %>
- <%= f.label :code %>
- <%= f.text_field :code, class: 'form-control' %>
- <% end %>
-
- <%= f.field_container :generate_code, class: ['checkbox'] do %>
- <%= f.label :generate_code do %>
- <%= f.check_box :generate_code %>
- <%= Spree.t(:generate_code) %>
- <% end %>
- <% end %>
- </div>
-
- <%= f.field_container :path, class: ['form-group'] do %>
- <%= f.label :path %>
- <%= f.text_field :path, class: 'form-control' %>
- <% end %>
-
- <%= f.field_container :advertise, class: ['checkbox'] do %>
- <%= f.label :advertise do %>
- <%= f.check_box :advertise %>
- <%= Spree.t(:advertise) %>
- <% end %>
- <% end %>
- </div>
-
- <div class="col-12 col-lg-4">
- <%= f.field_container :description, class: ['form-group'] do %>
- <%= f.label :description %>
- <%= f.text_area :description, rows: 7, class: 'form-control' %>
- <% end %>
-
- <%= f.field_container :category, class: ['form-group'] do %>
- <%= f.label :promotion_category %>
- <%= f.collection_select(:promotion_category_id, @promotion_categories, :id, :name, { include_blank: Spree.t('match_choices.none') }, { class: 'select2 w-100' }) %>
- <% end %>
-
- <% if @stores.count > 1 %>
- <%= f.field_container :stores, class: ['form-group'] do %>
- <%= f.label :promotion_stores, Spree.t(:stores) %>
- <%= collection_select(:promotion, :store_ids, @stores, :id, :unique_name, {}, { multiple: true, class: 'select2' }) %>
- <% end %>
- <% end %>
- </div>
-
- <div id="expiry_fields" class="col-12 col-lg-4">
- <div class="form-group">
- <%= f.field_container :usage_limit do %>
- <%= f.label :usage_limit, Spree.t('limit_usage_to') %>
- <%= f.number_field :usage_limit, min: 0, class: 'form-control hide-number-toggle' %>
- <% end %>
- <small class="form-text text-muted">
- <%= Spree.t(:current_promotion_usage, count: @promotion.credits_count) %>
- </small>
- </div>
- <div id="starts_at_field" class="form-group">
- <%= f.label :starts_at %>
- <div class="input-group datePickerFrom"
- data-wrap="true"
- data-enable-time="true"
- data-alt-format="<%= Spree.t(:fpr_human_friendly_date_time_format, scope: 'date_picker', default: 'M j, Y H:i') %>"
- data-max-date="<%= @promotion.expires_at %>">
- <%= f.datetime_field :starts_at,
- class: 'form-control shadow-none',
- placeholder: Spree.t('starting_from'),
- 'data-input':'' %>
-
- <%= render partial: 'spree/admin/shared/cal_close' %>
- </div>
- </div>
-
- <div id="expires_at_field" class="form-group">
- <%= f.label :expires_at %>
- <div class="input-group datePickerTo"
- data-wrap="true"
- data-enable-time='true'
- data-alt-format="<%= Spree.t(:fpr_human_friendly_date_time_format, scope: 'date_picker', default: 'M j, Y H:i') %>"
- data-min-date="<%= @promotion.starts_at %>">
- <%= f.datetime_field :expires_at,
- placeholder:Spree.t('ends_at'),
- class: 'form-control shadow-none',
- 'data-input':'' %>
-
- <%= render partial: 'spree/admin/shared/cal_close' %>
- </div>
- </div>
-
- </div>
-</div>
diff --git a/backend/app/views/spree/admin/promotions/_promotion_action.html.erb b/backend/app/views/spree/admin/promotions/_promotion_action.html.erb
deleted file mode 100644
index 54c1efa746..0000000000
--- a/backend/app/views/spree/admin/promotions/_promotion_action.html.erb
+++ /dev/null
@@ -1,12 +0,0 @@
-<div class="promotion_action promotion-block <%= promotion_action.type.to_s.demodulize.underscore %> card mb-3" id="<%= dom_id promotion_action %>">
- <% type_name = promotion_action.class.name.demodulize.underscore %>
- <div class="card-header d-flex justify-content-between">
- <%= link_to_with_icon 'delete.svg', '', spree.admin_promotion_promotion_action_path(@promotion, promotion_action), remote: true, method: :delete, class: 'delete order-2' %>
- <h3 class="card-title h5 mb-0 promotion-title"><%= Spree.t("promotion_action_types.#{type_name}.description") %></h3>
- </div>
- <% param_prefix = "promotion[promotion_actions_attributes][#{promotion_action.id}]" %>
- <%= hidden_field_tag "#{param_prefix}[id]", promotion_action.id %>
-
- <%= render partial: "spree/admin/promotions/actions/#{type_name}",
- locals: { promotion_action: promotion_action, param_prefix: param_prefix } %>
-</div>
diff --git a/backend/app/views/spree/admin/promotions/_promotion_rule.html.erb b/backend/app/views/spree/admin/promotions/_promotion_rule.html.erb
deleted file mode 100644
index 3910f0ead5..0000000000
--- a/backend/app/views/spree/admin/promotions/_promotion_rule.html.erb
+++ /dev/null
@@ -1,18 +0,0 @@
-<div class="promotion_rule promotion-block card mb-3" id="<%= dom_id promotion_rule %>">
- <% type_name = promotion_rule.class.name.demodulize.underscore %>
- <div class="card-header d-flex justify-content-between">
- <%= link_to_with_icon 'delete.svg', '',
- spree.admin_promotion_promotion_rule_path(@promotion, promotion_rule),
- remote: true,
- method: :delete,
- class: 'delete order-2' %>
- <h3 class='card-title h5 mb-0 promotion-title'>
- <%= Spree.t("promotion_rule_types.#{type_name}.description") %>
- </h3>
- </div>
- <% param_prefix = "promotion[promotion_rules_attributes][#{promotion_rule.id}]" %>
- <%= hidden_field_tag "#{param_prefix}[id]", promotion_rule.id %>
-
- <%= render partial: "spree/admin/promotions/rules/#{type_name}",
- locals: { promotion_rule: promotion_rule, param_prefix: param_prefix } %>
-</div>
diff --git a/backend/app/views/spree/admin/promotions/_rules.html.erb b/backend/app/views/spree/admin/promotions/_rules.html.erb
deleted file mode 100644
index ed5f654ebe..0000000000
--- a/backend/app/views/spree/admin/promotions/_rules.html.erb
+++ /dev/null
@@ -1,46 +0,0 @@
-<div class="card-header">
- <h1 class="card-title mb-0 h5">
- <%= Spree.t(:rules) %>
- </h1>
-</div>
-<div id="rule_fields" class="card-body">
-
- <%= form_tag spree.admin_promotion_promotion_rules_path(@promotion), remote: true, id: 'new_product_rule_form', class: 'mb-3' do %>
-
- <div class="form-group">
- <%= label_tag :promotion_rule_type, Spree.t(:add_rule_of_type) %>
- <%= select_tag('promotion_rule[type]', options_for_promotion_rule_types(@promotion), class: 'select2') %>
- </div>
- <div class="form-actions">
- <%= button Spree.t(:add), 'add.svg', 'submit', class: "btn-success" %>
- </div>
-
- <% end %>
-
- <%= form_for @promotion, url: object_url, method: :put do |f| %>
- <div id="promotion-policy-select">
- <% Spree::Promotion::MATCH_POLICIES.each do |policy| %>
- <div class="radio my-2">
- <%= f.label "match_policy_#{policy}" do %>
- <%= f.radio_button :match_policy, policy %>
- <%= Spree.t "promotion_form.match_policies.#{policy}" %>
- <% end %>
- </div>
- <% end %>
- </div>
-
- <div id="rules" class="filter_list mt-3">
- <% if @promotion.rules.any? %>
- <%= render partial: 'promotion_rule', collection: @promotion.rules, locals: {} %>
- <% else %>
- <div class="alert alert-warning">
- <%= Spree.t(:no_rules_added) %>
- </div>
- <% end %>
- </div>
-
- <div class="promotion-update actions">
- <%= button Spree.t('actions.update'), 'save.svg' %>
- </div>
- <% end %>
-</div>
diff --git a/backend/app/views/spree/admin/promotions/actions/_create_adjustment.html.erb b/backend/app/views/spree/admin/promotions/actions/_create_adjustment.html.erb
deleted file mode 100644
index 585a229c2f..0000000000
--- a/backend/app/views/spree/admin/promotions/actions/_create_adjustment.html.erb
+++ /dev/null
@@ -1,30 +0,0 @@
-<div class="card-body calculator-fields">
- <div class="row mb-0">
- <div class="form-group col-12 col-md-6 mb-0">
- <% field_name = "#{param_prefix}[calculator_type]" %>
- <%= label_tag field_name, Spree.t(:calculator) %>
- <%= select_tag field_name,
- options_from_collection_for_select(@calculators, :to_s, :description, promotion_action.calculator.type),
- class: 'type-select select2' %>
- </div>
- <% unless promotion_action.new_record? %>
- <div class="form-group col-12 col-md-6 mb-0 settings">
- <% type_name = promotion_action.calculator.type.demodulize.underscore %>
- <% if lookup_context.exists?("fields",
- ["spree/admin/promotions/calculators/#{type_name}"], true) %>
- <%= render "spree/admin/promotions/calculators/#{type_name}/fields",
- calculator: promotion_action.calculator, prefix: param_prefix %>
- <% else %>
- <%= render "spree/admin/promotions/calculators/default_fields",
- calculator: promotion_action.calculator, prefix: param_prefix %>
- <% end %>
- <%= hidden_field_tag "#{param_prefix}[calculator_attributes][id]", promotion_action.calculator.id %>
- </div>
- <% end %>
- </div>
- <% if promotion_action.calculator.respond_to?(:preferences) %>
- <div class="alert alert-info js-warning mt-3 mb-0">
- <%= Spree.t(:calculator_settings_warning) %>
- </div>
- <% end %>
-</div>
diff --git a/backend/app/views/spree/admin/promotions/actions/_create_item_adjustments.html.erb b/backend/app/views/spree/admin/promotions/actions/_create_item_adjustments.html.erb
deleted file mode 100644
index 8a1fd98e84..0000000000
--- a/backend/app/views/spree/admin/promotions/actions/_create_item_adjustments.html.erb
+++ /dev/null
@@ -1,29 +0,0 @@
-<div class="card-body calculator-fields">
- <div class="row mb-0">
- <div class="form-group col-12 col-md-6 mb-0">
- <% field_name = "#{param_prefix}[calculator_type]" %>
- <%= label_tag field_name, Spree.t(:calculator) %>
- <%= select_tag field_name,
- options_from_collection_for_select(Spree::Promotion::Actions::CreateItemAdjustments.calculators, :to_s, :description, promotion_action.calculator.type),
- class: 'type-select select2' %>
- </div>
- <% unless promotion_action.new_record? %>
- <div class="form-group col-12 col-md-6 mb-0 settings">
- <% promotion_action.calculator.preferences.keys.map do |key| %>
- <% field_name = "#{param_prefix}[calculator_attributes][preferred_#{key}]" %>
- <%= label_tag field_name, Spree.t(key.to_s) %>
- <%= preference_field_tag(field_name,
- promotion_action.calculator.get_preference(key),
- key: key,
- type: promotion_action.calculator.preference_type(key)) %>
- <% end %>
- <%= hidden_field_tag "#{param_prefix}[calculator_attributes][id]", promotion_action.calculator.id %>
- </div>
- <% end %>
- </div>
- <% if promotion_action.calculator.respond_to?(:preferences) %>
- <div class="alert alert-info js-warning mt-3 mb-0">
- <%= Spree.t(:calculator_settings_warning) %>
- </div>
- <% end %>
-</div>
diff --git a/backend/app/views/spree/admin/promotions/actions/_create_line_items.html.erb b/backend/app/views/spree/admin/promotions/actions/_create_line_items.html.erb
deleted file mode 100644
index ca85765b70..0000000000
--- a/backend/app/views/spree/admin/promotions/actions/_create_line_items.html.erb
+++ /dev/null
@@ -1,27 +0,0 @@
-<div class="card-body calculator-fields">
- <% promotion_action.promotion_action_line_items.each do |item| %>
- <% variant = item.variant %>
-
- <strong><%= item.quantity %> x <%= variant.name %></strong>
- <%= variant.options_text %>
- <% end %>
-
- <% if promotion_action.promotion_action_line_items.empty? %>
- <% line_items = promotion_action.promotion_action_line_items %>
- <% line_items.build %>
-
- <% line_items.each_with_index do |line_item, index| %>
- <div class="add-line-item">
- <% line_item_prefix = "#{param_prefix}[promotion_action_line_items_attributes][#{index}]" %>
- <div class="form-group">
- <%= label_tag "#{line_item_prefix}_variant_id", Spree.t(:variant) %>
- <%= select_tag "#{line_item_prefix}[variant_id]", line_item.variant_id, class: 'variant_autocomplete d-block w-100' %>
- </div>
- <div class="form-group mb-0">
- <%= label_tag "#{line_item_prefix}_quantity", Spree.t(:quantity) %>
- <%= number_field_tag "#{line_item_prefix}[quantity]", line_item.quantity, min: 1, class: 'form-control' %>
- </div>
- </div>
- <% end %>
- <% end %>
-</div>
diff --git a/backend/app/views/spree/admin/promotions/actions/_free_shipping.html.erb b/backend/app/views/spree/admin/promotions/actions/_free_shipping.html.erb
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/backend/app/views/spree/admin/promotions/calculators/_default_fields.html.erb b/backend/app/views/spree/admin/promotions/calculators/_default_fields.html.erb
deleted file mode 100644
index 736b2d45dc..0000000000
--- a/backend/app/views/spree/admin/promotions/calculators/_default_fields.html.erb
+++ /dev/null
@@ -1,11 +0,0 @@
-<% calculator.preferences.keys.map do |key| %>
- <div class="form-group">
- <% field_name = "#{prefix}[calculator_attributes][preferred_#{key}]" %>
- <%= label_tag field_name, Spree.t(key.to_s) %>
- <%= preference_field_tag(
- field_name,
- calculator.get_preference(key),
- type: calculator.preference_type(key),
- key: key) %>
- </div>
-<% end %>
diff --git a/backend/app/views/spree/admin/promotions/calculators/tiered_flat_rate/_fields.html.erb b/backend/app/views/spree/admin/promotions/calculators/tiered_flat_rate/_fields.html.erb
deleted file mode 100644
index f9469411c7..0000000000
--- a/backend/app/views/spree/admin/promotions/calculators/tiered_flat_rate/_fields.html.erb
+++ /dev/null
@@ -1,46 +0,0 @@
-<div class="form-group">
- <%= label_tag "#{prefix}[calculator_attributes][preferred_base_amount]",
- Spree.t(:base_amount) %>
- <%= preference_field_tag(
- "#{prefix}[calculator_attributes][preferred_base_amount]",
- calculator.preferred_base_amount,
- type: calculator.preference_type(:base_amount)) %>
-</div>
-
-<div class="form-group mb-0">
- <%= label_tag nil, Spree.t(:tiers) %>
- <%= content_tag :div, nil, class: "hidden js-original-tiers",
- data: { :'original-tiers' => Hash[calculator.preferred_tiers.sort] } %>
-</div>
-
-<div class="js-tiers"></div>
-<button class="btn btn-success js-add-tier"><%= Spree.t(:add) %></button>
-
-<script type="text/x-handlebars-template" id="tier-input-name">
- <%= prefix %>[calculator_attributes][preferred_tiers][{{base}}]
-</script>
-
-<script type="text/x-handlebars-template" id="tier-fields-template">
- <div class="tier card mb-3">
- <div class="card-body p-3">
- <div class="form-group">
- <div class="input-group">
- <div class="input-group-prepend">
- <div class="input-group-text">$</div>
- </div>
- <input class="js-base-input form-control" type="text" value={{baseField.value}}>
- </div>
- </div>
- <div class="form-group">
- <div class="input-group">
- <div class="input-group-prepend">
- <div class="input-group-text">$</div>
- </div>
- <input class="js-value-input form-control"
- name="{{valueField.name}}" type="text" value={{valueField.value}}>
- </div>
- </div>
- <a class="js-remove-tier btn btn-outline-secondary btn-sm"><span class="icon icon-delete"></span></a>
- </div>
- </div>
-</script>
diff --git a/backend/app/views/spree/admin/promotions/calculators/tiered_percent/_fields.html.erb b/backend/app/views/spree/admin/promotions/calculators/tiered_percent/_fields.html.erb
deleted file mode 100644
index 075c147cda..0000000000
--- a/backend/app/views/spree/admin/promotions/calculators/tiered_percent/_fields.html.erb
+++ /dev/null
@@ -1,46 +0,0 @@
-<div class="form-group">
- <%= label_tag "#{prefix}[calculator_attributes][preferred_base_percent]",
- Spree.t(:base_percent) %>
- <%= preference_field_tag(
- "#{prefix}[calculator_attributes][preferred_base_percent]",
- calculator.preferred_base_percent,
- type: calculator.preference_type(:base_percent)) %>
-</div>
-
-<div class="form-group mb-0">
- <%= label_tag nil, Spree.t(:tiers) %>
- <%= content_tag :div, nil, class: "hidden js-original-tiers",
- data: { :'original-tiers' => Hash[calculator.preferred_tiers.sort] } %>
-</div>
-
-<div class="js-tiers"></div>
-<button class="btn btn-success js-add-tier"><%= Spree.t(:add) %></button>
-
-<script type="text/x-handlebars-template" id="tier-input-name">
- <%= prefix %>[calculator_attributes][preferred_tiers][{{base}}]
-</script>
-
-<script type="text/x-handlebars-template" id="tier-fields-template">
- <div class="tier card mb-3">
- <div class="card-body p-3">
- <div class="form-group">
- <div class="input-group">
- <div class="input-group-prepend">
- <div class="input-group-text">$</div>
- </div>
- <input class="js-base-input form-control" type="text" value={{baseField.value}}>
- </div>
- </div>
- <div class="form-group">
- <div class="input-group">
- <div class="input-group-prepend">
- <div class="input-group-text">%</div>
- </div>
- <input class="js-value-input form-control"
- name="{{valueField.name}}" type="text" value={{valueField.value}}>
- </div>
- </div>
- <a class="js-remove-tier btn btn-outline-secondary btn-sm"><span class="icon icon-delete"></span></a>
- </div>
- </div>
-</script>
diff --git a/backend/app/views/spree/admin/promotions/edit.html.erb b/backend/app/views/spree/admin/promotions/edit.html.erb
deleted file mode 100644
index c412dabd95..0000000000
--- a/backend/app/views/spree/admin/promotions/edit.html.erb
+++ /dev/null
@@ -1,30 +0,0 @@
-<% content_for :page_title do %>
- <%= link_to Spree.t(:promotions), admin_promotions_url %> /
- <%= @promotion.name %>
-<% end %>
-
-<%= form_for @promotion, url: object_url, method: :put do |f| %>
-<div class="card mb-4">
- <div class="card-body">
- <%= render partial: 'form', locals: { f: f } %>
- <%= render partial: 'spree/admin/shared/edit_resource_links' %>
- </div>
- </div>
-
-<% end %>
-
-<div id="promotion-filters" class="row">
- <div id="rules_container" class="col-12 col-md-6">
- <div class="card ">
- <%= render partial: 'rules' %>
- </div>
- </div>
-
- <div id="actions_container" class="col-12 col-md-6">
- <div class="card ">
- <%= render partial: 'actions' %>
- </div>
- </div>
-</div>
-
-<%= render partial: "spree/admin/variants/autocomplete", formats: [:js] %>
diff --git a/backend/app/views/spree/admin/promotions/index.html.erb b/backend/app/views/spree/admin/promotions/index.html.erb
deleted file mode 100644
index 7bba47b0bf..0000000000
--- a/backend/app/views/spree/admin/promotions/index.html.erb
+++ /dev/null
@@ -1,86 +0,0 @@
-<% content_for :page_title do %>
- <%= plural_resource_name(Spree::Promotion) %>
-<% end %>
-
-<% content_for :page_actions do %>
- <%= button_link_to Spree.t(:new_promotion), new_object_url, class: "btn-success", icon: 'add.svg' %>
-<% end if can?(:create, Spree::Promotion) %>
-
-<% content_for :table_filter do %>
- <div data-hook="admin_promotions_index_search">
- <%= search_form_for [:admin, @search] do |f| %>
- <div class="row">
- <div class="col-12 col-lg-6">
- <div class="form-group">
- <%= label_tag :q_name_cont, Spree.t(:name) %>
- <%= f.text_field :name_cont, tabindex: 1, class: "form-control js-quick-search-target js-filterable" %>
- </div>
-
- <div class="form-group">
- <%= label_tag :q_code_cont, Spree.t(:code) %>
- <%= f.text_field :code_cont, tabindex: 1, class: "form-control js-filterable" %>
- </div>
- </div>
-
- <div class="col-12 col-lg-6">
- <div class="form-group">
- <%= label_tag :q_path_cont, Spree.t(:path) %>
- <%= f.text_field :path_cont, tabindex: 1, class: "form-control js-filterable" %>
- </div>
-
- <div class="form-group">
- <%= label_tag :q_promotion_category_id_eq, Spree.t(:promotion_category) %>
- <%= f.collection_select(:promotion_category_id_eq, @promotion_categories, :id, :name, { include_blank: Spree.t('match_choices.all') }, { class: 'select2 js-filterable' }) %>
- </div>
- </div>
- </div>
-
- <div data-hook="admin_promotions_index_search_buttons" class="form-actions">
- <%= button Spree.t(:filter_results), 'search.svg' %>
- </div>
- <% end %>
- </div>
-<% end %>
-
-<% if @promotions.any? %>
- <div class="table-responsive">
- <table class="table">
- <thead>
- <tr>
- <th><%= Spree.t(:name) %></th>
- <th><%= Spree.t(:code) %></th>
- <th><%= Spree.t(:description) %></th>
- <th><%= Spree.t(:usage_limit) %></th>
- <th><%= Spree.t(:promotion_uses) %></th>
- <th><%= Spree.t(:expiration) %></th>
- <th data-hook="admin_promotions_index_header_actions" class="actions"></th>
- </tr>
- </thead>
- <tbody>
- <% @promotions.each do |promotion| %>
- <tr id="<%= spree_dom_id promotion %>">
- <td><%= link_to promotion.name, spree.edit_admin_promotion_path(promotion) %></td>
- <td><%= promotion.code %></td>
- <td><%= promotion.description %></td>
- <td><%= promotion.usage_limit.nil? ? "∞" : promotion.usage_limit %></td>
- <td><%= Spree.t(:current_promotion_usage, count: promotion.credits_count) %></td>
- <td><%= promotion.expires_at.to_date.to_s(:short_date) if promotion.expires_at %></td>
- <td class="actions" data-hook="admin_promotions_index_row_actions">
- <span class="d-flex justify-content-end">
- <%= link_to_edit promotion, no_text: true if can?(:edit, promotion) %>
- <%= link_to_clone_promotion promotion, no_text: true if can?(:clone, promotion) %>
- <%= link_to_delete promotion, no_text: true if can?(:delete, promotion) %>
- </span>
- </td>
- </tr>
- <% end %>
- </tbody>
- </table>
- </div>
- <%= render 'spree/admin/shared/index_table_options', collection: @promotions, simple: true %>
-<% else %>
- <div class="alert alert-info no-objects-found">
- <%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree::Promotion)) %>,
- <%= link_to Spree.t(:add_one), new_object_url if can?(:create, Spree::Promotion) %>!
- </div>
-<% end %>
diff --git a/backend/app/views/spree/admin/promotions/new.html.erb b/backend/app/views/spree/admin/promotions/new.html.erb
deleted file mode 100644
index c5c19be0de..0000000000
--- a/backend/app/views/spree/admin/promotions/new.html.erb
+++ /dev/null
@@ -1,12 +0,0 @@
-<% content_for :page_title do %>
- <%= link_to Spree.t(:promotions), admin_promotions_url %> /
- <%= Spree.t(:new_promotion) %>
-<% end %>
-<div class="card">
- <div class="card-body">
- <%= form_for :promotion, url: collection_url do |f| %>
- <%= render partial: 'form', locals: { f: f } %>
- <%= render partial: 'spree/admin/shared/new_resource_links' %>
- <% end %>
- </div>
-</div>
diff --git a/backend/app/views/spree/admin/promotions/rules/_country.html.erb b/backend/app/views/spree/admin/promotions/rules/_country.html.erb
deleted file mode 100644
index f1266909a9..0000000000
--- a/backend/app/views/spree/admin/promotions/rules/_country.html.erb
+++ /dev/null
@@ -1,6 +0,0 @@
-<div class="card-body">
- <div class="form-group mb-0">
- <%= label_tag Spree.t('country_rule.label') %>
- <%= select_tag("#{param_prefix}[preferred_country_id]", options_for_select(Spree::Country.pluck(:name, :id), promotion_rule.preferred_country_id), { class: 'select_product form-control custom-select' }) %>
- </div>
-</div>
diff --git a/backend/app/views/spree/admin/promotions/rules/_first_order.html.erb b/backend/app/views/spree/admin/promotions/rules/_first_order.html.erb
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/backend/app/views/spree/admin/promotions/rules/_item_total.html.erb b/backend/app/views/spree/admin/promotions/rules/_item_total.html.erb
deleted file mode 100644
index 699f9450da..0000000000
--- a/backend/app/views/spree/admin/promotions/rules/_item_total.html.erb
+++ /dev/null
@@ -1,12 +0,0 @@
-<div class="card-body">
- <div class="row mb-0">
- <div class="form-group col-6 mb-3">
- <%= select_tag "#{param_prefix}[preferred_operator_min]", options_for_select(Spree::Promotion::Rules::ItemTotal::OPERATORS_MIN.map{|o| [Spree.t("item_total_rule.operators.#{o}"),o]}, promotion_rule.preferred_operator_min), { class: 'custom-select select_item_total mb-3' } %>
- <%= select_tag "#{param_prefix}[preferred_operator_max]", options_for_select(Spree::Promotion::Rules::ItemTotal::OPERATORS_MAX.map{|o| [Spree.t("item_total_rule.operators.#{o}"),o]}, promotion_rule.preferred_operator_max), { class: 'custom-select select_item_total' } %>
- </div>
- <div class="form-group col-6 mb-3">
- <%= text_field_tag "#{param_prefix}[preferred_amount_min]", promotion_rule.preferred_amount_min, class: 'form-control mb-3' %>
- <%= text_field_tag "#{param_prefix}[preferred_amount_max]", promotion_rule.preferred_amount_max, class: 'form-control' %>
- </div>
- </div>
-</div>
diff --git a/backend/app/views/spree/admin/promotions/rules/_one_use_per_user.html.erb b/backend/app/views/spree/admin/promotions/rules/_one_use_per_user.html.erb
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/backend/app/views/spree/admin/promotions/rules/_option_value.html.erb b/backend/app/views/spree/admin/promotions/rules/_option_value.html.erb
deleted file mode 100644
index 164fe69409..0000000000
--- a/backend/app/views/spree/admin/promotions/rules/_option_value.html.erb
+++ /dev/null
@@ -1,36 +0,0 @@
-<div class="card-body">
- <div class="promo-rule-option-values">
- <div class="js-promo-rule-option-values"></div> <!-- display div for option value select -->
- <button class="btn btn-primary btn-success js-add-promo-rule-option-value">
- <%= svg_icon name: "add.svg", width: '16', height: '16' %>
- <%= Spree.t(:add) %>
- </button>
- </div>
-</div>
-
-<%= content_tag :div, nil, class: "hidden js-original-promo-rule-option-values",
- data: { :'original-option-values' => promotion_rule.preferred_eligible_values } %>
-
-<script type="text/x-handlebars-template" id="promo-rule-option-value-option-values-select-name-template">
- <%= param_prefix %>[preferred_eligible_values][{{productId}}][]
-</script>
-
-<script type="text/x-handlebars-template" id="promo-rule-option-value-template">
- <div class="promo-rule-option-value panel card mb-3" id="promo-rule-option-value-{{productId}}">
- <div class="card-header d-flex justify-content-between">
- <label><%= Spree.t(:product) %> <%= Spree.t(:option_values) %></label>
- <a class="js-remove-promo-rule-option-value delete pull-right">
- <%= svg_icon name: "delete.svg", width: '16', height: '16' %>
- </a>
- </div>
- <div class="card-body row p-3">
- <div class="col-12 col-md-6 product-select">
- <%= select_tag "product", nil, class: 'js-promo-rule-option-value-product-select d-block w-100', id: "promo-rule-option-value-product-select-{{productId}}" %>
- </div>
- <div class="col-12 col-md-6 option-value-select">
- <%= select_tag "#{param_prefix}[preferred_eligible_values][{{ productId }}][]", nil, multiple: true, disabled: true, class: 'js-promo-rule-option-value-option-values-select d-none w-100', id: "promo-rule-option-value-option-values-select-{{productId}}" %>
- </div>
- </div>
- </div>
-</script>
-
diff --git a/backend/app/views/spree/admin/promotions/rules/_product.html.erb b/backend/app/views/spree/admin/promotions/rules/_product.html.erb
deleted file mode 100644
index 005a435d89..0000000000
--- a/backend/app/views/spree/admin/promotions/rules/_product.html.erb
+++ /dev/null
@@ -1,10 +0,0 @@
-<div class="card-body">
- <div class="form-group products_rule_products">
- <%= label_tag "#{param_prefix}_product_ids_string", Spree.t('product_rule.choose_products') %>
- <%= select "#{param_prefix}", 'product_ids_string', options_from_collection_for_select(promotion_rule.products, :id, :name, promotion_rule.products.pluck(:id)), { include_hidden: true }, multiple: true, class: 'product_picker d-block w-100' %>
- </div>
- <div class="form-group mb-0">
- <%= label_tag Spree.t('product_rule.label') %>
- <%= select_tag("#{param_prefix}[preferred_match_policy]", options_for_select(Spree::Promotion::Rules::Product::MATCH_POLICIES.map{|s| [Spree.t("product_rule.match_#{s}"),s] }, promotion_rule.preferred_match_policy), {class: 'select_product form-control custom-select'}) %>
- </div>
-</div>
diff --git a/backend/app/views/spree/admin/promotions/rules/_taxon.html.erb b/backend/app/views/spree/admin/promotions/rules/_taxon.html.erb
deleted file mode 100644
index 7ff5ef31ee..0000000000
--- a/backend/app/views/spree/admin/promotions/rules/_taxon.html.erb
+++ /dev/null
@@ -1,10 +0,0 @@
-<div class="card-body">
- <div class="form-group taxons_rule_taxons">
- <%= label_tag "#{param_prefix}_taxon_ids", Spree.t('taxon_rule.choose_taxons') %>
- <%= select_tag "#{param_prefix}[taxon_ids]", options_from_collection_for_select(promotion_rule.taxons, :id, :pretty_name, promotion_rule.taxon_ids), class: 'taxon_picker d-block w-100', multiple: true, id: :product_taxon_ids %>
- </div>
- <div class="form-group mb-0">
- <%= label_tag Spree.t('taxon_rule.label') %>
- <%= select_tag("#{param_prefix}[preferred_match_policy]", options_for_select(Spree::Promotion::Rules::Taxon::MATCH_POLICIES.map{|s| [Spree.t("taxon_rule.match_#{s}"),s] }, promotion_rule.preferred_match_policy), {class: 'select_taxon form-control custom-select'}) %>
- </div>
-</div>
diff --git a/backend/app/views/spree/admin/promotions/rules/_user.html.erb b/backend/app/views/spree/admin/promotions/rules/_user.html.erb
deleted file mode 100644
index ba315f346f..0000000000
--- a/backend/app/views/spree/admin/promotions/rules/_user.html.erb
+++ /dev/null
@@ -1,6 +0,0 @@
-<div class="card-body">
- <div class="form-group mb-0">
- <%= label_tag Spree.t('user_rule.choose_users') %>
- <%= select "#{param_prefix}", 'user_ids_string', options_from_collection_for_select(promotion_rule.users, :id, :email, promotion_rule.users.pluck(:id)), { include_hidden: true }, multiple: true, class: 'user_picker d-block w-100' %>
- </div>
-</div>
diff --git a/backend/app/views/spree/admin/promotions/rules/_user_logged_in.html.erb b/backend/app/views/spree/admin/promotions/rules/_user_logged_in.html.erb
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/backend/app/views/spree/admin/properties/_form.html.erb b/backend/app/views/spree/admin/properties/_form.html.erb
deleted file mode 100644
index 3619319d68..0000000000
--- a/backend/app/views/spree/admin/properties/_form.html.erb
+++ /dev/null
@@ -1,22 +0,0 @@
-<div data-hook="admin_property_form" class="row">
- <div class="col-12 col-md-6">
- <%= f.field_container :name, class: ['form-group'] do %>
- <%= f.label :name, Spree.t(:name) %> <span class="required">*</span>
- <%= f.text_field :name, class: 'form-control' %>
- <%= f.error_message_on :name %>
- <% end %>
- </div>
- <div class="col-12 col-md-6">
- <%= f.field_container :presentation, class: ['form-group'] do %>
- <%= f.label :presentation, Spree.t(:presentation) %> <span class="required">*</span>
- <%= f.text_field :presentation, class: 'form-control' %>
- <%= f.error_message_on :presentation %>
- <% end %>
- </div>
- <div class="col-12 col-md-6">
- <%= f.field_container :filterable, class: ['form-group'] do %>
- <%= f.label :filterable, Spree.t(:filterable) %>
- <%= f.check_box :filterable %>
- <% end %>
- </div>
-</div>
diff --git a/backend/app/views/spree/admin/properties/edit.html.erb b/backend/app/views/spree/admin/properties/edit.html.erb
deleted file mode 100644
index 6e5e831051..0000000000
--- a/backend/app/views/spree/admin/properties/edit.html.erb
+++ /dev/null
@@ -1,13 +0,0 @@
-<% content_for :page_title do %>
- <%= link_to Spree.t(:properties), admin_properties_url %> /
- <%= @property.name %>
-<% end %>
-
-<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @property } %>
-
-<%= form_for [:admin, @property] do |f| %>
- <fieldset>
- <%= render partial: 'form', locals: { f: f } %>
- <%= render partial: 'spree/admin/shared/edit_resource_links' %>
- </fieldset>
-<% end %>
diff --git a/backend/app/views/spree/admin/properties/index.html.erb b/backend/app/views/spree/admin/properties/index.html.erb
deleted file mode 100644
index 9d810f4e23..0000000000
--- a/backend/app/views/spree/admin/properties/index.html.erb
+++ /dev/null
@@ -1,86 +0,0 @@
-<% content_for :page_title do %>
- <%= plural_resource_name(Spree::Property) %>
-<% end %>
-
-<% content_for :page_actions do %>
- <%= button_link_to Spree.t(:new_property), new_object_url, { class: "btn-success", icon: 'add.svg', 'data-update' => 'new_property', id: 'new_property_link' } %>
-<% end if can?(:create, Spree::Property) %>
-
-<% content_for :table_filter do %>
- <div data-hook="admin_property_sidebar">
- <%= search_form_for [:admin, @search] do |f| %>
-
- <%- locals = {f: f} %>
-
- <div class="row">
- <div class="col-12 col-lg-6">
- <div data-hook="admin_property_index_search" class="form-group">
- <%= f.label :name_cont, Spree.t(:name) %>
- <%= f.text_field :name_cont, class: "form-control js-quick-search-target js-filterable" %>
- </div>
- </div>
-
- <div class="col-12 col-lg-6">
- <div class="form-group">
- <%= f.label :presentation_cont, Spree.t(:presentation) %>
- <%= f.text_field :presentation_cont, class: "form-control js-filterable" %>
- </div>
- </div>
- </div>
-
- <div class="row">
- <div class="col-12 col-lg-6">
- <div class="form-group">
- <%= label_tag :q_filterable_eq, Spree.t(:filterable_status) %>
- <%= f.select :filterable_eq, options_for_select([[Spree.t(:filterable), true], [Spree.t(:non_filterable), false]]), { include_blank: true }, class: 'select2-clear js-filterable' %>
- </div>
- </div>
- </div>
- </div>
-
- <div class="form-actions" data-hook="admin_pproperties_index_search_buttons">
- <%= button Spree.t(:search), 'search.svg' %>
- </div>
-
- <% end %>
- </div>
-<% end %>
-
-<% if @properties.any? %>
-<div class="table-responsive">
- <table class="table" id='listing_properties' data-hook>
- <thead>
- <tr data-hook="listing_properties_header">
- <th><%= Spree.t(:name) %></th>
- <th><%= Spree.t(:presentation) %></th>
- <th><%= Spree.t(:filterable) %></th>
- <th><%= Spree.t(:filter_param) %></th>
- <th class="actions"></th>
- </tr>
- </thead>
- <tbody>
- <% @properties.each do |property| %>
- <tr id="<%= spree_dom_id property %>" data-hook="listing_properties_row">
- <td><%= property.name %></td>
- <td><%= property.presentation %></td>
- <td><%= active_badge(property.filterable) %></td>
- <td><%= property.filter_param %></td>
- <td class="actions">
- <span class="d-flex justify-content-end">
- <%= link_to_edit(property, no_text: true) if can?(:edit, property) %>
- <%= link_to_delete(property, no_text: true) if can?(:delete, property) %>
- </span>
- </td>
- </tr>
- <% end %>
- </tbody>
- </table>
-</div>
-<% else %>
- <div class="alert alert-info no-objects-found">
- <%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree::Property)) %>,
- <%= link_to Spree.t(:add_one), new_object_url if can?(:create, Spree::OptionType) %>!
- </div>
-<% end %>
-
-<%= paginate @collection, theme: 'admin-twitter-bootstrap-4' %>
diff --git a/backend/app/views/spree/admin/properties/new.html.erb b/backend/app/views/spree/admin/properties/new.html.erb
deleted file mode 100644
index 51dea1a838..0000000000
--- a/backend/app/views/spree/admin/properties/new.html.erb
+++ /dev/null
@@ -1,15 +0,0 @@
-<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @property } %>
-
-<% content_for :page_title do %>
- <%= link_to Spree.t(:properties), admin_properties_url %> /
- <%= Spree.t(:new_property) %>
-<% end %>
-
-<%= form_for [:admin, @property] do |f| %>
- <fieldset data-hook="new_property">
- <%= render partial: 'form', locals: { f: f } %>
- <div class="form-actions">
- <%= render partial: 'spree/admin/shared/new_resource_links' %>
- </div>
- </fieldset>
-<% end %>
diff --git a/backend/app/views/spree/admin/prototypes/_form.html.erb b/backend/app/views/spree/admin/prototypes/_form.html.erb
deleted file mode 100644
index 6cded9bbf8..0000000000
--- a/backend/app/views/spree/admin/prototypes/_form.html.erb
+++ /dev/null
@@ -1,28 +0,0 @@
-<div data-hook="admin_prototype_form_fields">
- <%= f.field_container :name, class: ['form-group'] do %>
- <%= f.label :name, Spree.t(:name) %> <span class="required">*</span><br>
- <%= f.text_field :name, class: 'form-control' %>
- <%= f.error_message_on :name %>
- <% end %>
-
- <div id='properties' data-hook>
- <%= f.field_container :property_ids, class: ['form-group'] do %>
- <%= f.label :property_ids, Spree.t(:properties) %><br>
- <%= f.select :property_ids, Spree::Property.all.map { |p| ["#{p.presentation} (#{p.name})", p.id] }, {}, { multiple: true, class: "select2" } %>
- <% end %>
- </div>
-
- <div id="option_types" data-hook>
- <%= f.field_container :option_type_ids, class: ['form-group'] do %>
- <%= f.label :option_type_ids, Spree.t(:option_types) %><br>
- <%= f.select :option_type_ids, Spree::OptionType.all.map { |ot| ["#{ot.presentation} (#{ot.name})", ot.id] }, {}, { multiple: true, class: "select2" } %>
- <% end %>
- </div>
-
- <div id='taxons' data-hook>
- <%= f.field_container :taxon_ids, class: ['form-group'] do %>
- <%= f.label :taxon_ids, Spree.t(:taxons) %><br>
- <%= f.select :taxon_ids, current_store.taxons.pluck(:name, :id), {}, { multiple: true, class: "select2" } %>
- <% end %>
- </div>
-</div>
diff --git a/backend/app/views/spree/admin/prototypes/_prototypes.html.erb b/backend/app/views/spree/admin/prototypes/_prototypes.html.erb
deleted file mode 100644
index 0a2a2c4bca..0000000000
--- a/backend/app/views/spree/admin/prototypes/_prototypes.html.erb
+++ /dev/null
@@ -1,33 +0,0 @@
-<div class="table-responsive">
- <table class="table table-condensed table-bordered">
- <thead>
- <tr data-hook="available_header">
- <th><%= Spree.t(:name) %></th>
- <th class="actions"></th>
- </tr>
- </thead>
- <tbody>
- <% @prototypes.each do |prototype| %>
- <tr id="row_<%= prototype.id %>" data-hook="available_row">
- <td><%= prototype.name %></td>
- <td class="actions">
- <span class="d-flex justify-content-end">
- <%= link_to_with_icon 'save.svg',
- Spree.t(:select),
- select_admin_prototype_url(prototype),
- class: 'btn btn-success btn-sm ajax select_properties_from_prototype',
- no_text: true %>
- </span>
- </td>
- </tr>
- <% end %>
- <% if @prototypes.empty? %>
- <tr data-hook="available_none">
- <td colspan="2">
- <% Spree.t(:none) %>.
- </td>
- </tr>
- <% end %>
- </tbody>
- </table>
-</div>
diff --git a/backend/app/views/spree/admin/prototypes/available.js.erb b/backend/app/views/spree/admin/prototypes/available.js.erb
deleted file mode 100644
index b9510b45af..0000000000
--- a/backend/app/views/spree/admin/prototypes/available.js.erb
+++ /dev/null
@@ -1,2 +0,0 @@
-$("#prototypes").html('<%= escape_javascript(render partial: "spree/admin/prototypes/prototypes") %>');
-$(".js-new-ptype-link").hide();
diff --git a/backend/app/views/spree/admin/prototypes/edit.html.erb b/backend/app/views/spree/admin/prototypes/edit.html.erb
deleted file mode 100644
index 1e370fa693..0000000000
--- a/backend/app/views/spree/admin/prototypes/edit.html.erb
+++ /dev/null
@@ -1,13 +0,0 @@
-<% content_for :page_title do %>
- <%= link_to Spree.t(:prototypes), spree.admin_prototypes_url %> /
- <%= @prototype.name %>
-<% end %>
-
-<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @prototype } %>
-
-<%= form_for [:admin, @prototype] do |f| %>
- <fieldset>
- <%= render partial: 'form', locals: { f: f } %>
- <%= render partial: 'spree/admin/shared/edit_resource_links' %>
- </fieldset>
-<% end %>
diff --git a/backend/app/views/spree/admin/prototypes/index.html.erb b/backend/app/views/spree/admin/prototypes/index.html.erb
deleted file mode 100644
index 0b000a7837..0000000000
--- a/backend/app/views/spree/admin/prototypes/index.html.erb
+++ /dev/null
@@ -1,38 +0,0 @@
-<% content_for :page_title do %>
- <%= plural_resource_name(Spree::Prototype) %>
-<% end %>
-
-<% content_for :page_actions do %>
- <%= button_link_to Spree.t(:new_prototype), new_object_url, { class: "btn-success", icon: 'add.svg', 'data-update' => 'new_prototype', id: 'new_prototype_link'} %>
-<% end if can?(:create, Spree::Prototype) %>
-
-<% if @prototypes.any? %>
- <div class="table-responsive">
- <table class="table" id='listing_prototypes' data-hook>
- <thead>
- <tr data-hook="prototypes_header">
- <th><%= Spree.t(:name) %></th>
- <th class="actions"></th>
- </tr>
- </thead>
- <tbody>
- <% @prototypes.each do |prototype| %>
- <tr id="<%= spree_dom_id prototype %>" data-hook="prototypes_row">
- <td><%= prototype.name %></td>
- <td class="actions">
- <span class="d-flex justify-content-end">
- <%= link_to_edit(prototype, no_text: true, class: 'admin_edit_prototype') if can?(:edit, prototype) %>
- <%= link_to_delete(prototype, no_text: true) if can?(:delete, prototype) %>
- </span>
- </td>
- </tr>
- <% end %>
- </tbody>
- </table>
- </div>
-<% else %>
- <div class="alert alert-info no-objects-found">
- <%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree::Prototype)) %>,
- <%= link_to Spree.t(:add_one), new_object_url if can?(:create, Spree::Prototype) %>!
- </div>
-<% end %>
diff --git a/backend/app/views/spree/admin/prototypes/new.html.erb b/backend/app/views/spree/admin/prototypes/new.html.erb
deleted file mode 100644
index 837265b4c4..0000000000
--- a/backend/app/views/spree/admin/prototypes/new.html.erb
+++ /dev/null
@@ -1,13 +0,0 @@
-<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @prototype } %>
-
-<% content_for :page_title do %>
- <%= link_to Spree.t(:prototypes), spree.admin_prototypes_url %> /
- <%= Spree.t(:new_prototype) %>
-<% end %>
-
-<%= form_for [:admin, @prototype] do |f| %>
- <fieldset data-hook="new_prototype">
- <%= render partial: 'form', locals: { f: f } %>
- <%= render partial: 'spree/admin/shared/new_resource_links' %>
- </fieldset>
-<% end %>
diff --git a/backend/app/views/spree/admin/prototypes/select.js.erb b/backend/app/views/spree/admin/prototypes/select.js.erb
deleted file mode 100644
index f31df83002..0000000000
--- a/backend/app/views/spree/admin/prototypes/select.js.erb
+++ /dev/null
@@ -1,4 +0,0 @@
-<% @prototype_properties.sort_by{ |prop| -prop[:id] }.each do |prop| %>
- $("a.spree_add_fields").click();
- $(".product_property.fields:first input[type=text]:first").val("<%= prop.name %>");
-<% end %>
diff --git a/backend/app/views/spree/admin/prototypes/show.html.erb b/backend/app/views/spree/admin/prototypes/show.html.erb
deleted file mode 100644
index aca0438912..0000000000
--- a/backend/app/views/spree/admin/prototypes/show.html.erb
+++ /dev/null
@@ -1,52 +0,0 @@
-<% if @prototype.option_types.present? %>
- <h2><%= Spree.t(:variants) %></h2>
-
- <ul class="product-prototype-options">
- <% @prototype.option_types.each do |ot| %>
- <li class="option-type-field">
- <b>
- <%= check_box_tag "option_types[]", ot.id, (params[:option_types] || []).include?(ot.id.to_s), id: "option_type_#{ot.id}", class: "option-type" %>
- <%= label_tag "option_type_#{ot.id}", ot.presentation %>
- </b>
- <% if Spree::OptionType.color&.name == ot[:name] %>
- <ul class="option-type-values option-type-values__color">
- <% ot.option_values.each do |ov| %>
- <li>
- <%= label_tag "option_value_#{ov.id}" do %>
- <%= check_box_tag "product[option_values_hash[#{ot.id}]][]", ov.id, params[:product] && (params[:product][:option_values_hash] || {}).values.flatten.include?(ov.id.to_s), id: "option_value_#{ov.id}", class: "option-value" %>
- <div class="option-value__color" style="--presentation: <%= ov.presentation %>"></div>
- <% end %>
- </li>
- <% end %>
- </ul>
- <% else %>
- <ul class="option-type-values">
- <% ot.option_values.each do |ov| %>
- <li>
- <%= check_box_tag "product[option_values_hash[#{ot.id}]][]", ov.id, params[:product] && (params[:product][:option_values_hash] || {}).values.flatten.include?(ov.id.to_s), id: "option_value_#{ov.id}", class: "option-value" %>
- <%= label_tag "option_value_#{ov.id}", ov.presentation %>
- </li>
- <% end %>
- </ul>
- <% end %>
- </li>
- <% end %>
- </ul>
-
- <script type="text/javascript">
- //<![CDATA[
- (function($){
- $("input.option-type").change(function() {
- $(this).parents("li").find("input.option-value").prop("checked", this.checked);
- });
- $("input.option-value").change(function() {
- var any_checked = false;
- $(this).parents(".option-type-values").find("input.option-value").each(function(i, el) {
- any_checked = any_checked || el.checked;
- });
- $(this).parents(".option-type-field").find("input.option-type").prop("checked", any_checked);
- });
- })(jQuery);
- //]]>
- </script>
-<% end %>
diff --git a/backend/app/views/spree/admin/refund_reasons/edit.html.erb b/backend/app/views/spree/admin/refund_reasons/edit.html.erb
deleted file mode 100755
index 6253c207e2..0000000000
--- a/backend/app/views/spree/admin/refund_reasons/edit.html.erb
+++ /dev/null
@@ -1,3 +0,0 @@
-<%= render partial: 'spree/admin/shared/named_types/edit', locals: {
- collection_url_label: Spree.t(:refund_reasons)
-} %>
diff --git a/backend/app/views/spree/admin/refund_reasons/index.html.erb b/backend/app/views/spree/admin/refund_reasons/index.html.erb
deleted file mode 100755
index 4d103cc98d..0000000000
--- a/backend/app/views/spree/admin/refund_reasons/index.html.erb
+++ /dev/null
@@ -1,6 +0,0 @@
-<%= render partial: 'spree/admin/shared/named_types/index', locals: {
- page_title: plural_resource_name(Spree::RefundReason),
- new_button_text: Spree.t(:new_refund_reason),
- resource_name: plural_resource_name(Spree::RefundReason),
- resource: Spree::RefundReason
-} %>
diff --git a/backend/app/views/spree/admin/refund_reasons/new.html.erb b/backend/app/views/spree/admin/refund_reasons/new.html.erb
deleted file mode 100755
index 6ec309047a..0000000000
--- a/backend/app/views/spree/admin/refund_reasons/new.html.erb
+++ /dev/null
@@ -1,4 +0,0 @@
-<%= render partial: 'spree/admin/shared/named_types/new', locals: {
- collection_url_label: Spree.t(:refund_reasons),
- page_title: Spree.t(:new_refund_reason)
-} %>
diff --git a/backend/app/views/spree/admin/refunds/edit.html.erb b/backend/app/views/spree/admin/refunds/edit.html.erb
deleted file mode 100644
index 7fd446b95a..0000000000
--- a/backend/app/views/spree/admin/refunds/edit.html.erb
+++ /dev/null
@@ -1,29 +0,0 @@
-<%= render partial: 'spree/admin/shared/order_tabs', locals: { current: :payments } %>
-
-<% content_for :page_title do %>
- / <%= link_to "#{Spree.t(:payment)} #{@refund.payment.id}", spree.admin_order_payment_path(@refund.payment.order, @refund.payment) %>
- / <%= Spree.t(:refund) %> <%= @refund.id %>
-<% end %>
-
-<%= render 'spree/admin/shared/error_messages', target: @refund %>
-
-<%= form_for [:admin, @refund.payment.order, @refund.payment, @refund] do |f| %>
- <fieldset>
- <div data-hook="admin_refund_form_fields">
- <div class="form-group">
- <%= f.label :amount, Spree.t(:amount) %><br>
- <%= @refund.amount %>
- </div>
- <div class="form-group">
- <%= f.label :refund_reason_id, Spree.t(:reason) %><br>
- <%= f.collection_select(:refund_reason_id, refund_reasons, :id, :name, {}, {class: 'select2'}) %>
- </div>
- </div>
-
- <div class="form-actions" data-hook="buttons">
- <%= button Spree.t('actions.save'), 'save.svg' %>
- <span class="or"><%= Spree.t(:or) %></span>
- <%= button_link_to Spree.t('actions.cancel'), spree.admin_order_payments_url(@refund.payment.order), icon: "delete.svg" %>
- </div>
- </fieldset>
-<% end %>
diff --git a/backend/app/views/spree/admin/refunds/new.html.erb b/backend/app/views/spree/admin/refunds/new.html.erb
deleted file mode 100644
index 7a0ac1f97b..0000000000
--- a/backend/app/views/spree/admin/refunds/new.html.erb
+++ /dev/null
@@ -1,39 +0,0 @@
-<%= render partial: 'spree/admin/shared/order_tabs', locals: {current: :payments} %>
-
-<% content_for :page_title do %>
- / <%= link_to "#{Spree.t(:payment)} #{@refund.payment.id}", spree.admin_order_payment_path(@refund.payment.order, @refund.payment) %>
- / <%= Spree.t(:new_refund) %>
-<% end %>
-
-<%= render 'spree/admin/shared/error_messages', target: @refund %>
-
-<%= form_for [:admin, @refund.payment.order, @refund.payment, @refund] do |f| %>
- <fieldset>
- <div data-hook="admin_refund_form_fields">
- <div class="form-group">
- <%= f.label :payment_amount, Spree.t(:payment_amount) %><br>
- <%= @refund.payment.amount %>
- </div>
- <div class="form-group">
- <%= f.label :credit_allowed, Spree.t(:credit_allowed) %><br>
- <%= @refund.payment.credit_allowed %>
- </div>
- <%= f.field_container :amount, class: ['form-group'] do %>
- <%= f.label :amount, Spree.t(:amount) %>
- <%= f.text_field :amount, class: 'form-control' %>
- <%= f.error_message_on :amount %>
- <% end %>
- <%= f.field_container :reason, class: ['form-group'] do %>
- <%= f.label :refund_reason_id, Spree.t(:reason) %>
- <%= f.collection_select(:refund_reason_id, refund_reasons, :id, :name, {include_blank: true}, {class: 'select2-clear'}) %>
- <%= f.error_message_on :reason %>
- <% end %>
- </div>
-
- <div class="form-actions" data-hook="buttons">
- <%= button Spree.t(:refund), 'save.svg' %>
- <span class="or"><%= Spree.t(:or) %></span>
- <%= button_link_to Spree.t('actions.cancel'), spree.admin_order_payments_url(@refund.payment.order), icon: "cancel.svg" %>
- </div>
- </fieldset>
-<% end %>
diff --git a/backend/app/views/spree/admin/reimbursement_types/_form.html.erb b/backend/app/views/spree/admin/reimbursement_types/_form.html.erb
deleted file mode 100644
index d0279a9079..0000000000
--- a/backend/app/views/spree/admin/reimbursement_types/_form.html.erb
+++ /dev/null
@@ -1,32 +0,0 @@
-<div data-hook="admin_reimbursement_type_form_fields" class="row">
- <div class="col-12 col-md-8">
- <%= f.field_container :name, class: ['form-group'] do %>
- <%= f.label :name, Spree.t(:name) %>
- <%= f.text_field :name, class:'form-control' %>
- <%= f.error_message_on :name %>
- <% end %>
- </div>
- <%- if @reimbursement_type.new_record? %>
- <div class="col-12 col-md-8">
- <%= f.field_container :type, class: ['form-group'] do %>
- <%= f.label :type, Spree.t(:type) %>
- <%= f.select :type, options_for_select(Spree::ReimbursementType::KINDS), {:include_blank => false}, { :class => 'select2' } %>
- <%= f.error_message_on :type %>
- <% end %>
- </div>
- <% end %>
- <div class="col-12 col-md-5">
- <%= f.field_container :active, class: ['form-inline flex-row p-1'] do %>
- <%= f.check_box :active, class: 'form-control w-auto h-auto mr-1' %>
- <%= f.label :active, Spree.t(:active) %>
- <%= f.error_message_on :active %>
- <% end %>
- </div>
- <div class="col-12 col-md-5">
- <%= f.field_container :mutable, class: ['form-inline flex-row p-1'] do %>
- <%= f.check_box :mutable, class: 'form-control w-auto h-auto mr-1' %>
- <%= f.label :mutable, Spree.t(:mutable) %>
- <%= f.error_message_on :mutable %>
- <% end %>
- </div>
-</div>
diff --git a/backend/app/views/spree/admin/reimbursement_types/edit.html.erb b/backend/app/views/spree/admin/reimbursement_types/edit.html.erb
deleted file mode 100644
index 9a31337014..0000000000
--- a/backend/app/views/spree/admin/reimbursement_types/edit.html.erb
+++ /dev/null
@@ -1,11 +0,0 @@
-<% content_for :page_title do %>
- <%= link_to Spree.t(:reimbursement_types), spree.admin_reimbursement_types_url %> /
- <%= @reimbursement_type.name %>
-<% end %>
-
-<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @reimbursement_type } %>
-
-<%= form_for @reimbursement_type, :url => object_url, :method => :put do |reimbursement_form| %>
- <%= render partial: 'form', locals: { f: reimbursement_form } %>
- <%= render partial: 'spree/admin/shared/new_resource_links' %>
-<% end %>
diff --git a/backend/app/views/spree/admin/reimbursement_types/index.html.erb b/backend/app/views/spree/admin/reimbursement_types/index.html.erb
deleted file mode 100644
index 8784f4b766..0000000000
--- a/backend/app/views/spree/admin/reimbursement_types/index.html.erb
+++ /dev/null
@@ -1,43 +0,0 @@
-<% content_for :page_title do %>
- <%= plural_resource_name(Spree::ReimbursementType) %>
-<% end %>
-
-<% content_for :page_actions do %>
- <%= button_link_to Spree.t(:new_reimbursement_type), new_object_url, { :class => "btn-success", :icon => 'add.svg', :id => 'admin_new_reimbursement_type' } %>
-<% end if can?(:create, Spree::ReimbursementType) %>
-
-<% if @reimbursement_types.any? %>
-<div class="table-responsive">
- <table class="table" id='listing_reimbursement_types' data-hook>
- <thead>
- <tr data-hook="reimbursement_types_header">
- <th><%= Spree.t(:name) %></th>
- <th><%= Spree.t(:type) %></th>
- <th class="actions"></th>
- </tr>
- </thead>
- <tbody>
- <% @reimbursement_types.each do |reimbursement_type| %>
- <tr id="<%= spree_dom_id reimbursement_type %>" data-hook="reimbursement_type_row">
- <td class="align-center">
- <%= reimbursement_type.name.humanize %>
- </td>
- <td>
- <%= reimbursement_type.type.split('::', 3).last %>
- </td>
- <td class="actions">
- <span class="d-flex justify-content-end">
- <%= link_to_edit reimbursement_type, no_text: true, class: 'edit' if can?(:edit, reimbursement_type) %>
- <%= link_to_delete reimbursement_type, no_text: true if can?(:delete, reimbursement_type) %>
- </span>
- </td>
- </tr>
- <% end %>
- </tbody>
- </table>
- </div>
-<% else %>
- <div class="alert alert-info no-objects-found">
- <%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree::ReimbursementType)) %>
- </div>
-<% end %>
diff --git a/backend/app/views/spree/admin/reimbursement_types/new.html.erb b/backend/app/views/spree/admin/reimbursement_types/new.html.erb
deleted file mode 100644
index eb4bc0cde8..0000000000
--- a/backend/app/views/spree/admin/reimbursement_types/new.html.erb
+++ /dev/null
@@ -1,11 +0,0 @@
-<% content_for :page_title do %>
- <%= link_to Spree.t(:reimbursement_types), spree.admin_reimbursement_types_url %> /
- <%= Spree.t(:new_reimbursement_type) %>
-<% end %>
-
-<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @reimbursement_type } %>
-
-<%= form_for [:admin, @reimbursement_type] do |reimbursement_form| %>
- <%= render partial: 'form', locals: { f: reimbursement_form } %>
- <%= render partial: 'spree/admin/shared/new_resource_links' %>
-<% end %>
diff --git a/backend/app/views/spree/admin/reimbursements/edit.html.erb b/backend/app/views/spree/admin/reimbursements/edit.html.erb
deleted file mode 100644
index b327982427..0000000000
--- a/backend/app/views/spree/admin/reimbursements/edit.html.erb
+++ /dev/null
@@ -1,106 +0,0 @@
-<%= render partial: 'spree/admin/shared/order_tabs', locals: { current: :customer_returns } %>
-
-<% content_for :page_title do %>
- / <%= Spree.t(:reimbursement) %> #<%= @reimbursement.number %>
-<% end %>
-
-<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @reimbursement } %>
-
-<%= form_for [:admin, @order, @reimbursement] do |f| %>
- <fieldset class='no-border-bottom'>
- <legend><%= Spree.t(:items_to_be_reimbursed) %></legend>
- <div class="table-responsive">
- <table class="table table-condensed table-bordered reimbursement-return-items-table">
- <thead>
- <tr>
- <th><%= Spree.t(:product) %></th>
- <th><%= Spree.t(:preferred_reimbursement_type) %></th>
- <th><%= Spree.t(:reimbursement_type_override) %></th>
- <th><%= Spree.t(:pre_tax_refund_amount) %></th>
- <th><%= Spree.t(:total) %></th>
- <th><%= Spree.t(:exchange_for) %></th>
- </tr>
- </thead>
- <tbody>
- <%= f.fields_for :return_items, @reimbursement.return_items.sort_by(&:id) do |item_fields| %>
- <% return_item = item_fields.object %>
- <tr>
- <td>
- <div class="variant-name">
- <%= link_to return_item.inventory_unit.variant.name, spree.edit_admin_product_path(return_item.inventory_unit.variant.product) %>
- </div>
- <div class="variant-options"><%= return_item.inventory_unit.variant.options_text %></div>
- </td>
- <td>
- <%= reimbursement_type_name(return_item.preferred_reimbursement_type) %>
- </td>
- <td>
- <%= item_fields.select(:override_reimbursement_type_id,
- reimbursement_types.collect { |r| [r.name.humanize, r.id] },
- {include_blank: true},
- {class: 'select2'}
- ) %>
- </td>
- <td>
- <%= item_fields.text_field :pre_tax_amount, { class: 'refund-amount-input form-control' } %>
- </td>
- <td>
- <%= return_item.display_total %>
- </td>
- <td>
- <% if return_item.exchange_processed? %>
- <%= return_item.exchange_variant.exchange_name %>
- <% else %>
- <%= item_fields.collection_select :exchange_variant_id, return_item.eligible_exchange_variants, :id, :exchange_name, { include_blank: true }, { class: "select2-clear return-item-exchange-selection" } %>
- <% end %>
- </td>
- </tr>
- <% end %>
- </tbody>
- </table>
- </div>
- </fieldset>
-
- <div class="form-actions filter-actions actions" data-hook="buttons">
- <%= button Spree.t('actions.update'), 'update' %>
- </div>
-<% end %>
-
-<fieldset class="mt-3">
- <legend><%= Spree.t(:calculated_reimbursements) %></legend>
- <div class="table-responsive">
- <table class="table table-condensed table-bordered">
- <thead data-hook="customer_return_header">
- <tr>
- <th><%= Spree.t(:reimbursement_type) %></th>
- <th><%= Spree.t(:description) %></th>
- <th><%= Spree.t(:amount) %></th>
- </tr>
- </thead>
- <tbody>
- <% @reimbursement_objects.each do |reimbursement_object| %>
- <tr data-hook="reimbursement_reimbursement_object_row">
- <td><%= reimbursement_object.class.name.demodulize %></td>
- <td><%= reimbursement_object.description %></td>
- <td><%= reimbursement_object.display_amount %></td>
- </tr>
- <% end %>
- </tbody>
- </table>
- </div>
- <% if @order.has_non_reimbursement_related_refunds? %>
- <div class="alert alert-danger">
- <%= "#{Spree.t('note')}: #{Spree.t('this_order_has_already_received_a_refund')}. #{Spree.t('make_sure_the_above_reimbursement_amount_is_correct')}." %>
- </div>
- <% end %>
- <div class="form-actions" data-hook="reimburse-buttons">
- <% if [email protected]? %>
- <%= button_to [:perform, :admin, @order, @reimbursement], { class: 'btn btn-primary', method: 'post' } do %>
- <span class="icon icon-save"></span>
- <%= Spree.t(:reimburse) %>
- <% end %>
- <span class="or"><%= Spree.t(:or) %></span>
- <%= button_link_to Spree.t('actions.cancel'), url_for([:edit, :admin, @order, @reimbursement.customer_return]), icon: 'cancel' %>
- <% end %>
- </div>
-</fieldset>
diff --git a/backend/app/views/spree/admin/reimbursements/index.html.erb b/backend/app/views/spree/admin/reimbursements/index.html.erb
deleted file mode 100644
index a50d63b930..0000000000
--- a/backend/app/views/spree/admin/reimbursements/index.html.erb
+++ /dev/null
@@ -1,29 +0,0 @@
-<%= render partial: 'spree/admin/shared/order_tabs', locals: { current: :reimbursements } %>
-
-<% content_for :page_title do %>
- / <%= Spree.t(:edit_reimbursement) %>
-<% end %>
-
-<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @customer_return } %>
-<div class="table-responsive">
- <table class="table">
- <thead data-hook="customer_return_header">
- <tr>
- <th><%= Spree.t(:id) %></th>
- <th><%= Spree.t(:total) %></th>
- <th><%= Spree.t(:status) %></th>
- <th><%= "#{Spree.t('date')}/#{Spree.t('time')}" %></th>
- </tr>
- </thead>
- <tbody>
- <% @reimbursements.each do |reimbursement| %>
- <tr id="<%= spree_dom_id(reimbursement) %>" data-hook="reimbursement_row">
- <td><%= reimbursement.id %></td>
- <td><%= reimbursement.total %></td>
- <td><%= reimbursement.reimbursement_status %></td>
- <td><%= pretty_time(reimbursement.created_at) %></td>
- </tr>
- <% end %>
- </tbody>
- </table>
-</div>
diff --git a/backend/app/views/spree/admin/reimbursements/show.html.erb b/backend/app/views/spree/admin/reimbursements/show.html.erb
deleted file mode 100644
index 6f187cfaaf..0000000000
--- a/backend/app/views/spree/admin/reimbursements/show.html.erb
+++ /dev/null
@@ -1,98 +0,0 @@
-<%= render partial: 'spree/admin/shared/order_tabs', locals: { current: :customer_returns } %>
-
-<% content_for :page_title do %>
- / <%= Spree::Reimbursement.model_name.human %> #<%= @reimbursement.number %>
-<% end %>
-
-<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @reimbursement } %>
-
-<fieldset class='no-border-bottom'>
- <legend><%= Spree.t(:items_reimbursed) %></legend>
- <div class="table-responsive">
- <table class="table table-condensed table-bordered reimbursement-reimbursement-items-table">
- <thead>
- <tr>
- <th><%= Spree.t(:product) %></th>
- <th><%= Spree.t(:preferred_reimbursement_type) %></th>
- <th><%= Spree.t(:reimbursement_type_override) %></th>
- <th><%= Spree.t(:exchange_for) %></th>
- <th><%= Spree.t(:pre_tax_amount) %></th>
- <th><%= Spree.t(:total) %></th>
- </tr>
- </thead>
- <tbody>
- <% @reimbursement.return_items.each do |return_item| %>
- <tr>
- <td>
- <div class="variant-name">
- <%= link_to return_item.inventory_unit.variant.name, spree.edit_admin_product_path(return_item.inventory_unit.variant.product) %>
- </div>
- <div class="variant-options"><%= return_item.inventory_unit.variant.options_text %></div>
- </td>
- <td>
- <%= reimbursement_type_name(return_item.preferred_reimbursement_type) %>
- </td>
- <td>
- <%= reimbursement_type_name(return_item.override_reimbursement_type) %>
- </td>
- <td>
- <%= return_item.exchange_variant.try(:exchange_name) %>
- </td>
- <td>
- <%= return_item.display_pre_tax_amount %>
- </td>
- <td>
- <%= return_item.display_total %>
- </td>
- </tr>
- <% end %>
- </tbody>
- </table>
- </div>
-</fieldset>
-
-<fieldset>
- <legend><%= Spree.t(:refunds) %></legend>
- <div class="table-responsive">
- <table class="table table-condensed table-bordered">
- <thead data-hook="customer_return_header">
- <tr>
- <th><%= Spree.t(:description) %></th>
- <th><%= Spree.t(:amount) %></th>
- </tr>
- </thead>
- <tbody>
- <% @reimbursement.refunds.each do |refund| %>
- <tr id="<%= spree_dom_id(refund) %>" data-hook="reimbursement_refund_row">
- <td><%= refund.description %></td>
- <td><%= refund.display_amount %></td>
- </tr>
- <% end %>
- </tbody>
- </table>
- </div>
-</fieldset>
-
-<% if @reimbursement.credits.any? %>
- <fieldset>
- <legend><%= Spree.t(:credits) %></legend>
- <div class="table-responsive">
- <table class="table table-condensed table-bordered">
- <thead data-hook="customer_return_header">
- <tr>
- <th><%= Spree.t(:description) %></th>
- <th><%= Spree.t(:amount) %></th>
- </tr>
- </thead>
- <tbody>
- <% @reimbursement.credits.each do |credit| %>
- <tr id="<%= spree_dom_id(credit) %>" data-hook="reimbursement_refund_row">
- <td><%= credit.description %></td>
- <td><%= credit.display_amount %></td>
- </tr>
- <% end %>
- </tbody>
- </table>
- </div>
- </fieldset>
-<% end %>
diff --git a/backend/app/views/spree/admin/reports/index.html.erb b/backend/app/views/spree/admin/reports/index.html.erb
deleted file mode 100644
index 6cd18a07a6..0000000000
--- a/backend/app/views/spree/admin/reports/index.html.erb
+++ /dev/null
@@ -1,21 +0,0 @@
-<% content_for :page_title do %>
- <%= Spree.t(:reports) %> <%= Spree.t('admin.reports.for', store_name: current_store.unique_name) %>
-<% end %>
-<div class="table-responsive">
- <table class="table">
- <thead>
- <tr data-hook="reports_header">
- <th><%= Spree.t(:name) %></th>
- <th><%= Spree.t(:description) %></th>
- </tr>
- </thead>
- <tbody>
- <% @reports.each do |key, value| %>
- <tr data-hook="reports_row">
- <td><%= link_to value[:name], send("#{key}_admin_reports_url".to_sym) %></td>
- <td><%= value[:description] %></td>
- </tr>
- <% end %>
- </tbody>
- </table>
-</div>
diff --git a/backend/app/views/spree/admin/reports/sales_total.html.erb b/backend/app/views/spree/admin/reports/sales_total.html.erb
deleted file mode 100644
index 6935080876..0000000000
--- a/backend/app/views/spree/admin/reports/sales_total.html.erb
+++ /dev/null
@@ -1,32 +0,0 @@
-<% content_for :page_title do %>
- <%= link_to Spree.t(:reports), spree.admin_reports_url %> /
- <%= Spree.t(:sales_totals) %> <%= Spree.t('admin.reports.for', store_name: current_store.unique_name) %>
-<% end %>
-
-<div class="card bg-light mb-3">
- <div class="card-body">
- <%= render partial: 'spree/admin/shared/report_order_criteria' %>
- </div>
-</div>
-<div class="table-responsive">
- <table class="table table-bordered admin-report" data-hook="sales_total">
- <thead>
- <tr>
- <th><%= Spree.t(:currency) %></th>
- <th><%= Spree.t(:item_total) %></th>
- <th><%= Spree.t(:adjustment_total) %></th>
- <th><%= Spree.t(:sales_total) %></th>
- </tr>
- </thead>
- <tbody>
- <% @totals.each do |key, row| %>
- <tr>
- <td><%= key %></td>
- <td><%= Spree::Money.new(row[:item_total], { currency: key }) %></td>
- <td><%= Spree::Money.new(row[:adjustment_total], { currency: key }) %></td>
- <td><%= Spree::Money.new(row[:sales_total], { currency: key }) %></td>
- </tr>
- <% end %>
- </tbody>
- </table>
-</div>
diff --git a/backend/app/views/spree/admin/return_authorization_reasons/edit.html.erb b/backend/app/views/spree/admin/return_authorization_reasons/edit.html.erb
deleted file mode 100755
index 1368b27fe4..0000000000
--- a/backend/app/views/spree/admin/return_authorization_reasons/edit.html.erb
+++ /dev/null
@@ -1,3 +0,0 @@
-<%= render partial: 'spree/admin/shared/named_types/edit', locals: {
- collection_url_label: Spree.t(:return_authorization_reasons)
-} %>
diff --git a/backend/app/views/spree/admin/return_authorization_reasons/index.html.erb b/backend/app/views/spree/admin/return_authorization_reasons/index.html.erb
deleted file mode 100755
index bdd1c24c75..0000000000
--- a/backend/app/views/spree/admin/return_authorization_reasons/index.html.erb
+++ /dev/null
@@ -1,6 +0,0 @@
-<%= render partial: 'spree/admin/shared/named_types/index', locals: {
- page_title: plural_resource_name(Spree::ReturnAuthorizationReason),
- new_button_text: Spree.t(:new_rma_reason),
- resource_name: plural_resource_name(Spree::ReturnAuthorizationReason),
- resource: Spree::RefundReason
-} %>
diff --git a/backend/app/views/spree/admin/return_authorization_reasons/new.html.erb b/backend/app/views/spree/admin/return_authorization_reasons/new.html.erb
deleted file mode 100755
index 7d22ecd390..0000000000
--- a/backend/app/views/spree/admin/return_authorization_reasons/new.html.erb
+++ /dev/null
@@ -1,4 +0,0 @@
-<%= render partial: 'spree/admin/shared/named_types/new', locals: {
- collection_url_label: Spree.t(:return_authorization_reasons),
- page_title: Spree.t(:new_rma_reason)
-} %>
diff --git a/backend/app/views/spree/admin/return_authorizations/_form.html.erb b/backend/app/views/spree/admin/return_authorizations/_form.html.erb
deleted file mode 100644
index 952a1ba72f..0000000000
--- a/backend/app/views/spree/admin/return_authorizations/_form.html.erb
+++ /dev/null
@@ -1,106 +0,0 @@
-<% allow_return_item_changes = !@return_authorization.customer_returned_items? %>
-
-<div data-hook="admin_return_authorization_form_fields">
-<div class="table-responsive">
- <table class="table table-condensed table-bordered return-items-table">
- <thead>
- <tr data-hook="rma_header">
- <th>
- <% if allow_return_item_changes %>
- <%= check_box_tag 'select-all' %>
- <% end %>
- </th>
- <th><%= Spree.t(:product) %></th>
- <th><%= Spree.t(:status) %></th>
- <th><%= Spree.t(:charged) %></th>
- <th><%= Spree.t(:purchased_quantity) %></th>
- <th style="min-width:130px;"><%= Spree.t(:return_quantity) %></th>
- <th style="min-width:150px;"><%= Spree.t(:pre_tax_refund_amount) %></th>
- <th><%= Spree.t(:reimbursement_type) %></th>
- <th><%= Spree.t(:exchange_for) %></th>
- </tr>
- </thead>
- <tbody>
- <%= f.fields_for :return_items, @form_return_items do |item_fields| %>
- <% return_item = item_fields.object %>
- <% inventory_unit = return_item.inventory_unit %>
- <% editable = inventory_unit.shipped? && allow_return_item_changes && return_item.reimbursement.nil? %>
- <tr>
- <td class="inventory-unit-checkbox">
- <% if editable %>
- <%= item_fields.hidden_field :inventory_unit_id %>
- <%= item_fields.check_box :_destroy, {checked: return_item.persisted?, class: 'add-item', "data-price" => return_item.pre_tax_amount}, '0', '1' %>
- <% end %>
- </td>
- <td>
- <div class="variant-name">
- <%= link_to return_item.inventory_unit.variant.name, spree.edit_admin_product_path(return_item.inventory_unit.variant.product) %>
- </div>
- <div class="variant-options"><%= inventory_unit.variant.options_text %></div>
- </td>
- <td><%= inventory_unit.state.humanize %></td>
- <td class="charged-amount" data-charged-amount="<%= return_item.pre_tax_amount %>">
- <%= return_item.display_pre_tax_amount %>
- </td>
- <td class="purchased-quantity">
- <%= inventory_unit.quantity %>
- </td>
- <td>
- <% if editable %>
- <%= item_fields.number_field :return_quantity, { class: 'refund-quantity-input form-control', min: 0, max: return_item.return_quantity } %>
- <% else %>
- <%= return_item.return_quantity %>
- <% end %>
- </td>
- <td>
- <% if editable %>
- <%= item_fields.text_field :pre_tax_amount, { class: 'refund-amount-input form-control' } %>
- <% else %>
- <%= return_item.display_pre_tax_amount %>
- <% end %>
- </td>
- <td>
- <% if editable %>
- <%= item_fields.select :preferred_reimbursement_type_id, @reimbursement_types.collect{|r|[r.name.humanize, r.id]}, {include_blank: true}, {class: 'select2-clear'} %>
- <% end %>
- </td>
- <td>
- <% if editable %>
- <% if return_item.exchange_processed? %>
- <%= return_item.exchange_variant.exchange_name %>
- <% else %>
- <%= item_fields.collection_select :exchange_variant_id, return_item.eligible_exchange_variants, :id, :exchange_name, { include_blank: true }, { class: "select2-clear return-item-exchange-selection" } %>
- <% end %>
- <% end %>
- </td>
- </tr>
- <% end %>
- </tbody>
- </table>
-</div>
- <%= f.field_container :amount, class: ['alert alert-info'] do %>
- <%= Spree.t(:total_pre_tax_refund) %>: <span id="total_pre_tax_refund">0.00</span>
- <% end %>
-
- <%= f.field_container :stock_location, class: ['form-group'] do %>
- <%= f.label :stock_location, Spree.t(:stock_location) %> <span class="required">*</span>
- <%= f.select :stock_location_id, Spree::StockLocation.order_default.active.to_a.collect{|l|[l.name, l.id]}, {include_blank: true}, {class: 'select2-clear', "data-placeholder" => Spree.t(:select_a_stock_location)} %>
- <%= f.error_message_on :stock_location %>
- <% end %>
-
- <%= f.field_container :reason, class: ['form-group'] do %>
- <%= f.label :reason, Spree.t(:reason) %> <span class="required">*</span>
- <%= f.select :return_authorization_reason_id, @reasons.collect{|r|[r.name, r.id]}, {include_blank: true}, {class: 'select2-clear', "data-placeholder" => Spree.t(:select_a_return_authorization_reason)} %>
- <%= f.error_message_on :reason %>
- <% end %>
-
- <%= f.field_container :memo, class: ['form-group'] do %>
- <%= f.label :memo, Spree.t(:memo) %>
- <%= f.text_area :memo, class: 'form-control' %>
- <%= f.error_message_on :memo %>
- <% end %>
-</div>
-
-<% if Spree::Config[:expedited_exchanges] %>
- <div class="expedited-exchanges-warning"><%= Spree.t(:expedited_exchanges_warning, days_window: Spree::Config[:expedited_exchanges_days_window]) %></div>
-<% end %>
diff --git a/backend/app/views/spree/admin/return_authorizations/edit.html.erb b/backend/app/views/spree/admin/return_authorizations/edit.html.erb
deleted file mode 100644
index 1cb79307e3..0000000000
--- a/backend/app/views/spree/admin/return_authorizations/edit.html.erb
+++ /dev/null
@@ -1,26 +0,0 @@
-<% content_for :page_actions do %>
- <% if @return_authorization.can_cancel? %>
- <%= button_link_to Spree.t('actions.cancel'), cancel_admin_order_return_authorization_url(@order, @return_authorization), method: :put, data: { confirm: Spree.t(:are_you_sure) }, icon: "delete.svg" %>
- <% end %>
-<% end %>
-
-<%= render partial: 'spree/admin/shared/order_tabs', locals: { current: :return_authorizations } %>
-
-<% content_for :page_title do %>
- / <%= link_to Spree.t(:return_authorizations), spree.admin_order_return_authorizations_url %>
- / <%= @return_authorization.number %> (<%= Spree.t(@return_authorization.state.downcase) %>)
-<% end %>
-
-<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @return_authorization } %>
-
-<%= form_for [:admin, @order, @return_authorization] do |f| %>
- <fieldset>
- <%= render partial: 'form', locals: { f: f } %>
-
- <div class="form-actions" data-hook="buttons">
- <%= button Spree.t('actions.update'), 'save.svg' %>
- <span class="or"><%= Spree.t(:or) %></span>
- <%= button_link_to Spree.t('actions.cancel'), spree.admin_order_return_authorizations_url(@order), icon: 'cancel.svg' %>
- </div>
- </fieldset>
-<% end %>
diff --git a/backend/app/views/spree/admin/return_authorizations/index.html.erb b/backend/app/views/spree/admin/return_authorizations/index.html.erb
deleted file mode 100644
index 6edcb183ed..0000000000
--- a/backend/app/views/spree/admin/return_authorizations/index.html.erb
+++ /dev/null
@@ -1,57 +0,0 @@
-<%= render partial: 'spree/admin/shared/order_tabs', locals: { current: :return_authorizations } %>
-
-<% content_for :page_actions do %>
- <% if @order.shipments.any?(&:shipped?) && can?(:create, Spree::ReturnAuthorization) %>
- <%= button_link_to Spree.t(:new_return_authorization), new_admin_order_return_authorization_url(@order), class: "btn-success", icon: 'add.svg' %>
- <% end %>
-<% end %>
-
-<% content_for :page_title do %>
- / <%= Spree.t(:return_authorizations) %>
-<% end %>
-
-<% if @order.shipments.any?(&:shipped?) && @order.return_authorizations.any? %>
-<div class="table-responsive">
- <table class="table">
- <thead data-hook="rma_header">
- <tr>
- <th><%= Spree.t(:rma_number) %></th>
- <th><%= Spree.t(:status) %></th>
- <th><%= Spree.t(:pre_tax_total) %></th>
- <th><%= "#{Spree.t('date')}/#{Spree.t('time')}" %></th>
- <th></th>
- </tr>
- </thead>
- <tbody>
- <% @return_authorizations.each do |return_authorization| %>
- <tr id="<%= spree_dom_id(return_authorization) %>" data-hook="rma_row">
- <td><%= return_authorization.number %></td>
- <td>
- <strong class="badge badge-<%= return_authorization.state %> text-uppercase">
- <%= Spree.t("return_authorization_states.#{return_authorization.state}") %>
- </strong>
- </td>
- <td><%= return_authorization.display_pre_tax_total.to_html %></td>
- <td><%= pretty_time(return_authorization.created_at) %></td>
- <td class="actions">
- <span class="d-flex justify-content-end">
- <%= link_to_edit(return_authorization, no_text: true, class: 'edit') if can?(:edit, return_authorization) %>
- <% if can?(:delete, return_authorization) && !return_authorization.customer_returned_items? %>
- <%= link_to_delete return_authorization, no_text: true %>
- <% end %>
- </span>
- </td>
- </tr>
- <% end %>
- </tbody>
- </table>
-</div>
-<% elsif @order.shipments.any?(&:shipped?) %>
- <div class="alert alert-info no-objects-found">
- <%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree::ReturnAuthorization)) %>
- </div>
-<% else %>
- <div data-hook="rma_cannot_create" class="alert alert-info no-objects-found">
- <%= Spree.t(:cannot_create_returns) %>
- </div>
-<% end %>
diff --git a/backend/app/views/spree/admin/return_authorizations/new.html.erb b/backend/app/views/spree/admin/return_authorizations/new.html.erb
deleted file mode 100644
index 84b5913734..0000000000
--- a/backend/app/views/spree/admin/return_authorizations/new.html.erb
+++ /dev/null
@@ -1,18 +0,0 @@
-<%= render partial: 'spree/admin/shared/order_tabs', locals: { current: :return_authorizations } %>
-
-<% content_for :page_title do %>
- / <%= Spree.t(:new_return_authorization) %>
-<% end %>
-
-<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @return_authorization } %>
-<%= form_for [:admin, @order, @return_authorization] do |f| %>
- <fieldset>
- <%= render partial: 'form', locals: { f: f } %>
-
- <div class="form-actions" data-hook="buttons">
- <%= button Spree.t(:create), 'save.svg' %>
- <span class="or"><%= Spree.t(:or) %></span>
- <%= button_link_to Spree.t('actions.cancel'), spree.admin_order_return_authorizations_url(@order), icon: 'cancel.svg' %>
- </div>
- </fieldset>
-<% end %>
diff --git a/backend/app/views/spree/admin/return_index/customer_returns.html.erb b/backend/app/views/spree/admin/return_index/customer_returns.html.erb
deleted file mode 100644
index db74e78c69..0000000000
--- a/backend/app/views/spree/admin/return_index/customer_returns.html.erb
+++ /dev/null
@@ -1,65 +0,0 @@
-<% content_for :page_title do %>
- <%= Spree.t(:customer_returns) %>
-<% end %>
-
-<% content_for :table_filter do %>
- <div data-hook="admin_return_authorisations_index_filters">
- <%= search_form_for [:admin, @search], url: spree.admin_customer_returns_path do |f| %>
- <div class="row">
- <div class="col-12">
- <div class="form-group">
- <%= f.label :number_cont, Spree.t(:number) %>
- <%= f.text_field :number_cont, class: "form-control js-quick-search-target js-filterable" %>
- </div>
- </div>
- </div>
- <div data-hook="admin_return_authorisations_index_filters_buttons" class="form-actions">
- <%= button Spree.t(:search), 'search.svg' %>
- </div>
- <% end %>
- </div>
-<% end %>
-
-<% if @collection.any? %>
-<div class="table-responsive">
- <table class="table">
- <thead>
- <tr data-hook="rate_header">
- <th><%= Spree.t(:created_at) %></th>
- <th><%= Spree.t(:number) %></th>
- <th><%= Spree.t(:order) %></th>
- <th><%= Spree.t(:reimbursement_status) %></th>
- <th><%= Spree.t(:pre_tax_total) %></th>
- <th></th>
- </tr>
- </thead>
- <tbody>
- <% @collection.each do |customer_return| %>
- <tr id="<%= spree_dom_id customer_return %>" data-hook="customer_return_row">
- <td><%= customer_return.created_at.strftime('%F %T %Z') %></td>
- <td><%= link_to customer_return.number, spree.edit_admin_order_customer_return_path(customer_return.order, customer_return) %></td>
- <td><%= link_to customer_return.order.number, spree.edit_admin_order_path(customer_return.order) %></td>
- <td>
- <% if customer_return.fully_reimbursed? %>
- <span class="badge badge-success text-uppercase"><%= Spree.t(:reimbursed) %></span>
- <% else %>
- <span class="badge badge-inactive text-uppercase"><%= Spree.t(:incomplete) %></span>
- <% end %>
- </td>
- <td><%= customer_return.display_pre_tax_total.to_html %></td>
- <td class="actions">
- <span class="d-flex justify-content-end">
- <%= link_to_edit_url spree.edit_admin_order_customer_return_path(customer_return.order, customer_return), no_text: true if can?(:edit, customer_return) %>
- </span>
- </td>
- </tr>
- <% end %>
- </tbody>
- </table>
-</div>
-<% else %>
- <div class="alert alert-info no-objects-found">
- <%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree::CustomerReturn)) %>. </div>
-<% end %>
-
-<%= render partial: 'spree/admin/shared/index_table_options', locals: { collection: @collection, per_page_action: :customer_returns } %>
diff --git a/backend/app/views/spree/admin/return_index/return_authorizations.html.erb b/backend/app/views/spree/admin/return_index/return_authorizations.html.erb
deleted file mode 100644
index 5bca78da3a..0000000000
--- a/backend/app/views/spree/admin/return_index/return_authorizations.html.erb
+++ /dev/null
@@ -1,84 +0,0 @@
-<% content_for :page_title do %>
- <%= Spree.t(:return_authorizations) %>
-<% end %>
-
-<% content_for :page_tabs do %>
- <li class="nav-item">
- <%= link_to Spree.t(:all),
- spree.admin_return_authorizations_path,
- class: "nav-link #{'active' if params[:q][:state_eq].blank?}" %>
- </li>
- <li class="nav-item">
- <%= link_to Spree.t(:authorized),
- params.merge({q: {state_eq: :authorized}}).permit!,
- class: "nav-link #{'active' if params[:q][:state_eq] == 'authorized'}" %>
- </li>
- <li class="nav-item">
- <%= link_to Spree.t(:canceled),
- params.merge({q: {state_eq: :canceled}}).permit!,
- class: "nav-link #{'active' if params[:q][:state_eq] == 'canceled'}" %>
- </li>
-<% end %>
-
-<% content_for :table_filter do %>
- <div data-hook="admin_return_authorisations_index_filters">
- <%= search_form_for [:admin, @search], url: spree.admin_return_authorizations_path do |f| %>
- <div class="row">
- <div class="col-12 col-lg-6">
- <div class="form-group">
- <%= f.label :number_cont, Spree.t(:return_number) %>
- <%= f.text_field :number_cont, class: "form-control js-quick-search-target js-filterable" %>
- </div>
- </div>
- <div class="col-12 col-lg-6">
- <div class="form-group">
- <%= label_tag :q_state_eq, Spree.t(:status) %>
- <%= f.select :state_eq, Spree::ReturnAuthorization.state_machines[:state].states.collect {|s| [Spree.t("return_authorization_states.#{s.name}"), s.value]}, {include_blank: true}, class: 'select2-clear js-filterable' %>
- </div>
- </div>
- </div>
- <div data-hook="admin_return_authorisations_index_filters_buttons" class="form-actions">
- <%= button Spree.t(:search), 'search.svg' %>
- </div>
- <% end %>
- </div>
-<% end %>
-
-<% if @collection.any? %>
-<div class="table-responsive">
- <table class="table">
- <thead>
- <tr data-hook="rate_header">
- <th><%= Spree.t(:created_at) %></th>
- <th><%= Spree.t(:number) %></th>
- <th><%= Spree.t(:order) %></th>
- <th><%= Spree.t(:status) %></th>
- <th></th>
- </tr>
- </thead>
- <tbody>
- <% @collection.each do |return_authorization| %>
- <tr id="<%= spree_dom_id return_authorization %>" data-hook="return_authorization_row">
- <td><%= return_authorization.created_at.strftime('%F %T %Z') %></td>
- <td><%= link_to return_authorization.number, spree.edit_admin_order_return_authorization_path(return_authorization.order, return_authorization) %></td>
- <td><%= link_to return_authorization.order.number, spree.edit_admin_order_path(return_authorization.order) %></td>
- <td>
- <span class="badge badge-<%= return_authorization.state %> text-uppercase"><%= Spree.t("return_authorization_states.#{return_authorization.state}") %></span>
- </td>
- <td class="actions">
- <span class="d-flex justify-content-end">
- <%= link_to_edit return_authorization, url: spree.edit_admin_order_return_authorization_path(return_authorization.order, return_authorization), no_text: true if can?(:edit, return_authorization) %>
- </span>
- </td>
- </tr>
- <% end %>
- </tbody>
- </table>
- </div>
-<% else %>
- <div class="alert alert-info no-objects-found">
- <%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree::ReturnAuthorization)) %>.
- </div>
-<% end %>
-
-<%= render partial: 'spree/admin/shared/index_table_options', locals: { collection: @collection, per_page_action: :return_authorizations } %>
diff --git a/backend/app/views/spree/admin/roles/_form.html.erb b/backend/app/views/spree/admin/roles/_form.html.erb
deleted file mode 100644
index 68b67c99f2..0000000000
--- a/backend/app/views/spree/admin/roles/_form.html.erb
+++ /dev/null
@@ -1,9 +0,0 @@
-<div data-hook="admin_role_form_fields">
- <%= f.field_container :name, class: ["form-group"], 'data-hook' => "role_name" do %>
- <%= f.label :name, Spree.t(:name) %> <span class="required">*</span>
- <%= f.text_field :name, class: 'form-control' %>
- <%= f.error_message_on :name %>
- <% end %>
-
- <div data-hook="additional_role_fields"></div>
-</div>
diff --git a/backend/app/views/spree/admin/roles/edit.html.erb b/backend/app/views/spree/admin/roles/edit.html.erb
deleted file mode 100644
index 6fc77e77f1..0000000000
--- a/backend/app/views/spree/admin/roles/edit.html.erb
+++ /dev/null
@@ -1,13 +0,0 @@
-<% content_for :page_title do %>
- <%= link_to Spree.t(:roles), spree.admin_roles_url %> /
- <%= @role.name.capitalize %>
-<% end %>
-
-<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @role } %>
-
-<%= form_for [:admin, @role] do |f| %>
- <fieldset>
- <%= render partial: 'form', locals: { f: f } %>
- <%= render partial: 'spree/admin/shared/edit_resource_links' %>
- </fieldset>
-<% end %>
diff --git a/backend/app/views/spree/admin/roles/index.html.erb b/backend/app/views/spree/admin/roles/index.html.erb
deleted file mode 100644
index 6c6268622e..0000000000
--- a/backend/app/views/spree/admin/roles/index.html.erb
+++ /dev/null
@@ -1,38 +0,0 @@
-<% content_for :page_title do %>
- <%= Spree.t(:roles) %>
-<% end %>
-
-<% content_for :page_actions do %>
- <%= button_link_to Spree.t(:new_role), new_object_url, class: "btn-success", icon: 'add.svg', id: 'admin_new_role_link' %>
-<% end if can? :create, Spree::Role %>
-
-<% if @roles.any? %>
- <div class="table-responsive">
- <table class="table">
- <thead>
- <tr data-hook="admin_roles_index_headers">
- <th><%= Spree.t(:role_id) %></th>
- <th class="actions"></th>
- </tr>
- </thead>
- <tbody>
- <% @roles.each do |role| %>
- <tr id="<%= spree_dom_id role %>" data-hook="admin_roles_index_rows">
- <td><%= role.name %></td>
- <td class="actions">
- <span class="d-flex justify-content-end">
- <%= link_to_edit(role, no_text: true) if can? :edit, role %>
- <%= link_to_delete(role, no_text: true) if can? :destroy, role %>
- </span>
- </td>
- </tr>
- <% end %>
- </tbody>
- </table>
- </div>
-<% else %>
- <div class="alert alert-warning">
- <%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree::Role)) %>,
- <%= link_to(Spree.t(:add_one), new_object_url) if can? :create, Spree::Role %>!
- </div>
-<% end %>
diff --git a/backend/app/views/spree/admin/roles/new.html.erb b/backend/app/views/spree/admin/roles/new.html.erb
deleted file mode 100644
index daba60fdfd..0000000000
--- a/backend/app/views/spree/admin/roles/new.html.erb
+++ /dev/null
@@ -1,13 +0,0 @@
-<% content_for :page_title do %>
- <%= link_to Spree.t(:roles), spree.admin_roles_url %> /
- <%= Spree.t(:new_role) %>
-<% end %>
-
-<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @role } %>
-
-<%= form_for [:admin, @role] do |f| %>
- <fieldset>
- <%= render partial: 'form', locals: { f: f } %>
- <%= render partial: 'spree/admin/shared/new_resource_links' %>
- </fieldset>
-<% end %>
diff --git a/backend/app/views/spree/admin/shared/_account_nav.html.erb b/backend/app/views/spree/admin/shared/_account_nav.html.erb
deleted file mode 100644
index d976ac048a..0000000000
--- a/backend/app/views/spree/admin/shared/_account_nav.html.erb
+++ /dev/null
@@ -1,59 +0,0 @@
-<% if try_spree_current_user %>
- <div class="btn-group">
-
- <button id="accountNav" type="button" class="btn text-light px-3" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
- <%= svg_icon name: "user.svg", width: '24', height: '24', classes: 'mb-0' %>
- </button>
-
- <div class="dropdown-menu dropdown-menu-right overflow-hidden mt-2 p-0 mr-2">
- <div class="dropdown-item px-0 text-center bg-light">
- <span class="d-block text-dark py-2 px-4"><%= try_spree_current_user.email %></span>
- </div>
- <div class="dropdown-divider m-0"></div>
-
- <% if spree.respond_to? :root_path %>
- <%= link_to spree.root_path, target: :blank, class: 'd-block text-dark py-3 px-4 dropdown-item' do %>
- <%= svg_icon name: "store.svg", width: '18', height: '18' %>
- &nbsp;
- <%= Spree.t(:back_to_store) %>
- <% end %>
- <% end %>
-
- <% if can?(:manage, try_spree_current_user) %>
- <%= link_to spree.edit_admin_user_path(try_spree_current_user), class: 'd-block text-dark py-3 px-4 dropdown-item' do %>
- <%= svg_icon name: "user.svg", width: '18', height: '18' %>
- &nbsp;
- <%= Spree.t(:account) %>
- <% end %>
- <% end %>
-
- <% if admin_logout_link %>
- <%= link_to admin_logout_link, class: 'd-block text-dark py-3 px-4 dropdown-item' do %>
- <%= svg_icon name: "exit.svg", width: '18', height: '18' %>
- &nbsp;
- <%= Spree.t(:logout) %>
- <% end %>
- <% end %>
-
- <div class="dropdown-divider m-0"></div>
-
- <%= link_to 'http://spreecommerce.org/contact', target: :blank, class: 'd-block text-dark py-3 px-4 dropdown-item' do %>
- <%= svg_icon name: "info.svg", width: '18', height: '18' %>
- &nbsp;
- <%= Spree.t(:support) %>
- <% end %>
-
- <%= link_to 'http://slack.spreecommerce.org', target: :blank, class: 'd-block text-dark py-3 px-4 dropdown-item' do %>
- <%= svg_icon name: "slack.svg", width: '18', height: '18' %>
- &nbsp;
- <%= Spree.t(:join_slack) %>
- <% end %>
-
- <%= link_to 'https://dev-docs.spreecommerce.org/extensions/extensions', target: :blank, class: 'd-block text-dark py-3 px-4 dropdown-item' do %>
- <%= svg_icon name: "extensions.svg", width: '18', height: '18' %>
- &nbsp;
- <%= Spree.t(:extensions_directory) %>
- <% end %>
- </div>
- </div>
-<% end %>
diff --git a/backend/app/views/spree/admin/shared/_address.html.erb b/backend/app/views/spree/admin/shared/_address.html.erb
deleted file mode 100644
index a2e7f59888..0000000000
--- a/backend/app/views/spree/admin/shared/_address.html.erb
+++ /dev/null
@@ -1,38 +0,0 @@
-<div class="address vcard">
- <div class="fn"><%= address.full_name %></div>
- <% unless address.company.blank? %>
- <div class="org">
- <%= address.company %>
- </div>
- <% end %>
- <div class="adr">
- <div class="street-address">
- <div class="street-address-line">
- <%= address.address1 %>
- </div>
- <% unless address.address2.blank? %>
- <div class="street-address-line">
- <%= address.address2 %>
- </div>
- <% end %>
- </div>
- <div class="local">
- <span class="locality"><%= address.city %></span>
- <span class="region"><%= address.state_text %></span>
- <span class="postal-code"><%= address.zipcode %></span>
- <div class="country-name"><%= address.country.try(:name) %></div>
- </div>
- </div>
- <% unless address.phone.blank? %>
- <div class="tel">
- <span class="type"><%= Spree.t(:phone) %></span>
- <%= address.phone %>
- </div>
- <% end %>
- <% unless address.alternative_phone.blank? %>
- <div class="alternative-phone tel">
- <span class="type"><%= Spree.t(:alternative_phone) %></span>
- <%= address.alternative_phone %>
- </div>
- <% end %>
-</div>
diff --git a/backend/app/views/spree/admin/shared/_address_form.html.erb b/backend/app/views/spree/admin/shared/_address_form.html.erb
deleted file mode 100644
index 6471c2387e..0000000000
--- a/backend/app/views/spree/admin/shared/_address_form.html.erb
+++ /dev/null
@@ -1,45 +0,0 @@
-<% s_or_b = type.chars.first %>
-<div id="<%= type %>" data-hook="address_fields">
- <% Spree::Address::ADDRESS_FIELDS.each do |field| %>
- <% if field == "country" %>
- <%= field_container (s_or_b + '_' + field), nil, class: ["form-group", "#{type}-row"] do %>
- <%= f.label :country_id, Spree.t(:country) %>
- <div id="<%= s_or_b %>country">
- <%= f.collection_select :country_id, all_countries, :id, :name, {}, { class: 'select2 w-100' } %>
- </div>
- <% end %>
- <% elsif field == "state" %>
- <%= field_container (s_or_b + '_' + field), :state, class: ["form-group", "#{type}-row"] do %>
- <%= f.label :state_id, Spree.t(:state) %>
- <div id="<%= s_or_b %>state">
- <% if f.object.country.try(:states) %>
- <%= f.text_field :state_name,
- style: "display: #{f.object.country.try(:states) && f.object.country.states.empty? ? 'block' : 'none' };",
- disabled: !(f.object.country.try(:states) && f.object.country.states.empty?), class: 'form-control state_name' %>
- <%= f.collection_select :state_id, f.object.country.states.sort, :id, :name, { include_blank: true }, { class: 'select2 w-100', disabled: f.object.country.states.empty? } %>
- <% else %>
- <div>
- <em><%= Spree.t(:no_country) %></em>
- </div>
- <% end %>
- </div>
- <%= error_message_on f.object, :state_id %>
- <% end %>
- <% else %>
- <%= field_container (s_or_b + '_' + field), nil, class: ["form-group", "#{type}-row"] do %>
- <%= f.label field, Spree.t(field) %>
- <%= f.text_field field, class: 'form-control' %>
- <%= error_message_on f.object, field %>
- <% end %>
- <% end %>
- <% end %>
-</div>
-
-<% content_for :head do %>
- <script>
- document.addEventListener('DOMContentLoaded', function() {
- updateAddressState('<%= s_or_b %>');
- $('#<%= s_or_b %>country select').on('change', function() { updateAddressState('<%= s_or_b %>'); });
- })
- </script>
-<% end %>
diff --git a/backend/app/views/spree/admin/shared/_cal_close.html.erb b/backend/app/views/spree/admin/shared/_cal_close.html.erb
deleted file mode 100644
index 8deb697575..0000000000
--- a/backend/app/views/spree/admin/shared/_cal_close.html.erb
+++ /dev/null
@@ -1,10 +0,0 @@
-<div class="input-group-append append_over data-clear" data-clear>
- <span class="input-group-text force-round">
- <%= svg_icon name: "close.svg", width: '16', height: '16' %>
- </span>
-</div>
-<div class="input-group-append append_under data-toggle" data-toggle>
- <span class="input-group-text">
- <%= svg_icon name: "calendar.svg", width: '16', height: '16' %>
- </span>
-</div>
diff --git a/backend/app/views/spree/admin/shared/_calculator_fields.html.erb b/backend/app/views/spree/admin/shared/_calculator_fields.html.erb
deleted file mode 100644
index d10529a10c..0000000000
--- a/backend/app/views/spree/admin/shared/_calculator_fields.html.erb
+++ /dev/null
@@ -1,27 +0,0 @@
-<div id="calculator_fields" data-hook class="card mb-3">
-
- <div class="card-header">
- <h1 class="card-title mb-0 h5">
- <%= Spree.t(:calculator) %>
- </h1>
- </div>
-
- <div id="preference-settings" data-hook class="card-body">
- <div class="form-group">
- <%= f.label(:calculator_type, Spree.t(:calculator), for: 'calc_type') %>
- <%= f.select(:calculator_type, @calculators.map { |c| [c.description, c.name] }, {}, {id: 'calc_type', class: 'select2'}) %>
- </div>
- <% if [email protected]_record? %>
- <div class="form-group">
- <div class="calculator-settings">
- <%= f.fields_for :calculator do |calculator_form| %>
- <%= preference_fields @object.calculator, calculator_form %>
- <% end %>
- </div>
- <% if @object.calculator.respond_to?(:preferences) %>
- <span class="calculator-settings-warning info warning"><%= Spree.t(:calculator_settings_warning) %></span>
- <% end %>
- </div>
- <% end %>
- </div>
-</div>
diff --git a/backend/app/views/spree/admin/shared/_content_header.html.erb b/backend/app/views/spree/admin/shared/_content_header.html.erb
deleted file mode 100644
index 7e1f9447af..0000000000
--- a/backend/app/views/spree/admin/shared/_content_header.html.erb
+++ /dev/null
@@ -1,59 +0,0 @@
-<div id="contentHeader" class="row mb-0 pb-0">
- <% if content_for?(:page_title) || content_for?(:page_actions) %>
- <div class="content-header col <%= "with-page-tabs" if content_for?(:page_tabs) %> page-header">
- <div id="contentHeaderRow" class="row align-items-center <%= if content_for?(:page_tabs) then "border-bottom pb-2" else "border-bottom pb-2 mb-3" end %>">
-
- <% if content_for?(:page_title) %>
- <h1 class="contextual-title px-0 mb-0 col">
- <%= yield :page_title %>
- <% if content_for?(:page_title_small) %>
- <small><%= yield :page_title_small %></small>
- <% end %>
- </h1>
- <% end %>
-
- <% if content_for?(:page_actions) %>
- <div class="page-actions pl-0 pr-0 d-none d-lg-flex" data-hook="toolbar">
- <%= yield :page_actions %>
- </div>
- <% end %>
-
- <% if content_for?(:page_actions) || content_for?(:sidebar) %>
- <div class="d-flex d-lg-none justify-content-end m-0 p-0">
- <button type="button"
- id="contextual-menu-toggle"
- class="btn btn-outline-secondary shadow-none">
- <span class="d-none d-sm-inline">
- <%= Spree.t('more') %>
- </span>
- <%= svg_icon name: "chevron-down.svg", width: '16', height: '16' %>
- </button>
- </div>
- <% end %>
- </div>
-
- <% if content_for?(:page_tabs) %>
- <div class="row my-2 pb-1 pt-1 align-items-center" data-nav-x-wrapper>
- <div data-nav-x-container>
- <ul id="spreePageTabs" class="nav nav-pills flex-nowrap" data-nav-x-content>
- <%= yield :page_tabs %>
- </ul>
- </div>
-
- <button class="nav-x_Advancer nav-x_Advancer_Left" type="button">
- <svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" class="bi bi-chevron-left" viewBox="0 0 16 16">
- <path fill-rule="evenodd" d="M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z" />
- </svg>
- </button>
-
- <button class="nav-x_Advancer nav-x_Advancer_Right" type="button">
- <svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" class="bi bi-chevron-right" viewBox="0 0 16 16">
- <path fill-rule="evenodd" d="M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z" />
- </svg>
- </button>
- </div>
- <% end %>
-
- </div>
- <% end %>
-</div>
diff --git a/backend/app/views/spree/admin/shared/_destroy.js.erb b/backend/app/views/spree/admin/shared/_destroy.js.erb
deleted file mode 100644
index 6c92af395f..0000000000
--- a/backend/app/views/spree/admin/shared/_destroy.js.erb
+++ /dev/null
@@ -1,10 +0,0 @@
-<% if success = flash.discard(:success) %>
- show_flash('success', "<%= j success %>");
-<% end %>
-
-<% if error = flash.discard(:error) %>
- show_flash('error', "<%= j error %>");
-<% end %>
-
-<%= render partial: '/spree/admin/shared/update_order_state' if @order %>
-<%= render partial: '/spree/admin/shared/update_store_credit' if @store_credit %>
diff --git a/backend/app/views/spree/admin/shared/_edit_resource_links.html.erb b/backend/app/views/spree/admin/shared/_edit_resource_links.html.erb
deleted file mode 100644
index 25cd38b18c..0000000000
--- a/backend/app/views/spree/admin/shared/_edit_resource_links.html.erb
+++ /dev/null
@@ -1,5 +0,0 @@
-<div class="form-actions" data-hook="buttons">
- <%= button Spree.t('actions.update'), 'save.svg', 'submit', {class: 'btn-success', data: { disable_with: "#{ Spree.t(:saving) }..." }} %>
- <span class="or"><%= Spree.t(:or) %></span>
- <%= button_link_to Spree.t('actions.cancel'), collection_url, icon: 'cancel.svg' %>
-</div>
diff --git a/backend/app/views/spree/admin/shared/_error_messages.html.erb b/backend/app/views/spree/admin/shared/_error_messages.html.erb
deleted file mode 100644
index ca9a2af7c3..0000000000
--- a/backend/app/views/spree/admin/shared/_error_messages.html.erb
+++ /dev/null
@@ -1,12 +0,0 @@
-<% if target && target.errors.any? %>
- <div id="errorExplanation" class="errorExplanation alert alert-danger" data-hook>
- <p>
- <strong><%= Spree.t(:errors_prohibited_this_record_from_being_saved, count: target.errors.size) %>:</strong><br>
- </p>
- <ul class="ul-with-markup">
- <% target.errors.full_messages.each do |msg| %>
- <li><%= msg %></li>
- <% end %>
- </ul>
- </div>
-<% end %>
diff --git a/backend/app/views/spree/admin/shared/_head.html.erb b/backend/app/views/spree/admin/shared/_head.html.erb
deleted file mode 100644
index 086f37619a..0000000000
--- a/backend/app/views/spree/admin/shared/_head.html.erb
+++ /dev/null
@@ -1,32 +0,0 @@
-<meta charset="utf-8">
-<meta http-equiv="X-UA-Compatible" content="IE=edge">
-<meta name="viewport" content="width=device-width, initial-scale=1">
-
-<%= csrf_meta_tags %>
-
-<title>
- <% if content_for? :title %>
- <%= yield :title %>
- <% else %>
- <%= "Spree #{Spree.t('administration')}: " %>
- <%= Spree.t(controller.controller_name, default: controller.controller_name.titleize) %>
- <% end %>
-</title>
-
-<%= stylesheet_link_tag 'spree/backend/all', media: :all %>
-
-<%= render 'spree/admin/shared/paths' %>
-<%= javascript_include_tag 'spree/backend/all' %>
-<%= render "spree/admin/shared/translations" %>
-
-<script>
- <%== "var AUTH_TOKEN = #{form_authenticity_token.inspect};" %>
- <%== "Spree.api_key = '#{try_spree_current_user.spree_api_key}';" if try_spree_current_user %>
- <%== "var OAUTH_TOKEN = '#{admin_oauth_token}';" if defined?(admin_oauth_token) %>
- <%== "var ADDRESS_FIELDS = #{Spree::Address::ADDRESS_FIELDS}" %>
- <% if Rails.env.test? %>
- jQuery.fx.off = false
- <% end %>
-</script>
-
-<%= yield :head %>
diff --git a/backend/app/views/spree/admin/shared/_header.html.erb b/backend/app/views/spree/admin/shared/_header.html.erb
deleted file mode 100644
index 98bab63b09..0000000000
--- a/backend/app/views/spree/admin/shared/_header.html.erb
+++ /dev/null
@@ -1,22 +0,0 @@
-<header class="header logged-in">
- <nav class="navbar fixed-top navbar-dark flex-nowrap">
- <div class="col p-0 d-lg-none">
- <button
- id="sidebar-open"
- class="navbar-toggler h-100 text-light px-3"
- type="button"
- aria-expanded="false"
- aria-label="Toggle navigation">
- <%= svg_icon name: "menu.svg", width: '20', height: '20' %>
- </button>
- </div>
-
- <div id="storeSwitcherDropdown" class="col-auto text-center text-lg-left px-0 px-lg-2 align-items-center dropdown">
- <%= render partial: 'spree/admin/shared/store_switcher' %>
- </div>
-
- <div class="col text-right p-0">
- <%= render partial: 'spree/admin/shared/account_nav' %>
- </div>
- </nav>
-</header>
diff --git a/backend/app/views/spree/admin/shared/_index_table_options.html.erb b/backend/app/views/spree/admin/shared/_index_table_options.html.erb
deleted file mode 100644
index 548662a8e5..0000000000
--- a/backend/app/views/spree/admin/shared/_index_table_options.html.erb
+++ /dev/null
@@ -1,16 +0,0 @@
-<% args = params.clone %>
-
-<% if defined?(per_page_action) %>
- <% args[:action] = per_page_action %>
-<% end %>
-
-<div class="row index-pagination-row mt-4">
- <div class="col-12 col-sm-9 text-center text-sm-left">
- <%= paginate collection, theme: 'admin-twitter-bootstrap-4' %>
- </div>
- <div class="col-12 col-sm-3 text-center text-sm-left">
- <%= form_tag(per_page_dropdown_params(args), { method: :get, class: 'js-per-page-form form-inline justify-content-center justify-content-sm-end' }) do %>
- <%= per_page_dropdown %>
- <% end %>
- </div>
-</div>
diff --git a/backend/app/views/spree/admin/shared/_link_fields.html.erb b/backend/app/views/spree/admin/shared/_link_fields.html.erb
deleted file mode 100644
index cbcca53ce4..0000000000
--- a/backend/app/views/spree/admin/shared/_link_fields.html.erb
+++ /dev/null
@@ -1,22 +0,0 @@
-<% save_to = save_to || 'menu_item_link' %>
-<% linked_type = linked_type || nil %>
-
-<% if linked_type.present? %>
- <div data-panel-type="<%= linked_type %>" data-panel-id="<%= save_to %>">
- <%= render "spree/admin/shared/cms/#{spree_class_name_as_path(linked_type)}", resource: resource, save_to: save_to, f: f %>
- </div>
-<% elsif resource.linked_resource_type.present? %>
- <div data-panel-type="<%= resource.linked_resource_type %>" data-panel-id="<%= save_to %>">
- <%= render "spree/admin/shared/linkables/#{spree_class_name_as_path(resource.linked_resource_type)}", resource: resource, f: f %>
- </div>
-<% end %>
-
-<div class="d-none" data-target-message-pannel="<%= save_to %>">
- <div class="alert alert-warning mt-3">
- <% if %w[new create].include? controller.action_name %>
- <%= raw Spree.t('admin.navigation.click_create_to_load_new_link') %>
- <% else %>
- <%= raw Spree.t('admin.navigation.click_update_to_load_new_link') %>
- <% end %>
- </div>
-</div>
diff --git a/backend/app/views/spree/admin/shared/_main_menu.html.erb b/backend/app/views/spree/admin/shared/_main_menu.html.erb
deleted file mode 100644
index 5c94187207..0000000000
--- a/backend/app/views/spree/admin/shared/_main_menu.html.erb
+++ /dev/null
@@ -1,69 +0,0 @@
-<nav>
- <div class="text-right d-lg-none pl-3 py-2 border-bottom d-flex align-items-center">
- <div class="d-flex flex-grow-1 text-primary">
- <%= svg_icon name: "spree-logo.svg", width: '70', height: '30' %>
- </div>
- <button
- id="sidebar-close"
- class="btn btn-link d-flex"
- type="button"
- aria-expanded="false"
- aria-label="Toggle navigation">
- <%= svg_icon name: "cancel.svg", width: '20', height: '20', classes: 'p-0 m-0' %>
- </button>
- </div>
-
- <% if can? :admin, Spree::Order %>
- <ul class="nav nav-sidebar border-bottom" id="sidebarOrder">
- <%= tab *Spree::BackendConfiguration::ORDER_TABS, url: admin_orders_path, icon: 'list.svg' %>
- </ul>
- <% end %>
-
- <% if can?(:admin, Spree::ReturnAuthorization) || can?(:admin, Spree::CustomerReturn) %>
- <ul class="nav nav-sidebar border-bottom" id="sidebarReturn">
- <%= main_menu_tree Spree.t(:returns), icon: "returns.svg", sub_menu: "returns", url: "#sidebar-returns" %>
- </ul>
- <% end %>
-
- <% if can? :admin, Spree::Product %>
- <ul class="nav nav-sidebar border-bottom" id="sidebarProduct">
- <%= main_menu_tree Spree.t(:products), icon: "products.svg", sub_menu: "product", url: "#sidebar-product" %>
- </ul>
- <% end %>
-
- <% if can?(:admin, Spree::StockLocation) || can?(:admin, Spree::StockTransfer) %>
- <ul class="nav nav-sidebar border-bottom" id="sidebarStock">
- <%= main_menu_tree Spree.t(:stock), icon: "box.svg", sub_menu: "stock", url: "#sidebar-stock" %>
- </ul>
- <% end %>
-
- <% if can? :admin, Spree::Admin::ReportsController %>
- <ul class="nav nav-sidebar border-bottom" id="sidebarReport">
- <%= tab *Spree::BackendConfiguration::REPORT_TABS, icon: 'report.svg' %>
- </ul>
- <% end %>
-
- <% if can? :admin, Spree::Promotion %>
- <ul class="nav nav-sidebar border-bottom" id="sidebarPromotion">
- <%= main_menu_tree Spree.t(:promotions), icon: "promotion.svg", sub_menu: "promotion", url: "#sidebar-promotions" %>
- </ul>
- <% end %>
-
- <% if Spree.user_class && can?(:admin, Spree.user_class) %>
- <ul class="nav nav-sidebar border-bottom" id="sidebarUser">
- <%= tab *Spree::BackendConfiguration::USER_TABS, url: spree.admin_users_path, icon: 'users.svg' %>
- </ul>
- <% end %>
-
- <% if can? :admin, Spree::Menu %>
- <ul class="nav nav-sidebar border-bottom" id="sidebarMenu">
- <%= main_menu_tree Spree.t('admin.tab.content'), icon: "window-sidebar.svg", sub_menu: "content", url: "#sidebar-content" %>
- </ul>
- <% end %>
-
- <% if can? :admin, current_store %>
- <ul class="nav nav-sidebar border-bottom" id="sidebarConfiguration">
- <%= main_menu_tree Spree.t(:configurations), icon: "settings.svg", sub_menu: "configuration", url: "#sidebar-configuration" %>
- </ul>
- <% end %>
-</nav>
diff --git a/backend/app/views/spree/admin/shared/_new_resource_links.html.erb b/backend/app/views/spree/admin/shared/_new_resource_links.html.erb
deleted file mode 100644
index 693de8752c..0000000000
--- a/backend/app/views/spree/admin/shared/_new_resource_links.html.erb
+++ /dev/null
@@ -1,5 +0,0 @@
-<div class="form-actions" data-hook="buttons">
- <%= button Spree.t('actions.create'), 'save.svg', 'submit', {class: 'btn-success', data: { disable_with: "#{ Spree.t(:saving) }..." }} %>
- <span class="or"><%= Spree.t(:or) %></span>
- <%= button_link_to Spree.t('actions.cancel'), collection_url, icon: 'cancel.svg' %>
-</div>
diff --git a/backend/app/views/spree/admin/shared/_order_summary.html.erb b/backend/app/views/spree/admin/shared/_order_summary.html.erb
deleted file mode 100644
index c02882248d..0000000000
--- a/backend/app/views/spree/admin/shared/_order_summary.html.erb
+++ /dev/null
@@ -1,132 +0,0 @@
-<div class="card mb-3">
- <div class="card-header">
- <h3 class="card-title mb-0 h5"><%= Spree.t(:summary) %></h3>
- </div>
- <div class="table-responsive">
- <table class="table table-condensed table-bordered" id="order_tab_summary" data-hook>
- <tbody class="additional-info">
- <tr>
- <td id="order_status" width="35%" data-hook>
- <strong><%= Spree.t(:status) %>:</strong>
- </td>
- <td>
- <span class="state badge badge-<%= @order.state %> text-uppercase">
- <%= Spree.t(@order.state, scope: :order_state) %>
- </span>
- </td>
- </tr>
- <tr>
- <td data-hook='admin_order_tab_channel_title'>
- <strong><%= Spree.t(:channel) %>:</strong>
- </td>
- <td id='order_channel'><%= @order.channel %></td>
- </tr>
- <tr>
- <td data-hook='admin_order_tab_subtotal_title'>
- <strong><%= Spree.t(:subtotal) %>:</strong>
- </td>
- <td id='item_total'>
- <%= @order.display_item_total.to_html %>
- </td>
- </tr>
-
- <% if @order.checkout_steps.include?("delivery") && @order.ship_total > 0 %>
- <tr>
- <td data-hook='admin_order_tab_ship_total_title'>
- <strong><%= Spree.t(:ship_total) %>:</strong>
- </td>
- <td id='ship_total'>
- <%= @order.display_ship_total.to_html %>
- </td>
- </tr>
- <% end %>
-
- <% if @order.included_tax_total != 0 %>
- <tr>
- <td data-hook='admin_order_tab_included_tax_title'>
- <strong><%= Spree.t(:tax_included) %>:</strong>
- </td>
- <td id='included_tax_total'>
- <%= @order.display_included_tax_total.to_html %>
- </td>
- </tr>
- <% end %>
-
- <% if @order.additional_tax_total != 0 %>
- <tr>
- <td data-hook='admin_order_tab_additional_tax_title'>
- <strong><%= Spree.t(:tax) %>:</strong>
- </td>
- <td id='additional_tax_total'>
- <%= @order.display_additional_tax_total.to_html %>
- </td>
- </tr>
- <% end %>
-
- <tr>
- <td data-hook='admin_order_tab_total_title'>
- <strong><%= Spree.t(:total) %>:</strong>
- </td>
- <td id='order_total'><%= @order.display_total.to_html %></td>
- </tr>
-
- <% if @order.completed? %>
- <% if @order.shipment_state.present? %>
- <tr>
- <td>
- <strong><%= Spree.t(:shipment) %>:</strong>
- </td>
- <td id='shipment_status'>
- <span class="state badge badge-<%= @order.shipment_state %> text-uppercase">
- <%= Spree.t(@order.shipment_state, scope: :shipment_states, default: [:missing, "none"]) %>
- </span>
- </td>
- </tr>
- <% end %>
- <% if @order.payment_state.present? %>
- <tr>
- <td>
- <strong><%= Spree.t(:payment) %>:</strong>
- </td>
- <td id='payment_status'>
- <span class="state badge badge-<%= @order.payment_state %> text-uppercase">
- <%= Spree.t(@order.payment_state, scope: :payment_states, default: [:missing, "none"]) %>
- </span>
- </td>
- </tr>
- <% end %>
- <tr>
- <td data-hook='admin_order_tab_date_completed_title'>
- <strong><%= Spree.t(:date_completed) %>:</strong>
- </td>
- <td id='date_complete'>
- <%= pretty_time(@order.completed_at) %>
- </td>
- </tr>
- <% end %>
-
- <% if @order.approved? %>
- <tr>
- <td><strong><%= Spree.t(:approver) %></strong></td>
- <td><%= @order.approver.try(:email) %></td>
- </tr>
- <tr>
- <td><strong><%= Spree.t(:approved_at) %></strong></td>
- <td><%= pretty_time(@order.approved_at) %></td>
- </tr>
- <% end %>
-
- <% if @order.canceled? && @order.canceler && @order.canceled_at %>
- <tr>
- <td><strong><%= Spree.t(:canceler) %></strong></td>
- <td><%= @order.canceler.email %></td>
- </tr>
- <tr>
- <td><strong><%= Spree.t(:canceled_at) %></strong></td>
- <td><%= pretty_time(@order.canceled_at) %></td>
- </tr>
- <% end %>
- </tbody>
- </table>
- </div>
-</div>
diff --git a/backend/app/views/spree/admin/shared/_order_tabs.html.erb b/backend/app/views/spree/admin/shared/_order_tabs.html.erb
deleted file mode 100644
index c89be75730..0000000000
--- a/backend/app/views/spree/admin/shared/_order_tabs.html.erb
+++ /dev/null
@@ -1,93 +0,0 @@
-<% content_for :page_title do %>
- <%= link_to Spree.t(:orders), spree.admin_orders_path %> /
- <%= link_to @order.number, spree.edit_admin_order_path(@order) %>
-<% end %>
-
-<% content_for :sidebar do %>
- <ul class="nav flex-column nav-pills" data-hook="admin_order_tabs">
- <% if ((can? :update, @order) && (@order.shipments.size.zero? || @order.shipments.shipped.size.zero?)) %>
- <li data-hook='admin_order_tabs_cart_details'>
- <%= link_to_with_icon 'cart.svg',
- Spree.t(:cart),
- cart_admin_order_url(@order),
- class: "#{'active' if current == :cart} nav-link" %>
- </li>
- <% end %>
-
- <% if can? :update, @order %>
- <li data-hook='admin_order_tabs_channel_details'>
- <%= link_to_with_icon 'split.svg',
- Spree.t(:channel),
- channel_admin_order_url(@order),
- class: "#{'active' if current == :channel} nav-link" %>
- </li>
- <% end %>
-
- <% if can?(:update, @order) && @order.checkout_steps.include?("address") %>
- <li data-hook='admin_order_tabs_customer_details'>
- <%= link_to_with_icon 'user.svg',
- Spree.t(:customer),
- spree.admin_order_customer_url(@order),
- class: "#{'active' if current == :customer_details} nav-link" %>
- </li>
- <% end %>
-
- <% if can? :update, @order %>
- <li data-hook='admin_order_tabs_shipment_details'>
- <%= link_to_with_icon 'shipping.svg',
- Spree.t(:shipments),
- edit_admin_order_url(@order),
- class: "#{'active' if current == :shipments} nav-link" %>
- </li>
- <% end %>
-
- <% if can? :index, Spree::Adjustment %>
- <li data-hook='admin_order_tabs_adjustments'>
- <%= link_to_with_icon 'adjust.svg',
- Spree.t(:adjustments),
- spree.admin_order_adjustments_url(@order),
- class: "#{'active' if current == :adjustments} nav-link" %>
- </li>
- <% end %>
-
- <% if can?(:index, Spree::Payment) %>
- <li data-hook='admin_order_tabs_payments'>
- <%= link_to_with_icon 'payments.svg',
- Spree.t(:payments),
- spree.admin_order_payments_url(@order),
- class: "#{'active' if current == :payments} nav-link" %>
- </li>
- <% end %>
-
- <% if can? :index, Spree::ReturnAuthorization %>
- <% if @order.completed? %>
- <li data-hook='admin_order_tabs_return_authorizations'>
- <%= link_to_with_icon 'enter.svg',
- Spree.t(:return_authorizations),
- spree.admin_order_return_authorizations_url(@order),
- class: "#{'active' if current == :return_authorizations} nav-link" %>
- </li>
- <% end %>
- <% end %>
-
- <% if can? :index, Spree::CustomerReturn %>
- <% if @order.completed? %>
- <li>
- <%= link_to_with_icon 'returns.svg',
- Spree.t(:customer_returns),
- spree.admin_order_customer_returns_url(@order),
- class: "#{'active' if current == :customer_returns} nav-link" %>
- </li>
- <% end %>
- <% end %>
-
- <% if can? :update, @order %>
- <li data-hook='admin_order_tabs_state_changes'>
- <%= link_to_with_icon 'save.svg',
- Spree::StateChange.human_attribute_name(:state_changes),
- spree.admin_order_state_changes_url(@order),
- class: "#{'active' if current == :state_changes} nav-link" %>
- </li>
- <% end %>
- </ul>
-<% end %>
diff --git a/backend/app/views/spree/admin/shared/_paths.html.erb b/backend/app/views/spree/admin/shared/_paths.html.erb
deleted file mode 100644
index d8fa9c7062..0000000000
--- a/backend/app/views/spree/admin/shared/_paths.html.erb
+++ /dev/null
@@ -1,8 +0,0 @@
-<script>
- SpreePaths = <%==
- {
- mounted_at: Rails.application.routes.url_helpers.spree_path(trailing_slash: true),
- admin: Spree.admin_path.gsub(/\A(\/)?(.*[^\/])(\/)?\z/, '\\2/')
- }.to_json
- %>
-</script>
diff --git a/backend/app/views/spree/admin/shared/_product_tabs.html.erb b/backend/app/views/spree/admin/shared/_product_tabs.html.erb
deleted file mode 100644
index b465eb3e1d..0000000000
--- a/backend/app/views/spree/admin/shared/_product_tabs.html.erb
+++ /dev/null
@@ -1,56 +0,0 @@
-<% content_for :page_title do %>
- <%= link_to Spree.t(:products), admin_products_path %> /
- <%= @product.name %>
-<% end %>
-
-<% content_for :sidebar do %>
- <ul class="nav flex-column nav-pills" data-hook="admin_product_tabs">
- <%= content_tag :li do %>
- <%= link_to_with_icon 'edit.svg',
- Spree.t(:details),
- edit_admin_product_url(@product),
- class: "nav-link #{'active' if current == :details}" %>
-
- <% end if can?(:admin, Spree::Product) %>
-
- <%= content_tag :li do %>
- <%= link_to_with_icon 'images.svg',
- Spree.t(:images),
- spree.admin_product_images_url(@product),
- class: "nav-link #{'active' if current == :images}" %>
-
- <% end if can?(:admin, Spree::Image) && [email protected]? %>
-
- <%= content_tag :li do %>
- <%= link_to_with_icon 'adjust.svg',
- Spree.t(:variants),
- spree.admin_product_variants_url(@product),
- class: "nav-link #{'active' if current == :variants}" %>
-
- <% end if can?(:admin, Spree::Variant) && [email protected]? %>
-
- <%= content_tag :li do %>
- <%= link_to_with_icon 'list.svg',
- Spree.t(:properties),
- spree.admin_product_product_properties_url(@product),
- class: "nav-link #{'active' if current == :properties}" %>
-
- <% end if can?(:admin, Spree::ProductProperty) && [email protected]? %>
-
- <%= content_tag :li do %>
- <%= link_to_with_icon 'items.svg',
- Spree.t(:stock),
- stock_admin_product_url(@product),
- class: "nav-link #{'active' if current == :stock}" %>
-
- <% end if can?(:admin, Spree::StockItem) && [email protected]? %>
-
- <%= content_tag :li do %>
- <%= link_to_with_icon 'money.svg',
- Spree.t(:prices),
- admin_product_prices_path(@product),
- class: "nav-link #{'active' if current == :prices}" %>
-
- <% end if can?(:admin, Spree::Price) && [email protected]? %>
- </ul>
-<% end %>
diff --git a/backend/app/views/spree/admin/shared/_refunds.html.erb b/backend/app/views/spree/admin/shared/_refunds.html.erb
deleted file mode 100644
index 67ce46b7fb..0000000000
--- a/backend/app/views/spree/admin/shared/_refunds.html.erb
+++ /dev/null
@@ -1,36 +0,0 @@
-<div class="table-responsive">
- <table class="table table-condensed table-bordered" id='refunds' data-order-id='<%= @order.number %>'>
- <thead>
- <tr data-hook="refunds_header">
- <th><%= "#{Spree.t('date')}/#{Spree.t('time')}" %></th>
- <th><%= Spree.t(:payment_identifier) %></th>
- <th><%= Spree.t(:amount) %></th>
- <th><%= Spree.t(:payment_method) %></th>
- <th><%= Spree.t(:transaction_id) %></th>
- <th><%= Spree.t(:reason) %></th>
- <% if show_actions %>
- <th></th>
- <% end %>
- </tr>
- </thead>
- <tbody>
- <% refunds.each do |refund| %>
- <tr id="<%= dom_id(refund) %>" data-hook="refunds_row" class="<%= cycle('odd', 'even', name: 'refund_table_cycle') %>">
- <td><%= pretty_time(refund.created_at) %></td>
- <td><%= link_to refund.payment.number, spree.admin_order_payment_path(refund.payment.order, refund.payment) %></td>
- <td class="amount"><%= refund.display_amount %></td>
- <td><%= payment_method_name(refund.payment) %></td>
- <td><%= refund.transaction_id %></td>
- <td><%= truncate(refund.reason.name, length: 100) %></td>
- <% if show_actions %>
- <td class="actions">
- <span class="d-flex justify-content-end">
- <%= link_to_with_icon('edit.svg', Spree.t(:edit), edit_admin_order_payment_refund_path(refund.payment.order, refund.payment, refund), no_text: true, class: "btn btn-outline-secondary btn-sm") if can?(:edit, refund) %>
- </span>
- </td>
- <% end %>
- </tr>
- <% end %>
- </tbody>
- </table>
-</div>
diff --git a/backend/app/views/spree/admin/shared/_report_order_criteria.html.erb b/backend/app/views/spree/admin/shared/_report_order_criteria.html.erb
deleted file mode 100644
index 83a8cb479a..0000000000
--- a/backend/app/views/spree/admin/shared/_report_order_criteria.html.erb
+++ /dev/null
@@ -1,40 +0,0 @@
-<%= search_form_for @search, url: spree.sales_total_admin_reports_path do |s| %>
- <div class="form-group date-range-filter">
- <%= label_tag nil, Spree.t(:date_range) %>
- <div class="date-range-filter row">
- <div class="col-12 col-md-6 mb-3 mb-md-0">
- <div class="input-group datePickerFrom"
- data-wrap="true"
- data-alt-format="<%= Spree.t(:fpr_human_friendly_date_format, scope: 'date_picker', default: 'M j, Y') %>"
- data-max-date="<%= params[:q][:completed_at_lt] %>">
- <%= s.text_field :completed_at_gt,
- class: 'form-control shadow-none',
- placeholder: Spree.t(:starting_from),
- value: datepicker_field_value(params[:q][:completed_at_gt]),
- 'data-input':'' %>
-
- <%= render partial: 'spree/admin/shared/cal_close' %>
- </div>
- </div>
-
- <div class="col-12 col-md-6 mt-3 mt-md-0">
- <div class="input-group datePickerTo"
- data-wrap="true"
- data-alt-format="<%= Spree.t(:fpr_human_friendly_date_format, scope: 'date_picker', default: 'M j, Y') %>"
- data-min-date="<%= params[:q][:completed_at_gt] %>">
-
- <%= s.text_field :completed_at_lt,
- class: 'form-control shadow-none',
- placeholder: Spree.t(:ending_at),
- value: datepicker_field_value(params[:q][:completed_at_lt]),
- 'data-input':'' %>
- <%= render partial: 'spree/admin/shared/cal_close' %>
- </div>
- </div>
- </div>
- </div>
-
- <div class="form-actions">
- <%= button Spree.t(:search), 'search.svg' %>
- </div>
-<% end %>
diff --git a/backend/app/views/spree/admin/shared/_sidebar.html.erb b/backend/app/views/spree/admin/shared/_sidebar.html.erb
deleted file mode 100644
index 36953d30d7..0000000000
--- a/backend/app/views/spree/admin/shared/_sidebar.html.erb
+++ /dev/null
@@ -1,23 +0,0 @@
-<div class="d-lg-none page-actions__close border-bottom text-right">
- <button
- id="contextual-menu-close"
- class="btn btn-link"
- type="button"
- aria-expanded="false"
- aria-label="Toggle page actions">
- <%= svg_icon name: "cancel.svg", width: '20', height: '20' %>
- </button>
-</div>
-<% if content_for?(:page_actions) %>
- <div class="page-actions d-lg-none col-12 px-0 <% if content_for?(:sidebar) %>pb-3<% end %> text-center" data-hook="toolbar">
- <div class="d-flex justify-content-center flex-wrap">
- <%= yield :page_actions %>
- </div>
- </div>
-<% end %>
-
-<% if content_for?(:sidebar) %>
- <aside id="sidebar" class="main-right-sidebar px-0 pl-lg-2" data-hook>
- <%= yield :sidebar %>
- </aside>
-<% end %>
diff --git a/backend/app/views/spree/admin/shared/_store_switcher.html.erb b/backend/app/views/spree/admin/shared/_store_switcher.html.erb
deleted file mode 100644
index be3336bc87..0000000000
--- a/backend/app/views/spree/admin/shared/_store_switcher.html.erb
+++ /dev/null
@@ -1,23 +0,0 @@
-<% if can?(:admin, current_store) %>
- <span class="d-none d-lg-inline text-light">
- <%= svg_icon name: "spree-icon.svg", width: '35', height: '35' %>
- </span>
-
- <a class="px-0 py-1 btn text-light" id="storeSelectorDropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
- <span class="d-sm-none"><%= svg_icon name: "store.svg", width: '18', height: '18' %></span>
- <span class="d-none d-sm-inline"><%= current_store.name %></span> (<%= current_store.code %>) <%= svg_icon name: "chevron-down.svg", width: '12', height: '12', classes: 'ml-1 mb-0' %>
- </a>
-
- <div class="dropdown-menu dropdown-menu-left overflow-hidden ml-lg-2 mt-2 py-0" aria-labelledby="storeSelectorDropdown">
- <% @stores.each do |store| %>
- <%= store_switcher_link(store) %>
- <% end %>
-
- <% if can?(:create, Spree::Store) %>
- <div class="dropdown-divider m-0"></div>
- <%= link_to spree.new_admin_store_path, class: 'text-dark p-3 dropdown-item', id: 'addNewStoreLink' do %>
- <%= svg_icon name: "add.svg", width: '18', height: '18' %> <%= Spree.t(:add_new_store) %>
- <% end %>
- <% end %>
- </div>
-<% end %>
diff --git a/backend/app/views/spree/admin/shared/_table_filter.html.erb b/backend/app/views/spree/admin/shared/_table_filter.html.erb
deleted file mode 100644
index 6ec870029a..0000000000
--- a/backend/app/views/spree/admin/shared/_table_filter.html.erb
+++ /dev/null
@@ -1,26 +0,0 @@
-<% if content_for?(:table_filter) %>
- <div class="filter-wrap pb-1">
- <div class="col-12 px-0">
- <div class="input-group index-filter-button flex-nowrap">
- <span class="input-group-btn">
- <button class="btn js-show-index-filters m-0" type="button">
- <%= svg_icon name: "chevron-right.svg", width: '12', height: '12' %>
- <span class="d-none d-sm-inline"><%= Spree.t(:filter) %></span>
- </button>
- </span>
- <%= form_tag request.fullpath, id: "quick-search", class: 'flex-grow-1' do %>
- <%= text_field_tag :quick_search, nil, class: "form-control js-quick-search", placeholder: Spree.t(:search_by) %>
- <% end %>
- </div>
- <% unless defined?(simple) %>
- <div id="table-filter" data-hook class="card bg-light filter-well">
- <div class="card-body">
- <%= yield :table_filter %>
- </div>
- </div>
- <% end %>
- </div>
- </div>
-
- <div class="table-active-filters js-filters"></div>
-<% end %>
diff --git a/backend/app/views/spree/admin/shared/_translations.html.erb b/backend/app/views/spree/admin/shared/_translations.html.erb
deleted file mode 100644
index fbab291135..0000000000
--- a/backend/app/views/spree/admin/shared/_translations.html.erb
+++ /dev/null
@@ -1,54 +0,0 @@
-<script>
- Spree.translations = <%==
- { abbr_day_names: I18n.t(:abbr_day_names, scope: :date),
- add: Spree.t(:add),
- are_you_sure: Spree.t(:are_you_sure),
- are_you_sure_delete: Spree.t(:are_you_sure_delete),
- bill_address: Spree.t(:bill_address),
- cancel: Spree.t(:cancel, scope: :actions),
- choose_a_customer: Spree.t(:choose_a_customer),
- confirm_delete: Spree.t(:confirm_delete),
- currency_separator: I18n.t('number.currency.format.separator'),
- cut: Spree.t(:cut),
- destroy: Spree.t(:destroy, scope: :actions),
- edit: Spree.t(:edit, scope: :actions),
- find_a_taxon: Spree.t(:find_a_taxon),
- item_stock_placeholder: Spree.t(:choose_location),
- loading: Spree.t(:loading),
- month_names: I18n.t(:month_names, scope: :date).instance_eval {|o|
- o.try(:reject, &:blank?) || o},
- more: Spree.t(:more),
- move_could_not_be_saved: Spree.t('admin.navigation.move_could_not_be_saved'),
- name: Spree.t(:name),
- new_taxon: Spree.t(:new_taxon),
- next: Spree.t(:next),
- no_results: Spree.t(:no_results),
- option_type_placeholder: Spree.t(:option_type_placeholder),
- paste: Spree.t(:paste),
- previous: Spree.t(:previous),
- remove: Spree.t(:remove),
- rename: Spree.t(:rename),
- save: Spree.t(:save, scope: :actions),
- search: Spree.t(:search),
- searching: Spree.t(:searching),
- server_error: Spree.t(:server_error),
- select_an_option: Spree.t(:select_an_option),
- sku: Spree.t(:sku),
- type_to_search: Spree.t(:type_to_search),
- taxon_placeholder: Spree.t(:taxon_placeholder),
- taxonomy_tree_error: Spree.t(:taxonomy_tree_error),
- tags_placeholder: Spree.t(:tags_placeholder),
- tracking: Spree.t(:tracking),
- variant_placeholder: Spree.t(:variant_placeholder),
- value: Spree.t(:value),
-
- # Substitute - for _ converting zh-tw to zh_tw
- # Flatpickr not making things easy here.
- flatpickr_locale: "#{flatpickr_local_fallback.sub("-", "_")}"
-
- }.to_json
-%>
-</script>
-
-<%= javascript_include_tag "select2_locale_#{select2_local_fallback}" %>
-<%= javascript_include_tag "flatpickr/l10n/#{flatpickr_local_fallback}" %>
diff --git a/backend/app/views/spree/admin/shared/_update_order_state.js.erb b/backend/app/views/spree/admin/shared/_update_order_state.js.erb
deleted file mode 100644
index 0c9d9fa7ad..0000000000
--- a/backend/app/views/spree/admin/shared/_update_order_state.js.erb
+++ /dev/null
@@ -1,11 +0,0 @@
-$('#order_tab_summary h5#order_status').html('<%= j Spree.t(:status) %>: <%= j Spree.t(@order.state, scope: :order_state) %>');
-$('#order_tab_summary h5#order_total').html('<%= j Spree.t(:total) %>: <%= j @order.display_total.to_html %>');
-
-<% if @order.completed? %>
- <% if @order.payment_state.present? %>
- $('#order_tab_summary h5#payment_status').html('<%= j Spree.t(:payment) %>: <%= j Spree.t(@order.payment_state, scope: :payment_states, default: [:missing, "none"]) %>');
- <% end %>
- <% if @order.shipment_state.present? %>
- $('#order_tab_summary h5#shipment_status').html('<%= j Spree.t(:shipment) %>: <%= j Spree.t(@order.shipment_state, scope: :shipment_state, default: [:missing, "none"]) %>');
- <% end %>
-<% end %>
diff --git a/backend/app/views/spree/admin/shared/_update_store_credit.js.erb b/backend/app/views/spree/admin/shared/_update_store_credit.js.erb
deleted file mode 100644
index 2cf98ac354..0000000000
--- a/backend/app/views/spree/admin/shared/_update_store_credit.js.erb
+++ /dev/null
@@ -1 +0,0 @@
-$('#user-lifetime-stats #store_credit').html('<%= Spree::Money.new(@user.total_available_store_credit) %>');
diff --git a/backend/app/views/spree/admin/shared/_version.html.erb b/backend/app/views/spree/admin/shared/_version.html.erb
deleted file mode 100644
index 9d379a6ee4..0000000000
--- a/backend/app/views/spree/admin/shared/_version.html.erb
+++ /dev/null
@@ -1,7 +0,0 @@
-<% if can?(:admin, current_store) && Spree::Backend::Config[:admin_show_version] %>
- <small
- class="spree-version font-weight-bold ml-3 my-3 text-muted"
- aria-label="Spree Commerce version">
- <%= Spree.version %>
- </small>
-<% end %>
diff --git a/backend/app/views/spree/admin/shared/cms/_spree_product.html.erb b/backend/app/views/spree/admin/shared/cms/_spree_product.html.erb
deleted file mode 100644
index f397452937..0000000000
--- a/backend/app/views/spree/admin/shared/cms/_spree_product.html.erb
+++ /dev/null
@@ -1,27 +0,0 @@
-<%= f.field_container save_to, class: ['form-group'] do %>
- <%= f.label save_to, Spree.t('admin.cms.link_to_product') %>
- <%= f.select save_to, options_from_collection_for_select([resource], save_to, save_to, resource.send(save_to) || nil), { include_blank: true },
- id: "cms_section_#{save_to}",
- data: { autocomplete_placeholder_value: Spree.t('admin.navigation.seach_for_a_product'),
- autocomplete_clear_value: true,
- autocomplete_url_value: 'products_api_v2',
- autocomplete_return_attr_value: 'name',
- autocomplete_custom_return_id_value: 'slug' } %>
-
- <%= f.error_message_on :save_to %>
-<% end %>
-
-<% if resource.link_one.present? %>
- <script>
- populateSelectOptionsFromApi({
- targetElement: "#cms_section_<%= save_to %>",
- apiUrl: Spree.routes.products_api_v2 + "?filter[slug_matches]=<%= resource.send(save_to) %>",
- returnValueFromAttributes: 'slug',
- returnOptionText: 'name',
-
- <% if resource.send(save_to) %>
- selectedOption: "<%= resource.send(save_to) %>"
- <% end %>
- })
- </script>
-<% end %>
diff --git a/backend/app/views/spree/admin/shared/cms/_spree_taxon.html.erb b/backend/app/views/spree/admin/shared/cms/_spree_taxon.html.erb
deleted file mode 100644
index 780907afa3..0000000000
--- a/backend/app/views/spree/admin/shared/cms/_spree_taxon.html.erb
+++ /dev/null
@@ -1,27 +0,0 @@
-<%= f.field_container save_to, class: ['form-group'] do %>
- <%= f.label save_to, Spree.t('admin.cms.link_to_taxon') %>
- <%= f.select save_to, options_from_collection_for_select([resource], save_to, save_to, resource.send(save_to) || nil), { include_blank: true },
- id: "cms_section_#{save_to}",
- data: { autocomplete_placeholder_value: Spree.t('admin.navigation.seach_for_a_taxon'),
- autocomplete_clear_value: true,
- autocomplete_url_value: 'taxons_api_v2',
- autocomplete_return_attr_value: 'pretty_name',
- autocomplete_custom_return_id_value: 'permalink' } %>
-
- <%= f.error_message_on :save_to %>
-<% end %>
-
-<% if resource.link_one.present? %>
- <script>
- populateSelectOptionsFromApi({
- targetElement: "#cms_section_<%= save_to %>",
- apiUrl: Spree.routes.taxons_api_v2 + "?filter[permalink_matches]=<%= resource.send(save_to) %>",
- returnValueFromAttributes: 'permalink',
- returnOptionText: 'pretty_name',
-
- <% if resource.send(save_to) %>
- selectedOption: "<%= resource.send(save_to) %>"
- <% end %>
- })
- </script>
-<% end %>
diff --git a/backend/app/views/spree/admin/shared/linkables/_home_page.html.erb b/backend/app/views/spree/admin/shared/linkables/_home_page.html.erb
deleted file mode 100644
index 9437dd56e8..0000000000
--- a/backend/app/views/spree/admin/shared/linkables/_home_page.html.erb
+++ /dev/null
@@ -1,3 +0,0 @@
-<div class="alert alert-info mt-3">
- <%= Spree.t('admin.navigation.this_link_takes_you_to_your_stores_home_page') %>
-</div>
diff --git a/backend/app/views/spree/admin/shared/linkables/_spree_cms_page.erb b/backend/app/views/spree/admin/shared/linkables/_spree_cms_page.erb
deleted file mode 100644
index 525ed9cc53..0000000000
--- a/backend/app/views/spree/admin/shared/linkables/_spree_cms_page.erb
+++ /dev/null
@@ -1,23 +0,0 @@
-<% if resource.linked_resource %>
- <% resorce_holder = [resource.linked_resource] %>
- <% id_holder = :id %>
- <% name_holder = :title %>
- <% active_id_holder = resource.linked_resource.id %>
- <% end %>
- <%= f.field_container :linked_resource_id, class: ['form-group'] do %>
- <%= f.label :linked_resource_id, Spree.t('page') %>
- <%= f.select :linked_resource_id,
- options_from_collection_for_select(resorce_holder || [],
- id_holder, name_holder, active_id_holder || nil),
- { include_blank: true },
- class: 'select2autocomplete',
- data: { autocomplete_placeholder_value: Spree.t('admin.linkable.seach_for_a_page'),
- autocomplete_clear_value: true,
- autocomplete_url_value: 'pages_api_v2',
- autocomplete_return_attr_value: 'title',
- autocomplete_search_query_value: 'title_i_cont',
- autocomplete_additional_url_params_value: 'filter[type_not_eq]=Spree::Cms::Pages::Homepage' } %>
-
- <%= f.error_message_on :linked_resource_id %>
- <small class="form-text text-muted"><%= resource.link %></small>
-<% end %>
diff --git a/backend/app/views/spree/admin/shared/linkables/_spree_product.html.erb b/backend/app/views/spree/admin/shared/linkables/_spree_product.html.erb
deleted file mode 100644
index 8339130a61..0000000000
--- a/backend/app/views/spree/admin/shared/linkables/_spree_product.html.erb
+++ /dev/null
@@ -1,20 +0,0 @@
-<% if resource.linked_resource %>
- <% resorce_holder = [resource.linked_resource] %>
- <% id_holder = :id %>
- <% name_holder = :name %>
- <% active_id_holder = resource.linked_resource.id %>
- <% end %>
- <%= f.field_container :linked_resource_id, class: ['form-group'] do %>
- <%= f.label :linked_resource_id, Spree.t('product') %>
- <%= f.select :linked_resource_id,
- options_from_collection_for_select(resorce_holder || [],
- id_holder, name_holder, active_id_holder || nil),
- { include_blank: true },
- class: 'select2autocomplete',
- data: { autocomplete_placeholder_value: Spree.t('admin.navigation.seach_for_a_product'),
- autocomplete_clear_value: true,
- autocomplete_url_value: 'products_api_v2' } %>
-
- <%= f.error_message_on :linked_resource_id %>
- <small class="form-text text-muted"><%= resource.link %></small>
-<% end %>
diff --git a/backend/app/views/spree/admin/shared/linkables/_spree_taxon.html.erb b/backend/app/views/spree/admin/shared/linkables/_spree_taxon.html.erb
deleted file mode 100644
index 982286afda..0000000000
--- a/backend/app/views/spree/admin/shared/linkables/_spree_taxon.html.erb
+++ /dev/null
@@ -1,22 +0,0 @@
-<% if resource.linked_resource %>
- <% resource_holder = [resource.linked_resource] %>
- <% id_holder = :id %>
- <% name_holder = :pretty_name %>
- <% active_id_holder = resource.linked_resource.id %>
- <% end %>
-
- <%= f.field_container :linked_resource_field, class: ['form-group'] do %>
- <%= f.label :linked_resource_id, Spree.t('taxon') %>
- <%= f.select :linked_resource_id,
- options_from_collection_for_select(resource_holder || [],
- id_holder, name_holder, active_id_holder || nil),
- { include_blank: true },
- class: 'select2autocomplete',
- data: { autocomplete_placeholder_value: Spree.t('admin.navigation.seach_for_a_taxon'),
- autocomplete_clear_value: true,
- autocomplete_url_value: 'taxons_api_v2',
- autocomplete_return_attr_value: 'pretty_name' } %>
-
- <%= f.error_message_on :linked_resource_id %>
- <small class="form-text text-muted"><%= resource.link %></small>
- <% end %>
diff --git a/backend/app/views/spree/admin/shared/linkables/_url.html.erb b/backend/app/views/spree/admin/shared/linkables/_url.html.erb
deleted file mode 100644
index 5ff45fe4e0..0000000000
--- a/backend/app/views/spree/admin/shared/linkables/_url.html.erb
+++ /dev/null
@@ -1,16 +0,0 @@
-<%= f.field_container :destination, class: ['form-group'] do %>
- <%= f.label :destination, Spree.t(:url) %>
- <%= f.text_field :destination, class: 'form-control' %>
- <%= f.error_message_on :destination %>
- <small class="form-text text-muted">
- <%= raw Spree.t('admin.navigation.url_info') %>
- </small>
-<% end %>
-
-<%= f.field_container :new_window do %>
- <div class="custom-control custom-checkbox">
- <%= f.check_box :new_window, class: 'custom-control-input' %>
- <%= f.label :new_window, Spree.t('admin.navigation.open_link_in_new_window'), class: 'custom-control-label' %>
- <%= f.error_message_on :new_window %>
- </div>
-<% end %>
diff --git a/backend/app/views/spree/admin/shared/named_types/_edit.html.erb b/backend/app/views/spree/admin/shared/named_types/_edit.html.erb
deleted file mode 100644
index eb7aa10f62..0000000000
--- a/backend/app/views/spree/admin/shared/named_types/_edit.html.erb
+++ /dev/null
@@ -1,13 +0,0 @@
-<% content_for :page_title do %>
- <%= link_to collection_url_label, collection_url %> /
- <%= @object.name %>
-<% end %>
-
-<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @object } %>
-
-<%= form_for [:admin, @object] do |f| %>
- <fieldset>
- <%= render partial: 'spree/admin/shared/named_types/form', locals: { f: f } %>
- <%= render partial: 'spree/admin/shared/edit_resource_links' %>
- </fieldset>
-<% end %>
diff --git a/backend/app/views/spree/admin/shared/named_types/_form.html.erb b/backend/app/views/spree/admin/shared/named_types/_form.html.erb
deleted file mode 100644
index 24fccc09b9..0000000000
--- a/backend/app/views/spree/admin/shared/named_types/_form.html.erb
+++ /dev/null
@@ -1,13 +0,0 @@
-<div data-hook="admin_named_type_form_fields">
- <%= f.field_container :name, class: ['form-group'] do %>
- <%= f.label :name, Spree.t(:name) %> <span class="required">*</span>
- <%= f.text_field :name, class: 'form-control' %>
- <%= f.error_message_on :name %>
- <% end %>
- <div class="form-group checkbox">
- <%= label_tag :active do %>
- <%= f.check_box :active %>
- <%= Spree.t(:active) %>
- <% end %>
- </div>
-</div>
diff --git a/backend/app/views/spree/admin/shared/named_types/_index.html.erb b/backend/app/views/spree/admin/shared/named_types/_index.html.erb
deleted file mode 100644
index 9797d15413..0000000000
--- a/backend/app/views/spree/admin/shared/named_types/_index.html.erb
+++ /dev/null
@@ -1,46 +0,0 @@
-<% content_for :page_title do %>
- <%= page_title %>
-<% end %>
-
-<% content_for :page_actions do %>
- <%= button_link_to new_button_text, new_object_url, { icon: 'add.svg', id: 'admin_new_named_type', class: "btn-success" } %>
-<% end if can? :create, resource %>
-
-<% if @collection.any? %>
-<div class="table-responsive">
- <table class="table" id='listing_named_types' data-hook>
- <thead>
- <tr data-hook="named_types_header">
- <th><%= Spree.t(:name) %></th>
- <th><%= Spree.t(:status) %></th>
- <th></th>
- </tr>
- </thead>
- <tbody id="<%= resource_name.to_s.parameterize.underscore %>">
- <% @collection.each do |named_type| %>
- <tr id="<%= spree_dom_id named_type %>" data-hook="named_type_row">
- <td class="align-center">
- <%= named_type.name %>
- </td>
- <td class="align-center">
- <%= active_badge(named_type.active, label: Spree.t(named_type.active? ? :active : :inactive)) %>
- </td>
- <td class="actions">
- <span class="d-flex justify-content-end">
- <% if named_type.mutable? %>
- <%= link_to_edit(named_type, no_text: true) if can? :edit, named_type %>
- <%= link_to_delete(named_type, no_text: true) if can? :delete, named_type %>
- <% end %>
- </span>
- </td>
- </tr>
- <% end %>
- </tbody>
- </table>
-</div>
-<% else %>
- <div class="alert alert-info no-objects-found">
- <%= Spree.t(:no_resource_found, resource: resource_name) %>,
- <%= link_to(Spree.t(:add_one), new_object_url) if can? :create, resource %>!
- </div>
-<% end %>
diff --git a/backend/app/views/spree/admin/shared/named_types/_new.html.erb b/backend/app/views/spree/admin/shared/named_types/_new.html.erb
deleted file mode 100644
index ae7e8205f1..0000000000
--- a/backend/app/views/spree/admin/shared/named_types/_new.html.erb
+++ /dev/null
@@ -1,13 +0,0 @@
-<% content_for :page_title do %>
- <%= link_to collection_url_label, collection_url %> /
- <%= page_title %>
-<% end %>
-
-<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @object } %>
-
-<%= form_for [:admin, @object] do |f| %>
- <fieldset>
- <%= render partial: 'spree/admin/shared/named_types/form', locals: { f: f } %>
- <%= render partial: 'spree/admin/shared/new_resource_links' %>
- </fieldset>
-<% end %>
diff --git a/backend/app/views/spree/admin/shared/sub_menu/_configuration.html.erb b/backend/app/views/spree/admin/shared/sub_menu/_configuration.html.erb
deleted file mode 100644
index d15122710c..0000000000
--- a/backend/app/views/spree/admin/shared/sub_menu/_configuration.html.erb
+++ /dev/null
@@ -1,21 +0,0 @@
-<ul data-hook="admin_configurations_sidebar_menu" class="border-top bg-white collapse nav nav-pills nav-stacked" id="sidebar-configuration">
- <%= configurations_sidebar_menu_item(Spree.t(:general_settings), spree.edit_admin_general_settings_path) if can? :manage, Spree::Config %>
- <%= configurations_sidebar_menu_item(Spree.t(:stores), spree.admin_stores_path) if can? :manage, Spree::Store %>
- <%= configurations_sidebar_menu_item(Spree.t(:tax_categories), spree.admin_tax_categories_path) if can? :manage, Spree::TaxCategory %>
- <%= configurations_sidebar_menu_item(Spree.t(:tax_rates), spree.admin_tax_rates_path) if can? :manage, Spree::TaxRate %>
- <%= configurations_sidebar_menu_item(Spree.t(:zones), spree.admin_zones_path) if can? :manage, Spree::Zone %>
- <%= configurations_sidebar_menu_item(Spree.t(:countries), spree.admin_countries_path) if can? :manage, Spree::Country %>
-
- <% if country = current_store.default_country %>
- <%= configurations_sidebar_menu_item(Spree.t(:states), spree.admin_country_states_path(country)) if can? :manage, Spree::Country %>
- <% end %>
-
- <%= configurations_sidebar_menu_item(Spree.t(:payment_methods), spree.admin_payment_methods_path) if can? :manage, Spree::PaymentMethod %>
- <%= configurations_sidebar_menu_item(Spree.t(:shipping_methods), spree.admin_shipping_methods_path) if can? :manage, Spree::ShippingMethod %>
- <%= configurations_sidebar_menu_item(Spree.t(:shipping_categories), spree.admin_shipping_categories_path) if can? :manage, Spree::ShippingCategory %>
- <%= configurations_sidebar_menu_item(Spree.t(:store_credit_categories), spree.admin_store_credit_categories_path) if can? :manage, Spree::StoreCreditCategory %>
- <%= configurations_sidebar_menu_item(Spree.t(:refund_reasons), spree.admin_refund_reasons_path) if can? :manage, Spree::RefundReason %>
- <%= configurations_sidebar_menu_item(Spree.t(:reimbursement_types), spree.admin_reimbursement_types_path) if can? :manage, Spree::ReimbursementType %>
- <%= configurations_sidebar_menu_item(Spree.t(:return_authorization_reasons), spree.admin_return_authorization_reasons_path) if can? :manage, Spree::ReturnAuthorizationReason %>
- <%= configurations_sidebar_menu_item(Spree.t(:roles), spree.admin_roles_path) if can? :manage, Spree::Role %>
-</ul>
diff --git a/backend/app/views/spree/admin/shared/sub_menu/_content.html.erb b/backend/app/views/spree/admin/shared/sub_menu/_content.html.erb
deleted file mode 100644
index 73c4f3b145..0000000000
--- a/backend/app/views/spree/admin/shared/sub_menu/_content.html.erb
+++ /dev/null
@@ -1,4 +0,0 @@
-<ul id="sidebar-content" class="border-top bg-white collapse nav nav-pills nav-stacked" data-hook="admin_content">
- <%= tab :menus, match_path: '/menus', label: Spree.t('admin.tab.navigation') %>
- <%= tab :cms_pages, match_path: '/cms_pages', label: Spree.t('admin.tab.pages') %>
-</ul>
diff --git a/backend/app/views/spree/admin/shared/sub_menu/_product.html.erb b/backend/app/views/spree/admin/shared/sub_menu/_product.html.erb
deleted file mode 100644
index 682f158faf..0000000000
--- a/backend/app/views/spree/admin/shared/sub_menu/_product.html.erb
+++ /dev/null
@@ -1,8 +0,0 @@
-<ul id="sidebar-product" class="border-top bg-white collapse nav nav-pills nav-stacked" data-hook="admin_product_sub_tabs">
- <%= tab :products, match_path: '/products' %>
- <%= tab :option_types, match_path: '/option_types' %>
- <%= tab :properties %>
- <%= tab :prototypes %>
- <%= tab :taxonomies, match_path: '/taxonomies' %>
- <%= tab :taxons, match_path: '/taxons' %>
-</ul>
diff --git a/backend/app/views/spree/admin/shared/sub_menu/_promotion.html.erb b/backend/app/views/spree/admin/shared/sub_menu/_promotion.html.erb
deleted file mode 100644
index 8a549a7025..0000000000
--- a/backend/app/views/spree/admin/shared/sub_menu/_promotion.html.erb
+++ /dev/null
@@ -1,4 +0,0 @@
-<ul id="sidebar-promotions" class="border-top bg-white collapse nav nav-pills nav-stacked" data-hook="admin_promotion_sub_tabs">
- <%= tab :promotions %>
- <%= tab :promotion_categories %>
-</ul>
diff --git a/backend/app/views/spree/admin/shared/sub_menu/_returns.html.erb b/backend/app/views/spree/admin/shared/sub_menu/_returns.html.erb
deleted file mode 100644
index c8aff69cad..0000000000
--- a/backend/app/views/spree/admin/shared/sub_menu/_returns.html.erb
+++ /dev/null
@@ -1,4 +0,0 @@
-<ul id="sidebar-returns" class="border-top bg-white collapse nav nav-pills nav-stacked" data-hook="admin_returns_sub_tabs">
- <%= tab :return_authorizations, url: spree.admin_return_authorizations_path, match_path: '/return_authorizations' if can?(:admin, Spree::ReturnAuthorization) %>
- <%= tab :customer_returns, url: spree.admin_customer_returns_path, match_path: '/customer_returns' if can?(:admin, Spree::CustomerReturn) %>
-</ul>
diff --git a/backend/app/views/spree/admin/shared/sub_menu/_stock.html.erb b/backend/app/views/spree/admin/shared/sub_menu/_stock.html.erb
deleted file mode 100644
index fb29cff606..0000000000
--- a/backend/app/views/spree/admin/shared/sub_menu/_stock.html.erb
+++ /dev/null
@@ -1,4 +0,0 @@
-<ul id="sidebar-stock" class="border-top bg-white collapse nav nav-pills nav-stacked" data-hook="admin_stock_sub_tabs">
- <%= tab(:stock_transfers, spree.admin_stock_transfers_path) if can? :manage, Spree::StockTransfer %>
- <%= tab(:stock_locations, spree.admin_stock_locations_path) if can? :manage, Spree::StockLocation %>
-</ul>
diff --git a/backend/app/views/spree/admin/shipping_categories/_form.html.erb b/backend/app/views/spree/admin/shipping_categories/_form.html.erb
deleted file mode 100644
index 34cc719253..0000000000
--- a/backend/app/views/spree/admin/shipping_categories/_form.html.erb
+++ /dev/null
@@ -1,9 +0,0 @@
-<div data-hook="admin_shipping_category_form_fields">
- <div data-hook="name" class="form-group">
- <%= f.field_container :name, class: ["form-group"] do %>
- <%= f.label :name, Spree.t(:name) %><br>
- <%= f.text_field :name, class: 'form-control' %>
- <%= f.error_message_on :name %>
- <% end %>
- </div>
-</div>
diff --git a/backend/app/views/spree/admin/shipping_categories/edit.html.erb b/backend/app/views/spree/admin/shipping_categories/edit.html.erb
deleted file mode 100644
index 1182cd907a..0000000000
--- a/backend/app/views/spree/admin/shipping_categories/edit.html.erb
+++ /dev/null
@@ -1,11 +0,0 @@
-<% content_for :page_title do %>
- <%= link_to Spree.t(:shipping_categories), spree.admin_shipping_categories_url %> /
- <%= @shipping_category.name %>
-<% end %>
-
-<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @shipping_category } %>
-
-<%= form_for [:admin, @shipping_category] do |f| %>
- <%= render partial: 'form', locals: { f: f } %>
- <%= render partial: 'spree/admin/shared/edit_resource_links' %>
-<% end %>
diff --git a/backend/app/views/spree/admin/shipping_categories/index.html.erb b/backend/app/views/spree/admin/shipping_categories/index.html.erb
deleted file mode 100644
index 862a5e9163..0000000000
--- a/backend/app/views/spree/admin/shipping_categories/index.html.erb
+++ /dev/null
@@ -1,38 +0,0 @@
-<% content_for :page_title do %>
- <%= plural_resource_name(Spree::ShippingCategory) %>
-<% end %>
-
-<% content_for :page_actions do %>
- <%= button_link_to Spree.t(:new_shipping_category), new_object_url, class: "btn-success", icon: 'add.svg' %>
-<% end if can? :create, Spree::ShippingCategory %>
-
-<% if @shipping_categories.any? %>
-<div class="table-responsive">
- <table class="table">
- <thead>
- <tr data-hook="categories_header">
- <th><%= Spree.t(:name) %></th>
- <th class="actions"></th>
- </tr>
- </thead>
- <tbody>
- <% @shipping_categories.each do |shipping_category| %>
- <tr id="<%= spree_dom_id shipping_category %>" data-hook="category_row">
- <td><%= shipping_category.name %></td>
- <td class="actions">
- <span class="d-flex justify-content-end">
- <%= link_to_edit(shipping_category, no_text: true) if can? :edit, shipping_category %>
- <%= link_to_delete(shipping_category, no_text: true) if can? :edit, shipping_category %>
- </span>
- </td>
- </tr>
- <% end %>
- </tbody>
- </table>
-</div>
-<% else %>
- <div class="alert alert-info no-objects-found">
- <%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree::ShippingCategory)) %>,
- <%= link_to(Spree.t(:add_one), new_object_url) if can? :create, Spree::ShippingCategory %>!
- </div>
-<% end %>
diff --git a/backend/app/views/spree/admin/shipping_categories/new.html.erb b/backend/app/views/spree/admin/shipping_categories/new.html.erb
deleted file mode 100644
index 33ebae42e5..0000000000
--- a/backend/app/views/spree/admin/shipping_categories/new.html.erb
+++ /dev/null
@@ -1,13 +0,0 @@
-<% content_for :page_title do %>
- <%= link_to Spree.t(:shipping_categories), spree.admin_shipping_categories_url %> /
- <%= Spree.t(:new_shipping_category) %>
-<% end %>
-
-<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @shipping_category } %>
-
-<%= form_for [:admin, @shipping_category] do |f| %>
- <fieldset>
- <%= render partial: 'form', locals: { f: f } %>
- <%= render partial: 'spree/admin/shared/new_resource_links' %>
- </fieldset>
-<% end %>
diff --git a/backend/app/views/spree/admin/shipping_methods/_form.html.erb b/backend/app/views/spree/admin/shipping_methods/_form.html.erb
deleted file mode 100644
index 8e2e0bae22..0000000000
--- a/backend/app/views/spree/admin/shipping_methods/_form.html.erb
+++ /dev/null
@@ -1,119 +0,0 @@
-<div data-hook="admin_shipping_method_form_fields">
- <div class="row">
- <div data-hook="admin_shipping_method_form_name_field" class="col-12 col-lg-6">
- <%= f.field_container :name, class: ['form-group'] do %>
- <%= f.label :name, Spree.t(:name) %>
- <%= f.text_field :name, class: 'form-control' %>
- <%= f.error_message_on :name %>
- <% end %>
- </div>
-
- <div data-hook="admin_shipping_method_form_display_field" class="col-12 col-lg-6">
- <%= f.field_container :display_on, class: ['form-group'] do %>
- <%= f.label :display_on, Spree.t(:display) %>
- <%= select(:shipping_method, :display_on, Spree::ShippingMethod::DISPLAY.collect { |display| [Spree.t(display), display.to_s] }, { include_blank: true }, { class: 'select2-clear' }) %>
- <%= f.error_message_on :display_on %>
- <% end %>
- </div>
- </div>
-
- <div class="row">
- <div data-hook="admin_shipping_method_form_internal_name_field" class="col-12 col-lg-4">
- <%= f.field_container :admin_name, class: ['form-group'] do %>
- <%= f.label :admin_name, Spree.t(:internal_name) %>
- <%= f.text_field :admin_name, class: 'form-control', label: false %>
- <%= f.error_message_on :admin_name %>
- <% end %>
- </div>
-
- <div data-hook="admin_shipping_method_form_code" class="col-12 col-lg-4">
- <%= f.field_container :code, class: ['form-group'] do %>
- <%= f.label :code, Spree.t(:code) %>
- <%= f.text_field :code, class: 'form-control', label: false %>
- <%= f.error_message_on :code %>
- <% end %>
- </div>
-
- <div data-hook="admin_shipping_method_form_tracking_url_field" class="col-12 col-lg-4">
- <%= f.field_container :tracking_url, class: ['form-group'] do %>
- <%= f.label :tracking_url, Spree.t(:tracking_url) %>
- <%= f.text_field :tracking_url, class: 'form-control', placeholder: Spree.t(:tracking_url_placeholder) %>
- <%= f.error_message_on :tracking_url %>
- <% end %>
- </div>
- </div>
-</div>
-
-<div class="row">
- <div data-hook="admin_shipping_method_form_availability_fields" class="col-12 col-lg-6">
- <div class="card mb-3 categories">
- <div class="card-header">
- <h1 class="card-title mb-0 h5">
- <%= Spree.t(:shipping_categories) %>
- </h1>
- </div>
-
- <div class="card-body">
- <%= f.field_container :categories, class: ['form-group'] do %>
- <% Spree::ShippingCategory.all.each do |category| %>
- <div class="checkbox">
- <%= label_tag do %>
- <%= check_box_tag('shipping_method[shipping_categories][]', category.id, @shipping_method.shipping_categories.include?(category)) %>
- <%= category.name %>
- <% end %>
- </div>
- <% end %>
- <%= f.error_message_on :shipping_category_id %>
- <% end %>
- </div>
- </div>
- </div>
-
- <div class="col-12 col-lg-6">
- <div class="card mb-3">
- <div class="card-header">
- <h1 class="card-title mb-0 h5">
- <%= Spree.t(:zones) %>
- </h1>
- </div>
-
- <div class="card-body">
- <%= f.field_container :zones, class: ['form-group'] do %>
- <% shipping_method_zones = @shipping_method.zones.to_a %>
- <% Spree::Zone.all.each do |zone| %>
- <div class="checkbox">
- <%= label_tag do %>
- <%= check_box_tag('shipping_method[zones][]', zone.id, shipping_method_zones.include?(zone)) %>
- <%= zone.name %>
- <% end %>
- </div>
- <% end %>
- <%= f.error_message_on :zone_id %>
- <% end %>
- </div>
- </div>
- </div>
-</div>
-
-<div class="row">
- <div data-hook="admin_shipping_method_form_calculator_fields" class="col-12 col-lg-6">
- <%= render partial: 'spree/admin/shared/calculator_fields', locals: { f: f } %>
- </div>
-
- <div class="col-12 col-lg-6">
- <div class="card mb-3 tax_categories">
- <div class="card-header">
- <h1 class="card-title mb-0 h5">
- <%= Spree.t(:tax_category) %>
- </h1>
- </div>
-
- <div class="card-body">
- <%= f.field_container :categories, class: ['form-group'] do %>
- <%= f.select :tax_category_id, @tax_categories.map { |tc| [tc.name, tc.id] }, { include_blank: true }, class: "select2-clear" %>
- <%= f.error_message_on :tax_category_id %>
- <% end %>
- </div>
- </div>
- </div>
-</div>
diff --git a/backend/app/views/spree/admin/shipping_methods/edit.html.erb b/backend/app/views/spree/admin/shipping_methods/edit.html.erb
deleted file mode 100644
index 6b48a69221..0000000000
--- a/backend/app/views/spree/admin/shipping_methods/edit.html.erb
+++ /dev/null
@@ -1,17 +0,0 @@
-<% content_for :page_title do %>
- <%= link_to Spree.t(:shipping_methods), spree.admin_shipping_methods_url %> /
- <%= @shipping_method.name %>
-<% end %>
-
-<div data-hook="admin_shipping_method_edit_form_header">
- <%= render partial: 'spree/admin/shared/error_messages', locals: { target: @shipping_method } %>
-</div>
-
-<div data-hook="admin_shipping_method_edit_form">
- <%= form_for [:admin, @shipping_method] do |f| %>
- <%= render partial: 'form', locals: { f: f } %>
- <div data-hook="admin_shipping_method_edit_form_buttons">
- <%= render partial: 'spree/admin/shared/edit_resource_links' %>
- </div>
- <% end %>
-</div>
diff --git a/backend/app/views/spree/admin/shipping_methods/index.html.erb b/backend/app/views/spree/admin/shipping_methods/index.html.erb
deleted file mode 100644
index fced5b1da4..0000000000
--- a/backend/app/views/spree/admin/shipping_methods/index.html.erb
+++ /dev/null
@@ -1,48 +0,0 @@
-<% content_for :page_title do %>
- <%= plural_resource_name(Spree::ShippingMethod) %>
-<% end %>
-
-<% content_for :page_actions do %>
- <%= button_link_to Spree.t(:new_shipping_method), new_object_url, class: "btn-success", icon: 'add.svg', id: 'admin_new_shipping_method_link' %>
-<% end if can? :create, Spree::ShippingMethod %>
-
-<% if @shipping_methods.any? %>
-<div class="table-responsive">
- <table class="table" id='listing_shipping_methods'>
- <thead>
- <tr data-hook="admin_shipping_methods_index_headers">
- <th><%= Spree.t(:name) %></th>
- <th><%= Spree.t(:zone) %></th>
- <th><%= Spree.t(:calculator) %></th>
- <th class="text-center"><%= Spree.t(:display) %></th>
- <th data-hook="admin_shipping_methods_index_header_actions" class="actions"></th>
- </tr>
- </thead>
- <tbody>
- <% @shipping_methods.includes(:zones, :calculator).each do |shipping_method| %>
- <tr id="<%= spree_dom_id shipping_method %>" data-hook="admin_shipping_methods_index_rows">
- <td><%= shipping_method.admin_name + ' / ' if shipping_method.admin_name.present? %><%= shipping_method.name %></td>
- <td>
- <% shipping_method.zones.each do |zone| %>
- <%= link_to zone.name, spree.edit_admin_zone_path(zone) %>
- <% end %>
- </td>
- <td><%= shipping_method.calculator.description %></td>
- <td class="text-center"><%= shipping_method.display_on.blank? ? Spree.t(:none) : Spree.t(shipping_method.display_on) %></td>
- <td class="actions" data-hook="admin_shipping_methods_index_row_actions">
- <span class="d-flex justify-content-end">
- <%= link_to_edit(shipping_method, no_text: true) if can? :edit, shipping_method %>
- <%= link_to_delete(shipping_method, no_text: true) if can? :delete, shipping_method %>
- </span>
- </td>
- </tr>
- <% end %>
- </tbody>
- </table>
-</div>
-<% else %>
- <div class="alert alert-info no-objects-found">
- <%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree::ShippingMethod)) %>,
- <%= link_to(Spree.t(:add_one), new_object_url) if can? :create, Spree::PaymentMethod %>!
- </div>
-<% end %>
diff --git a/backend/app/views/spree/admin/shipping_methods/new.html.erb b/backend/app/views/spree/admin/shipping_methods/new.html.erb
deleted file mode 100644
index 86128aaeef..0000000000
--- a/backend/app/views/spree/admin/shipping_methods/new.html.erb
+++ /dev/null
@@ -1,20 +0,0 @@
-<% content_for :page_title do %>
- <%= link_to Spree.t(:shipping_methods), spree.admin_shipping_methods_url %> /
- <%= Spree.t(:new_shipping_method) %>
-<% end %>
-
-<div data-hook="admin_shipping_method_new_form_header">
- <%= render partial: 'spree/admin/shared/error_messages', locals: { target: @shipping_method } %>
-</div>
-
-<div data-hook="admin_shipping_method_new_form">
- <%= form_for [:admin, @shipping_method] do |f| %>
- <fieldset>
- <%= render partial: 'form', locals: { f: f } %>
-
- <div data-hook="admin_shipping_method_new_form_buttons">
- <%= render partial: 'spree/admin/shared/new_resource_links' %>
- </div>
- </fieldset>
- <% end %>
-</div>
diff --git a/backend/app/views/spree/admin/state_changes/index.html.erb b/backend/app/views/spree/admin/state_changes/index.html.erb
deleted file mode 100644
index 0137a5ba5a..0000000000
--- a/backend/app/views/spree/admin/state_changes/index.html.erb
+++ /dev/null
@@ -1,48 +0,0 @@
-<%= render partial: 'spree/admin/shared/order_tabs', locals: { current: :state_changes } %>
-
-<% content_for :page_title do %>
- / <%= plural_resource_name(Spree::StateChange) %>
-<% end %>
-
-<% if @state_changes.any? %>
-<div class="table-responsive">
- <table class="table" id="listing_order_state_changes" data-hook>
- <thead>
- <tr data-hook="admin_orders_state_changes_headers">
- <th><%= Spree::StateChange.human_attribute_name(:type) %></th>
- <th><%= Spree::StateChange.human_attribute_name(:state_from) %></th>
- <th><%= Spree::StateChange.human_attribute_name(:state_to) %></th>
- <th><%= Spree::StateChange.human_attribute_name(:user) %></th>
- <th><%= Spree::StateChange.human_attribute_name(:timestamp) %></th>
- </tr>
- </thead>
-
- <tbody>
- <% @state_changes.each do |state_change| %>
- <% scope = state_change.name == 'order' ? "#{ state_change.name }_state" : "#{ state_change.name }_states" -%>
- <tr>
- <td><%= Spree.t("state_machine_states.#{state_change.name}") %></td>
- <td><%= state_change.previous_state ? Spree.t(state_change.previous_state, scope: scope) : Spree.t(:previous_state_missing) %></td>
- <td><%= Spree.t(state_change.next_state, scope: scope) %></td>
- <td>
- <% if state_change.user %>
- <% user_login = state_change.user.try(:login) || state_change.user.try(:email) %>
- <%= link_to user_login, spree.admin_user_path(state_change.user) %>
- <% end %>
- </td>
- <td>
- <%= pretty_time(state_change.created_at) %>
- <% if state_change.created_at != state_change.updated_at %>
- <small><%= Spree::StateChange.human_attribute_name(:updated) %>: <%= pretty_time(state_change.updated_at) %></small>
- <% end %>
- </td>
- </tr>
- <% end %>
- </tbody>
- </table>
-</div>
-<% else %>
- <div class="alert alert-info no-objects-found">
- <%= Spree.t(:no_state_changes) %>
- </div>
-<% end %>
diff --git a/backend/app/views/spree/admin/states/_form.html.erb b/backend/app/views/spree/admin/states/_form.html.erb
deleted file mode 100644
index 38fbb1e080..0000000000
--- a/backend/app/views/spree/admin/states/_form.html.erb
+++ /dev/null
@@ -1,15 +0,0 @@
-<div data-hook="admin_state_form_fields" class="row">
- <div class="col-12 col-md-6">
- <%= f.field_container :name, class: ['form-group'] do %>
- <%= f.label :name, Spree.t(:name) %>
- <%= f.text_field :name, class: 'form-control' %>
- <%= f.error_message_on :name %>
- <% end %>
- </div>
- <div class="col-12 col-md-6">
- <%= f.field_container :abbr, class: ['form-group'] do %>
- <%= f.label :abbr, Spree.t(:abbreviation) %>
- <%= f.text_field :abbr, class: 'form-control' %>
- <% end %>
- </div>
-</div>
diff --git a/backend/app/views/spree/admin/states/_state_list.html.erb b/backend/app/views/spree/admin/states/_state_list.html.erb
deleted file mode 100644
index ff8ef05bec..0000000000
--- a/backend/app/views/spree/admin/states/_state_list.html.erb
+++ /dev/null
@@ -1,29 +0,0 @@
-<div id="new_state" data-hook></div>
-<div class="table-responsive">
- <table class="table" id='listing_states' data-hook>
- <thead>
- <tr data-hook="states_header">
- <th><%= Spree.t(:name) %></th>
- <th class="text-center"><%= Spree.t(:abbreviation) %></th>
- <th class="actions"></th>
- </tr>
- </thead>
- <tbody>
- <% @states.each do |state| %>
- <tr id="<%= spree_dom_id state %>" data-hook="states_row">
- <td><%= state.name %></td>
- <td class="text-center"><%= state.abbr %></td>
- <td class="actions">
- <span class="d-flex justify-content-end">
- <%= link_to_edit(state, no_text: true) if can? :edit, state %>
- <%= link_to_delete(state, no_text: true) if can? :delete, state %>
- </span>
- </td>
- </tr>
- <% end %>
- <% if @states.empty? %>
- <tr><td colspan="3"><%= Spree.t(:none) %></td></tr>
- <% end %>
- </tbody>
- </table>
-</div>
diff --git a/backend/app/views/spree/admin/states/edit.html.erb b/backend/app/views/spree/admin/states/edit.html.erb
deleted file mode 100644
index c9b490dc18..0000000000
--- a/backend/app/views/spree/admin/states/edit.html.erb
+++ /dev/null
@@ -1,13 +0,0 @@
-<% content_for :page_title do %>
- <%= link_to Spree.t(:states), spree.admin_country_states_url(@country) %> /
- <%= @state.name %>
-<% end %>
-
-<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @state } %>
-
-<%= form_for [:admin, @country, @state] do |f| %>
- <fieldset>
- <%= render partial: 'form', locals: { f: f } %>
- <%= render partial: 'spree/admin/shared/edit_resource_links' %>
- </fieldset>
-<% end %>
diff --git a/backend/app/views/spree/admin/states/index.html.erb b/backend/app/views/spree/admin/states/index.html.erb
deleted file mode 100644
index 7677134a38..0000000000
--- a/backend/app/views/spree/admin/states/index.html.erb
+++ /dev/null
@@ -1,18 +0,0 @@
-<% content_for :page_title do %>
- <%= plural_resource_name(Spree::State) %>
-<% end %>
-
-<% content_for :page_actions do %>
- <%= button_link_to Spree.t(:new_state), new_admin_country_state_url(@country), { class: "btn-success", icon: 'add.svg', id: 'new_state_link' } %>
-<% end if can? :create, Spree::State %>
-
-<div data-hook="country" class="form-group">
- <%= label_tag :country, Spree.t(:country) %>
- <select id="country" class='observe_field select2' data-base-url="<%= admin_states_path(format: :js) %>?country_id=" data-update="#state-list">
- <%= options_from_collection_for_select(@countries, :id, :name, @country.id) %>
- </select>
-</div>
-
-<div id="state-list" data-hook>
- <%= render partial: 'state_list' %>
-</div>
diff --git a/backend/app/views/spree/admin/states/new.html.erb b/backend/app/views/spree/admin/states/new.html.erb
deleted file mode 100644
index a3372dace5..0000000000
--- a/backend/app/views/spree/admin/states/new.html.erb
+++ /dev/null
@@ -1,13 +0,0 @@
-<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @state } %>
-
-<% content_for :page_title do %>
- <%= link_to Spree.t(:states), spree.admin_country_states_url(@country) %> /
- <%= Spree.t(:new_state) %>
-<% end %>
-
-<%= form_for [:admin, @country, @state] do |f| %>
- <fieldset>
- <%= render partial: 'form', locals: { f: f } %>
- <%= render partial: 'spree/admin/shared/new_resource_links' %>
- </fieldset>
-<% end %>
diff --git a/backend/app/views/spree/admin/states/new.js.erb b/backend/app/views/spree/admin/states/new.js.erb
deleted file mode 100644
index 89e5cc4ea9..0000000000
--- a/backend/app/views/spree/admin/states/new.js.erb
+++ /dev/null
@@ -1,2 +0,0 @@
-$("#new_state").html("<%= escape_javascript(render template: 'spree/admin/states/new', formats: [:html], handlers: [:erb]) %>");
-$("#new_state_link").hide();
diff --git a/backend/app/views/spree/admin/stock_items/destroy.js.erb b/backend/app/views/spree/admin/stock_items/destroy.js.erb
deleted file mode 100644
index e3c6c133fd..0000000000
--- a/backend/app/views/spree/admin/stock_items/destroy.js.erb
+++ /dev/null
@@ -1 +0,0 @@
-$("#stock-item-<%= @stock_item.id %>").fadeOut();
diff --git a/backend/app/views/spree/admin/stock_locations/_form.html.erb b/backend/app/views/spree/admin/stock_locations/_form.html.erb
deleted file mode 100644
index a82b2c6ce9..0000000000
--- a/backend/app/views/spree/admin/stock_locations/_form.html.erb
+++ /dev/null
@@ -1,87 +0,0 @@
-<div data-hook="admin_stock_locations_form_fields">
- <div class="row">
- <div class="col-12 col-md-9" data-hook="stock_location_names">
- <div data-hook="stock_location_name">
- <%= f.field_container :name, class: ['form-group'] do %>
- <%= f.label :name, Spree.t(:name) %> <span class="required">*</span><br>
- <%= f.text_field :name, class: 'form-control', required: true %>
- <%= f.error_message_on :name %>
- <% end %>
- </div>
- <div data-hook="stock_location_admin_name">
- <%= f.field_container :admin_name, class: ['form-group'] do %>
- <%= f.label :admin_name, Spree.t(:internal_name) %>
- <%= f.text_field :admin_name, class: 'form-control', label: false %>
- <% end %>
- </div>
- </div>
-
- <div class="col-12 col-md-3" data-hook="stock_location_status">
- <strong><%= Spree.t(:status) %></strong>
- <div class="checkbox my-2" data-hook="stock_location_active">
- <%= label_tag :active do %>
- <%= f.check_box :active %>
- <%= Spree.t(:active) %>
- <% end %>
- </div>
- <div class="checkbox my-2" data-hook="stock_location_default">
- <%= label_tag :default do %>
- <%= f.check_box :default %>
- <%= Spree.t(:default) %>
- <% end %>
- </div>
- <div class="checkbox my-2" data-hook="stock_location_backorderable_default">
- <%= label_tag :backorderable_default do %>
- <%= f.check_box :backorderable_default %>
- <%= Spree.t(:backorderable_default) %>
- <% end %>
- </div>
- <div class="checkbox my-2" data-hook="stock_location_propagate_all_variants">
- <%= label_tag :propagate_all_variants do %>
- <%= f.check_box :propagate_all_variants %>
- <%= Spree.t(:propagate_all_variants) %>
- <% end %>
- </div>
- </div>
- </div>
-
- <div class="form-group" data-hook="stock_location_address1">
- <%= f.label :address1, Spree.t(:street_address) %>
- <%= f.text_field :address1, class: 'form-control' %>
- </div>
-
- <div class="form-group" data-hook="stock_location_city">
- <%= f.label :city, Spree.t(:city) %>
- <%= f.text_field :city, class: 'form-control' %>
- </div>
-
- <div class="form-group" data-hook="stock_location_address2">
- <%= f.label :address2, Spree.t(:street_address_2) %>
- <%= f.text_field :address2, class: 'form-control' %>
- </div>
-
- <div class="form-group" data-hook="stock_location_zipcode">
- <%= f.label :zipcode, Spree.t(:zip) %>
- <%= f.text_field :zipcode, class: 'form-control' %>
- </div>
-
- <div class="form-group" data-hook="stock_location_phone">
- <%= f.label :phone, Spree.t(:phone) %>
- <%= f.phone_field :phone, class: 'form-control' %>
- </div>
-
- <div class="form-group" data-hook="stock_location_country">
- <%= f.label :country_id, Spree.t(:country) %>
- <span id="country"><%= f.collection_select :country_id, available_countries, :id, :name, {}, { class: 'select2' } %></span>
- </div>
-
- <div class="form-group" data-hook="stock_location_state">
- <% if f.object.country %>
- <%= f.label :state_id, Spree.t(:state) %>
- <span id="state" class="region">
- <%= f.text_field :state_name, style: "#{f.object.country.states.empty? ? '' : 'display: none;'}", disabled: !f.object.country.states.empty?, class: 'state_name form-control' %>
- <%= f.collection_select :state_id, f.object.country.states.sort, :id, :name, { include_blank: true }, {class: 'select2-clear', style: "#{f.object.country.states.empty? ? 'display: none;' : '' };", disabled: f.object.country.states.empty?} %>
- </span>
- <% end %>
- </div>
-</div>
diff --git a/backend/app/views/spree/admin/stock_locations/_transfer_stock_form.html.erb b/backend/app/views/spree/admin/stock_locations/_transfer_stock_form.html.erb
deleted file mode 100644
index 6dc377db6d..0000000000
--- a/backend/app/views/spree/admin/stock_locations/_transfer_stock_form.html.erb
+++ /dev/null
@@ -1,39 +0,0 @@
-<%= form_tag transfer_stock_admin_stock_locations_path do %>
- <fieldset>
- <legend><%= Spree.t(:move_stock_between_locations) %></legend>
- <div data-hook="admin_stock_movements_form_fields" class="row">
- <div class="col-12 col-md-5">
- <div class="form-group" id="stock_movement_transfer_from_field">
- <%= label_tag :stock_location_from_id, Spree.t(:transfer_from_location) %>
- <%= select_tag :stock_location_from_id, options_from_collection_for_select(@stock_locations, :id, :name), class: 'select2' %>
- </div>
- </div>
- <div class="col-12 col-md-5">
- <div class="form-group" id="stock_movement_transfer_to_field">
- <%= label_tag :stock_location_to_id, Spree.t(:transfer_to_location) %>
- <%= select_tag :stock_location_to_id, options_from_collection_for_select(@stock_locations, :id, :name), class: 'select2' %>
- </div>
- </div>
-
- <div class="col-12 col-md-5">
- <div class="form-group" id="stock_movement_variant_id_field">
- <%= label_tag 'variant_id', Spree.t(:variant) %>
- <%= select_tag :variant_id, options_from_collection_for_select(@variants, :id, :name_and_sku), class: 'select2' %>
- </div>
- </div>
-
- <div class="col-12 col-md-5">
- <div class="form-group" id="stock_movement_quantity_field">
- <%= label_tag 'quantity', Spree.t(:quantity) %>
- <%= number_field_tag :quantity, 1, class: 'form-control' %>
- </div>
- </div>
- </div>
-
- <div class="form-actions" data-hook="buttons">
- <%= button Spree.t(:transfer_stock), 'add' %>
- <span class="or"><%= Spree.t(:or) %></span>
- <%= button_link_to Spree.t('actions.cancel'), collection_url, icon: 'cancel.svg' %>
- </div>
- </fieldset>
-<% end %>
diff --git a/backend/app/views/spree/admin/stock_locations/edit.html.erb b/backend/app/views/spree/admin/stock_locations/edit.html.erb
deleted file mode 100644
index e89acd727d..0000000000
--- a/backend/app/views/spree/admin/stock_locations/edit.html.erb
+++ /dev/null
@@ -1,13 +0,0 @@
-<% content_for :page_title do %>
- <%= link_to Spree.t(:stock_locations), spree.admin_stock_locations_url %> /
- <%= @stock_location.name %>
-<% end %>
-
-<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @stock_location } %>
-
-<%= form_for [:admin, @stock_location] do |f| %>
- <fieldset>
- <%= render partial: 'form', locals: { f: f } %>
- <%= render partial: 'spree/admin/shared/edit_resource_links' %>
- </fieldset>
-<% end %>
diff --git a/backend/app/views/spree/admin/stock_locations/index.html.erb b/backend/app/views/spree/admin/stock_locations/index.html.erb
deleted file mode 100644
index d194d6c834..0000000000
--- a/backend/app/views/spree/admin/stock_locations/index.html.erb
+++ /dev/null
@@ -1,45 +0,0 @@
-<% content_for :page_title do %>
- <%= plural_resource_name(Spree::StockLocation) %>
-<% end %>
-
-<% content_for :page_actions do %>
- <%= button_link_to Spree.t(:new_stock_location), new_object_url, { class: "btn-success", icon: 'add.svg', id: 'admin_new_stock_location' } %>
-<% end if can? :create, Spree::StockLocation %>
-
-<% if @stock_locations.any? %>
-<div class="table-responsive">
- <table class="table" id='listing_stock_locations' data-hook>
- <thead>
- <tr data-hook="stock_locations_header">
- <th><%= Spree.t(:name) %></th>
- <th><%= Spree.t(:stock_movements) %></th>
- <th><%= Spree.t(:status) %></th>
- <th class="actions"></th>
- </tr>
- </thead>
- <tbody>
- <% @stock_locations.each do |stock_location|
- @edit_url = spree.edit_admin_stock_location_path(stock_location)
- @delete_url = spree.admin_stock_location_path(stock_location) %>
-
- <tr id="<%= spree_dom_id stock_location %>" data-hook="stock_location_row">
- <td><%= display_name(stock_location) %></td>
- <td><%= link_to Spree.t(:stock_movements), spree.admin_stock_location_stock_movements_path(stock_location.id) %> </td>
- <td><%= active_badge(stock_location.active, label: Spree.t(state(stock_location))) %></td>
- <td class="actions">
- <span class="d-flex justify-content-end">
- <%= link_to_edit(stock_location, no_text: true) if can? :create, stock_location %>
- <%= link_to_delete(stock_location, no_text: true) if can? :create, stock_location %>
- </span>
- </td>
- </tr>
- <% end %>
- </tbody>
- </table>
-</div>
-<% else %>
- <div class="alert alert-info no-objects-found">
- <%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree::StockLocation)) %>,
- <%= link_to(Spree.t(:add_one), new_object_url) if can? :create, Spree::StockLocation %>!
- </div>
-<% end %>
diff --git a/backend/app/views/spree/admin/stock_locations/new.html.erb b/backend/app/views/spree/admin/stock_locations/new.html.erb
deleted file mode 100644
index a5de1c7765..0000000000
--- a/backend/app/views/spree/admin/stock_locations/new.html.erb
+++ /dev/null
@@ -1,13 +0,0 @@
-<% content_for :page_title do %>
- <%= link_to Spree.t(:stock_locations), spree.admin_stock_locations_url %> /
- <%= Spree.t(:new_stock_location) %>
-<% end %>
-
-<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @stock_location } %>
-
-<%= form_for [:admin, @stock_location] do |f| %>
- <fieldset>
- <%= render partial: 'form', locals: { f: f } %>
- <%= render partial: 'spree/admin/shared/new_resource_links' %>
- </fieldset>
-<% end %>
diff --git a/backend/app/views/spree/admin/stock_movements/_form.html.erb b/backend/app/views/spree/admin/stock_movements/_form.html.erb
deleted file mode 100644
index 2805022a8a..0000000000
--- a/backend/app/views/spree/admin/stock_movements/_form.html.erb
+++ /dev/null
@@ -1,12 +0,0 @@
-<div data-hook="admin_stock_movements_form_fields">
- <%= f.field_container :quantity, class: ['form-group'] do %>
- <%= f.label :quantity, Spree.t(:quantity) %>
- <%= f.text_field :quantity, class: 'form-control' %>
- <% end %>
- <%= f.field_container :stock_item_id, class: ['form-group'] do %>
- <%= f.label :stock_item_id, Spree.t(:stock_item_id) %>
- <%= select_tag 'stock_movement[stock_item_id]', nil , class: 'variant_autocomplete d-block w-100', :'data-stock-location-id' => params[:stock_location_id] %>
- <% end %>
-</div>
-
-<%= render partial: "spree/admin/variants/autocomplete", formats: :js %>
diff --git a/backend/app/views/spree/admin/stock_movements/index.html.erb b/backend/app/views/spree/admin/stock_movements/index.html.erb
deleted file mode 100644
index bd63f59fa6..0000000000
--- a/backend/app/views/spree/admin/stock_movements/index.html.erb
+++ /dev/null
@@ -1,45 +0,0 @@
-<% content_for :page_title do %>
- <%= link_to Spree.t(:stock_locations), spree.admin_stock_locations_path %> /
- <%= Spree.t(:stock_movements_for_stock_location, stock_location_name: @stock_location.name) %>
-<% end %>
-
-<% content_for :page_actions do %>
- <%= button_link_to Spree.t(:new_stock_movement), new_admin_stock_location_stock_movement_path(@stock_location), icon: 'add.svg', class: 'btn-success', id: 'admin_new_stock_movement_link' %>
-<% end %>
-
-<% if @stock_movements.any? %>
-<div class="table-responsive">
- <table class="table" id='listing_stock_movements'>
- <colgroup>
- <col style="width: 35%">
- <col style="width: 20%">
- <col style="width: 45%">
- </colgroup>
- <thead>
- <tr data-hook="admin_stock_movements_index_headers">
- <th><%= Spree.t(:variant) %>
- <th><%= Spree.t(:quantity) %></th>
- <th><%= Spree.t(:action) %></th>
- </tr>
- </thead>
- <tbody>
- <% @stock_movements.each do |stock_movement| %>
- <tr id="<%= spree_dom_id stock_movement %>" data-hook="admin_stock_movements_index_rows">
- <td>
- <%= display_variant(stock_movement) %>
- </td>
- <td><%= stock_movement.quantity %></td>
- <td><%= pretty_originator(stock_movement) %></td>
- </tr>
- <% end %>
- </tbody>
- </table>
-</div>
-<% else %>
- <div class="alert alert-info no-objects-found">
- <%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree::StockMovement)) %>,
- <%= link_to Spree.t(:add_one), spree.new_admin_stock_location_stock_movement_path(@stock_location) %>!
- </div>
-<% end %>
-
-<%= paginate @stock_movements, theme: 'admin-twitter-bootstrap-4' %>
diff --git a/backend/app/views/spree/admin/stock_movements/new.html.erb b/backend/app/views/spree/admin/stock_movements/new.html.erb
deleted file mode 100644
index e186152a54..0000000000
--- a/backend/app/views/spree/admin/stock_movements/new.html.erb
+++ /dev/null
@@ -1,14 +0,0 @@
-<% content_for :page_title do %>
- <%= link_to Spree.t(:stock_locations), spree.admin_stock_locations_url %> /
- <%= link_to Spree.t(:stock_movements), spree.admin_stock_location_stock_movements_path(stock_location) %> /
- <%= Spree.t(:new_stock_movement) %>
-<% end %>
-
-<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @stock_movement } %>
-
-<%= form_for [:admin, stock_location, @stock_movement] do |f| %>
- <fieldset>
- <%= render partial: 'form', locals: { f: f } %>
- <%= render partial: 'spree/admin/shared/new_resource_links', locals: { collection_url: admin_stock_location_stock_movements_path(stock_location) } %>
- </fieldset>
-<% end %>
diff --git a/backend/app/views/spree/admin/stock_transfers/_stock_movements.html.erb b/backend/app/views/spree/admin/stock_transfers/_stock_movements.html.erb
deleted file mode 100644
index f4bb475063..0000000000
--- a/backend/app/views/spree/admin/stock_transfers/_stock_movements.html.erb
+++ /dev/null
@@ -1,24 +0,0 @@
-<div id="source-movements-table" class="twelve columns alpha">
- <div class="table-responsive">
- <table class="table sortable">
- <thead data-hook="bulk_variants_header">
- <tr>
- <th><%= Spree.t('variant') %></th>
- <th><%= Spree.t('sku') %></th>
- <th><%= Spree.t('quantity') %></th>
- <th><%= Spree.t('count_on_hand') %></th>
- </tr>
- </thead>
- <tbody id="bulk_variants_tbody">
- <% stock_movements.each do |movement| %>
- <tr>
- <td><%= link_to movement.stock_item.variant.name, spree.edit_admin_product_path(movement.stock_item.variant.product) %></td>
- <td><%= movement.stock_item.variant.sku %></td>
- <td><%= movement.quantity %></td>
- <td><%= movement.stock_item.count_on_hand %></td>
- </tr>
- <% end %>
- </tbody>
- </table>
- </div>
-</div>
diff --git a/backend/app/views/spree/admin/stock_transfers/index.html.erb b/backend/app/views/spree/admin/stock_transfers/index.html.erb
deleted file mode 100644
index bc3110b525..0000000000
--- a/backend/app/views/spree/admin/stock_transfers/index.html.erb
+++ /dev/null
@@ -1,92 +0,0 @@
-<% content_for :page_title do %>
- <%= plural_resource_name(Spree::StockTransfer) %>
-<% end %>
-
-<% content_for :page_actions do %>
- <%= button_link_to Spree.t(:new_stock_transfer), new_admin_stock_transfer_path, { icon: 'add.svg', class: 'btn-success' } %>
-<% end if can? :create, Spree::StockTransfer %>
-
-<% content_for :table_filter do %>
- <div data-hook="admin_orders_index_search">
- <%= search_form_for @q, url: admin_stock_transfers_path do |f| %>
- <div class="row mb-0">
- <div class="col-12 col-lg-4">
- <div class="form-group">
- <%= f.label :reference_cont, Spree.t(:reference_contains) %>
- <%= f.text_field :reference_cont, class: 'form-control js-filterable js-quick-search-target' %>
- </div>
- </div>
-
- <div class="col-12 col-lg-4">
- <div class="form-group">
- <%= f.label :source_location, Spree.t(:source) %>
- <%= f.select :source_location_id_eq,
- options_from_collection_for_select(@stock_locations, :id, :name, @q.source_location_id_eq),
- { include_blank: true }, class: 'select2-clear js-filterable' %>
- </div>
- </div>
-
- <div class="col-12 col-lg-4">
- <div class="form-group">
- <%= f.label :destination_location, Spree.t(:destination) %>
- <%= f.select :destination_location_id_eq,
- options_from_collection_for_select(@stock_locations, :id, :name, @q.destination_location_id_eq),
- { include_blank: true }, class: 'select2-clear js-filterable' %>
- </div>
- </div>
- </div>
-
- <div class="form-actions" data-hook="admin_stock_transfers_index_search_buttons">
- <%= button Spree.t(:filter_results), 'search.svg' %>
- </div>
- <% end %>
- </div>
-<% end %>
-
-<% if @stock_transfers.any? %>
-<div class="table-responsive">
- <table class="table" id='listing_stock_transfers' data-hook>
- <thead>
- <tr data-hook='stock_transfers_header'>
- <th><%= Spree.t(:number) %></th>
- <th><%= Spree.t(:reference) %></th>
- <th><%= Spree.t(:source) %></th>
- <th><%= Spree.t(:destination) %></th>
- <th><%= Spree.t(:created_at) %></th>
- <th class='actions'></th>
- </tr>
- </thead>
- <tbody>
- <% @stock_transfers.each do |stock_transfer| %>
- <tr id="<%= spree_dom_id stock_transfer %>" data-hook="stock_transfer_row">
- <td><%= link_to stock_transfer.number, admin_stock_transfer_path(stock_transfer) %></td>
- <td><%= stock_transfer.reference %></td>
- <td>
- <% if stock_transfer.source_location.present? %>
- <%= stock_transfer.source_location.name %>
- <% end %>
- </td>
- <td>
- <% if stock_transfer.destination_location.present? %>
- <%= stock_transfer.destination_location.name %>
- <% end %>
- </td>
- <td><%= stock_transfer.created_at.strftime('%F %T %Z') %></td>
- <td class="actions">
- <span class="d-flex justify-content-end">
- <%= link_to_with_icon 'view.svg', Spree.t(:show), admin_stock_transfer_path(stock_transfer), class: 'btn btn-outline-secondary btn-sm', no_text: true, data: {action: 'view'} %>
- </span>
- </td>
- </tr>
- <% end %>
- </tbody>
- </table>
-</div>
-<% else %>
- <div class="alert alert-info no-objects-found">
- <%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree::StockTransfer)) %>,
- <%= link_to(Spree.t(:add_one), new_admin_stock_transfer_path) if can? :create, Spree::StockTransfer %>!
- </div>
-<% end %>
-
-<%= paginate @stock_transfers, theme: 'admin-twitter-bootstrap-4' %>
diff --git a/backend/app/views/spree/admin/stock_transfers/new.html.erb b/backend/app/views/spree/admin/stock_transfers/new.html.erb
deleted file mode 100644
index 8be2f52cbe..0000000000
--- a/backend/app/views/spree/admin/stock_transfers/new.html.erb
+++ /dev/null
@@ -1,111 +0,0 @@
-<% content_for :page_title do %>
- <%= link_to Spree.t(:stock_transfers), spree.admin_stock_transfers_url %> /
- <%= Spree.t(:new_stock_transfer) %>
-<% end %>
-
-<script type='text/template' id='transfer_variant_template'>
- {{#each variants}}
- <tr>
- <td>{{name}}</td>
- <td class='text-center'>{{quantity}}</td>
- <td class='actions'>
- <span class='d-flex justify-content-center'>
- <button class='icon_link btn btn-danger btn-sm transfer_remove_variant' data-variant-id='{{id}}'>
- <span class='icon icon-delete' data-variant-id='{{id}}'></span>
- </button>
- <input type='hidden' id='variant[]' name='variant[]' value='{{id}}'>
- <input type='hidden' id='quantity[]' name='quantity[]' value='{{quantity}}'>
- </span>
- </td>
- </tr>
- {{/each}}
-</script>
-
-<%= form_tag admin_stock_transfers_path, method: :post do %>
- <div class="card mb-3">
- <div class="card-header">
- <h1 class="card-title mb-0 h5">
- <%= Spree.t(:transfer_stock) %>
- </h1>
- </div>
-
- <div class="card-body">
- <div data-hook="admin_stock_movements_form_fields">
- <div class="form-group" id="stock_movement_reference_field">
- <%= label_tag 'reference', raw("#{Spree.t(:reference)} (#{Spree.t(:optional)})") %>
- <%= text_field_tag :reference, '', class: 'form-control' %>
- </div>
- <div class="form-group" id="receive_stock_field">
- <div class="checkbox">
- <label for="receive_stock">
- <%= check_box_tag :transfer_receive_stock %>
- <%= Spree.t('receive_stock') %>
- </label>
- </div>
- </div>
- <div class="form-group" id="transfer_source_location_id_field">
- <%= label_tag :transfer_source_location_id, Spree.t(:source) %>
- <%= select_tag :transfer_source_location_id, {}, class: 'select2' %>
- </div>
- <div class="form-group" id="transfer_destination_location_id_field">
- <%= label_tag :transfer_destination_location_id, Spree.t(:destination) %>
- <%= select_tag :transfer_destination_location_id, {}, class: 'select2' %>
- </div>
- </div>
- </div>
- </div>
-
- <div class="card mb-3" id="add-variant-to-transfer">
- <div class="card-header">
- <h1 class="card-title mb-0 h5">
- <%= Spree.t(:add_variant) %>
- </h1>
- </div>
-
- <div class="card-body">
- <div class="row">
- <div class="col-12 col-lg-8">
- <div class="form-group" id="stock_movement_variant_id_field">
- <%= label_tag 'variant_id', Spree.t(:variant) %>
- <div class="input-group">
- <%= select_tag 'transfer_variant', nil, class: 'd-block w-100', id: 'transfer_variant' %>
- </div>
- </div>
- </div>
-
- <div class="col-12 col-lg-4">
- <div class="form-group" id="stock_movement_quantity_field">
- <%= label_tag :transfer_variant_quantity, Spree.t(:quantity) %>
- <div class="input-group">
- <%= number_field_tag :transfer_variant_quantity, 1, class: 'form-control', min: 1 %>
- <span class="input-group-btn ml-2">
- <%= button Spree.t(:add), 'add.svg', 'submit', class: "transfer_add_variant" %>
- </span>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
-
- <div class="alert alert-info no-objects-found">
- <%= Spree.t(:no_resource_found, resource: I18n.t(:other, scope: 'activerecord.models.spree/variant')) %>.
- </div>
-
- <div id="transfer-variants-table" style="display:none" class="table-responsive">
- <table class="table table-bordered sortable">
- <thead data-hook="transfer_variants_header">
- <th><%= Spree.t(:name) %></th>
- <th class="text-center"><%= Spree.t(:quantity) %></th>
- <th class="actions"></th>
- </thead>
- <tbody id="transfer_variants_tbody">
-
- </tbody>
- </table>
- </div>
-
- <div class="form-actions" data-hook="buttons">
- <%= button Spree.t(:transfer_stock), 'add.svg', class: 'transfer_transfer' %>
- </div>
-<% end %>
diff --git a/backend/app/views/spree/admin/stock_transfers/show.html.erb b/backend/app/views/spree/admin/stock_transfers/show.html.erb
deleted file mode 100644
index 529b5d67f8..0000000000
--- a/backend/app/views/spree/admin/stock_transfers/show.html.erb
+++ /dev/null
@@ -1,43 +0,0 @@
-<% content_for :page_title do %>
- <%= link_to Spree.t(:stock_transfers), spree.admin_stock_transfers_url %> /
- <%= @stock_transfer.number %>
-<% end %>
-
-<% content_for :page_actions do %>
- <%= button_link_to Spree.t(:new_stock_transfer), new_admin_stock_transfer_path, { icon: 'add', class: 'btn-success' } %>
-<% end if can? :create, Spree::StockTransfer %>
-
-<fieldset>
- <legend><%= Spree.t(:stock_transfer_name) %></legend>
-<div class="table-responsive">
- <table class="table table-bordered">
- <tr>
- <td width="30%"><strong><%= Spree.t(:created_at) %></strong></td>
- <td><%= pretty_time(@stock_transfer.created_at) %></td>
- </tr>
- <% if @stock_transfer.reference.present? %>
- <tr>
- <td><strong><%= Spree.t(:reference) %></strong></td>
- <td><%= @stock_transfer.reference %></td>
- </tr>
- <% end %>
- </table>
-</div>
- <% if @stock_transfer.source_movements.present? %>
- <fieldset>
- <legend id="stock-location-source">
- <%= Spree.t(:source) %> / <%= @stock_transfer.source_location.name %>
- </legend>
- <%= render partial: 'stock_movements', object: @stock_transfer.source_movements %>
- </fieldset>
- <% end %>
-
- <% if @stock_transfer.destination_movements.present? %>
- <fieldset>
- <legend id="stock-location-destination">
- <%= Spree.t(:destination) %> / <%= @stock_transfer.destination_location.name %>
- </legend>
- <%= render partial: 'stock_movements', object: @stock_transfer.destination_movements %>
- </fieldset>
- <% end %>
-</fieldset>
diff --git a/backend/app/views/spree/admin/store_credit_categories/_form.html.erb b/backend/app/views/spree/admin/store_credit_categories/_form.html.erb
deleted file mode 100644
index 3652dbc6a6..0000000000
--- a/backend/app/views/spree/admin/store_credit_categories/_form.html.erb
+++ /dev/null
@@ -1,9 +0,0 @@
-<div data-hook="admin_store_credit_category_form_fields">
- <%= f.field_container :name, class: ['form-group'], 'data-hook' => 'store_credit_category_name' do %>
- <%= f.label :name, Spree.t(:name) %> <span class="required">*</span>
- <%= f.text_field :name, class: 'form-control' %>
- <%= f.error_message_on :name %>
- <% end %>
-
- <div data-hook="additional_store_credit_category_fields"></div>
-</div>
diff --git a/backend/app/views/spree/admin/store_credit_categories/edit.html.erb b/backend/app/views/spree/admin/store_credit_categories/edit.html.erb
deleted file mode 100644
index b3b74df0f0..0000000000
--- a/backend/app/views/spree/admin/store_credit_categories/edit.html.erb
+++ /dev/null
@@ -1,13 +0,0 @@
-<% content_for :page_title do %>
- <%= link_to Spree.t(:store_credit_categories), spree.admin_store_credit_categories_url %> /
- <%= @store_credit_category.name %>
-<% end %>
-
-<%= render 'spree/admin/shared/error_messages', target: @store_credit_category %>
-
-<%= form_for [:admin, @store_credit_category] do |f| %>
- <fieldset>
- <%= render partial: 'form', locals: { f: f } %>
- <%= render partial: 'spree/admin/shared/edit_resource_links' %>
- </fieldset>
-<% end %>
diff --git a/backend/app/views/spree/admin/store_credit_categories/index.html.erb b/backend/app/views/spree/admin/store_credit_categories/index.html.erb
deleted file mode 100644
index 9f59976bcc..0000000000
--- a/backend/app/views/spree/admin/store_credit_categories/index.html.erb
+++ /dev/null
@@ -1,38 +0,0 @@
-<% content_for :page_title do %>
- <%= plural_resource_name(Spree::StoreCreditCategory) %>
-<% end %>
-
-<% content_for :page_actions do %>
- <%= button_link_to Spree.t(:new_store_credit_category), new_object_url, class: "btn-success", icon: 'add.svg', id: 'admin_new_store_credit_category_link' %>
-<% end if can? :create, Spree::StoreCreditCategory %>
-
-<% if @store_credit_categories.any? %>
-<div class="table-responsive">
- <table class="table">
- <thead>
- <tr data-hook="admin_store_credit_categories_index_headers">
- <th><%= Spree.t(:name) %></th>
- <th class="actions"></th>
- </tr>
- </thead>
- <tbody>
- <% @store_credit_categories.each do |store_credit_category| %>
- <tr id="<%= spree_dom_id store_credit_category %>" data-hook="admin_store_credit_categories_index_rows">
- <td><%= store_credit_category.name %></td>
- <td class="actions">
- <span class="d-flex justify-content-end">
- <%= link_to_edit(store_credit_category, no_text: true) if can? :edit, store_credit_category %>
- <%= link_to_delete(store_credit_category, no_text: true) if can? :destroy, store_credit_category %>
- </span>
- </td>
- </tr>
- <% end %>
- </tbody>
- </table>
-</div>
-<% else %>
- <div class="alert alert-warning">
- <%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree::StoreCreditCategory)) %>,
- <%= link_to(Spree.t(:add_one), new_object_url) if can? :create, Spree::StoreCreditCategory %>!
- </div>
-<% end %>
diff --git a/backend/app/views/spree/admin/store_credit_categories/new.html.erb b/backend/app/views/spree/admin/store_credit_categories/new.html.erb
deleted file mode 100644
index a8840ef20e..0000000000
--- a/backend/app/views/spree/admin/store_credit_categories/new.html.erb
+++ /dev/null
@@ -1,13 +0,0 @@
-<% content_for :page_title do %>
- <%= link_to Spree.t(:store_credit_categories), spree.admin_store_credit_categories_url %> /
- <%= Spree.t(:new_store_credit_category) %>
-<% end %>
-
-<%= render 'spree/admin/shared/error_messages', target: @store_credit_category %>
-
-<%= form_for [:admin, @store_credit_category] do |f| %>
- <fieldset>
- <%= render partial: 'form', locals: { f: f } %>
- <%= render partial: 'spree/admin/shared/new_resource_links' %>
- </fieldset>
-<% end %>
diff --git a/backend/app/views/spree/admin/store_credits/_form.html.erb b/backend/app/views/spree/admin/store_credits/_form.html.erb
deleted file mode 100644
index 1d8f840cdf..0000000000
--- a/backend/app/views/spree/admin/store_credits/_form.html.erb
+++ /dev/null
@@ -1,27 +0,0 @@
-<div data-hook='admin_store_credit_form_fields'>
- <%= f.field_container :amount, class: %w[form-group] do %>
- <%= f.label :amount, raw(Spree.t(:amount) + required_span_tag) %>
- <%= f.text_field :amount, class: 'form-control' %>
- <%= f.error_message_on :amount %>
- <% end %>
- <%= f.field_container :currency, class: %w[form-group] do %>
- <%= f.label :currency, raw(Spree.t(:currency) + required_span_tag) %>
- <%= f.select :currency, currency_options(f.object.currency) %>
- <%= f.error_message_on :currency %>
- <% end %>
- <%= f.field_container :category, class: %w[form-group] do %>
- <%= f.label :category, raw(Spree.t(:category) + required_span_tag) %>
- <%= f.select :category_id, options_from_collection_for_select(@credit_categories, :id, :name, f.object.category.try(:id)),
- { include_blank: true }, { class: 'select2 fullwidth', placeholder: Spree.t(:select_a_store_credit_reason) } %>
- <%= f.error_message_on :category %>
- <% end %>
- <%= f.field_container :memo, class: %w[form-group] do %>
- <%= f.label :memo, Spree.t(:memo) %>
- <%= f.text_area :memo, class: 'form-control' %>
- <%= f.error_message_on :memo %>
- <% end %>
-</div>
-
-<script>
- $('#store_credit_currency').select2();
-</script>
diff --git a/backend/app/views/spree/admin/store_credits/edit.html.erb b/backend/app/views/spree/admin/store_credits/edit.html.erb
deleted file mode 100644
index 5f5677fc59..0000000000
--- a/backend/app/views/spree/admin/store_credits/edit.html.erb
+++ /dev/null
@@ -1,14 +0,0 @@
-<%= render partial: 'spree/admin/users/sidebar', locals: { current: :store_credits } %>
-
-<% content_for :page_title do %>
- <%= link_to @user.email, spree.edit_admin_user_url(@user) %> /
- <%= link_to Spree.t(:'admin.user.store_credits'), spree.admin_user_store_credits_path(@user) %> /
- <%= Spree.t(:editing_resource, resource: Spree::StoreCredit.model_name.human) %>
-<% end %>
-
-<%= form_for @store_credit, url: spree.admin_user_store_credit_path(@user, @store_credit) do |f| %>
- <fieldset>
- <%= render partial: 'form', locals: { f: f } %>
- <%= render partial: 'spree/admin/shared/edit_resource_links', locals: { collection_url: spree.admin_user_store_credits_path(@user) } %>
- </fieldset>
-<% end %>
diff --git a/backend/app/views/spree/admin/store_credits/index.html.erb b/backend/app/views/spree/admin/store_credits/index.html.erb
deleted file mode 100644
index ba4822e4e6..0000000000
--- a/backend/app/views/spree/admin/store_credits/index.html.erb
+++ /dev/null
@@ -1,54 +0,0 @@
-<%= render partial: 'spree/admin/users/sidebar', locals: { current: :store_credits } %>
-
-<% content_for :page_title do %>
- <%= link_to @user.email, spree.edit_admin_user_url(@user) %> /
- <%= Spree.t(:"admin.user.store_credits") %>
-<% end %>
-
-<% content_for :title do %>
- <%= "Spree #{Spree.t('administration')}: #{Spree.t(:"admin.user.store_credits")}" %>
-<% end %>
-
-<% content_for :page_actions do %>
- <%= button_link_to Spree.t(:add_store_credit), spree.new_admin_user_store_credit_path(@user), class: "btn-success", icon: 'add.svg' if can?(:create, Spree::StoreCredit) %>
-<% end %>
-
-<% if @store_credits.any? %>
-<div class="table-responsive">
- <table class="table">
- <thead>
- <th><%= Spree.t(:credited) %></th>
- <th><%= Spree.t(:used) %></th>
- <th><%= Spree.t(:category) %></th>
- <th><%= Spree.t(:created_by) %></th>
- <th><%= Spree.t(:issued_on) %></th>
- <th data-hook="admin_store_credits_index_header_actions" class="actions"></th>
- <thead>
- <tbody>
- <% @store_credits.each do |store_credit| %>
- <tr>
- <td><%= store_credit.display_amount.to_html %></td>
- <td><%= store_credit.display_amount_used.to_html %></td>
- <td><%= store_credit.category_name %></td>
- <td><%= store_credit.created_by_email %></td>
- <td><%= l store_credit.created_at.to_date %></td>
- <td class="actions" data-hook="admin_store_credits_index_row_actions">
- <span class="d-flex justify-content-end">
- <% if store_credit.amount_used.zero? %>
- <%= link_to_edit_url spree.edit_admin_user_store_credit_path(@user, store_credit), no_text: true if can?(:edit, store_credit) %>
- <%= link_to_delete store_credit, no_text: true, url: spree.admin_user_store_credit_path(@user, store_credit) if can?(:destroy, store_credit) %>
- <% end %>
- </span>
- </td>
- </tr>
- <% end %>
- </tbody>
- </table>
-</div>
-<% else %>
- <div class="alert alert-info no-objects-found">
- <%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree::StoreCredit)) %>
- </div>
-<% end %>
-
-<%= render 'spree/admin/users/lifetime_stats' %>
diff --git a/backend/app/views/spree/admin/store_credits/new.html.erb b/backend/app/views/spree/admin/store_credits/new.html.erb
deleted file mode 100644
index 8660300cb6..0000000000
--- a/backend/app/views/spree/admin/store_credits/new.html.erb
+++ /dev/null
@@ -1,14 +0,0 @@
-<%= render partial: 'spree/admin/users/sidebar', locals: { current: :store_credits } %>
-
-<% content_for :page_title do %>
- <%= link_to @user.email, spree.edit_admin_user_url(@user) %> /
- <%= link_to Spree.t(:'admin.user.store_credits'), spree.admin_user_store_credits_path(@user) %> /
- <%= Spree.t(:add_store_credit) %>
-<% end %>
-
-<%= form_for @store_credit, url: spree.admin_user_store_credits_path(@user, @store_credit) do |f| %>
- <fieldset>
- <%= render partial: 'form', locals: { f: f } %>
- <%= render partial: 'spree/admin/shared/new_resource_links', locals: { collection_url: spree.admin_user_store_credits_path(@user) } %>
- </fieldset>
-<% end %>
diff --git a/backend/app/views/spree/admin/stores/_form.html.erb b/backend/app/views/spree/admin/stores/_form.html.erb
deleted file mode 100644
index 724658c577..0000000000
--- a/backend/app/views/spree/admin/stores/_form.html.erb
+++ /dev/null
@@ -1,259 +0,0 @@
-<div data-hook="admin_store_form_fields">
-
-<div class="card mb-4">
- <div class="card-header">
- <h1 class="card-title mb-0 h5">
- <%= Spree.t(:basic_information) %>
- </h1>
- </div>
- <div class="card-body">
- <%= f.field_container :logo, class: ['form-group'] do %>
- <% if @store.logo.attached? && @store.logo.variable? %>
- <%= image_tag main_app.url_for(@store.logo.variant(resize: '244x104>')) %>
- <% elsif @store.logo.attached? && @store.logo.image? %>
- <%= image_tag main_app.url_for(@store.logo) %>
- <% end %>
- <%= f.field_container :logo, class: ['form-group'] do %>
- <%= f.label :logo, Spree.t(:logo) %><br>
- <%= f.file_field :logo %>
- <%= f.error_message_on :logo %>
- <% end %>
- <% end %>
- <%= f.field_container :mailer_logo, class: ['form-group'] do %>
- <% if @store.mailer_logo.attached? && @store.mailer_logo.variable? %>
- <%= image_tag main_app.url_for(@store.mailer_logo.variant(resize: '244x104>')) %>
- <% end %>
- <%= f.field_container :mailer_logo, class: ['form-group'] do %>
- <%= f.label :mailer_logo, Spree.t(:mailer_logo) %><br>
- <%= f.file_field :mailer_logo, accept: Spree::Store::MAILER_LOGO_CONTENT_TYPES.join(',') %>
- <%= f.error_message_on :mailer_logo %>
- <% end %>
- <% end %>
- <%= f.field_container :favicon_image, class: ['form-group'] do %>
- <% if @store.favicon_image.attached? && @store.favicon_image.variable? %>
- <%= image_tag main_app.url_for(@store.favicon_image.variant(resize: '104x104')) %>
- <% end %>
- <%= f.field_container :favicon_image, class: ['form-group'] do %>
- <%= f.label :favicon_image, "#{Spree.t(:favicon)} (#{Spree.t(:favicon_upload_info)})" %><br>
- <%= f.file_field :favicon_image, accept: Spree::Store::FAVICON_CONTENT_TYPES.join(',') %>
- <%= f.error_message_on :favicon_image %>
- <% end %>
- <% end %>
- <%= f.field_container :name, class: ['form-group'] do %>
- <%= f.label :name, raw(Spree.t(:name) + required_span_tag) %>
- <%= f.text_field :name, class: 'form-control', required: true %>
- <%= f.error_message_on :name %>
- <% end %>
- <%= f.field_container :code, class: ['form-group'] do %>
- <%= f.label :code, raw(Spree.t(:code) + required_span_tag) %>
- <%= f.text_field :code, class: 'form-control', required: true %>
- <small class="form-text text-muted">
- <%= Spree.t('store_form.code_help') %>
- </small>
- <%= f.error_message_on :code %>
- <% end %>
- <%= f.field_container :url, class: ['form-group'] do %>
- <%= f.label :url, raw(Spree.t(:url) + required_span_tag) %>
- <div class="input-group mb-3">
- <div class="input-group-prepend">
- <span class="input-group-text" id="basic-addon3">https://</span>
- </div>
- <%= f.text_field :url, class: 'form-control', required: true %>
- </div>
- <%= f.error_message_on :url %>
- <% end %>
- </div>
-</div>
-
-<div class="card mb-4">
- <div class="card-header">
- <h1 class="card-title mb-0 h5">
- <%= Spree.t(:seo) %>
- </h1>
- </div>
- <div class="card-body">
- <%= f.field_container :seo_title, class: ['form-group'] do %>
- <%= f.label :seo_title, Spree.t(:seo_title) %>
- <%= f.text_field :seo_title, class: 'form-control' %>
- <%= f.error_message_on :seo_title %>
- <% end %>
- <%= f.field_container :meta_description, class: ['form-group'] do %>
- <%= f.label :meta_description, Spree.t(:meta_description) %>
- <%= f.text_area :meta_description, class: 'form-control' %>
- <%= f.error_message_on :meta_description %>
- <% end %>
- <%= f.field_container :meta_keywords, class: ['form-group'] do %>
- <%= f.label :meta_keywords, Spree.t(:meta_keywords) %>
- <%= f.text_field :meta_keywords, class: 'form-control' %>
- <%= f.error_message_on :meta_keywords %>
- <% end %>
- <%= f.field_container :seo_robots, class:['form-group'] do %>
- <%= f.label :seo_robots, Spree.t(:seo_robots) %>
- <%= f.text_field :seo_robots, class: 'form-control' %>
- <%= f.error_message_on :seo_robots %>
- <small class="form-text text-muted">
- <%= raw(Spree.t('store_form.seo_robots')) %>
- </small>
- <% end %>
- </div>
-</div>
-
-<div class="card mb-4">
- <div class="card-header">
- <h1 class="card-title mb-0 h5">
- <%= Spree.t(:email).pluralize %>
- </h1>
- </div>
- <div class="card-body">
- <%= f.field_container :mail_from_address, class: ['form-group'] do %>
- <%= f.label :mail_from_address, raw(Spree.t(:mail_from_address) + required_span_tag) %>
- <%= f.text_field :mail_from_address, class: 'form-control', required: true %>
- <%= f.error_message_on :mail_from_address %>
- <small class="form-text text-muted">
- <%= Spree.t('store_form.mail_from_address_help') %>
- </small>
- <% end %>
-
- <%= f.field_container :customer_support_email, class: ['form-group'] do %>
- <%= f.label :customer_support_email, Spree.t(:customer_support_email) %>
- <%= f.text_field :customer_support_email, class: 'form-control' %>
- <%= f.error_message_on :customer_support_email %>
- <small class="form-text text-muted">
- <%= Spree.t('store_form.customer_support_email_help') %>
- </small>
- <% end %>
-
- <%= f.field_container :new_order_notifications_email, class: ['form-group'] do %>
- <%= f.label :new_order_notifications_email, Spree.t(:new_order_notifications_email) %>
- <%= f.text_field :new_order_notifications_email, class: 'form-control' %>
- <%= f.error_message_on :new_order_notifications_email %>
- <small class="form-text text-muted">
- <%= Spree.t('store_form.new_order_notifications_email_help') %>
- </small>
- <% end %>
- </div>
-</div>
-
-<div class="card mb-4">
- <div class="card-header">
- <h1 class="card-title mb-0 h5">
- <%= Spree.t(:internationalization) %>
- </h1>
- </div>
- <div class="card-body">
- <%= f.field_container :default_currency, class: ['form-group'] do %>
- <%= f.label :default_currency %>
- <%= f.select :default_currency, currency_options(@store.default_currency), {}, { class: 'select2' } %>
- <%= f.error_message_on :default_currency %>
- <% end %>
- <%= f.field_container :supported_currencies, class: ['form-group'] do %>
- <%= f.label :supported_currencies, Spree.t(:supported_currencies) %>
- <%= f.select :supported_currencies, currency_options(@store.supported_currencies&.split(',')), { prompt: false }, { multiple: true, class: 'select2' } %>
- <%= f.error_message_on :supported_currencies %>
- <% end %>
- <%= f.field_container :checkout_zone_id, class: ['form-group'] do %>
- <%= f.label :checkout_zone_id, Spree.t(:zone) %>
- <%= f.select :checkout_zone_id, options_for_select(@zones, selected_checkout_zone(@store)&.id), { include_blank: Spree.t(:no_limits_zone) }, { class: 'select2' } %>
- <small class="form-text text-muted">
- <%= raw(Spree.t('store_form.checkout_zone_help')) %>
- </small>
- <%= f.error_message_on :checkout_zone_id %>
- <% end %>
- <%= f.field_container :default_locale, class: ['form-group'] do %>
- <%= f.label :default_locale %>
- <%= f.select :default_locale, options_from_collection_for_select(all_locales_options, :last, :first, @store.default_locale || I18n.locale), {}, { class: 'select2' } %>
- <%= f.error_message_on :default_locale %>
- <% unless defined?(SpreeI18n) %>
- <small class="form-text text-muted">
- <%= raw(Spree.t('store_form.locales_help')) %>
- </small>
- <% end %>
- <% end %>
- <%= f.field_container :supported_locales, class: ['form-group'] do %>
- <%= f.label :supported_locales, Spree.t(:supported_locales) %>
- <%= f.select :supported_locales, options_from_collection_for_select(all_locales_options, :last, :first, @store.supported_locales&.split(',')), {}, { multiple: true, class: 'select2' } %>
- <%= f.error_message_on :supported_locales %>
- <% end %>
- <%= f.field_container :default_country_id, class: ['form-group'] do %>
- <%= f.label :default_country_id, Spree.t('i18n.default_country') %>
- <%= f.select :default_country_id, options_from_collection_for_select(@countries, :id, :name, @store.default_country_id), {}, { class: 'select2' } %>
- <%= f.error_message_on :default_country_id %>
- <small class="form-text text-muted">
- <%= Spree.t('store_form.default_country_help') %>
- </small>
- <% end %>
- </div>
-</div>
-
-<div class="card mb-4">
- <div class="card-header">
- <h1 class="card-title mb-0 h5">
- <%= Spree.t(:social) %>
- </h1>
- </div>
- <div class="card-body">
- <div class="alert alert-warning col-12">
- <%= Spree.t('store_form.social_help') %>
- </div>
-
- <%= f.field_container :facebook, class: ['form-group'] do %>
- <%= f.label :facebook, Spree.t(:facebook) %>
- <div class="input-group mb-3">
- <div class="input-group-prepend">
- <span class="input-group-text" id="basic-addon3">https://facebook.com</span>
- </div>
- <%= f.text_field :facebook, class: 'form-control' %>
- </div>
- <%= f.error_message_on :facebook %>
- <% end %>
- <%= f.field_container :twitter, class: ['form-group'] do %>
- <%= f.label :twitter, Spree.t(:twitter) %>
- <div class="input-group mb-3">
- <div class="input-group-prepend">
- <span class="input-group-text" id="basic-addon3">https://twitter.com</span>
- </div>
- <%= f.text_field :twitter, class: 'form-control' %>
- </div>
- <%= f.error_message_on :twitter %>
- <% end %>
- <%= f.field_container :instagram, class: ['form-group'] do %>
- <%= f.label :instagram, Spree.t(:instagram) %>
- <div class="input-group mb-3">
- <div class="input-group-prepend">
- <span class="input-group-text" id="basic-addon3">https://instagram.com</span>
- </div>
- <%= f.text_field :instagram, class: 'form-control' %>
- </div>
- <%= f.error_message_on :instagram %>
- <% end %>
- </div>
-</div>
-
-<div class="card mb-4">
- <div class="card-header">
- <h1 class="card-title mb-0 h5">
- <%= Spree.t(:footer) %>
- </h1>
- </div>
- <div class="card-body">
- <div class="alert alert-warning col-12">
- <%= Spree.t('store_form.footer_help') %>
- </div>
-
- <%= f.field_container :description, class: ['form-group'] do %>
- <%= f.label :description, Spree.t(:description) %>
- <%= f.text_area :description, class: 'form-control' %>
- <%= f.error_message_on :description %>
- <% end %>
- <%= f.field_container :address, class: ['form-group'] do %>
- <%= f.label :address, Spree.t(:address) %>
- <%= f.text_area :address, class: 'form-control' %>
- <%= f.error_message_on :address %>
- <% end %>
- <%= f.field_container :contact_phone, class: ['form-group'] do %>
- <%= f.label :contact_phone, Spree.t(:contact_phone) %>
- <%= f.text_field :contact_phone, class: 'form-control' %>
- <%= f.error_message_on :contact_phone %>
- <% end %>
- </div>
-</div>
diff --git a/backend/app/views/spree/admin/stores/edit.html.erb b/backend/app/views/spree/admin/stores/edit.html.erb
deleted file mode 100644
index f78cc20055..0000000000
--- a/backend/app/views/spree/admin/stores/edit.html.erb
+++ /dev/null
@@ -1,13 +0,0 @@
-<% content_for :page_title do %>
- <%= link_to Spree.t(:stores), spree.admin_stores_url %> /
- <%= @store.name %>
-<% end %>
-
-<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @store } %>
-
-<%= form_for [:admin, @store] do |f| %>
- <fieldset>
- <%= render partial: 'form', locals: { f: f } %>
- <%= render partial: 'spree/admin/shared/edit_resource_links', locals: { collection_url: spree.admin_stores_path } %>
- </fieldset>
-<% end %>
diff --git a/backend/app/views/spree/admin/stores/index.html.erb b/backend/app/views/spree/admin/stores/index.html.erb
deleted file mode 100644
index 2394d2718e..0000000000
--- a/backend/app/views/spree/admin/stores/index.html.erb
+++ /dev/null
@@ -1,51 +0,0 @@
-<% content_for :page_title do %>
- <%= Spree.t(:"admin.user.stores") %>
-<% end %>
-
-<% content_for :page_actions do %>
- <%= button_link_to Spree.t(:add_store), spree.new_admin_store_path(@user), class: "btn-success", icon: 'add.svg' if can?(:create, Spree::Store) %>
-<% end %>
-
-<% if @stores.any? %>
-<div class="table-responsive">
- <table class="table">
- <thead>
- <th><%= Spree.t(:name) %></th>
- <th><%= Spree.t(:url) %></th>
- <th><%= Spree.t(:supported_currencies) %></th>
- <th><%= Spree.t(:supported_locales) %></th>
- <th><%= Spree.t(:default) %>?</th>
- <th data-hook="admin_stores_index_header_actions" class="actions"></th>
- <thead>
- <tbody>
- <% @stores.each do |store| %>
- <tr>
- <td><%= store.unique_name %></td>
- <td><%= link_to store.url, store.formatted_url, target: :blank %></td>
- <td><%= store.supported_currencies_list.map(&:iso_code).join(', ') %></td>
- <td><%= store.supported_locales_list.map {|l| locale_presentation(l).first }.join(', ') %></td>
- <td><%= active_badge(store.default) %></td>
- <td class="actions" data-hook="admin_stores_index_row_actions">
- <span class="d-flex justify-content-end">
- <%= link_to_edit_url spree.edit_admin_store_path(store), no_text: true if can?(:edit, store) %>
-
- <% if can?(:edit, store) %>
- <% btn_url = store.default? ? '#' : spree.set_default_admin_store_path(store) %>
- <% btn_class = store.default? ? 'outline-secondary disabled' : 'warning' %>
- <% btn_label = store.default? ? nil : Spree.t(:store_set_default_button) %>
- <%= link_to_with_icon('save.svg', btn_label, btn_url, no_text: true, method: (store.default? ? nil : :put), class: "btn btn-#{btn_class} btn-sm with-tip", aria: {disabled: store.default?}) %>
- <% end %>
-
- <%= link_to_delete store, no_text: true, url: spree.admin_store_path(store) if can?(:destroy, store) %>
- </span>
- </td>
- </tr>
- <% end %>
- </tbody>
- </table>
-</div>
-<% else %>
- <div class="alert alert-info no-objects-found">
- <%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree::Store)) %>
- </div>
-<% end %>
diff --git a/backend/app/views/spree/admin/stores/new.html.erb b/backend/app/views/spree/admin/stores/new.html.erb
deleted file mode 100644
index 5bae904535..0000000000
--- a/backend/app/views/spree/admin/stores/new.html.erb
+++ /dev/null
@@ -1,11 +0,0 @@
-<% content_for :page_title do %>
- <%= link_to Spree.t(:stores), spree.admin_stores_path(@store) %> /
- <%= Spree.t(:add_store) %>
-<% end %>
-
-<%= form_for @store, url: spree.admin_stores_path(@store) do |f| %>
- <fieldset>
- <%= render partial: 'form', locals: { f: f } %>
- <%= render partial: 'spree/admin/shared/new_resource_links', locals: { collection_url: spree.admin_stores_path(@store) } %>
- </fieldset>
-<% end %>
diff --git a/backend/app/views/spree/admin/tax_categories/_form.html.erb b/backend/app/views/spree/admin/tax_categories/_form.html.erb
deleted file mode 100644
index bcc9b6d8ad..0000000000
--- a/backend/app/views/spree/admin/tax_categories/_form.html.erb
+++ /dev/null
@@ -1,24 +0,0 @@
-<div data-hook="admin_tax_category_form_fields">
- <%= f.field_container :name, class: ['form-group'] do %>
- <%= f.label :name, Spree.t(:name) %>
- <%= f.text_field :name, class: 'form-control' %>
- <%= f.error_message_on :name %>
- <% end %>
-
- <%= f.field_container :tax_code, class: ['form-group'] do %>
- <%= f.label :tax_code, Spree.t(:tax_code) %>
- <%= f.text_field :tax_code, class: 'form-control' %>
- <% end %>
-
- <%= f.field_container :description, class: ['form-group'] do %>
- <%= f.label :description, Spree.t(:description) %><br>
- <%= f.text_field :description, class: 'form-control' %>
- <% end %>
-
- <%= f.field_container :is_default, class: ['form-group checkbox'] do %>
- <%= f.label :is_default do %>
- <%= f.check_box :is_default %>
- <%= Spree.t(:default) %>
- <% end %>
- <% end %>
-</div>
diff --git a/backend/app/views/spree/admin/tax_categories/edit.html.erb b/backend/app/views/spree/admin/tax_categories/edit.html.erb
deleted file mode 100644
index bad4abdc13..0000000000
--- a/backend/app/views/spree/admin/tax_categories/edit.html.erb
+++ /dev/null
@@ -1,13 +0,0 @@
-<% content_for :page_title do %>
- <%= link_to Spree.t(:tax_categories), spree.admin_tax_categories_url %> /
- <%= @tax_category.name %>
-<% end %>
-
-<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @tax_category } %>
-
-<%= form_for [:admin, @tax_category] do |f| %>
- <fieldset>
- <%= render partial: 'form', locals: { f: f } %>
- <%= render partial: 'spree/admin/shared/edit_resource_links' %>
- </fieldset>
-<% end %>
diff --git a/backend/app/views/spree/admin/tax_categories/index.html.erb b/backend/app/views/spree/admin/tax_categories/index.html.erb
deleted file mode 100644
index c5449edbca..0000000000
--- a/backend/app/views/spree/admin/tax_categories/index.html.erb
+++ /dev/null
@@ -1,46 +0,0 @@
-<% content_for :page_title do %>
- <%= plural_resource_name(Spree::TaxCategory) %>
-<% end %>
-
-<% content_for :page_actions do %>
- <%= button_link_to Spree.t(:new_tax_category), new_object_url, class: "btn-success", icon: 'add.svg', id: 'admin_new_tax_categories_link' %>
-<% end if can? :create, Spree::TaxCategory %>
-
-<% if @tax_categories.any? %>
-<div class="table-responsive">
- <table class="table" id='listing_tax_categories' data-hook>
- <thead>
- <tr data-hook="tax_header">
- <th><%= Spree.t(:name) %></th>
- <th><%= Spree.t(:tax_code) %></th>
- <th><%= Spree.t(:description) %></th>
- <th><%= Spree.t(:default) %></th>
- <th></th>
- </tr>
- </thead>
- <tbody>
- <% @tax_categories.each do |tax_category|
- @edit_url = edit_admin_tax_category_path(tax_category)
- @delete_url = admin_tax_category_path(tax_category) %>
-
- <tr id="<%= spree_dom_id tax_category %>" data-hook="tax_row">
- <td><%= tax_category.name %></td>
- <td><%= tax_category.tax_code %></td>
- <td><%= tax_category.description %></td>
- <td><%= active_badge(tax_category.is_default?) %></td>
- <td class="actions">
- <span class="d-flex justify-content-end">
- <%= link_to_edit(tax_category, no_text: true) if can? :edit, tax_category %>
- <%= link_to_delete(tax_category, no_text: true) if can? :delete, tax_category %>
- </span>
- </tr>
- <% end %>
- </tbody>
- </table>
-</div>
-<% else %>
- <div class="alert alert-info no-objects-found">
- <%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree::TaxCategory)) %>,
- <%= link_to(Spree.t(:add_one), new_object_url) if can? :create, Spree::TaxCategory %>!
- </div>
-<% end %>
diff --git a/backend/app/views/spree/admin/tax_categories/new.html.erb b/backend/app/views/spree/admin/tax_categories/new.html.erb
deleted file mode 100644
index 5210e65e88..0000000000
--- a/backend/app/views/spree/admin/tax_categories/new.html.erb
+++ /dev/null
@@ -1,13 +0,0 @@
-<% content_for :page_title do %>
- <%= link_to Spree.t(:tax_categories), spree.admin_tax_categories_url %> /
- <%= Spree.t(:new_tax_category) %>
-<% end %>
-
-<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @tax_category } %>
-
-<%= form_for [:admin, @tax_category] do |f| %>
- <fieldset>
- <%= render partial: 'form', locals: { f: f } %>
- <%= render partial: 'spree/admin/shared/new_resource_links' %>
- </fieldset>
-<% end %>
diff --git a/backend/app/views/spree/admin/tax_categories/show.html.erb b/backend/app/views/spree/admin/tax_categories/show.html.erb
deleted file mode 100644
index 8b13789179..0000000000
--- a/backend/app/views/spree/admin/tax_categories/show.html.erb
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/backend/app/views/spree/admin/tax_rates/_form.html.erb b/backend/app/views/spree/admin/tax_rates/_form.html.erb
deleted file mode 100644
index af45a23b7d..0000000000
--- a/backend/app/views/spree/admin/tax_rates/_form.html.erb
+++ /dev/null
@@ -1,56 +0,0 @@
-<div data-hook="admin_tax_rate_form_fields">
- <div class="card mb-3" data-hook="tax_rates">
- <div class="card-header">
- <h1 class="card-title mb-0 h5">
- <%= Spree.t(:general_settings) %>
- </h1>
- </div>
-
- <div class="card-body">
- <div class="row">
- <div class="col-12 col-lg-6">
- <div data-hook="name" class="form-group">
- <%= f.label :name, Spree.t(:name) %>
- <%= f.text_field :name, class: 'form-control' %>
- </div>
- <div data-hook="rate" class="form-group">
- <%= f.field_container :amount, class: ["form-group"] do %>
- <%= f.label :amount, Spree.t(:rate) %>
- <%= f.text_field :amount, class: 'form-control' %>
- <%= f.error_message_on :amount %>
- <small class="form-text text-muted">
- <%= Spree.t(:tax_rate_amount_explanation) %>
- </small>
- <% end %>
- </div>
- <div data-hook="included" class="form-group">
- <%= f.label :included_in_price do %>
- <%= f.check_box :included_in_price %>
- <%= Spree.t(:included_in_price) %>
- <% end %>
- </div>
- </div>
-
- <div class="col-12 col-lg-6">
- <div data-hook="zone" class="form-group">
- <%= f.label :zone, Spree.t(:zone) %>
- <%= f.collection_select(:zone_id, @available_zones, :id, :name, {}, {class: 'select2'}) %>
- </div>
- <div data-hook="category" class="form-group">
- <%= f.label :tax_category_id, Spree.t(:tax_category) %>
- <%= f.collection_select(:tax_category_id, @available_categories,:id, :name, {}, {class: 'select2'}) %>
- </div>
- <div data-hook="show_rate" class="form-group">
- <%= f.label :show_rate_in_label do %>
- <%= f.check_box :show_rate_in_label %>
- <%= Spree.t(:show_rate_in_label) %>
- <% end %>
- </div>
- </div>
- </div>
- </div>
-
- </div>
-</div>
-
-<%= render 'spree/admin/shared/calculator_fields', f: f %>
diff --git a/backend/app/views/spree/admin/tax_rates/edit.html.erb b/backend/app/views/spree/admin/tax_rates/edit.html.erb
deleted file mode 100644
index 5fd76792d5..0000000000
--- a/backend/app/views/spree/admin/tax_rates/edit.html.erb
+++ /dev/null
@@ -1,11 +0,0 @@
-<% content_for :page_title do %>
- <%= link_to Spree.t(:tax_rates), spree.admin_tax_rates_url %> /
- <%= @tax_rate.name %>
-<% end %>
-
-<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @tax_rate } %>
-
-<%= form_for [:admin, @tax_rate] do |f| %>
- <%= render partial: 'form', locals: { f: f } %>
- <%= render partial: 'spree/admin/shared/edit_resource_links' %>
-<% end %>
diff --git a/backend/app/views/spree/admin/tax_rates/index.html.erb b/backend/app/views/spree/admin/tax_rates/index.html.erb
deleted file mode 100644
index e0fed244a4..0000000000
--- a/backend/app/views/spree/admin/tax_rates/index.html.erb
+++ /dev/null
@@ -1,50 +0,0 @@
-<% content_for :page_title do %>
- <%= plural_resource_name(Spree::TaxRate) %>
-<% end %>
-
-<% content_for :page_actions do %>
- <%= button_link_to Spree.t(:new_tax_rate), new_object_url, class: "btn-success", icon: 'add.svg' %>
-<% end if can? :create, Spree::TaxRate %>
-
-<% if @tax_rates.any? %>
-<div class="table-responsive">
- <table class="table">
- <thead>
- <tr data-hook="rate_header">
- <th><%= Spree.t(:zone) %></th>
- <th><%= Spree.t(:name) %></th>
- <th><%= Spree.t(:tax_category) %></th>
- <th><%= Spree.t(:amount) %></th>
- <th><%= Spree.t(:included_in_price) %></th>
- <th><%= Spree.t(:show_rate_in_label) %></th>
- <th><%= Spree.t(:calculator) %></th>
- <th></th>
- </tr>
- </thead>
- <tbody>
- <% @tax_rates.each do |tax_rate| %>
- <tr id="<%= spree_dom_id tax_rate %>" data-hook="rate_row">
- <td><%= tax_rate.zone.try(:name) || Spree.t(:not_available) %></td>
- <td><%= tax_rate.name %></td>
- <td><%= tax_rate.tax_category.try(:name) || Spree.t(:not_available) %></td>
- <td><%= tax_rate.amount %></td>
- <td><%= active_badge(tax_rate.included_in_price?) %></td>
- <td><%= active_badge(tax_rate.show_rate_in_label?) %></td>
- <td><%= tax_rate.calculator.to_s %></td>
- <td class="actions">
- <span class="d-flex justify-content-end">
- <%= link_to_edit(tax_rate, no_text: true) if can? :edit, tax_rate %>
- <%= link_to_delete(tax_rate, no_text: true) if can? :delete, tax_rate %>
- </span>
- </td>
- </tr>
- <% end %>
- </tbody>
- </table>
-</div>
-<% else %>
- <div class="alert alert-info no-objects-found">
- <%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree::TaxRate)) %>,
- <%= link_to(Spree.t(:add_one), new_object_url) if can? :create, Spree::TaxRate %>!
- </div>
-<% end %>
diff --git a/backend/app/views/spree/admin/tax_rates/new.html.erb b/backend/app/views/spree/admin/tax_rates/new.html.erb
deleted file mode 100644
index 3900f3a99a..0000000000
--- a/backend/app/views/spree/admin/tax_rates/new.html.erb
+++ /dev/null
@@ -1,14 +0,0 @@
-<% content_for :page_title do %>
- <%= link_to Spree.t(:tax_rates), spree.admin_tax_rates_url %> /
- <%= Spree.t(:new_tax_rate) %>
-<% end %>
-
-<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @tax_rate } %>
-
-<%= form_for [:admin, @tax_rate] do |f| %>
- <fieldset>
- <%= render partial: 'form', locals: { f: f } %>
-
- <%= render partial: 'spree/admin/shared/new_resource_links' %>
- </fieldset>
-<% end %>
diff --git a/backend/app/views/spree/admin/taxonomies/_form.html.erb b/backend/app/views/spree/admin/taxonomies/_form.html.erb
deleted file mode 100644
index 2add648122..0000000000
--- a/backend/app/views/spree/admin/taxonomies/_form.html.erb
+++ /dev/null
@@ -1,7 +0,0 @@
-<div data-hook="admin_inside_taxonomy_form" class="form-group">
- <%= f.field_container :name, class: ['form-group'] do %>
- <%= f.label :name, Spree.t(:name) %> <span class="required">*</span>
- <%= f.text_field :name, class: 'form-control' %>
- <%= f.error_message_on :name, class: 'error-message' %>
- <% end %>
-</div>
diff --git a/backend/app/views/spree/admin/taxonomies/_js_head.html.erb b/backend/app/views/spree/admin/taxonomies/_js_head.html.erb
deleted file mode 100644
index 0f54ad9cf9..0000000000
--- a/backend/app/views/spree/admin/taxonomies/_js_head.html.erb
+++ /dev/null
@@ -1,7 +0,0 @@
-<% content_for :head do %>
- <%= javascript_tag "var taxonomy_id = #{@taxonomy.id};
- $(document).ready(function(){
- setup_taxonomy_tree(taxonomy_id);
- });
- " %>
-<% end %>
diff --git a/backend/app/views/spree/admin/taxonomies/_list.html.erb b/backend/app/views/spree/admin/taxonomies/_list.html.erb
deleted file mode 100644
index 545a1a2f91..0000000000
--- a/backend/app/views/spree/admin/taxonomies/_list.html.erb
+++ /dev/null
@@ -1,27 +0,0 @@
-<div class="table-responsive">
- <table class="table sortable" id='listing_taxonomies' data-hook data-sortable-link="<%= update_positions_admin_taxonomies_url %>">
- <thead>
- <tr data-hook="taxonomies_header">
- <th class="no-border handel-head"></th>
- <th><%= Spree.t(:name) %></th>
- <th class="actions"></th>
- </tr>
- </thead>
- <tbody id="sortVert">
- <% @taxonomies.each do |taxonomy| %>
- <tr id="<%= spree_dom_id taxonomy %>" data-hook="taxonomies_row">
- <td class="move-handle">
- <%= svg_icon name: "sort.svg", width: '18', height: '18' %>
- </td>
- <td><%= taxonomy.name %></td>
- <td class="actions">
- <span class="d-flex justify-content-end">
- <%= link_to_edit taxonomy.id, no_text: true if can?(:edit, taxonomy) %>
- <%= link_to_delete taxonomy, no_text: true if can?(:delete, taxonomy) %>
- </span>
- </td>
- </tr>
- <% end %>
- </tbody>
- </table>
-</div>
diff --git a/backend/app/views/spree/admin/taxonomies/edit.html.erb b/backend/app/views/spree/admin/taxonomies/edit.html.erb
deleted file mode 100755
index d0a09d6de6..0000000000
--- a/backend/app/views/spree/admin/taxonomies/edit.html.erb
+++ /dev/null
@@ -1,37 +0,0 @@
-<%= render partial: 'js_head' %>
-
-<% content_for :page_title do %>
- <%= link_to Spree.t(:taxonomies), spree.admin_taxonomies_url %> /
- <%= @taxonomy.name %>
-<% end %>
-
-<div id="ajax_error" class="errorExplanation" style="display:none;"></div>
-
-<%= form_for [:admin, @taxonomy] do |f| %>
- <fieldset>
- <%= render partial: 'form', locals: { f: f } %>
- <div class="form-group">
- <%= label_tag nil, Spree.t(:tree) %>
- <script>
- Spree.routes.taxonomy_taxons_path = "<%= spree.api_v1_taxonomy_taxons_path(@taxonomy) %>";
- Spree.routes.admin_taxonomy_taxons_path = "<%= spree.admin_taxonomy_taxons_path(@taxonomy) %>";
- Spree.routes.jstree_theme_path = "<%= stylesheet_path("jquery.jstree/themes/spree/style.css") %>";
- </script>
- <div id="taxonomy_tree" class="tree">
- <div class="alert alert-warning">
- <%= Spree.t(:loading_tree) %>
- </div>
- </div>
- </div>
-
- <div class="alert alert-info">
- <%= Spree.t(:taxonomy_tree_instruction) %>
- </div>
-
- <div class="form-actions">
- <%= button Spree.t('actions.update'), 'save.svg', 'submit', { class: 'btn-success' } %>
- <span class="or"><%= Spree.t(:or) %></span>
- <%= button_link_to Spree.t('actions.cancel'), admin_taxonomies_path, icon: 'cancel.svg' %>
- </div>
- </fieldset>
-<% end %>
diff --git a/backend/app/views/spree/admin/taxonomies/index.html.erb b/backend/app/views/spree/admin/taxonomies/index.html.erb
deleted file mode 100644
index d754fec9de..0000000000
--- a/backend/app/views/spree/admin/taxonomies/index.html.erb
+++ /dev/null
@@ -1,18 +0,0 @@
-<% content_for :page_title do %>
- <%= plural_resource_name(Spree::Taxonomy) %>
-<% end %>
-
-<% content_for :page_actions do %>
- <%= button_link_to Spree.t(:new_taxonomy), new_object_url, class: "btn-success", icon: 'add.svg', id: 'admin_new_taxonomy_link' %>
-<% end if can?(:create, Spree::Taxonomy) %>
-
-<% if @taxonomies.any? %>
- <div id="list-taxonomies" data-hook>
- <%= render 'list' %>
- </div>
-<% else %>
- <div class="alert alert-info no-objects-found">
- <%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree::Taxonomy)) %>,
- <%= link_to Spree.t(:add_one), new_object_url if can?(:create, Spree::Taxonomy) %>!
- </div>
-<% end %>
diff --git a/backend/app/views/spree/admin/taxonomies/new.html.erb b/backend/app/views/spree/admin/taxonomies/new.html.erb
deleted file mode 100644
index 08a2a2b5c1..0000000000
--- a/backend/app/views/spree/admin/taxonomies/new.html.erb
+++ /dev/null
@@ -1,12 +0,0 @@
-<% content_for :page_title do %>
- <%= link_to Spree.t(:taxonomies), spree.admin_taxonomies_url %> /
- <%= Spree.t(:new_taxonomy) %>
-<% end %>
-<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @taxonomy } %>
-
-<%= form_for [:admin, @taxonomy] do |f| %>
- <fieldset>
- <%= render partial: 'form', locals: { f: f } %>
- <%= render partial: 'spree/admin/shared/new_resource_links' %>
- </fieldset>
-<% end %>
diff --git a/backend/app/views/spree/admin/taxons/_form.html.erb b/backend/app/views/spree/admin/taxons/_form.html.erb
deleted file mode 100644
index 90882a8620..0000000000
--- a/backend/app/views/spree/admin/taxons/_form.html.erb
+++ /dev/null
@@ -1,59 +0,0 @@
-<div data-hook="admin_inside_taxon_form">
- <%= f.field_container :name, class: ['form-group'] do %>
- <%= f.label :name, raw(Spree.t(:name) + required_span_tag) %>
- <%= text_field :taxon, :name, class: 'form-control' %>
- <%= f.error_message_on :name, class: 'error-message' %>
- <% end %>
-
- <%= f.field_container :permalink, class: ['form-group'] do %>
- <%= label_tag :permalink_part, raw(Spree.t(:permalink) + required_span_tag) %>
- <div class="input-group mb-3">
- <div class="input-group-prepend">
- <span class="input-group-text" id="basic-addon3">
- <%= [current_store.formatted_url, 't', @parent_permalink].join('/') %>
- </span>
- </div>
- <%= text_field_tag :permalink_part, @permalink_part, class: 'form-control', required: true %>
- </div>
- <% end %>
-
- <%= f.field_container :hide_from_nav, class: ['form-group'] do %>
- <%= f.label :hide_from_nav do %>
- <%= Spree.t(:hide_from_subcategories_nav) %>
- <br>
- <%= f.check_box :hide_from_nav, { checked: @taxon.hide_from_nav } %>
- <small><%= Spree.t(:say_yes) %></small>
- <% end %>
- <% end %>
-
- <%= f.field_container :icon, class: ['form-group'] do %>
- <%= f.label :icon, Spree.t(:header_banner) %>
- <%= image_tag(main_app.url_for(@taxon.icon.try(:attachment)), class: 'w-100') if @taxon.icon %>
- <%= f.file_field :icon %>
- <% if @taxon.icon.present? %>
- <%= link_to Spree.t(:remove_image),
- remove_icon_admin_taxonomy_taxon_url(@taxonomy.id, @taxon.id),
- method: :delete %>
- <% end %>
- <% end %>
-
- <%= f.field_container :description, class: ['form-group'] do %>
- <%= f.label :description, Spree.t(:description) %>
- <%= f.text_area :description, class: "form-control #{'spree-rte' if taxon_wysiwyg_editor_enabled? }", rows: 20 %>
- <% end %>
-
- <%= f.field_container :meta_title, class: ['form-group'] do %>
- <%= f.label :meta_title, Spree.t(:meta_title) %>
- <%= f.text_field :meta_title, class: 'form-control', rows: 6 %>
- <% end %>
-
- <%= f.field_container :meta_description, class: ['form-group'] do %>
- <%= f.label :meta_description, Spree.t(:meta_description) %>
- <%= f.text_area :meta_description, class: 'form-control', rows: 6 %>
- <% end %>
-
- <%= f.field_container :meta_keywords, class: ['form-group'] do %>
- <%= f.label :meta_keywords, Spree.t(:meta_keywords) %>
- <%= f.text_field :meta_keywords, class: 'form-control', rows: 6 %>
- <% end %>
-</div>
diff --git a/backend/app/views/spree/admin/taxons/_taxon_table.html.erb b/backend/app/views/spree/admin/taxons/_taxon_table.html.erb
deleted file mode 100644
index 5ee0134c5f..0000000000
--- a/backend/app/views/spree/admin/taxons/_taxon_table.html.erb
+++ /dev/null
@@ -1,25 +0,0 @@
-<div class="table-responsive">
- <table class="table table-condensed table-bordered">
- <thead>
- <tr data-hook="taxons_header">
- <th><%= Spree.t(:name) %></th>
- <th><%= Spree.t(:path) %></th>
- <th></th>
- </tr>
- </thead>
- <tbody>
- <% taxons.each do |taxonp| %>
- <tr id="<%= spree_dom_id(taxon) %>" data-hook="taxons_row">
- <td><%= taxon.name %></td>
- <td><%= taxon_path taxon %></td>
- <td class="actions">
- <%= link_to_delete taxon, url: remove_admin_product_taxon_url(@product, taxon), name: icon('delete.svg') + ' ' + Spree.t(:remove) %>
- </td>
- </tr>
- <% end %>
- <% if taxons.empty? %>
- <tr data-hook="taxons_none"><td colspan="3"><%= Spree.t(:none) %>.</td></tr>
- <% end %>
- </tbody>
- </table>
-</div>
diff --git a/backend/app/views/spree/admin/taxons/edit.html.erb b/backend/app/views/spree/admin/taxons/edit.html.erb
deleted file mode 100644
index 86309f173d..0000000000
--- a/backend/app/views/spree/admin/taxons/edit.html.erb
+++ /dev/null
@@ -1,24 +0,0 @@
-<% content_for :page_title do %>
- <%= link_to Spree.t(:taxonomies), spree.admin_taxonomies_url %> /
- <%= link_to @taxonomy.name, spree.edit_admin_taxonomy_url(@taxonomy) %> /
- <%= @taxon.name %>
-<% end %>
-
-<% content_for :page_actions do %>
- <%= taxon_preview_link(@taxon) %>
-<% end %>
-
-<%# Because otherwise the form would attempt to use to_param of @taxon %>
-<% form_url = admin_taxonomy_taxon_path(@taxonomy.id, @taxon.id) %>
-
-<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @taxon } %>
-
-<%= form_for [:admin, @taxonomy, @taxon], method: :put, url: form_url, html: { multipart: true } do |f| %>
- <%= render 'form', f: f %>
-
- <div class="form-actions" data-hook="buttons">
- <%= button Spree.t('actions.update'), 'save.svg' %>
- <span class="or"><%= Spree.t(:or) %></span>
- <%= button_link_to Spree.t('actions.cancel'), edit_admin_taxonomy_url(@taxonomy), icon: "cancel.svg" %>
- </div>
-<% end %>
diff --git a/backend/app/views/spree/admin/taxons/index.html.erb b/backend/app/views/spree/admin/taxons/index.html.erb
deleted file mode 100644
index 024179cfdf..0000000000
--- a/backend/app/views/spree/admin/taxons/index.html.erb
+++ /dev/null
@@ -1,13 +0,0 @@
-<% content_for :page_title do %>
- <%= Spree.t(:taxons) %>
-<% end %>
-
-<div class="taxon-products-view">
- <div class="form-group">
- <%= select_tag :taxon_id, nil, class: 'd-block w-100' %>
- </div>
-
- <ul id="taxon_products" class="taxon row"></ul>
-
- <%= render partial: "spree/admin/products/autocomplete", formats: :js %>
-</div>
diff --git a/backend/app/views/spree/admin/users/_addresses_form.html.erb b/backend/app/views/spree/admin/users/_addresses_form.html.erb
deleted file mode 100644
index 88a79f1369..0000000000
--- a/backend/app/views/spree/admin/users/_addresses_form.html.erb
+++ /dev/null
@@ -1,38 +0,0 @@
-<div class="row">
- <div data-hook="bill_address_wrapper" class="col-12 col-lg-6">
- <div class="card mb-3">
- <div class="card-header">
- <h1 class="card-title mb-0 h5">
- <%= Spree.t(:billing_address) %>
- </h1>
- </div>
-
- <div class="card-body">
- <%= f.fields_for :bill_address, @user.bill_address || @user.addresses.new(country: current_store.default_country) do |ba_form| %>
- <%= render partial: 'spree/admin/shared/address_form', locals: { f: ba_form, type: "billing" } %>
- <% end %>
- </div>
- </div>
- </div>
-
- <div data-hook="ship_address_wrapper" class="col-12 col-lg-6">
- <div class="card mb-3">
- <div class="card-header">
- <h1 class="card-title mb-0 h5">
- <%= Spree.t(:shipping_address) %>
- </h1>
- </div>
-
- <div class="card-body">
- <p class="form-group" data-hook="use_billing">
- <% checked = @user.bill_address.nil? ? false : @user.bill_address == @user.ship_address %>
- <%= check_box_tag 'user[use_billing]', '1', checked, class: 'checkbox' %>
- <%= label_tag :use_billing, Spree.t(:use_billing_address), for: 'user_use_billing', id: 'use_billing', class: 'form-check-label' %>
- </p>
- <%= f.fields_for :ship_address, @user.ship_address || @user.addresses.new(country: current_store.default_country) do |sa_form| %>
- <%= render partial: 'spree/admin/shared/address_form', locals: { f: sa_form, type: "shipping" } %>
- <% end %>
- </div>
- </div>
- </div>
-</div>
diff --git a/backend/app/views/spree/admin/users/_form.html.erb b/backend/app/views/spree/admin/users/_form.html.erb
deleted file mode 100644
index 392d041c4a..0000000000
--- a/backend/app/views/spree/admin/users/_form.html.erb
+++ /dev/null
@@ -1,35 +0,0 @@
-<div data-hook="admin_user_form_fields" class="row">
- <div class="col-12 col-md-6">
- <%= f.field_container :email, class: ['form-group'] do %>
- <%= f.label :email, Spree.t(:email) %>
- <%= f.email_field :email, class: 'form-control' %>
- <%= f.error_message_on :email %>
- <% end %>
-
- <div data-hook="admin_user_form_roles" class="form-group">
- <strong><%= Spree.t(:roles) %></strong>
- <%= f.collection_check_boxes :spree_role_ids, Spree::Role.all, :id, :name do |role_form| %>
- <div class="checkbox">
- <%= role_form.label for: "user_spree_role_#{role_form.object.name}" do %>
- <%= role_form.check_box id: "user_spree_role_#{role_form.object.name}" %>
- <%= role_form.object.name %>
- <% end %>
- </div>
- <% end %>
- </div>
- </div>
-
- <div data-hook="admin_user_form_password_fields" class="col-12 col-md-6">
- <%= f.field_container :password, class: ['form-group'] do %>
- <%= f.label :password, Spree.t(:password) %>
- <%= f.password_field :password, class: 'form-control' %>
- <%= f.error_message_on :password %>
- <% end %>
-
- <%= f.field_container :password_confirmation, class: ['form-group'] do %>
- <%= f.label :password_confirmation, Spree.t(:confirm_password) %>
- <%= f.password_field :password_confirmation, class: 'form-control' %>
- <%= f.error_message_on :password_confirmation %>
- <% end %>
- </div>
-</div>
diff --git a/backend/app/views/spree/admin/users/_lifetime_stats.html.erb b/backend/app/views/spree/admin/users/_lifetime_stats.html.erb
deleted file mode 100644
index 57dd34875c..0000000000
--- a/backend/app/views/spree/admin/users/_lifetime_stats.html.erb
+++ /dev/null
@@ -1,43 +0,0 @@
-<div data-hook="admin_user_lifetime_stats" class="card mb-3">
- <div class="card-header">
- <h1 class="card-title mb-0 h5">
- <%= Spree.t(:lifetime_stats) %>
- </h1>
- </div>
- <div class="table-responsive">
- <table class="table" id="user-lifetime-stats" data-hook>
- <tr>
- <td width="30%"><%= Spree.t(:total_sales) %>:</td>
- <td>
- <% @user.report_values_for(:lifetime_value, current_store).each do |value| %>
- <div><%= value %></div>
- <% end %>
- </td>
- </tr>
- <tr>
- <td><%= Spree.t(:num_orders) %>:</td>
- <td><%= @user.order_count(current_store) %></td>
- </tr>
- <tr>
- <td><%= Spree.t(:average_order_value) %>:</td>
- <td>
- <% @user.report_values_for(:average_order_value, current_store).each do |value| %>
- <div><%= value %></div>
- <% end %>
- </td>
- </tr>
- <tr>
- <td><%= Spree.t('admin.user.store_credits') %>:</td>
- <td id="store_credit">
- <% @user.available_store_credits(current_store).each do |value| %>
- <div><%= value %></div>
- <% end %>
- </td>
- </tr>
- <tr>
- <td><%= Spree.t(:member_since) %>:</td>
- <td><%= pretty_time(@user.created_at) %></td>
- </tr>
- </table>
- </div>
-</div>
diff --git a/backend/app/views/spree/admin/users/_sidebar.html.erb b/backend/app/views/spree/admin/users/_sidebar.html.erb
deleted file mode 100644
index 8d5705bdbd..0000000000
--- a/backend/app/views/spree/admin/users/_sidebar.html.erb
+++ /dev/null
@@ -1,38 +0,0 @@
-<% content_for :page_title do %>
- <%= link_to Spree.t(:users), spree.admin_users_path %> /
-<% end %>
-
-<% content_for :sidebar do %>
- <ul class="nav flex-column nav-pills" data-hook="admin_user_tab_options">
- <li>
- <%= link_to_with_icon 'user.svg',
- Spree.t(:"admin.user.account"),
- spree.edit_admin_user_path(@user),
- class: "nav-link #{'active' if current == :account}" %>
- </li>
- <li>
- <%= link_to_with_icon 'location.svg',
- Spree.t(:"admin.user.addresses"),
- spree.addresses_admin_user_path(@user),
- class: "nav-link #{'active' if current == :address}" %>
- </li>
- <li>
- <%= link_to_with_icon 'list.svg',
- Spree.t(:"admin.user.orders"),
- spree.orders_admin_user_path(@user),
- class: "nav-link #{'active' if current == :orders}" %>
- </li>
- <li>
- <%= link_to_with_icon 'items.svg',
- Spree.t(:"admin.user.items"),
- spree.items_admin_user_path(@user),
- class: "nav-link #{'active' if current == :items}" %>
- </li>
- <li>
- <%= link_to_with_icon 'payments.svg',
- Spree.t(:"admin.user.store_credits"),
- spree.admin_user_store_credits_path(@user),
- class: "nav-link #{'active' if current == :store_credits}" %>
- </li>
- </ul>
-<% end %>
diff --git a/backend/app/views/spree/admin/users/_user_page_actions.html.erb b/backend/app/views/spree/admin/users/_user_page_actions.html.erb
deleted file mode 100644
index b145123143..0000000000
--- a/backend/app/views/spree/admin/users/_user_page_actions.html.erb
+++ /dev/null
@@ -1,3 +0,0 @@
-<% content_for :page_actions do %>
- <%= button_link_to Spree.t(:create_new_order), spree.new_admin_order_path(user_id: @user.id), class: "btn-success", icon: 'add.svg' if can?(:create, Spree::Order) %>
-<% end %>
diff --git a/backend/app/views/spree/admin/users/addresses.html.erb b/backend/app/views/spree/admin/users/addresses.html.erb
deleted file mode 100644
index 380a8fd147..0000000000
--- a/backend/app/views/spree/admin/users/addresses.html.erb
+++ /dev/null
@@ -1,28 +0,0 @@
-<%= render partial: 'spree/admin/users/sidebar', locals: { current: :address } %>
-<%= render partial: 'spree/admin/users/user_page_actions' %>
-
-<% content_for :page_title do %>
- <%= link_to @user.email, spree.edit_admin_user_url(@user) %> /
- <%= Spree.t(:addresses) %>
-<% end %>
-
-<div data-hook="admin_user_addresses" id="admin_user_edit_addresses">
- <div data-hook="admin_user_edit_form_header">
- <%= render partial: 'spree/admin/shared/error_messages', locals: { target: @user } %>
- </div>
-
- <div data-hook="admin_user_address_edit_form">
- <%= form_for [:admin, @user], as: :user, url: addresses_admin_user_url(@user), method: :put do |f| %>
-
- <%= render partial: 'addresses_form', locals: { f: f } %>
-
- <div class="form-actions text-center card bg-light mb-3" data-hook="admin_user_edit_form_button">
- <div class="card-body">
- <%= render partial: 'spree/admin/shared/edit_resource_links', locals: { collection_url: spree.admin_users_url } %>
- </div>
- </div>
- <% end %>
- </div>
-</div>
-
-<%= render 'spree/admin/users/lifetime_stats' %>
diff --git a/backend/app/views/spree/admin/users/edit.html.erb b/backend/app/views/spree/admin/users/edit.html.erb
deleted file mode 100644
index 186ae4ef95..0000000000
--- a/backend/app/views/spree/admin/users/edit.html.erb
+++ /dev/null
@@ -1,72 +0,0 @@
-<%= render partial: 'spree/admin/users/sidebar', locals: { current: :account } %>
-<%= render partial: 'spree/admin/users/user_page_actions' %>
-
-<% content_for :page_title do %>
- <%= @user.email %>
-<% end %>
-
-<div data-hook="admin_user_edit_general_settings" class="card mb-3">
- <div class="card-header">
- <h1 class="card-title mb-0 h5">
- <%= Spree.t(:general_settings) %>
- </h1>
- </div>
-
- <div class="card-body">
- <div data-hook="admin_user_edit_form_header">
- <%= render partial: 'spree/admin/shared/error_messages', locals: { target: @user } %>
- </div>
-
- <div data-hook="admin_user_edit_form">
- <%= form_for [:admin, @user], as: :user, url: spree.admin_user_url(@user), method: :put do |f| %>
- <%= render partial: 'form', locals: { f: f } %>
-
- <div data-hook="admin_user_edit_form_button">
- <%= render partial: 'spree/admin/shared/edit_resource_links', locals: { collection_url: spree.admin_users_url } %>
- </div>
- <% end %>
- </div>
- </div>
-</div>
-
-<div data-hook="admin_user_api_key" id="admin_user_edit_api_key" class="card mb-3">
- <div class="card-header">
- <h1 class="card-title mb-0 h5">
- <%= Spree.t('access', scope: 'api') %>
- </h1>
- </div>
-
- <div class="card-body">
- <% if @user.spree_api_key.present? %>
- <div class="form-group">
- <div id="current-api-key">
- <label><%= Spree.t('key', scope: 'api') %>: </label>
- <strong><%= @user.spree_api_key %></strong>
- </div>
- </div>
- <div class="form-actions">
- <%= form_tag spree.clear_api_key_admin_user_path(@user), method: :put do %>
- <%= button Spree.t('clear_key', scope: 'api'), 'delete.svg', 'submit', class: "btn-danger" %>
- <% end %>
-
- <span class="or"><%= Spree.t(:or) %></span>
-
- <%= form_tag spree.generate_api_key_admin_user_path(@user), method: :put do %>
- <%= button Spree.t('regenerate_key', scope: 'api'), 'recycle.svg' %>
- <% end %>
- </div>
-
- <% else %>
-
- <div class="alert alert-warning"><%= Spree.t('no_key', scope: 'api') %></div>
-
- <div class="form-actions">
- <%= form_tag spree.generate_api_key_admin_user_path(@user), method: :put do %>
- <%= button Spree.t('generate_key', scope: 'api'), 'key' %>
- <% end %>
- </div>
- <% end %>
- </div>
-</div>
-
-<%= render 'spree/admin/users/lifetime_stats' %>
diff --git a/backend/app/views/spree/admin/users/index.html.erb b/backend/app/views/spree/admin/users/index.html.erb
deleted file mode 100644
index 8bbe929e58..0000000000
--- a/backend/app/views/spree/admin/users/index.html.erb
+++ /dev/null
@@ -1,80 +0,0 @@
-<% content_for :page_title do %>
- <%= Spree.t(:users) %>
-<% end %>
-
-<% content_for :page_actions do %>
- <%= button_link_to Spree.t(:new_user), new_admin_user_url, class: "btn-success", icon: 'add.svg', id: 'admin_new_user_link' %>
-<% end if can? :create, Spree::user_class %>
-
-<% content_for :table_filter_title do %>
- <%= Spree.t(:search) %>
-<% end %>
-
-<% content_for :table_filter do %>
- <div data-hook="admin_users_index_search">
- <%= search_form_for [:admin, @search], url: spree.admin_users_url do |f| %>
- <div class="form-group">
- <%= f.label :email_cont, Spree.t(:email) %>
- <%= f.text_field :email_cont, class: "form-control js-quick-search-target js-filterable" %>
- </div>
- <div class="row">
- <div class="col-12 col-lg-6">
- <div class="form-group">
- <%= f.label :bill_address_firstname_cont, Spree.t(:first_name) %>
- <%= f.text_field :bill_address_firstname_cont, class: 'form-control js-filterable' %>
- </div>
- </div>
- <div class="col-12 col-lg-6">
- <div class="form-group">
- <%= f.label :bill_address_lastname_cont, Spree.t(:last_name) %>
- <%= f.text_field :bill_address_lastname_cont, class: 'form-control js-filterable' %>
- </div>
- </div>
- </div>
- <% if Spree::Config[:company] %>
- <div class="form-group">
- <%= f.label :bill_address_company_cont, Spree.t(:company) %>
- <%= f.text_field :bill_address_company_cont, class: 'form-control js-filterable' %>
- </div>
- <% end %>
- <div data-hook="admin_users_index_search_buttons" class="form-actions">
- <%= button Spree.t(:search), 'search.svg' %>
- </div>
- <% end %>
- </div>
-<% end %>
-
-<% if @users.any? %>
- <div class="table-responsive">
- <table class="table" id="listing_users" data-hook>
- <thead>
- <tr data-hook="admin_users_index_headers">
- <th>
- <%= sort_link @search,:email, Spree.t(:user), {}, {title: 'users_email_title'} %>
- </th>
- <th data-hook="admin_users_index_header_actions" class="actions"></th>
- </tr>
- </thead>
- <tbody>
- <% @users.each do |user| %>
- <tr id="<%= spree_dom_id user %>" data-hook="admin_users_index_rows">
- <td class='user_email'><%= link_to user.email, edit_admin_user_url(user) %></td>
- <td data-hook="admin_users_index_row_actions" class="actions">
- <span class="d-flex justify-content-end">
- <%= link_to_edit user, no_text: true if can?(:edit, user) %>
- <%= link_to_delete user, no_text: true if can?(:delete, user) %>
- </span>
- </td>
- </tr>
- <% end %>
- </tbody>
- </table>
- </div>
-<% else %>
- <div class="alert alert-info no-objects-found">
- <%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree.user_class)) %>,
- <%= link_to Spree.t(:add_one), new_object_url %>!
- </div>
-<% end %>
-
-<%= paginate @users, theme: 'admin-twitter-bootstrap-4' %>
diff --git a/backend/app/views/spree/admin/users/items.html.erb b/backend/app/views/spree/admin/users/items.html.erb
deleted file mode 100644
index 243ca05c9c..0000000000
--- a/backend/app/views/spree/admin/users/items.html.erb
+++ /dev/null
@@ -1,67 +0,0 @@
-<%= render partial: 'spree/admin/users/sidebar', locals: { current: :items } %>
-<%= render partial: 'spree/admin/users/user_page_actions' %>
-
-<% content_for :page_title do %>
- <%= link_to @user.email, spree.edit_admin_user_url(@user) %> /
- <%= Spree.t(:"admin.user.items_purchased") %>
-<% end %>
-
-<fieldset data-hook="admin_user_items_purchased">
-
- <% if @orders.any? %>
- <%# TODO add search interface %>
- <div class="table-responsive">
- <table class="table table-condensed table-bordered stock-contents" id="listing_items" data-hook="stock-contents">
- <thead>
- <th><%= sort_link @search, :completed_at, I18n.t(:completed_at, scope: 'activerecord.attributes.spree/order'), {}, {title: 'orders_completed_at_title'} %></th>
- <th colspan=2><%= Spree.t(:description) %></th>
- <th><%= I18n.t(:price, scope: 'activerecord.attributes.spree/line_item') %></th>
- <th><%= I18n.t(:quantity, scope: 'activerecord.attributes.spree/line_item') %></th>
- <th><%= Spree.t(:total) %></th>
- <th><%= sort_link @search, :state, I18n.t(:state, scope: 'activerecord.attributes.spree/order'), {}, {title: 'orders_state_title'} %></th>
- <th><%= sort_link @search, :number, Spree.t(:order_num, scope: 'admin.user'), {}, {title: 'orders_number_title'} %></th>
- </thead>
- <tbody>
- <% @orders.each do |order| %>
- <% order.line_items.each do |item| %>
- <tr class="stock-item" data-item-quantity="<%= item.quantity %>">
- <td class="order-completed-at"><%= order_time(order.completed_at) if order.completed_at %></td>
- <td class="item-image">
- <%= small_image(item.variant) %>
- </td>
- <td class="item-name">
- <%= item.name %>
- <br>
- <%= "(#{item.options_text})" if item.options_text.present? %>
- <% if item.sku.present? %>
- <strong><%= Spree.t(:sku) %>:</strong> <%= item.variant.sku %>
- <% end %>
- </td>
- <td class="item-price"><%= item.single_money.to_html %></td>
- <td class="item-quantity"><%= item.quantity %></td>
- <td class="item-total"><%= item.money.to_html %></td>
- <td class="order-state">
- <div class="state <%= order.state.downcase %>"><%= Spree.t("order_state.#{order.state.downcase}") %></div>
- <% if order.payment_state %>
- <div class="state <%= order.payment_state %>"><%= link_to Spree.t("payment_states.#{order.payment_state}"), admin_order_payments_path(order) %></div>
- <% end %>
- <% if Spree::Order.checkout_step_names.include?(:delivery) && order.shipment_state %>
- <div class="state <%= order.shipment_state %>"><%= Spree.t("shipment_states.#{order.shipment_state}") %></div>
- <% end %>
- </td>
- <td class="order-number"><%= link_to order.number, edit_admin_order_url(order) %></td>
- </tr>
- <% end %>
- <% end %>
- </table>
- </div>
- <% else %>
- <div class="alert alert-info no-objects-found">
- <%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree::Order)) %>,
- <%= link_to Spree.t(:add_one), spree.new_admin_order_path %>!
- </div>
- <% end %>
- <%= paginate @orders, theme: 'admin-twitter-bootstrap-4' %>
-</fieldset>
-
-<%= render 'spree/admin/users/lifetime_stats' %>
diff --git a/backend/app/views/spree/admin/users/new.html.erb b/backend/app/views/spree/admin/users/new.html.erb
deleted file mode 100644
index 7dd2267089..0000000000
--- a/backend/app/views/spree/admin/users/new.html.erb
+++ /dev/null
@@ -1,18 +0,0 @@
-<% content_for :page_title do %>
- <%= link_to Spree.t(:users), spree.admin_users_url %> /
- <%= Spree.t(:new_user) %>
-<% end %>
-
-<div data-hook="admin_user_new_form_header">
- <%= render partial: 'spree/admin/shared/error_messages', locals: { target: @user } %>
-</div>
-
-<div data-hook="admin_user_new_form">
- <%= form_for [:admin, @user], url: spree.admin_users_url, method: :post do |f| %>
- <%= render partial: 'form', locals: { f: f } %>
-
- <div data-hook="admin_user_new_form_buttons">
- <%= render partial: 'spree/admin/shared/new_resource_links' %>
- </div>
- <% end %>
-</div>
diff --git a/backend/app/views/spree/admin/users/orders.html.erb b/backend/app/views/spree/admin/users/orders.html.erb
deleted file mode 100644
index d596eb5673..0000000000
--- a/backend/app/views/spree/admin/users/orders.html.erb
+++ /dev/null
@@ -1,53 +0,0 @@
-<%= render partial: 'spree/admin/users/sidebar', locals: { current: :orders } %>
-<%= render partial: 'spree/admin/users/user_page_actions' %>
-
-<% content_for :page_title do %>
- <%= link_to @user.email, spree.edit_admin_user_url(@user) %> /
- <%= Spree.t(:"admin.user.order_history") %>
-<% end %>
-
-<fieldset data-hook="admin_user_order_history">
-
- <% if @orders.any? %>
- <%# TODO add search interface %>
- <div class="table-responsive">
- <table class="table table-condensed table-bordered" id="listing_orders" data-hook>
- <thead>
- <tr data-hook="admin_orders_index_headers">
- <th><%= sort_link @search, :completed_at, I18n.t(:completed_at, scope: 'activerecord.attributes.spree/order'), {}, {title: 'orders_completed_at_title'} %></th>
- <th><%= sort_link @search, :number, I18n.t(:number, scope: 'activerecord.attributes.spree/order'), {}, {title: 'orders_number_title'} %></th>
- <th><%= sort_link @search, :state, I18n.t(:state, scope: 'activerecord.attributes.spree/order'), {}, {title: 'orders_state_title'} %></th>
- <th><%= sort_link @search, :total, I18n.t(:total, scope: 'activerecord.attributes.spree/order'), {}, {title: 'orders_total_title'} %></th>
- </tr>
- </thead>
- <tbody>
- <% @orders.each do |order| %>
- <tr data-hook="admin_orders_index_rows" class="state-<%= order.state.downcase %> <%= cycle('odd', 'even') %>">
- <td class="order-completed-at"><%= order_time(order.completed_at) if order.completed_at %></td>
- <td class="order-number"><%= link_to order.number, edit_admin_order_path(order) %></td>
- <td class="order-state">
- <div class="state <%= order.state.downcase %>"><%= Spree.t("order_state.#{order.state.downcase}") %></div>
- <% if order.payment_state %>
- <div class="state <%= order.payment_state %>"><%= link_to Spree.t("payment_states.#{order.payment_state}"), admin_order_payments_path(order) %></div>
- <% end %>
- <% if Spree::Order.checkout_step_names.include?(:delivery) && order.shipment_state %>
- <div class="state <%= order.shipment_state %>"><%= Spree.t("shipment_states.#{order.shipment_state}") %></div>
- <% end %>
- </td>
- <td class="order-total"><%= order.display_total.to_html %></td>
- </tr>
- <% end %>
- </tbody>
- </table>
- </div>
- <% else %>
- <div class="alert alert-info no-objects-found">
- <%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree::Order)) %>,
- <%= link_to Spree.t(:add_one), spree.new_admin_order_path %>!
- </div>
- <% end %>
-
- <%= paginate @orders, theme: 'admin-twitter-bootstrap-4' %>
-</fieldset>
-
-<%= render 'spree/admin/users/lifetime_stats' %>
diff --git a/backend/app/views/spree/admin/variants/_autocomplete.js.erb b/backend/app/views/spree/admin/variants/_autocomplete.js.erb
deleted file mode 100644
index 1d0b3facbd..0000000000
--- a/backend/app/views/spree/admin/variants/_autocomplete.js.erb
+++ /dev/null
@@ -1,25 +0,0 @@
-<script type='text/template' id='variant_autocomplete_template'>
- <div class='variant-autocomplete-item media align-items-center'>
- <figure class='variant-image media-left mb-0 mr-3'>
- {{#if variant.image }}
- <div class="admin-product-image-container small-img">
- <img src='{{variant.image}}' class="thumbnail mb-0" />
- </div>
- {{ else }}
- <div class="admin-product-image-container small-img">
- <%= inline_svg_tag "noimage/backend-missing-image.svg", class: "noimage", size: "60%*60%" %>
- </div>
- {{/if}}
- </figure>
-
- <div class='variant-details media-body'>
- <h5 class="variant-name media-heading h6 mb-0">{{variant.name}}</h5>
- {{#if variant.option_values}}
- {{#each variant.option_values}}
- <strong>{{this.option_type_presentation}}:</strong> {{name_or_presentation this}}<br/>
- {{/each}}
- {{/if}}
- <strong><%= Spree.t(:sku) %>:</strong> {{variant.sku}}
- </div>
- </div>
-</script>
diff --git a/backend/app/views/spree/admin/variants/_autocomplete_line_items_stock.js.erb b/backend/app/views/spree/admin/variants/_autocomplete_line_items_stock.js.erb
deleted file mode 100644
index 484dda4239..0000000000
--- a/backend/app/views/spree/admin/variants/_autocomplete_line_items_stock.js.erb
+++ /dev/null
@@ -1,69 +0,0 @@
-<script type='text/template' id='variant_line_items_autocomplete_stock_template'>
-
- <label><%= Spree.t(:select_stock) %></label>
-
- <table class="stock-levels table table-bordered" data-hook="stock-levels">
- <thead>
- <th><%= Spree.t(:name) %></th>
- <th class="text-center"><%= Spree.t(:count_on_hand) %></th>
- <th class="text-center"><%= Spree.t(:quantity) %></th>
- <th></th>
- </thead>
- <tbody>
- <tr>
- <td>{{variant.name}}</td>
- {{#if variant.track_inventory}}
- {{#if variant.is_orderable}}
- <td class="text-center">
- {{variant.total_on_hand}}
- </td>
-
- <td class="text-center">
- <input class="quantity form-control" id="variant_quantity" data-variant-id="{{variant.id}}" type="number" min="1" value="1">
- </td>
- <td class="actions">
- <span class="d-flex justify-content-center">
- <button class="btn btn-sm btn-success add_variant with-tip" data-variant-id="{{variant.id}}" title="<%= Spree.t(:add) %>" data-action="add">
- <%= svg_icon name: "add.svg", width: '16', height: '16' %>
- </button>
- </span>
- </td>
- {{else}}
- {{#if variant.is_backorderable}}
- <td class="text-center">
- {{variant.total_on_hand}} (<%= Spree.t(:backorders_allowed) %>)
- </td>
-
- <td class="text-center">
- <input class="quantity form-control" id="variant_quantity" data-variant-id="{{variant.id}}" type="number" min="1" value="1">
- </td>
- <td class="actions">
- <span class="d-flex justify-content-center">
- <button class="btn btn-sm btn-success add_variant with-tip" data-variant-id="{{variant.id}}" title="<%= Spree.t(:add) %>" data-action="add">
- <%= svg_icon name: "add.svg", width: '16', height: '16' %>
- </button>
- </span>
- </td>
- {{else}}
- <td class="text-center"><%= Spree.t(:out_of_stock) %></td>
- <td class="text-center">0</td>
- <td></td>
- {{/if}}
- {{/if}}
- {{else}}
- <td class="text-center"><%= Spree.t(:doesnt_track_inventory) %></td>
- <td class="text-center">
- <input class="quantity form-control" id="variant_quantity" data-variant-id="{{variant.id}}" type="number" min="1" value="1">
- </td>
- <td class="actions">
- <span class="d-flex justify-content-center">
- <button class="btn btn-sm btn-success add_variant with-tip" data-variant-id="{{variant.id}}" title="<%= Spree.t(:add) %>" data-action="add">
- <%= svg_icon name: "add.svg", width: '16', height: '16' %>
- </button>
- </span>
- </td>
- {{/if}}
- </tr>
- </tbody>
- </table>
-</script>
diff --git a/backend/app/views/spree/admin/variants/_autocomplete_stock.js.erb b/backend/app/views/spree/admin/variants/_autocomplete_stock.js.erb
deleted file mode 100644
index acb6207be8..0000000000
--- a/backend/app/views/spree/admin/variants/_autocomplete_stock.js.erb
+++ /dev/null
@@ -1,53 +0,0 @@
-<script type='text/template' id='variant_autocomplete_stock_template'>
-
- <label><%= Spree.t(:select_stock) %></label>
- <table class="table table-condensed table-bordered stock-levels mb-0" data-hook="stock-levels">
- <thead>
- <th><%= Spree.t(:location) %></th>
- <th><%= Spree.t(:count_on_hand) %></th>
- <th width="15%"><%= Spree.t(:quantity) %></th>
- <th class="actions"></th>
- </thead>
- <tbody>
- {{#each variant.stock_items}}
- <tr>
- <td>{{this.stock_location_name}}</td>
- {{#unless ../variant.track_inventory}}
- <td><%= Spree.t(:doesnt_track_inventory) %></td>
- <td>
- <input class="quantity form-control input-sm" id="stock_item_quantity" data-stock-location-id="{{this.stock_location_id}}" type="number" min="1" value="1">
- </td>
- <td class="actions">
- <span class="d-flex justify-content-center">
- <button class="btn btn-sm btn-success add_variant with-tip" data-stock-location-id="{{this.stock_location_id}}" title="<%= Spree.t(:add) %>" data-action="add">
- <%= svg_icon name: "add", width: '16', height: '16' %>
- </button>
- </span>
- </td>
- {{else}}
- {{#if this.available}}
- <td>
- {{this.count_on_hand}}
- {{#if this.backorderable}} (<%= Spree.t(:backorders_allowed) %>) {{/if}}
- </td>
- <td>
- <input class="quantity form-control input-sm" id="stock_item_quantity" data-stock-location-id="{{this.stock_location_id}}" type="number" min="1" value="1">
- </td>
- <td class="actions">
- <span class="d-flex justify-content-center">
- <button class="btn btn-sm btn-success add_variant with-tip" data-stock-location-id="{{this.stock_location_id}}" title="<%= Spree.t(:add) %>" data-action="add">
- <%= svg_icon name: "add", width: '16', height: '16' %>
- </button>
- </span>
- </td>
- {{else}}
- <td><%= Spree.t(:out_of_stock) %></td>
- <td>0</td>
- <td></td>
- {{/if}}
- {{/unless}}
- </tr>
- {{/each}}
- </tbody>
- </table>
-</script>
diff --git a/backend/app/views/spree/admin/variants/_form.html.erb b/backend/app/views/spree/admin/variants/_form.html.erb
deleted file mode 100644
index fdf2f551ea..0000000000
--- a/backend/app/views/spree/admin/variants/_form.html.erb
+++ /dev/null
@@ -1,68 +0,0 @@
-<div class="row">
- <div data-hook="admin_variant_form_fields" class="col-12 col-md-6">
- <div data-hook="variants">
- <% @product.option_types.each do |option_type| %>
- <div class="form-group" data-hook="presentation">
- <%= label :new_variant, option_type.presentation %>
- <% if option_type.name == 'color' %>
- <%= f.collection_select 'option_value_ids', option_type.option_values, :id, :name,
- { include_blank: true }, { name: 'variant[option_value_ids][]', class: 'select2-clear', id: "option_value_ids-#{option_type.id}" } %>
- <% else %>
- <%= f.collection_select 'option_value_ids', option_type.option_values, :id, :presentation,
- { include_blank: true }, { name: 'variant[option_value_ids][]', class: 'select2-clear', id: "option_value_ids-#{option_type.id}" } %>
- <% end %>
- </div>
- <% end %>
-
- <div class="form-group" data-hook="sku">
- <%= f.label :sku, Spree.t(:sku) %>
- <%= f.text_field :sku, class: 'form-control' %>
- </div>
-
- <div class="form-group" data-hook="price">
- <%= f.label :price, Spree.t(:price) %>
- <%= f.text_field :price, value: number_to_currency(@variant.price, unit: ''), class: 'form-control' %>
- </div>
-
- <div class="form-group" data-hook="compare_at_price">
- <%= f.label :compare_at_price, Spree.t(:compare_at_price) %>
- <%= f.text_field :compare_at_price, value: number_to_currency(@variant.compare_at_price, unit: ''), class: 'form-control' %>
- </div>
-
- <div class="form-group" data-hook="cost_price">
- <%= f.label :cost_price, Spree.t(:cost_price) %>
- <%= f.text_field :cost_price, value: number_to_currency(@variant.cost_price, unit: ''), class: 'form-control' %>
- </div>
-
- <div class="form-group" data-hook="tax_category">
- <%= f.label :tax_category_id, Spree.t(:tax_category) %>
- <%= f.collection_select(:tax_category_id, @tax_categories, :id, :name, { include_blank: Spree.t('match_choices.none') }, { class: 'select2' }) %>
- </div>
-
- <div class="form-group" data-hook="discontinue_on">
- <%= f.label :discontinue_on, Spree.t(:discontinue_on) %>
- <%= f.error_message_on :discontinue_on %>
- <div class="input-group datepicker"
- data-wrap="true"
- data-alt-format="<%= Spree.t(:fpr_human_friendly_date_format, scope: 'date_picker', default: 'M j, Y') %>">
- <%= f.text_field :discontinue_on,
- value: datepicker_field_value(@variant.discontinue_on),
- placeholder: Spree.t(:select_a_date),
- class: 'form-control shadow-none',
- 'data-input':'' %>
-
- <%= render partial: 'spree/admin/shared/cal_close' %>
- </div>
- </div>
- </div>
- </div>
-
- <div class="col-12 col-md-6" data-hook="admin_variant_form_additional_fields">
- <% [:weight, :height, :width, :depth].each do |field| %>
- <div class="form-group" data-hook="<%= field %>"><%= f.label field, Spree.t(field) %>
- <% value = number_with_precision(@variant.send(field), precision: 2) %>
- <%= f.text_field field, value: value, class: 'form-control' %>
- </div>
- <% end %>
- </div>
-</div>
diff --git a/backend/app/views/spree/admin/variants/_split.js.erb b/backend/app/views/spree/admin/variants/_split.js.erb
deleted file mode 100644
index 5c8ec8f0cc..0000000000
--- a/backend/app/views/spree/admin/variants/_split.js.erb
+++ /dev/null
@@ -1,35 +0,0 @@
-<script type='text/template' id='variant_split_template'>
- <tr class='stock-item-split' data-variant-id='{{variant.id}}'>
- <td colspan='2'>
- <%= Spree.t("move_variant_to", default: "Move {{variant.name}} to") %>
- </td>
- <td colspan='2'>
- <select name="item_stock_location" id='item_stock_location' style='width:100%;'>
- <option></option>
- <optgroup label="<%=Spree.t('existing_shipments')%>">
- {{#each shipments}}
- <option data-shipment-number='{{this.number}}' value='{{this.stock_location_id}}'>{{this.stock_location.name}}({{this.number}})</option>
- {{/each}}
- </optgroup>
- <optgroup label="<%=Spree.t('new_shipment_at_location')%>">
- {{#each variant.stock_items}}
- <option data-new-shipment='true' value='{{this.stock_location_id}}'>{{this.stock_location_name}}&nbsp({{this.count_on_hand}} on hand)</option>
- {{/each}}
- </optgroup>
- </select>
- </td>
- <td>
- <input class="quantity form-control" id="item_quantity" type="number" min="1" value="1" max="{{max_quantity}}">
- </td>
- <td class='actions'>
- <span class='d-flex justify-content-center'>
- <a href='#' class='cancel-split with-tip btn btn-sm btn-outline-secondary' title='Cancel'>
- <%= svg_icon name: "cancel", classes: 'icon-cancel', width: '16', height: '16' %>
- </a>
- <a href='#' class='icon-save-split save-split with-tip btn btn-sm btn-success' title='Save'>
- <%= svg_icon name: "split", classes: 'icon-save', width: '16', height: '16' %>
- </a>
- </span>
- </td>
- </tr>
-</script>
diff --git a/backend/app/views/spree/admin/variants/edit.html.erb b/backend/app/views/spree/admin/variants/edit.html.erb
deleted file mode 100644
index 50f249761a..0000000000
--- a/backend/app/views/spree/admin/variants/edit.html.erb
+++ /dev/null
@@ -1,13 +0,0 @@
-<%= render partial: 'spree/admin/shared/product_tabs', locals: { current: :variants } %>
-
-<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @variant } %>
-
-<%= form_for [:admin, @product, @variant] do |f| %>
- <fieldset>
- <div data-hook="admin_variant_edit_form">
- <%= render partial: 'form', locals: { f: f } %>
- </div>
-
- <%= render partial: 'spree/admin/shared/edit_resource_links' %>
- </fieldset>
-<% end %>
diff --git a/backend/app/views/spree/admin/variants/index.html.erb b/backend/app/views/spree/admin/variants/index.html.erb
deleted file mode 100644
index f7d1d014ed..0000000000
--- a/backend/app/views/spree/admin/variants/index.html.erb
+++ /dev/null
@@ -1,71 +0,0 @@
-<%= render partial: 'spree/admin/shared/product_tabs', locals: {current: :variants} %>
-
-<%# Place for new variant form %>
-<div id="new_variant" data-hook></div>
-
-<% if @variants.any? %>
-<div class="table-responsive">
- <table class="table sortable" data-sortable-link="<%= update_positions_admin_product_variants_path(@product) %>">
- <thead data-hook="variants_header">
- <tr>
- <th colspan="2"><%= Spree.t(:options) %></th>
- <th><%= Spree.t(:price) %></th>
- <th><%= sort_link @search, :sku, Spree.t(:sku) %></th>
- <th class="actions"></th>
- </tr>
- </thead>
- <tbody id="sortVert">
- <% @variants.each do |variant| %>
- <tr id="<%= spree_dom_id variant %>" <%= 'style="color:red;"' if variant.deleted? %> data-hook="variants_row">
- <td class="move-handle">
- <% if can? :edit, variant %>
- <%= svg_icon name: "sort.svg", width: '18', height: '18' %>
- <% end %>
- </td>
- <td><%= variant.options_text %></td>
- <td><%= display_price(variant) %></td>
- <td><%= variant.sku %></td>
- <td class="actions">
- <span class="d-flex justify-content-end">
- <%= link_to_edit(variant, no_text: true) if can?(:edit, variant) && !variant.deleted? %>
- <%= link_to_delete(variant, no_text: true) if can?(:destroy, variant) && !variant.deleted? %>
- </span>
- </td>
- </tr>
- <% end %>
- <% unless @product.has_variants? %>
- <tr>
- <td colspan="5"><%= Spree.t(:none) %></td>
- </tr>
- <% end %>
- </tbody>
- </table>
-</div>
-<% else %>
- <div class="no-objects-found alert alert-info">
- <%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree::Variant)) %>
- <% if can?(:create, Spree::Variant) && [email protected]_option_values? %>
- - <%= link_to(Spree.t(:add_one), spree.new_admin_product_variant_path(@product)) %>!
- <% end %>
- </div>
-<% end %>
-
-<% if @product.empty_option_values? %>
- <% if can?(:modify, Spree::ProductOptionType) %>
- <p class='first_add_option_types no-objects-found' data-hook="first_add_option_types">
- <%= Spree.t(:to_add_variants_you_must_first_define) %>
- <%= link_to(Spree.t(:option_types), spree.admin_product_url(@product)) %>
- <% if can?(:read, Spree::OptionType) && can?([:create, :read], Spree::OptionValue) %>
- <%= Spree.t(:and) %>
- <%= link_to Spree.t(:option_values), spree.admin_option_types_url %>
- <% end %>
- </p>
- <% end %>
-<% else %>
- <% content_for :page_actions do %>
- <%= product_preview_link(@product) %>
- <%= button_link_to(Spree.t(:new_variant), spree.new_admin_product_variant_url(@product), { icon: 'add.svg', :'data-update' => 'new_variant', class: 'btn-success', id: 'new_var_link' }) if can? :create, Spree::Variant %>
- <%= button_link_to (@deleted == '1' ? Spree.t(:show_active) : Spree.t(:show_deleted)), spree.admin_product_variants_url(@product, { q: { deleted_at_null: @deleted == '1' ? "0" : "1" } }), { class: 'btn-outline-secondary', icon: 'filter.svg' } %>
- <% end %>
-<% end %>
-<%= render partial: 'spree/admin/shared/index_table_options', locals: { collection: @collection } %>
diff --git a/backend/app/views/spree/admin/variants/new.html.erb b/backend/app/views/spree/admin/variants/new.html.erb
deleted file mode 100644
index f9abc8deda..0000000000
--- a/backend/app/views/spree/admin/variants/new.html.erb
+++ /dev/null
@@ -1,15 +0,0 @@
-<%= render partial: 'spree/admin/shared/product_tabs', locals: {current: :variants} %>
-
-<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @variant } %>
-
-<%= form_for [:admin, @product, @variant] do |f| %>
- <div class="card mb-3 bg-light">
- <div class="card-body">
- <fieldset data-hook="admin_variant_new_form">
- <legend class="border-bottom"><%= Spree.t(:new_variant) %></legend>
- <%= render partial: 'form', locals: { f: f } %>
- <%= render partial: 'spree/admin/shared/new_resource_links' %>
- </fieldset>
- </div>
- </div>
-<% end %>
diff --git a/backend/app/views/spree/admin/variants/new.js.erb b/backend/app/views/spree/admin/variants/new.js.erb
deleted file mode 100644
index 9ddfd69970..0000000000
--- a/backend/app/views/spree/admin/variants/new.js.erb
+++ /dev/null
@@ -1,3 +0,0 @@
-$("#new_variant").html('<%= escape_javascript(render template: 'spree/admin/variants/new', formats: [:html], handlers: [:erb]) %>');
-$(".select2").select2();
-$("#new_var_link").hide();
diff --git a/backend/app/views/spree/admin/variants/update.js.erb b/backend/app/views/spree/admin/variants/update.js.erb
deleted file mode 100644
index e4bc0cc8e0..0000000000
--- a/backend/app/views/spree/admin/variants/update.js.erb
+++ /dev/null
@@ -1 +0,0 @@
-<%= @object.as_json %>
diff --git a/backend/app/views/spree/admin/zones/_country_members.html.erb b/backend/app/views/spree/admin/zones/_country_members.html.erb
deleted file mode 100644
index 90410d736b..0000000000
--- a/backend/app/views/spree/admin/zones/_country_members.html.erb
+++ /dev/null
@@ -1,16 +0,0 @@
-<div id="country_members" data-hook="member">
- <div class="card mb-3">
- <div class="card-header">
- <h1 class="card-title mb-0 h5">
- <%= Spree.t(:countries) %>
- </h1>
- </div>
-
- <div class="card-body">
- <%= zone_form.field_container :country_ids, class: ['form-group'] do %>
- <%= zone_form.label :country_ids, Spree.t(:countries) %>
- <%= zone_form.collection_select :country_ids, @countries, :id, :name, {}, { multiple: true, class: "select2" } %>
- <% end %>
- </div>
- </div>
-</div>
diff --git a/backend/app/views/spree/admin/zones/_form.html.erb b/backend/app/views/spree/admin/zones/_form.html.erb
deleted file mode 100644
index ade55836bd..0000000000
--- a/backend/app/views/spree/admin/zones/_form.html.erb
+++ /dev/null
@@ -1,49 +0,0 @@
-<div class="row">
- <div class="col-12 col-lg-6" data-hook="admin_zone_form_fields">
- <div class="card mb-3">
- <div class="card-header">
- <h1 class="card-title mb-0 h5"><%= Spree.t(:general_settings) %></h1>
- </div>
-
- <div class="card-body">
- <%= zone_form.field_container :name, class: ['form-group'] do %>
- <%= zone_form.label :name, Spree.t(:name) %>
- <%= zone_form.text_field :name, class: 'form-control' %>
- <%= zone_form.error_message_on :name %>
- <% end %>
-
- <%= zone_form.field_container :description, class: ['form-group'] do %>
- <%= zone_form.label :description, Spree.t(:description) %>
- <%= zone_form.text_field :description, class: 'form-control' %>
- <% end %>
-
- <div data-hook="default" class="form-group checkbox">
- <%= label_tag "zone[#{:default_tax}" do %>
- <%= zone_form.check_box :default_tax %>
- <%= Spree.t(:default_tax_zone) %>
- <% end %>
- </div>
-
- <div data-hook="type" class="form-group">
- <strong><%= Spree.t(:type) %></strong>
- <div class="radio my-2">
- <%= label_tag :country_based do %>
- <%= zone_form.radio_button('kind', 'country', { id: 'country_based' }) %>
- <%= Spree.t(:country_based) %>
- <% end %>
- </div>
- <div class="radio my-2">
- <%= label_tag :state_based do %>
- <%= zone_form.radio_button('kind', 'state', { id: 'state_based' }) %>
- <%= Spree.t(:state_based) %>
- <% end %>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="col-12 col-lg-6">
- <%= render partial: 'state_members', locals: { zone_form: zone_form } %>
- <%= render partial: 'country_members', locals: { zone_form: zone_form } %>
- </div>
-</div>
diff --git a/backend/app/views/spree/admin/zones/_state_members.html.erb b/backend/app/views/spree/admin/zones/_state_members.html.erb
deleted file mode 100644
index 89104cc689..0000000000
--- a/backend/app/views/spree/admin/zones/_state_members.html.erb
+++ /dev/null
@@ -1,16 +0,0 @@
-<div id="state_members" data-hook="member">
- <div class="card mb-3">
- <div class="card-header">
- <h1 class="card-title mb-0 h5">
- <%= Spree.t(:states) %>
- </h1>
- </div>
-
- <div class="card-body">
- <%= zone_form.field_container :state_ids, class: ['form-group'] do %>
- <%= zone_form.label :state_ids, Spree.t(:states) %>
- <%= zone_form.collection_select :state_ids, @states, :id, :name, {}, { multiple: true, class: "select2" } %>
- <% end %>
- </div>
- </div>
-</div>
diff --git a/backend/app/views/spree/admin/zones/edit.html.erb b/backend/app/views/spree/admin/zones/edit.html.erb
deleted file mode 100644
index 737859dbfc..0000000000
--- a/backend/app/views/spree/admin/zones/edit.html.erb
+++ /dev/null
@@ -1,12 +0,0 @@
-<% content_for :page_title do %>
- <%= link_to Spree.t(:zones), spree.admin_zones_url %> /
- <%= @zone.name %>
-<% end %>
-
-<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @zone } %>
-
-<%= form_for [:admin, @zone] do |zone_form| %>
- <%= render partial: 'form', locals: { zone_form: zone_form } %>
-
- <%= render partial: 'spree/admin/shared/edit_resource_links' %>
-<% end %>
diff --git a/backend/app/views/spree/admin/zones/index.html.erb b/backend/app/views/spree/admin/zones/index.html.erb
deleted file mode 100644
index 546cd358e1..0000000000
--- a/backend/app/views/spree/admin/zones/index.html.erb
+++ /dev/null
@@ -1,46 +0,0 @@
-<% content_for :page_title do %>
- <%= Spree.t(:zones) %>
-<% end %>
-
-<% content_for :page_actions do %>
- <%= button_link_to Spree.t(:new_zone), new_object_url, class: "btn-success", icon: 'add.svg', id: 'admin_new_zone_link' %>
-<% end if can? :create, Spree::Zone %>
-
-<% if @zones.any? %>
-<div class="table-responsive">
- <table class="table" id='listing_zones' data-hook>
- <thead>
- <tr data-hook="zones_header">
- <th><%= sort_link @search,:name, Spree.t(:name), title: 'zones_order_by_name_title' %></th>
- <th>
- <%= sort_link @search,:description, Spree.t(:description), {}, {title: 'zones_order_by_description_title'} %>
- </th>
- <th><%= Spree.t(:default_tax_zone) %></th>
- <th class="actions"></th>
- </tr>
- </thead>
- <tbody>
- <% @zones.each do |zone| %>
- <tr id="<%= spree_dom_id zone %>" data-hook="zones_row">
- <td><%= zone.name %></td>
- <td><%= zone.description %></td>
- <td><%= active_badge(zone.default_tax?) %></td>
- <td class="actions">
- <span class="d-flex justify-content-end">
- <%= link_to_edit(zone, no_text: true) if can? :edit, zone %>
- <%= link_to_delete(zone, no_text: true) if can? :delete, zone %>
- </span>
- </td>
- </tr>
- <% end %>
- </tbody>
- </table>
-</div>
-<% else %>
- <div class="alert alert-info no-objects-found">
- <%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree::Zone)) %>,
- <%= link_to(Spree.t(:add_one), new_object_url) if can? :create, Spree::Zone %>!
- </div>
-<% end %>
-
-<%= paginate @zones, theme: 'admin-twitter-bootstrap-4' %>
diff --git a/backend/app/views/spree/admin/zones/new.html.erb b/backend/app/views/spree/admin/zones/new.html.erb
deleted file mode 100644
index dc648f1672..0000000000
--- a/backend/app/views/spree/admin/zones/new.html.erb
+++ /dev/null
@@ -1,11 +0,0 @@
-<% content_for :page_title do %>
- <%= link_to Spree.t(:zones), spree.admin_zones_url %> /
- <%= Spree.t(:new_zone) %>
-<% end %>
-
-<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @zone } %>
-
-<%= form_for [:admin, @zone] do |zone_form| %>
- <%= render partial: 'form', locals: { zone_form: zone_form } %>
- <%= render partial: 'spree/admin/shared/new_resource_links' %>
-<% end %>
diff --git a/backend/app/views/spree/layouts/admin.html.erb b/backend/app/views/spree/layouts/admin.html.erb
deleted file mode 100644
index 02a63d5be3..0000000000
--- a/backend/app/views/spree/layouts/admin.html.erb
+++ /dev/null
@@ -1,91 +0,0 @@
-<!DOCTYPE html>
-<html lang="<%= I18n.locale %>">
- <head data-hook="admin_inside_head">
- <%= render partial: 'spree/admin/shared/head' %>
- </head>
-
- <body class="admin">
- <%#-------------------------------------------------%>
- <%# Header navbar %>
- <%#-------------------------------------------------%>
- <%= render partial: 'spree/admin/shared/header' %>
-
- <%#-------------------------------------------------%>
- <%# Main content %>
- <%#-------------------------------------------------%>
- <div id="wrapper" class="container-fluid
- <% if content_for?(:sidebar) || content_for?(:page_actions) %>
- mb-4 mb-lg-0
- <% end %>">
- <div class="row">
-
- <%#-------------------------------------------------%>
- <%# Sidebar %>
- <%#-------------------------------------------------%>
- <aside
- class="col-12 col-lg-3 col-xl-2 sidebar position-fixed d-flex justify-content-between flex-column px-0"
- id="main-sidebar"
- data-hook="admin_tabs">
- <%= render partial: 'spree/admin/shared/main_menu' %>
- <%= render partial: 'spree/admin/shared/version' %>
- </aside>
-
- <%#-------------------------------------------------%>
- <%# Content %>
- <%#-------------------------------------------------%>
- <main class="col-12 col-lg-9 col-xl-10 offset-lg-3 offset-xl-2 main pt-2" id="main-part">
- <div class="container-lg">
-
- <%#-------------------------------------------------%>
- <%# Content header (page title/actions) %>
- <%#-------------------------------------------------%>
- <%= render partial: 'spree/admin/shared/content_header' %>
-
- <div class="row">
- <%#-------------------------------------------------%>
- <%# Main content %>
- <%#-------------------------------------------------%>
- <div class="<%= content_for?(:sidebar) ? 'with-sidebar col-12 col-lg-9 px-0' : 'col-12 px-0' %>" id="content" data-hook>
- <%= render partial: 'spree/admin/shared/table_filter' if content_for?(:table_filter) %>
- <%= yield %>
- </div>
-
- <%#-------------------------------------------------%>
- <%# Inner aside %>
- <%#-------------------------------------------------%>
- <% if content_for?(:sidebar) || content_for?(:page_actions) %>
- <div class="col-12 col-lg-3 m-0 p-4 p-lg-0" id="contextualSideMenu">
- <%= render partial: 'spree/admin/shared/sidebar' %>
- </div>
- <% end %>
- </div>
-
- </div>
- </main>
- </div>
- </div>
-
- <%#-------------------------------------------------%>
- <%# Insert footer scripts here %>
- <%#-------------------------------------------------%>
- <div id="multi-backdrop" class="modal-backdrop fade"></div>
- <div data-hook="admin_footer_scripts"></div>
-
- <%#-------------------------------------------------%>
- <%# Alerts %>
- <%#-------------------------------------------------%>
- <div id="FlashAlertsContainer" class="d-none">
- <%= flash_alert(flash) %>
- </div>
-
- <%#-------------------------------------------------%>
- <%# Loading progress bars %>
- <%#-------------------------------------------------%>
- <div id="progress">
- <div class="alert alert-info alert-progress">
- <div class="spinner"><%= Spree.t(:loading) %>...</div>
- <div class="progress-message"><%= Spree.t(:loading) %>...</div>
- </div>
- </div>
- </body>
-</html>
diff --git a/backend/config/initializers/assets.rb b/backend/config/initializers/assets.rb
deleted file mode 100644
index f86cb42673..0000000000
--- a/backend/config/initializers/assets.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-Rails.application.config.assets.precompile << 'spree_backend_manifest.js'
-
-Rails.application.config.assets.configure do |env|
- env.export_concurrent = false
-end
diff --git a/backend/config/initializers/form_builder.rb b/backend/config/initializers/form_builder.rb
deleted file mode 100644
index 6d1fbcd841..0000000000
--- a/backend/config/initializers/form_builder.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# Allow some application_helper methods to be used in the scoped form_for manner
-#
-class ActionView::Helpers::FormBuilder
- def field_container(method, options = {}, &block)
- @template.field_container(@object_name, method, options, &block)
- end
-
- def error_message_on(method, options = {})
- @template.error_message_on(@object_name, method, objectify_options(options))
- end
-end
-
-ActionView::Base.field_error_proc = proc { |html_tag, _instance| "<span class=\"field_with_errors\">#{html_tag}</span>".html_safe }
diff --git a/backend/config/initializers/ransack.rb b/backend/config/initializers/ransack.rb
deleted file mode 100644
index e04f939420..0000000000
--- a/backend/config/initializers/ransack.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-Ransack.configure do |config|
- config.custom_arrows = {
- down_arrow: '<svg width="100%" height="100%" viewBox="0 0 2134 2134" version="1.1" xmlns="http://www.w3.org/2000/svg"
- xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve"
- style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
- <path fill="currentColor" d="M1023.16,561.619l-923.077,923.077c-24.038,24.038 -24.038,62.98 0,87.019c24.039,
- 24.038 62.981,24.038 87.019,0l879.568,-879.568l879.567,879.568c24.039,24.038 62.981,
- 24.038 87.019,0c12.02,-12.019 18.029,-27.725 18.029,-43.51c0,-15.785 -6.009,-31.49 -18.029,
- -43.509l-923.077,-923.077c-24.038,-24.039 -62.98,-24.039 -87.019,
- 0Z" style="fill-rule:nonzero;stroke:currentColor;stroke-width:75px;"/></svg>',
-
- up_arrow: '<svg width="100%" height="100%" viewBox="0 0 2134 2134" version="1.1"
- xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
- xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
- <path fill="currentColor" d="M1110.18,
- 1571.72l923.077,-923.077c24.039,-24.039 24.039,-62.981 0,-87.019c-24.038,
- -24.039 -62.98,-24.039 -87.019,0l-879.567,879.567l-879.568,-879.567c-24.038,
- -24.039 -62.98,-24.039 -87.019,0c-12.019,12.019 -18.029,27.724 -18.029,43.509c0,
- 15.785 6.01,31.491 18.029,43.51l923.077,923.077c24.039,24.038 62.981,24.038 87.019,
- 0Z" style="fill-rule:nonzero;stroke:currentColor;stroke-width:75px;"/></svg>',
-
- default_arrow: '<svg class="default-filter-arrow" width="100%" height="100%" viewBox="0 0 2134 2134" version="1.1"
- xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve"
- style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
- <path fill="currentColor" d="M1110.18,1571.72l923.077,-923.077c24.039,-24.039 24.039,-62.981 0,
- -87.019c-24.038,-24.039 -62.98,-24.039 -87.019,0l-879.567,879.567l-879.568,-879.567c-24.038,
- -24.039 -62.98,-24.039 -87.019,0c-12.019,12.019 -18.029,27.724 -18.029,43.509c0,15.785 6.01,
- 31.491 18.029,43.51l923.077,923.077c24.039,24.038 62.981,24.038 87.019,0Z"
- style="fill-rule:nonzero;stroke:currentColor;stroke-width:75px;"/></svg>'
- }
-end
diff --git a/backend/config/routes.rb b/backend/config/routes.rb
deleted file mode 100644
index 15f2de0e6b..0000000000
--- a/backend/config/routes.rb
+++ /dev/null
@@ -1,206 +0,0 @@
-Spree::Core::Engine.add_routes do
- namespace :admin, path: Spree.admin_path do
- resources :promotions do
- resources :promotion_rules
- resources :promotion_actions
- member do
- post :clone
- end
- end
-
- resources :promotion_categories, except: [:show]
-
- resources :zones
-
- resources :stores do
- member do
- put :set_default
- end
- end
-
- resources :countries do
- resources :states
- end
- resources :states
- resources :tax_categories
-
- resources :products do
- resources :product_properties do
- collection do
- post :update_positions
- end
- end
- resources :images do
- collection do
- post :update_positions
- end
- end
- member do
- post :clone
- get :stock
- end
- resources :variants do
- collection do
- post :update_positions
- end
- end
- resources :variants_including_master, only: [:update]
- resources :prices, only: [:index, :create]
- end
-
- resources :option_types do
- collection do
- post :update_positions
- post :update_values_positions
- end
- end
-
- delete '/option_values/:id', to: 'option_values#destroy', as: :option_value
-
- resources :properties do
- collection do
- get :filtered
- end
- end
-
- delete '/product_properties/:id', to: 'product_properties#destroy', as: :product_property
-
- resources :prototypes do
- member do
- get :select
- end
-
- collection do
- get :available
- end
- end
-
- resources :orders, except: [:show] do
- member do
- get :cart
- post :resend
- get :open_adjustments
- get :close_adjustments
- put :approve
- put :cancel
- put :resume
- get :channel
- put :set_channel
- end
-
- resources :state_changes, only: [:index]
-
- resource :customer, controller: 'orders/customer_details'
- resources :customer_returns, only: [:index, :new, :edit, :create, :update] do
- member do
- put :refund
- end
- end
-
- resources :adjustments
- resources :return_authorizations do
- member do
- put :cancel
- end
- end
- resources :payments do
- member do
- put :fire
- end
-
- resources :log_entries
- resources :refunds, only: [:new, :create, :edit, :update]
- end
-
- resources :reimbursements, only: [:index, :create, :show, :edit, :update] do
- member do
- post :perform
- end
- end
- end
-
- get '/return_authorizations', to: 'return_index#return_authorizations', as: :return_authorizations
- get '/customer_returns', to: 'return_index#customer_returns', as: :customer_returns
-
- resource :general_settings do
- collection do
- post :clear_cache
- end
- end
-
- resources :return_items, only: [:update]
-
- resources :taxonomies do
- collection do
- post :update_positions
- end
- resources :taxons do
- member do
- delete :remove_icon
- end
- end
- end
-
- resources :taxons, only: [:index, :show]
-
- resources :reports, only: [:index] do
- collection do
- get :sales_total
- post :sales_total
- end
- end
-
- resources :reimbursement_types
- resources :refund_reasons, except: :show
- resources :return_authorization_reasons, except: :show
-
- resources :shipping_methods
- resources :shipping_categories
- resources :stock_transfers, only: [:index, :show, :new, :create]
- resources :stock_locations do
- resources :stock_movements, except: [:edit, :update, :destroy]
- collection do
- post :transfer_stock
- end
- end
-
- resources :stock_items, only: [:create, :update, :destroy]
- resources :store_credit_categories
- resources :tax_rates
- resources :payment_methods do
- collection do
- post :update_positions
- end
- end
- resources :roles
-
- resources :users do
- member do
- get :addresses
- put :addresses
- put :clear_api_key
- put :generate_api_key
- get :items
- get :orders
- end
- resources :store_credits
- end
-
- resources :cms_pages do
- resources :cms_sections, except: :index
- end
-
- resources :menus do
- resources :menu_items, except: :index do
- member do
- delete :remove_icon
- end
- end
- end
-
- get '/forbidden', to: 'errors#forbidden', as: :forbidden
- end
-
- spree_path = Rails.application.routes.url_helpers.try(:spree_path, trailing_slash: true) || '/'
- get Spree.admin_path, to: redirect((spree_path + Spree.admin_path + '/orders').gsub('//', '/')), as: :admin
-end
diff --git a/backend/lib/generators/spree/backend/copy_views/copy_views_generator.rb b/backend/lib/generators/spree/backend/copy_views/copy_views_generator.rb
deleted file mode 100644
index e4821757b3..0000000000
--- a/backend/lib/generators/spree/backend/copy_views/copy_views_generator.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-module Spree
- module Backend
- class CopyViewsGenerator < Rails::Generators::Base
- desc 'Copies views from spree backend to your application'
-
- def self.source_paths
- [File.expand_path('../../../../../app', __dir__)]
- end
-
- def copy_views
- directory 'views', './app/views'
- end
- end
- end
-end
diff --git a/backend/lib/generators/spree/backend/install/install_generator.rb b/backend/lib/generators/spree/backend/install/install_generator.rb
deleted file mode 100644
index 9667fe2922..0000000000
--- a/backend/lib/generators/spree/backend/install/install_generator.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-module Spree
- module Backend
- module Generators
- class InstallGenerator < Rails::Generators::Base
- desc 'Installs spree rails admin panel'
-
- def self.source_paths
- [
- File.expand_path('templates', __dir__),
- File.expand_path('../templates', "../#{__FILE__}"),
- File.expand_path('../templates', "../../#{__FILE__}"),
- ]
- end
-
- def install
- template 'vendor/assets/javascripts/spree/backend/all.js'
- template 'vendor/assets/stylesheets/spree/backend/all.css'
- end
- end
- end
- end
-end
diff --git a/backend/lib/generators/spree/backend/install/templates/vendor/assets/javascripts/spree/backend/all.js b/backend/lib/generators/spree/backend/install/templates/vendor/assets/javascripts/spree/backend/all.js
deleted file mode 100644
index 80edc71ae7..0000000000
--- a/backend/lib/generators/spree/backend/install/templates/vendor/assets/javascripts/spree/backend/all.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// This is a manifest file that'll be compiled into including all the files listed below.
-// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
-// be included in the compiled file accessible from http://example.com/assets/application.js
-// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
-// the compiled file.
-//
-//= require spree/backend
-//= require_tree .
diff --git a/backend/lib/generators/spree/backend/install/templates/vendor/assets/stylesheets/spree/backend/all.css b/backend/lib/generators/spree/backend/install/templates/vendor/assets/stylesheets/spree/backend/all.css
deleted file mode 100644
index 20f0f987e1..0000000000
--- a/backend/lib/generators/spree/backend/install/templates/vendor/assets/stylesheets/spree/backend/all.css
+++ /dev/null
@@ -1,9 +0,0 @@
-/*
- * This is a manifest file that'll automatically include all the stylesheets available in this directory
- * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
- * the top of the compiled file, but it's generally better to create a new file per style scope.
- *
- *= require spree/backend
- *= require_self
- *= require_tree .
-*/
diff --git a/backend/lib/spree/backend.rb b/backend/lib/spree/backend.rb
deleted file mode 100644
index f3b3325652..0000000000
--- a/backend/lib/spree/backend.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-require 'spree_core'
-require 'spree_api'
-
-require 'sprockets/railtie'
-
-require 'jquery-rails'
-require 'jquery-ui-rails'
-require 'select2-rails'
-require 'flatpickr'
-require 'bootstrap'
-require 'glyphicons'
-require 'popper_js'
-require 'inline_svg'
-require 'responders'
-require 'tinymce-rails'
-
-require 'spree/backend/action_callbacks'
-require 'spree/backend/callbacks'
-require 'spree/backend/engine'
diff --git a/backend/lib/spree/backend/action_callbacks.rb b/backend/lib/spree/backend/action_callbacks.rb
deleted file mode 100644
index cd5eece195..0000000000
--- a/backend/lib/spree/backend/action_callbacks.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-module Spree
- class ActionCallbacks
- attr_reader :before_methods
- attr_reader :after_methods
- attr_reader :fails_methods
-
- def initialize
- @before_methods = []
- @after_methods = []
- @fails_methods = []
- end
-
- def before(method)
- @before_methods << method
- end
-
- def after(method)
- @after_methods << method
- end
-
- def fails(method)
- @fails_methods << method
- end
- end
-end
diff --git a/backend/lib/spree/backend/callbacks.rb b/backend/lib/spree/backend/callbacks.rb
deleted file mode 100644
index 69b4e183b4..0000000000
--- a/backend/lib/spree/backend/callbacks.rb
+++ /dev/null
@@ -1,47 +0,0 @@
-module Spree
- module Backend
- module Callbacks
- extend ActiveSupport::Concern
-
- module ClassMethods
- attr_accessor :callbacks
-
- protected
-
- def new_action
- custom_callback(:new_action)
- end
-
- def create
- custom_callback(:create)
- end
-
- def update
- custom_callback(:update)
- end
-
- def destroy
- custom_callback(:destroy)
- end
-
- def custom_callback(action)
- @callbacks ||= {}
- @callbacks[action] ||= Spree::ActionCallbacks.new
- end
- end
-
- protected
-
- def invoke_callbacks(action, callback_type)
- callbacks = self.class.callbacks || {}
- return if callbacks[action].nil?
-
- case callback_type.to_sym
- when :before then callbacks[action].before_methods.each { |method| send method }
- when :after then callbacks[action].after_methods.each { |method| send method }
- when :fails then callbacks[action].fails_methods.each { |method| send method }
- end
- end
- end
- end
-end
diff --git a/backend/lib/spree/backend/engine.rb b/backend/lib/spree/backend/engine.rb
deleted file mode 100644
index 2d217ac9d3..0000000000
--- a/backend/lib/spree/backend/engine.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-module Spree
- module Backend
- class Engine < ::Rails::Engine
- config.middleware.use 'Spree::Backend::Middleware::SeoAssist'
-
- initializer 'spree.backend.environment', before: :load_config_initializers do |_app|
- Spree::Backend::Config = Spree::BackendConfiguration.new
- end
-
- # filter sensitive information during logging
- initializer 'spree.params.filter' do |app|
- app.config.filter_parameters += [:password, :password_confirmation, :number]
- end
-
- initializer 'spree.backend.checking_deprecated_preferences' do
- Spree::Backend::Config.deprecated_preferences.each do |pref|
- # FIXME: we should only notify about deprecated preferences that are in use, not all of them
- # warn "[DEPRECATION] Spree::Backend::Config[:#{pref[:name]}] is deprecated. #{pref[:message]}"
- end
- end
- end
- end
-end
diff --git a/backend/lib/spree_backend.rb b/backend/lib/spree_backend.rb
deleted file mode 100644
index 258273bfb1..0000000000
--- a/backend/lib/spree_backend.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-require 'spree/backend'
-
-module Spree
- def self.admin_path
- Spree::Backend::Config[:admin_path]
- end
-
- # Used to configure admin_path for Spree
- #
- # Example:
- #
- # write the following line in `config/initializers/spree.rb`
- # Spree.admin_path = '/custom-path'
-
- def self.admin_path=(path)
- Spree::Backend::Config[:admin_path] = path
- end
-end
diff --git a/backend/script/rails b/backend/script/rails
deleted file mode 100755
index dbe7b350bf..0000000000
--- a/backend/script/rails
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/usr/bin/env ruby
-# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
-
-ENGINE_ROOT = File.expand_path('../..', __FILE__)
-ENGINE_PATH = File.expand_path('../../lib/spree/backend/engine', __FILE__)
-
-require 'rails/all'
-require 'rails/engine/commands'
-
diff --git a/backend/spec/controllers/spree/admin/adjustments_controller_controller_spec.rb b/backend/spec/controllers/spree/admin/adjustments_controller_controller_spec.rb
deleted file mode 100644
index a4cb0e20d9..0000000000
--- a/backend/spec/controllers/spree/admin/adjustments_controller_controller_spec.rb
+++ /dev/null
@@ -1,99 +0,0 @@
-require 'spec_helper'
-
-module Spree
- module Admin
- describe AdjustmentsController, type: :controller do
- stub_authorization!
-
- describe '#index' do
- subject do
- get :index, params: { order_id: order.to_param }
- end
-
- let!(:order) { create(:order) }
- let!(:adjustment_1) { create(:adjustment, order: order) }
-
- before do
- create(:adjustment, order: order, eligible: false) # adjustment_2
- subject
- end
-
- it 'returns 200 status' do
- expect(response.status).to eq 200
- end
-
- it 'loads the order' do
- expect(assigns(:order)).to eq order
- end
-
- it 'returns only eligible adjustments' do
- expect(assigns(:adjustments)).to match_array([adjustment_1])
- end
- end
-
- describe '#destroy' do
- subject(:destroy) do
- delete :destroy, params: { order_id: order.to_param, id: adjustment.id, format: :js }
- end
-
- shared_examples 'adjustment destroyed' do
- it 'destroys one adjustment' do
- expect { destroy }.to change { Spree::Adjustment.count }.by(-1)
- end
-
- it 'assigns adjustment object to instance variable' do
- destroy
-
- expect(assigns(:adjustment)).to eq(adjustment)
- end
-
- it 'returns 200 status' do
- destroy
-
- expect(response).to have_http_status(:ok)
- end
-
- it 'returns success flash response' do
- destroy
-
- expect(flash[:success]).to eq(Spree.t(:successfully_removed, resource: 'Adjustment'))
- end
-
- it 'leaves error flash empty' do
- destroy
-
- expect(flash[:error]).to be_nil
- end
- end
-
- context 'when adjustment is from coupon code' do
- context 'when is destroyed' do
- let!(:order) { create(:order) }
- let!(:promotion) { create(:promotion, orders: [order]) }
- let!(:source) { Spree::Promotion::Actions::CreateAdjustment.create(promotion_id: promotion.id) }
- let!(:adjustment) { create(:adjustment, order: order, source_type: 'Spree::PromotionAction', source: source) }
-
- it 'SD-875 removes associated promotion from order' do
- expect(adjustment.order.promotions).to include promotion
-
- destroy
-
- expect(adjustment.order.promotions).not_to include promotion
- end
-
- it_behaves_like 'adjustment destroyed'
- end
- end
-
- context 'when adjustment is created directly' do
- context 'when is destroyed' do
- let!(:order) { create(:order) }
- let!(:adjustment) { create(:adjustment, order: order, source_type: nil, source: nil) }
-
- it_behaves_like 'adjustment destroyed'
- end
- end
- end
- end
- end
-end
diff --git a/backend/spec/controllers/spree/admin/base_controller_spec.rb b/backend/spec/controllers/spree/admin/base_controller_spec.rb
deleted file mode 100644
index 879a8f0b6b..0000000000
--- a/backend/spec/controllers/spree/admin/base_controller_spec.rb
+++ /dev/null
@@ -1,83 +0,0 @@
-# Spree's rpsec controller tests get the Spree::ControllerHacks
-# we don't need those for the anonymous controller here, so
-# we call process directly instead of get
-require 'spec_helper'
-
-class AdminFakesController < Spree::Admin::BaseController
- def index
- render plain: 'index'
- end
-end
-
-describe Spree::Admin::BaseController, type: :controller do
- controller(Spree::Admin::BaseController) do
- def index
- authorize! :update, Spree::Order
- render plain: 'test'
- end
- end
-
- context '#generate_api_key' do
- let(:user) { mock_model(Spree.user_class, has_spree_role?: true) }
-
- before do
- allow(controller).to receive(:authorize_admin).and_return(true)
- allow(controller).to receive(:try_spree_current_user) { user }
- end
-
- it 'generates the API key for a user when they visit' do
- expect(user).to receive(:spree_api_key).and_return(nil)
- expect(user).to receive(:generate_spree_api_key!)
- get :index
- end
-
- it 'does not attempt to regenerate the API key if the key is already set' do
- expect(user).to receive(:spree_api_key).and_return('fake')
- expect(user).not_to receive(:generate_spree_api_key!)
- get :index
- end
- end
-
- describe '#redirect_unauthorized_access' do
- controller(AdminFakesController) do
- def index
- redirect_unauthorized_access
- end
- end
- context 'when logged in' do
- before do
- allow(controller).to receive_messages(try_spree_current_user: double('User', id: 1, last_incomplete_spree_order: nil))
- end
-
- it 'redirects forbidden path' do
- get :index
- expect(response).to redirect_to('/admin/forbidden')
- end
- end
-
- context 'when guest user' do
- before do
- allow(controller).to receive_messages(try_spree_current_user: nil)
- end
-
- it 'redirects login path' do
- allow(controller).to receive_messages(spree_login_path: '/login')
- get :index
- expect(response).to redirect_to('/login')
- end
-
- context 'redirects to root' do
- it 'of spree' do
- allow(controller).to receive_message_chain(:spree, :root_path).and_return('/root')
- get :index
- expect(response).to redirect_to '/root'
- end
-
- it 'of main app' do
- get :index
- expect(response).to redirect_to '/'
- end
- end
- end
- end
-end
diff --git a/backend/spec/controllers/spree/admin/customer_returns_controller_spec.rb b/backend/spec/controllers/spree/admin/customer_returns_controller_spec.rb
deleted file mode 100644
index 30473fb81c..0000000000
--- a/backend/spec/controllers/spree/admin/customer_returns_controller_spec.rb
+++ /dev/null
@@ -1,202 +0,0 @@
-require 'spec_helper'
-
-module Spree
- module Admin
- describe CustomerReturnsController, type: :controller do
- stub_authorization!
-
- describe '#index' do
- subject do
- get :index, params: { order_id: customer_return.order.to_param }
- end
-
- let(:order) { customer_return.order }
- let(:customer_return) { create(:customer_return) }
-
- it 'loads the order' do
- subject
- expect(assigns(:order)).to eq order
- end
-
- it 'loads the customer return' do
- subject
- expect(assigns(:customer_returns)).to include(customer_return)
- end
-
- context 'for different store' do
- let!(:new_store) { create(:store) }
-
- before { allow_any_instance_of(described_class).to receive(:current_store).and_return(new_store) }
-
- it 'should not load any orders' do
- expect { subject }.to raise_error(ActiveRecord::RecordNotFound)
- end
-
- it 'should not load any customer returns' do
- expect { subject }.to raise_error(ActiveRecord::RecordNotFound)
- end
- end
- end
-
- describe '#new' do
- subject do
- get :new, params: { order_id: order.to_param }
- end
-
- let(:order) { create(:shipped_order, line_items_count: 1) }
- let!(:rma) { create :return_authorization, order: order, return_items: [create(:return_item, inventory_unit: order.inventory_units.first)] }
-
- before do
- create(:reimbursement_type, active: false) # inactive_reimbursement_type
- create(:reimbursement_type) # first_active_reimbursement_type
- create(:reimbursement_type) # second_active_reimbursement_type
- end
-
- it 'loads the order' do
- subject
- expect(assigns(:order)).to eq order
- end
-
- it 'creates a new customer return' do
- subject
- expect(assigns(:customer_return)).not_to be_persisted
- end
-
- context 'with previous customer return' do
- let(:order) { create(:shipped_order, line_items_count: 4) }
- let(:rma) { create(:return_authorization, order: order) }
-
- let!(:rma_return_item) { create(:return_item, return_authorization: rma, inventory_unit: order.inventory_units.first) }
- let!(:customer_return_return_item) { create(:return_item, return_authorization: rma, inventory_unit: order.inventory_units.last) }
-
- context 'there is a return item associated with an rma but not a customer return' do
- before do
- create(:customer_return_without_return_items, return_items: [customer_return_return_item]) # previous_customer_return
- subject
- end
-
- it 'loads the persisted rma return items' do
- expect(assigns(:rma_return_items).all?(&:persisted?)).to eq true
- end
-
- it 'has one rma return item' do
- expect(assigns(:rma_return_items)).to include(rma_return_item)
- end
- end
- end
- end
-
- describe '#edit' do
- subject do
- get :edit, params: { order_id: order.to_param, id: customer_return.to_param }
- end
-
- let(:order) { customer_return.order }
- let(:customer_return) { create(:customer_return, line_items_count: 3) }
-
- let!(:accepted_return_item) { customer_return.return_items.order('id').first.tap(&:accept!) }
- let!(:rejected_return_item) { customer_return.return_items.order('id').second.tap(&:reject!) }
- let!(:manual_intervention_return_item) { customer_return.return_items.order('id').third.tap(&:require_manual_intervention!) }
-
- before { subject }
-
- it 'loads the order' do
- expect(assigns(:order)).to eq order
- end
-
- it 'loads the customer return' do
- expect(assigns(:customer_return)).to eq customer_return
- end
-
- it 'loads the accepted return items' do
- expect(assigns(:accepted_return_items)).to eq [accepted_return_item]
- end
-
- it 'loads the rejected return items' do
- expect(assigns(:rejected_return_items)).to eq [rejected_return_item]
- end
-
- it 'loads the return items that require manual intervention' do
- expect(assigns(:manual_intervention_return_items)).to eq [manual_intervention_return_item]
- end
-
- it 'loads the return items that are still pending' do
- expect(assigns(:pending_return_items)).to eq []
- end
-
- it 'loads the reimbursements that are still pending' do
- expect(assigns(:pending_reimbursements)).to eq []
- end
- end
-
- describe '#create' do
- subject do
- post :create, params: customer_return_params
- end
-
- let(:current_store) { Spree::Store.default }
- let(:order) { create(:shipped_order, line_items_count: 1, store: current_store) }
- let!(:return_authorization) { create :return_authorization, order: order, return_items: [create(:return_item, inventory_unit: order.inventory_units.shipped.last)] }
-
- before { allow_any_instance_of(described_class).to receive(:current_store).and_return(current_store) }
-
- context 'valid customer return' do
- let(:stock_location) { order.shipments.last.stock_location }
-
- let(:customer_return_params) do
- {
- order_id: order.to_param,
- customer_return: {
- stock_location_id: stock_location.id,
- return_items_attributes: {
- '0' => {
- id: return_authorization.return_items.first.id,
- returned: '1',
- 'pre_tax_amount' => '15.99',
- inventory_unit_id: order.inventory_units.shipped.last.id
- }
- }
- }
- }
- end
-
- it 'creates a customer return' do
- expect { subject }.to change { current_store.customer_returns.count }.by(1)
- end
-
- it 'redirects to the index page' do
- subject
- expect(response).to redirect_to(spree.edit_admin_order_customer_return_path(order, assigns(:customer_return)))
- end
- end
-
- context 'invalid customer return' do
- let(:customer_return_params) do
- {
- order_id: order.to_param,
- customer_return: {
- stock_location_id: '',
- return_items_attributes: {
- '0' => {
- returned: '1',
- 'pre_tax_amount' => '15.99',
- inventory_unit_id: order.inventory_units.shipped.last.id
- }
- }
- }
- }
- end
-
- it "doesn't create a customer return" do
- expect { subject }.not_to change { current_store.customer_returns.count }
- end
-
- it 'renders the new page' do
- subject
- expect(response).to render_template(:new)
- end
- end
- end
- end
- end
-end
diff --git a/backend/spec/controllers/spree/admin/errors_controller_spec.rb b/backend/spec/controllers/spree/admin/errors_controller_spec.rb
deleted file mode 100644
index 8ae7850541..0000000000
--- a/backend/spec/controllers/spree/admin/errors_controller_spec.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-require 'spec_helper'
-
-describe Spree::Admin::ErrorsController, type: :controller do
- let(:user) { create(:user) }
-
- before { allow(controller).to receive_messages(spree_current_user: user) }
-
- context '#forbidden' do
- shared_context 'should be able to display forbidden page' do
- it do
- get :forbidden
- expect(response).to have_http_status(403)
- end
- end
-
- context 'user with admin role' do
- before { user.spree_roles << Spree::Role.find_or_create_by(name: 'admin') }
-
- it_behaves_like 'should be able to display forbidden page'
- end
-
- context 'user without admin role' do
- it_behaves_like 'should be able to display forbidden page'
- end
- end
-end
diff --git a/backend/spec/controllers/spree/admin/general_settings_controller_spec.rb b/backend/spec/controllers/spree/admin/general_settings_controller_spec.rb
deleted file mode 100644
index aea533018c..0000000000
--- a/backend/spec/controllers/spree/admin/general_settings_controller_spec.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-require 'spec_helper'
-
-describe Spree::Admin::GeneralSettingsController, type: :controller do
- let(:user) { create(:user) }
-
- before do
- allow(controller).to receive_messages spree_current_user: user
- user.spree_roles << Spree::Role.find_or_create_by(name: 'admin')
- end
-
- describe '#clear_cache' do
- subject { post :clear_cache }
-
- shared_examples 'a HTTP 204 response' do
- it 'grant access to users with an admin role' do
- subject
- expect(response.status).to eq(204)
- end
- end
-
- context 'when no callback' do
- it_behaves_like 'a HTTP 204 response'
- end
-
- context 'when callback implemented' do
- Spree::Admin::GeneralSettingsController.class_eval do
- custom_callback(:clear_cache).after :foo
-
- def foo
- # Make a call to Akamai, CloudFlare, etc invalidation....
- end
- end
-
- before do
- expect(controller).to receive(:foo).once
- end
-
- it_behaves_like 'a HTTP 204 response'
- end
- end
-end
diff --git a/backend/spec/controllers/spree/admin/images_controller_spec.rb b/backend/spec/controllers/spree/admin/images_controller_spec.rb
deleted file mode 100644
index a9789abd8c..0000000000
--- a/backend/spec/controllers/spree/admin/images_controller_spec.rb
+++ /dev/null
@@ -1,188 +0,0 @@
-require 'spec_helper'
-
-module Spree
- module Admin
- describe ImagesController, type: :controller do
- stub_authorization!
-
- let(:store) { Spree::Store.default }
- let(:product) { create(:product, stores: [store]) }
- let(:product_in_other_store) { create(:product, stores: [create(:store)]) }
-
- describe '#index' do
- let!(:image_1) { create(:image, viewable: product.master) }
- let!(:image_2) { create(:image, viewable: product.master) }
- let!(:image_3) { create(:image, viewable: create(:variant)) }
- let!(:image_4) { create(:image, viewable: product_in_other_store.master) }
-
- it 'assigns the images for a requested product' do
- get :index, params: { product_id: product.slug }
- expect(assigns(:collection)).to include image_1
- expect(assigns(:collection)).to include image_2
- expect(assigns(:collection)).not_to include image_4
- end
- end
-
- describe '#destroy' do
- context 'when request format is javascript' do
- subject(:send_request) do
- delete :destroy, params: { product_id: product, id: image, format: :js }
- end
-
- let(:image) { create(:image, viewable: product.master) }
-
- shared_examples 'correct response' do
- it { expect(assigns(:image)).to eq(image) }
- it { expect(response).to have_http_status(:ok) }
- end
-
- context 'will successfully destroy image' do
- describe 'returns response' do
- before { send_request }
-
- it_behaves_like 'correct response'
- it { expect(flash[:success]).to eq('Image has been successfully removed!') }
- end
- end
-
- context 'can destroy image belonging to a variant not master_variant' do
- let(:variant) { create(:variant) }
- let(:product) { variant.product }
- let(:image) { create(:image, viewable: variant) }
-
- before do
- product.update(stores: [store])
- product.save
- product.reload
- end
-
- it do
- send_request
- expect(flash[:error]).not_to eq('Image is not found')
- expect(flash[:success]).to eq('Image has been successfully removed!')
- end
- end
-
- context 'can not destroy image belonging to a variant not master_variant but also belongs to other store' do
- let(:variant) { create(:variant) }
- let(:product) { variant.product }
- let(:image) { create(:image, viewable: variant) }
-
- before do
- product.update(stores: [create(:store)])
- product.save
- product.reload
- end
-
- it do
- send_request
- expect(flash[:error]).to eq('Image is not found')
- end
- end
-
- context 'cannot destroy image of other product' do
- let(:other_product) { create(:product, stores: [store]) }
- let(:image) { create(:image, viewable: other_product) }
-
- it { expect(send_request).to redirect_to(spree.admin_product_images_path(product)) }
-
- it do
- send_request
- expect(flash[:error]).to eq('Image is not found')
- end
- end
-
- context 'cannot destroy image of product from different store' do
- let(:product) { create(:product, stores: [create(:store)]) }
- before { send_request }
-
- it do
- expect(send_request).to redirect_to(spree.admin_product_images_path(product))
- expect(flash[:error]).to eq('Image is not found')
- end
- end
- end
-
- context 'when request format is html' do
- subject(:send_request) do
- delete :destroy, params: { product_id: product, id: image, format: :html }
- end
-
- let(:image) { create(:image, viewable: product.master) }
-
- shared_examples 'correct response' do
- it { expect(assigns(:image)).to eq(image) }
- it { expect(response).to have_http_status(:ok) }
- end
-
- context 'will successfully destroy image' do
- describe 'returns response' do
- before { send_request }
-
- it { expect(send_request).to redirect_to(spree.admin_product_images_path(product)) }
- end
- end
-
- context 'can destroy image belonging to a variant not master_variant' do
- let(:variant) { create(:variant) }
- let(:product) { variant.product }
- let(:image) { create(:image, viewable: variant) }
-
- before do
- product.update(stores: [store])
- product.save
- product.reload
- end
-
- it do
- send_request
- expect(flash[:error]).not_to eq('Image is not found')
- expect(flash[:success]).to eq('Image has been successfully removed!')
- expect(send_request).to redirect_to(spree.admin_product_images_path(product))
- end
- end
-
- context 'can not destroy image belonging to a variant not master_variant but also belongs to other store' do
- let(:variant) { create(:variant) }
- let(:product) { variant.product }
- let(:image) { create(:image, viewable: variant) }
-
- before do
- product.update(stores: [create(:store)])
- product.save
- product.reload
- end
-
- it do
- send_request
- expect(flash[:error]).to eq('Image is not found')
- end
- end
-
- context 'cannot destroy image of other product' do
- let(:other_product) { create(:product, stores: [store]) }
- let(:image) { create(:image, viewable: other_product) }
-
- it { expect(send_request).to redirect_to(spree.admin_product_images_path(product)) }
-
- it do
- send_request
- expect(flash[:error]).to eq('Image is not found')
- end
- end
-
- context 'cannot destroy image of product from different store' do
- let(:product) { create(:product, stores: [create(:store)]) }
-
- before { send_request }
-
- it do
- expect(send_request).to redirect_to(spree.admin_product_images_path(product))
- expect(flash[:error]).to eq('Image is not found')
- end
- end
- end
- end
- end
- end
-end
diff --git a/backend/spec/controllers/spree/admin/missing_products_controller_spec.rb b/backend/spec/controllers/spree/admin/missing_products_controller_spec.rb
deleted file mode 100644
index e6c7530586..0000000000
--- a/backend/spec/controllers/spree/admin/missing_products_controller_spec.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-require 'spec_helper'
-# This test exists in this file because in the standard admin/products_controller spec
-# There is the stub_authorization call. This call is not triggered for this test because
-# the load_resource filter in Spree::Admin::ResourceController is prepended to the filter chain
-# this means this call is triggered before the authorize_admin call and in this case
-# the load_resource filter halts the request meaning authorize_admin is not called at all.
-describe Spree::Admin::ProductsController, type: :controller do
- stub_authorization!
-
- # Regression test for GH #538
- it 'cannot find a non-existent product' do
- get :edit, params: { id: 'non-existent-product' }
- expect(response).to redirect_to(spree.admin_products_path)
- expect(flash[:error]).to eql('Product is not found')
- end
-end
diff --git a/backend/spec/controllers/spree/admin/orders/customer_details_controller_spec.rb b/backend/spec/controllers/spree/admin/orders/customer_details_controller_spec.rb
deleted file mode 100644
index 0534953917..0000000000
--- a/backend/spec/controllers/spree/admin/orders/customer_details_controller_spec.rb
+++ /dev/null
@@ -1,78 +0,0 @@
-require 'spec_helper'
-require 'cancan'
-require 'spree/testing_support/bar_ability'
-
-describe Spree::Admin::Orders::CustomerDetailsController, type: :controller do
- context 'with authorization' do
- stub_authorization!
-
- let(:store) { Spree::Store.default }
- let(:user) { create(:user) }
- let(:country) { create(:country) }
- let(:state) { create(:state, country: country) }
-
- let(:order) do
- create(:order_with_line_items, total: 100, number: 'R123456789', store: store, state: 'cart', user: nil, email: '[email protected]')
- end
-
- let(:valid_attributes) do
- {
- order_id: order.number,
- order: {
- email: '',
- use_billing: '',
- bill_address_attributes: build(:address, firstname: 'Jane', country: country, state: state).attributes,
- ship_address_attributes: build(:address, firstname: 'Jane', country: country, state: state).attributes,
- user_id: user.id.to_s
- },
- guest_checkout: guest_checkout
- }
- end
-
- describe '#update' do
- let(:attributes) { valid_attributes }
-
- def send_request(params = {})
- put :update, params: params
- end
-
- before { send_request(attributes) }
-
- context 'using guest checkout' do
- let(:guest_checkout) { 'true' }
-
- context 'valid parameters' do
- it { expect(response).to redirect_to(edit_admin_order_url(order)) }
- it { expect(order.reload.bill_address.firstname).to eq('Jane') }
- it { expect(order.reload.user).to be_nil }
- end
-
- context 'invalid parameters' do
- let(:attributes) do
- valid_attributes.deep_merge(order: { ship_address_attributes: { 'firstname' => '' } })
- end
-
- it { expect(response).to render_template(:edit) }
- end
- end
-
- context 'user order' do
- let(:guest_checkout) { 'false' }
-
- context 'valid parameters' do
- it { expect(response).to redirect_to(edit_admin_order_url(order)) }
- it { expect(order.reload.bill_address.firstname).to eq('Jane') }
- it { expect(order.reload.user).to eq(user) }
- end
-
- context 'invalid parameters' do
- let(:attributes) do
- valid_attributes.merge(guest_checkout: 'false', order: { user_id: 99_999_999 })
- end
-
- it { expect(response).to render_template(:edit) }
- end
- end
- end
- end
-end
diff --git a/backend/spec/controllers/spree/admin/orders_controller_spec.rb b/backend/spec/controllers/spree/admin/orders_controller_spec.rb
deleted file mode 100644
index 3bfaf98b24..0000000000
--- a/backend/spec/controllers/spree/admin/orders_controller_spec.rb
+++ /dev/null
@@ -1,351 +0,0 @@
-require 'spec_helper'
-require 'cancan'
-require 'spree/testing_support/bar_ability'
-
-# Ability to test access to specific model instances
-class OrderSpecificAbility
- include CanCan::Ability
-
- def initialize(_user)
- can [:admin, :manage], Spree::Order, number: 'R987654321'
- end
-end
-
-describe Spree::Admin::OrdersController, type: :controller do
- let(:store) { Spree::Store.default }
-
- shared_examples 'refreshes shipping rates conditionally' do |action_name|
- let(:shipments) { order.reload.shipments }
-
- before do
- order.shipments.each { |s| s.shipping_rates.destroy_all }
- get action_name, params: { id: order.number }
- end
-
- context 'when order is not completed' do
- it { expect(shipments.map(&:shipping_rates).flatten).not_to be_empty }
- it { expect(shipments.first.selected_shipping_rate.shipping_method.available_to_display?(display_value)).to be_truthy }
- end
-
- context 'when order is complete' do
- let(:order) { create(:order_ready_to_ship, store: store) }
-
- it { expect(shipments.map(&:shipping_rates).flatten).to be_empty }
- end
- end
-
- context 'with authorization' do
- stub_authorization!
-
- let(:order) { create(:order_with_line_items, number: 'R123456789', store: store) }
- let(:adjustments) { order.all_adjustments.reload }
- let(:admin_user) { create(:admin_user) }
- let(:display_value) { Spree::ShippingMethod::DISPLAY_ON_BACK_END }
-
- before do
- allow(controller).to receive(:try_spree_current_user).and_return(admin_user)
- end
-
- describe '#approve' do
- it 'approves an order' do
- put :approve, params: { id: order.number }
- expect(flash[:success]).to eq Spree.t(:order_approved)
- order.reload
- expect(order.approved?).to eq true
- expect(order.approver).to eq admin_user
- end
- end
-
- describe '#cancel' do
- let(:order) { create(:order_ready_to_ship, store: store) }
-
- it 'cancels an order' do
- put :cancel, params: { id: order.number }
- expect(flash[:success]).to eq Spree.t(:order_canceled)
- order.reload
- expect(order.canceled?).to eq true
- expect(order.canceler).to eq admin_user
- end
- end
-
- describe '#channel' do
- subject do
- get :channel, params: { id: order.number }
- end
-
- it 'displays a page with channel input' do
- expect(subject).to render_template :channel
- end
- end
-
- context '#set_channel' do
- it 'sets channel on an order' do
- put :set_channel, params: { id: order.number, channel: 'POS' }
- expect(order.reload.channel).to eq 'POS'
-
- expect(flash[:success]).to eq Spree.t(:successfully_updated, resource: 'Order')
- end
- end
-
- describe '#resume' do
- let(:order) { create(:order, state: 'canceled', store: store) }
-
- it 'resumes an order' do
- put :resume, params: { id: order.number }
- order.reload
- expect(order.resumed?).to eq(true)
- expect(flash[:success]).to eq Spree.t(:order_resumed)
- end
- end
-
- describe '#resend' do
- let(:order) { create(:order, state: 'canceled', store: store) }
-
- it 'resends oder mailer' do
- put :resend, params: { id: order.number }
- expect(flash[:success]).to eq Spree.t(:order_email_resent)
- end
- end
-
- context 'pagination' do
- it 'can page through the orders' do
- get :index, params: { page: 2, per_page: 10 }
- expect(assigns[:orders].offset_value).to eq(10)
- expect(assigns[:orders].limit_value).to eq(10)
- end
- end
-
- # Test for #3346
- describe '#new' do
- it 'a new order has the current user assigned as a creator and proper store' do
- get :new
- expect(assigns[:order].created_by).to eq(admin_user)
- expect(assigns[:order].store).to eq(store)
- end
- end
-
- # Regression test for #3684
- describe '#edit' do
- it_behaves_like 'refreshes shipping rates conditionally', :edit
- end
-
- describe '#cart' do
- it_behaves_like 'refreshes shipping rates conditionally', :cart
- end
-
- # Test for #3919
- context 'search' do
- before do
- create(:completed_order_with_totals)
- expect(Spree::Order.count).to eq 1
- end
-
- def send_request
- get :index, params: {
- q: {
- line_items_variant_id_in: Spree::Order.first.variant_ids
- }
- }
- end
-
- it 'does not display duplicate results' do
- send_request
- expect(assigns[:orders].map(&:number).count).to eq 1
- end
-
- it 'preloads users' do
- allow(Spree::Order).to receive(:preload).with(:user).and_return(Spree::Order.all)
- send_request
- end
- end
-
- describe '#open_adjustments' do
- let(:order) { create(:order_ready_to_ship, store: store) }
- let(:shipment) { order.shipments.first }
-
- before do
- shipment.adjustments.create!(
- order: order,
- label: 'Additional',
- amount: 5,
- included: false,
- state: 'closed'
- )
- shipment.update_amounts
- end
-
- it 'changes all the closed adjustments to open' do
- post :open_adjustments, params: { id: order.number }
- expect(adjustments.map(&:state)).to eq(['open'])
- end
-
- it 'sets the flash success message' do
- post :open_adjustments, params: { id: order.number }
- expect(flash[:success]).to eql('All adjustments successfully opened!')
- end
-
- context 'when referer' do
- before do
- request.env['HTTP_REFERER'] = '/'
- end
-
- it 'redirects back' do
- post :open_adjustments, params: { id: order.number }
- expect(response).to redirect_to('/')
- end
- end
-
- context 'when no referer' do
- before do
- request.env['HTTP_REFERER'] = nil
- end
-
- it 'refirects to fallback location' do
- post :open_adjustments, params: { id: order.number }
- expect(response).to redirect_to(admin_order_adjustments_url(order))
- end
- end
- end
-
- describe '#close_adjustments' do
- let(:order) { create(:order_ready_to_ship, store: store) }
- let(:shipment) { order.shipments.first }
-
- before do
- shipment.adjustments.create!(
- order: order,
- label: 'Additional',
- amount: 5,
- included: false,
- state: 'open'
- )
- shipment.update_amounts
- end
-
- it 'changes all the open adjustments to closed' do
- post :close_adjustments, params: { id: order.number }
- expect(adjustments.map(&:state)).to eq(['closed'])
- end
-
- it 'sets the flash success message' do
- post :close_adjustments, params: { id: order.number }
- expect(flash[:success]).to eql('All adjustments successfully closed!')
- end
-
- context 'when referer' do
- before do
- request.env['HTTP_REFERER'] = '/'
- end
-
- it 'redirects back' do
- post :close_adjustments, params: { id: order.number }
- expect(response).to redirect_to('/')
- end
- end
-
- context 'when no referer' do
- before do
- request.env['HTTP_REFERER'] = nil
- end
-
- it 'refirects to fallback location' do
- post :close_adjustments, params: { id: order.number }
- expect(response).to redirect_to(admin_order_adjustments_url(order))
- end
- end
- end
- end
-
- describe '#authorize_admin' do
- let(:user) { create(:user) }
- let(:order) { create(:completed_order_with_totals, number: 'R987654321') }
-
- def with_ability(ability)
- Spree::Ability.register_ability(ability)
- yield
- ensure
- Spree::Ability.remove_ability(ability)
- end
-
- before do
- allow(Spree::Order).to receive_messages find: order
- allow(controller).to receive_messages spree_current_user: user
- end
-
- it 'grants access to users with an admin role' do
- user.spree_roles << Spree::Role.find_or_create_by(name: 'admin')
- post :index
- expect(response).to render_template :index
- end
-
- it 'grants access to users with an bar role' do
- with_ability(BarAbility) do
- user.spree_roles << Spree::Role.find_or_create_by(name: 'bar')
- post :index
- expect(response).to render_template :index
- end
- end
-
- it 'denies access to users with an bar role' do
- with_ability(BarAbility) do
- allow(order).to receive(:update).and_return true
- allow(order).to receive(:user).and_return Spree.user_class.new
- allow(order).to receive(:token).and_return nil
- user.spree_roles.clear
- user.spree_roles << Spree::Role.find_or_create_by(name: 'bar')
- put :update, params: { id: order.number }
- expect(response).to redirect_to(spree.admin_forbidden_path)
- end
- end
-
- it 'denies access to users without an admin role' do
- allow(user).to receive_messages has_spree_role?: false
- post :index
- expect(response).to redirect_to(spree.admin_forbidden_path)
- end
-
- it 'denies access to not signed in users' do
- allow(controller).to receive_messages spree_current_user: nil
- get :index
- expect(response).to redirect_to('/')
- end
-
- it 'restricts returned order(s) on index when using OrderSpecificAbility' do
- number = order.number
-
- create_list(:completed_order_with_totals, 3)
- expect(Spree::Order.complete.count).to eq 4
-
- with_ability(OrderSpecificAbility) do
- allow(user).to receive_messages has_spree_role?: false
- get :index
- expect(response).to render_template :index
- expect(assigns['orders'].distinct(false).size).to eq 1
- expect(assigns['orders'].first.number).to eq number
- expect(Spree::Order.accessible_by(Spree::Ability.new(user), :index).pluck(:number)).to eq [number]
- end
- end
- end
-
- context 'wrong order number' do
- stub_authorization!
-
- it 'redirects to orders list' do
- get :edit, params: { id: 99_999_999 }
-
- expect(response).to redirect_to(spree.admin_orders_path)
- end
- end
-
- context 'order from another store' do
- stub_authorization!
-
- let(:order) { create(:order_with_line_items, store: create(:store)) }
-
- it 'redirects to orders list' do
- get :edit, params: { id: order.number }
-
- expect(response).to redirect_to(spree.admin_orders_path)
- end
- end
-end
diff --git a/backend/spec/controllers/spree/admin/payment_methods_controller_spec.rb b/backend/spec/controllers/spree/admin/payment_methods_controller_spec.rb
deleted file mode 100644
index 395af4a2d0..0000000000
--- a/backend/spec/controllers/spree/admin/payment_methods_controller_spec.rb
+++ /dev/null
@@ -1,126 +0,0 @@
-require 'spec_helper'
-
-module Spree
- class GatewayWithPassword < PaymentMethod
- preference :password, :string, default: 'password'
- end
-
- describe Admin::PaymentMethodsController, type: :controller do
- stub_authorization!
-
- let(:store) { Spree::Store.default }
- let(:payment_method) { GatewayWithPassword.create!(name: 'Bogus', preferred_password: 'haxme', stores: [store]) }
-
- # regression test for #2094
- it 'does not clear password on update' do
- expect(payment_method.preferred_password).to eq('haxme')
- put :update, params: { id: payment_method.id, payment_method: { type: payment_method.class.to_s, preferred_password: '' } }
- expect(response).to redirect_to(spree.edit_admin_payment_method_path(payment_method))
-
- payment_method.reload
- expect(payment_method.preferred_password).to eq('haxme')
- end
-
- it 'saves payment method preferences on update' do
- put :update, params: {
- id: payment_method.id,
- payment_method: {
- type: payment_method.class.to_s,
- name: 'Bogus'
- },
- gateway_with_password: {
- preferred_password: 'abc'
- }
- }
-
- payment_method.reload
- expect(payment_method.preferred_password).to eq('abc')
- end
-
- context 'tries to save invalid payment' do
- it "doesn't break, responds nicely" do
- expect do
- post :create, params: { payment_method: { name: '', type: 'Spree::Gateway::Bogus' } }
- end.not_to raise_error
- end
- end
-
- it 'can create a payment method of a valid type' do
- expect do
- post :create, params: { payment_method: { name: 'Test Method', type: 'Spree::Gateway::Bogus' } }
- end.to change(Spree::PaymentMethod, :count).by(1)
-
- expect(Spree::PaymentMethod.last.stores).to eq([store])
-
- expect(response).to redirect_to spree.edit_admin_payment_method_path(assigns(:payment_method))
- end
-
- it 'can not create a payment method of an invalid type' do
- expect do
- post :create, params: { payment_method: { name: 'Invalid Payment Method', type: 'Spree::InvalidType' } }
- end.to change(Spree::PaymentMethod, :count).by(0)
-
- expect(response).to redirect_to spree.new_admin_payment_method_path
- end
-
- describe '#index' do
- let!(:payment_method_1) { create(:payment_method, stores: [store]) }
- let!(:payment_method_2) { create(:payment_method, stores: [store]) }
- let!(:payment_method_3) { create(:payment_method, stores: [create(:store)]) }
-
- it 'assigns the payment_methods for current store' do
- get :index
- expect(assigns(:collection)).to include payment_method_1
- expect(assigns(:collection)).to include payment_method_2
- expect(assigns(:collection)).not_to include payment_method_3
- end
- end
-
- describe '#edit' do
- subject(:send_request) do
- get :edit, params: { id: payment_method }
- end
-
- it { expect(send_request).to have_http_status(:ok) }
-
- context 'payment method from different store' do
- let(:payment_method) { create(:payment_method, stores: [create(:store)]) }
-
- it { expect(send_request).to redirect_to(spree.admin_payment_methods_path) }
- end
- end
-
- describe '#destroy' do
- subject(:send_request) do
- delete :destroy, params: { id: payment_method, format: :js }
- end
-
- let(:payment_method) { create(:payment_method, stores: [store], name: 'Test') }
-
- shared_examples 'correct response' do
- it { expect(assigns(:payment_method)).to eq(payment_method) }
- it { expect(response).to have_http_status(:ok) }
- end
-
- context 'will successfully destroy payment_method' do
- describe 'returns response' do
- before { send_request }
-
- it_behaves_like 'correct response'
- it { expect(flash[:success]).to eq('Payment Method "Test" has been successfully removed!') }
- end
- end
-
- context 'cannot destroy payment_method from different store' do
- let(:payment_method) { create(:payment_method, stores: [create(:store)]) }
-
- it { expect(send_request).to redirect_to(spree.admin_payment_methods_path) }
-
- it do
- send_request
- expect(flash[:error]).to eq('Payment Method is not found')
- end
- end
- end
- end
-end
diff --git a/backend/spec/controllers/spree/admin/payments_controller_spec.rb b/backend/spec/controllers/spree/admin/payments_controller_spec.rb
deleted file mode 100644
index c23ad3ec0b..0000000000
--- a/backend/spec/controllers/spree/admin/payments_controller_spec.rb
+++ /dev/null
@@ -1,95 +0,0 @@
-require 'spec_helper'
-
-module Spree
- module Admin
- describe PaymentsController, type: :controller do
- stub_authorization!
-
- let(:order) { create(:order) }
-
- context 'with a valid credit card' do
- let(:order) { create(:order_with_line_items, state: 'payment') }
- let(:payment_method) { create(:credit_card_payment_method, display_on: 'back_end') }
-
- before do
- attributes = {
- order_id: order.number,
- card: 'new',
- payment: {
- amount: order.total,
- payment_method_id: payment_method.id.to_s,
- source_attributes: {
- name: 'Test User',
- number: '4111 1111 1111 1111',
- expiry: "09 / #{Time.current.year + 1}",
- verification_value: '123'
- }
- }
- }
- post :create, params: attributes
- end
-
- it 'processes payment correctly' do
- expect(order.payments.count).to eq(1)
- expect(response).to redirect_to(spree.admin_order_payments_path(order))
- expect(order.reload.state).to eq('complete')
- end
-
- # Regression for #4768
- it 'doesnt process the same payment twice' do
- expect(Spree::LogEntry.where(source: order.payments.first).count).to eq(1)
- end
- end
-
- # Regression test for #3233
- context 'with a backend payment method' do
- before do
- @payment_method = create(:check_payment_method, display_on: 'back_end')
- end
-
- it 'loads backend payment methods' do
- get :new, params: { order_id: order.number }
- expect(response.status).to eq(200)
- expect(assigns[:payment_methods]).to include(@payment_method)
- end
- end
-
- context 'order has billing address' do
- before do
- order.bill_address = create(:address)
- order.save!
- end
-
- context 'order does not have payments' do
- it 'redirect to new payments page' do
- get :index, params: { amount: 100, order_id: order.number }
- expect(response).to redirect_to(spree.new_admin_order_payment_path(order))
- end
- end
-
- context 'order has payments' do
- before do
- order.payments << create(:payment, amount: order.total, order: order, state: 'completed')
- end
-
- it 'shows the payments page' do
- get :index, params: { amount: 100, order_id: order.number }
- expect(response.code).to eq '200'
- end
- end
- end
-
- context 'order does not have a billing address' do
- before do
- order.bill_address = nil
- order.save
- end
-
- it 'redirects to the customer details page' do
- get :index, params: { amount: 100, order_id: order.number }
- expect(response).to redirect_to(spree.edit_admin_order_customer_path(order))
- end
- end
- end
- end
-end
diff --git a/backend/spec/controllers/spree/admin/products_controller_spec.rb b/backend/spec/controllers/spree/admin/products_controller_spec.rb
deleted file mode 100644
index e4cfb08c36..0000000000
--- a/backend/spec/controllers/spree/admin/products_controller_spec.rb
+++ /dev/null
@@ -1,225 +0,0 @@
-require 'spec_helper'
-
-describe Spree::Admin::ProductsController, type: :controller do
- stub_authorization!
-
- let(:store) { Spree::Store.default }
-
- context '#index' do
- let(:ability_user) { stub_model(Spree::LegacyUser, has_spree_role?: true) }
-
- # Regression test for #1259
- it 'can find a product by SKU' do
- product = create(:product, sku: 'ABC123', stores: [store])
- get :index, params: { q: { sku_start: 'ABC123' } }
- expect(assigns[:collection]).not_to be_empty
- expect(assigns[:collection]).to include(product)
- end
-
- it 'cannot find products from different stores' do
- product = create(:product, sku: 'ABC123', stores: [create(:store)])
- get :index, params: { q: { sku_start: 'ABC123' } }
- expect(assigns[:collection]).to be_empty
- expect(assigns[:collection]).not_to include(product)
- end
- end
-
-
-
- # regression test for #1370
- context 'adding properties to a product' do
- let!(:product) { create(:product, stores: [store]) }
-
- specify do
- put :update, params: {
- id: product.to_param,
- product: { product_properties_attributes: { '1' => { property_name: 'Foo', value: 'bar' } } }
- }
- expect(flash[:success]).to eq("Product #{product.name.inspect} has been successfully updated!")
- end
- end
-
- # regression test for #801
- describe '#destroy' do
- let(:product) { mock_model(Spree::Product) }
- let(:products) { double(ActiveRecord::Relation) }
-
- def send_request
- delete :destroy, params: { id: product, format: :js }
- end
-
- context 'will successfully destroy product' do
- before do
- allow(Spree::Product).to receive(:friendly).and_return(products)
- allow(products).to receive(:find).with(product.id.to_s).and_return(product)
- allow(product).to receive(:destroy).and_return(true)
- end
-
- describe 'expects to receive' do
- after { send_request }
-
- it { expect(Spree::Product).to receive(:friendly).and_return(products) }
- it { expect(products).to receive(:find).with(product.id.to_s).and_return(product) }
- it { expect(product).to receive(:destroy).and_return(true) }
- end
-
- describe 'assigns' do
- before { send_request }
-
- it { expect(assigns(:product)).to eq(product) }
- end
-
- describe 'response' do
- before { send_request }
-
- it { expect(response).to have_http_status(:ok) }
- it { expect(flash[:success]).to eq(Spree.t('notice_messages.product_deleted')) }
- end
- end
-
- context 'will not successfully destroy product' do
- let(:error_msg) { 'Failed to delete' }
-
- before do
- allow(Spree::Product).to receive(:friendly).and_return(products)
- allow(products).to receive(:find).with(product.id.to_s).and_return(product)
- allow(product).to receive_message_chain(:errors, :full_messages).and_return([error_msg])
- allow(product).to receive(:destroy).and_return(false)
- end
-
- describe 'expects to receive' do
- after { send_request }
-
- it { expect(Spree::Product).to receive(:friendly).and_return(products) }
- it { expect(products).to receive(:find).with(product.id.to_s).and_return(product) }
- it { expect(product).to receive(:destroy).and_return(false) }
- end
-
- describe 'assigns' do
- before { send_request }
-
- it { expect(assigns(:product)).to eq(product) }
- end
-
- describe 'response' do
- before { send_request }
-
- it { expect(response).to have_http_status(:ok) }
-
- it 'set flash error' do
- expected_error = Spree.t('notice_messages.product_not_deleted', error: error_msg)
- expect(flash[:error]).to eq(expected_error)
- end
- end
- end
-
- context 'cannot destroy product from different store' do
- let(:product) { create(:product, stores: [create(:store)]) }
-
- it { expect(send_request).to redirect_to(spree.admin_products_path) }
-
- it do
- send_request
- expect(flash[:error]).to eq('Product is not found')
- end
- end
- end
-
- describe '#clone' do
- subject(:send_request) do
- post :clone, params: { id: product, format: :js }
- end
-
- let!(:product) { create(:custom_product, name: 'MyProduct', sku: 'MySku') }
- let(:product2) { create(:custom_product, name: 'COPY OF MyProduct', sku: 'COPY OF MySku') }
- let(:variant) { create(:master_variant, name: 'COPY OF MyProduct', sku: 'COPY OF MySku', created_at: product.created_at - 1.day) }
-
- context 'will successfully clone product' do
- before do
- Timecop.freeze(Date.today + 30)
- allow(product).to receive(:duplicate).and_return(product2)
- send_request
- end
-
- after do
- Timecop.return
- end
-
- describe 'response' do
- it { expect(response).to have_http_status(:found) }
- it { expect(response).to be_redirect }
- it { expect(flash[:success]).to eq(Spree.t('notice_messages.product_cloned')) }
- end
- end
-
- context 'will not successfully clone product' do
- before do
- variant
- end
-
- describe 'response' do
- before { send_request }
-
- it { expect(response).to have_http_status(:found) }
- it { expect(response).to be_redirect }
-
- it 'set flash error' do
- expected_error = Spree.t('notice_messages.product_not_cloned', error: 'Validation failed: Sku has already been taken')
- expect(flash[:error]).to eq(expected_error)
- end
- end
- end
-
- context 'cannot clone product from different store' do
- let(:product) { create(:product, stores: [create(:store)]) }
-
- it { expect(send_request).to redirect_to(spree.admin_products_path) }
-
- it do
- send_request
- expect(flash[:error]).to eq('Product is not found')
- end
- end
- end
-
- describe '#show' do
- let(:product) { create(:product, stores: [store]) }
- let(:send_request) { get :stock, params: { id: product } }
-
- it { expect(send_request).to have_http_status(:ok) }
-
- context 'cannot see product from different store' do
- let(:product) { create(:product, stores: [create(:store)]) }
-
- it { expect(send_request).to redirect_to(spree.admin_products_path) }
-
- it do
- send_request
- expect(flash[:error]).to eq('Product is not found')
- end
- end
- end
-
- describe '#stock' do
- let(:product) { create(:product, stores: [store]) }
- let(:send_request) { get :stock, params: { id: product } }
-
- it 'restricts stock location based on accessible attributes' do
- expect(Spree::StockLocation).to receive(:accessible_by).and_return([])
- send_request
- end
-
- it { expect(send_request).to have_http_status(:ok) }
-
- context 'cannot see stock of product from different store' do
- let(:product) { create(:product, stores: [create(:store)]) }
-
- it { expect(send_request).to redirect_to(spree.admin_products_path) }
-
- it do
- send_request
- expect(flash[:error]).to eq('Product is not found')
- end
- end
- end
-end
diff --git a/backend/spec/controllers/spree/admin/promotion_actions_controller_spec.rb b/backend/spec/controllers/spree/admin/promotion_actions_controller_spec.rb
deleted file mode 100644
index 901a628b42..0000000000
--- a/backend/spec/controllers/spree/admin/promotion_actions_controller_spec.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-require 'spec_helper'
-
-describe Spree::Admin::PromotionActionsController, type: :controller do
- stub_authorization!
-
- let!(:promotion) { create(:promotion) }
-
- it 'can create a promotion action of a valid type' do
- post :create, params: { promotion_id: promotion.id, action_type: 'Spree::Promotion::Actions::CreateAdjustment' }
- expect(response).to be_redirect
- expect(response).to redirect_to spree.edit_admin_promotion_path(promotion)
- expect(promotion.actions.count).to eq(1)
- end
-
- it 'can not create a promotion action of an invalid type' do
- post :create, params: { promotion_id: promotion.id, action_type: 'Spree::InvalidType' }
- expect(response).to be_redirect
- expect(response).to redirect_to spree.edit_admin_promotion_path(promotion)
- expect(promotion.rules.count).to eq(0)
- end
-end
diff --git a/backend/spec/controllers/spree/admin/promotion_rules_controller_spec.rb b/backend/spec/controllers/spree/admin/promotion_rules_controller_spec.rb
deleted file mode 100644
index 75e405c2ae..0000000000
--- a/backend/spec/controllers/spree/admin/promotion_rules_controller_spec.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-require 'spec_helper'
-
-describe Spree::Admin::PromotionRulesController, type: :controller do
- stub_authorization!
-
- let!(:promotion) { create(:promotion) }
-
- it 'can create a promotion rule of a valid type' do
- post :create, params: { promotion_id: promotion.id, promotion_rule: { type: 'Spree::Promotion::Rules::Product' } }
- expect(response).to be_redirect
- expect(response).to redirect_to spree.edit_admin_promotion_path(promotion)
- expect(promotion.rules.count).to eq(1)
- end
-
- it 'can not create a promotion rule of an invalid type' do
- post :create, params: { promotion_id: promotion.id, promotion_rule: { type: 'Spree::InvalidType' } }
- expect(response).to be_redirect
- expect(response).to redirect_to spree.edit_admin_promotion_path(promotion)
- expect(promotion.rules.count).to eq(0)
- end
-end
diff --git a/backend/spec/controllers/spree/admin/promotions_controller_spec.rb b/backend/spec/controllers/spree/admin/promotions_controller_spec.rb
deleted file mode 100644
index 2e5553b083..0000000000
--- a/backend/spec/controllers/spree/admin/promotions_controller_spec.rb
+++ /dev/null
@@ -1,90 +0,0 @@
-require 'spec_helper'
-
-describe Spree::Admin::PromotionsController, type: :controller do
- stub_authorization!
-
- let(:store) { Spree::Store.default }
- let(:store_2) { create(:store) }
-
- let!(:promotion1) { create(:promotion, name: 'name1', code: 'code1', path: 'path1', stores: [store, store_2]) }
- let!(:promotion2) { create(:promotion, name: 'name2', code: 'code2', path: 'path2', stores: [store]) }
- let!(:promotion3) { create(:promotion, name: 'name3', code: 'code3', path: 'path3', stores: [store_2]) }
- let!(:category) { create :promotion_category }
-
- describe '#index' do
- it 'succeeds' do
- get :index
- expect(assigns[:promotions]).to match_array [promotion2, promotion1]
- end
-
- it 'assigns promotion categories' do
- get :index
- expect(assigns[:promotion_categories]).to match_array [category]
- end
-
- context 'search' do
- it 'pages results' do
- get :index, params: { per_page: '1' }
- expect(assigns[:promotions]).to eq [promotion2]
- end
-
- it 'filters by name' do
- get :index, params: { q: { name_cont: promotion1.name } }
- expect(assigns[:promotions]).to eq [promotion1]
- end
-
- it 'filters by code' do
- get :index, params: { q: { code_cont: promotion1.code } }
- expect(assigns[:promotions]).to eq [promotion1]
- end
-
- it 'filters by path' do
- get :index, params: { q: { path_cont: promotion1.path } }
- expect(assigns[:promotions]).to eq [promotion1]
- end
- end
- end
-
- describe '#clone' do
- subject do
- post :clone, params: { id: promotion1.id }
- end
-
- it 'creates a copy of promotion' do
- expect { subject }.to change { Spree::Promotion.count }.by(1)
- end
-
- it 'creates a copy of promotion with changed fields' do
- subject
- new_promo = Spree::Promotion.last
- expect(new_promo.name).to eq 'New name1'
- expect(new_promo.code).to match(/code1_[a-zA-Z]{4}/)
- expect(new_promo.path).to match(/path1_[a-zA-Z]{4}/)
- end
- end
-
- describe '#destroy' do
- subject(:send_request) do
- delete :destroy, params: { id: promotion, format: :js }
- end
-
- context 'will successfully destroy promotion' do
- let!(:promotion) { create(:promotion, stores: [store, store_2]) }
-
- describe 'returns response' do
- before { send_request }
-
- it { expect(assigns(:promotion)).to eq(promotion) }
- it { expect(response).to have_http_status(:ok) }
- it { expect(flash[:success]).to eq("Promotion \"#{promotion.name}\" has been successfully removed!") }
- end
- end
-
- context 'cannot destroy promotion from different store' do
- let!(:promotion) { create(:promotion, stores: [store_2]) }
-
- it { expect(send_request).to redirect_to(spree.admin_promotions_path) }
- it { expect { send_request }.not_to change { Spree::Promotion.count } }
- end
- end
-end
diff --git a/backend/spec/controllers/spree/admin/refunds_controller_spec.rb b/backend/spec/controllers/spree/admin/refunds_controller_spec.rb
deleted file mode 100644
index 2cacfef2de..0000000000
--- a/backend/spec/controllers/spree/admin/refunds_controller_spec.rb
+++ /dev/null
@@ -1,32 +0,0 @@
-require 'spec_helper'
-
-describe Spree::Admin::RefundsController do
- stub_authorization!
-
- describe 'POST create' do
- context 'a Spree::Core::GatewayError is raised' do
- subject do
- post :create, params: {
- refund: { amount: '50.0', refund_reason_id: '1' },
- order_id: payment.order.to_param,
- payment_id: payment.to_param
- }
- end
-
- let(:payment) { create(:payment) }
-
- before do
- def controller.create
- raise Spree::Core::GatewayError, 'An error has occurred'
- end
- end
-
- it 'sets an error message with the correct text' do
- subject
- expect(flash[:error]).to eq 'An error has occurred'
- end
-
- it { is_expected.to render_template(:new) }
- end
- end
-end
diff --git a/backend/spec/controllers/spree/admin/reimbursements_controller_spec.rb b/backend/spec/controllers/spree/admin/reimbursements_controller_spec.rb
deleted file mode 100644
index 321b7f5757..0000000000
--- a/backend/spec/controllers/spree/admin/reimbursements_controller_spec.rb
+++ /dev/null
@@ -1,74 +0,0 @@
-require 'spec_helper'
-
-describe Spree::Admin::ReimbursementsController, type: :controller do
- stub_authorization!
-
- before do
- Spree::RefundReason.find_or_create_by!(name: Spree::RefundReason::RETURN_PROCESSING_REASON, mutable: false)
- end
-
- describe '#create' do
- subject do
- post :create, params: { order_id: order.to_param, build_from_customer_return_id: customer_return.id }
- end
-
- let(:customer_return) { create(:customer_return, line_items_count: 1) }
- let(:order) { customer_return.order }
- let(:return_item) { customer_return.return_items.first }
- let(:payment) { order.payments.first }
-
- it 'creates the reimbursement' do
- expect { subject }.to change { order.reimbursements.count }.by(1)
- expect(assigns(:reimbursement).return_items.to_a).to eq customer_return.return_items.to_a
- end
-
- it 'redirects to the edit page' do
- subject
- expect(response).to redirect_to(spree.edit_admin_order_reimbursement_path(order, assigns(:reimbursement)))
- end
- end
-
- describe '#perform' do
- subject do
- post :perform, params: { order_id: order.to_param, id: reimbursement.to_param }
- end
-
- let(:reimbursement) { create(:reimbursement) }
- let(:customer_return) { reimbursement.customer_return }
- let(:order) { reimbursement.order }
- let(:return_items) { reimbursement.return_items }
- let(:payment) { order.payments.first }
-
- it 'redirects to customer return page' do
- subject
- expect(response).to redirect_to spree.admin_order_reimbursement_path(order, reimbursement)
- end
-
- it 'performs the reimbursement' do
- expect do
- subject
- end.to change { payment.refunds.count }.by(1)
- expect(payment.refunds.last.amount).to be > 0
- expect(payment.refunds.last.amount).to eq return_items.to_a.sum(&:total)
- end
-
- context 'a Spree::Core::GatewayError is raised' do
- before do
- def controller.perform
- raise Spree::Core::GatewayError, 'An error has occurred'
- end
- end
-
- it 'sets an error message with the correct text' do
- subject
- expect(flash[:error]).to eq 'An error has occurred'
- end
-
- it 'redirects to the edit page' do
- subject
- redirect_path = spree.edit_admin_order_reimbursement_path(order, assigns(:reimbursement))
- expect(response).to redirect_to(redirect_path)
- end
- end
- end
-end
diff --git a/backend/spec/controllers/spree/admin/reports_controller_spec.rb b/backend/spec/controllers/spree/admin/reports_controller_spec.rb
deleted file mode 100644
index ccf1cdc13f..0000000000
--- a/backend/spec/controllers/spree/admin/reports_controller_spec.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-require 'spec_helper'
-
-describe Spree::Admin::ReportsController, type: :controller do
- stub_authorization!
-
- after do
- Spree::Admin::ReportsController.available_reports.delete_if do |key, _value|
- key != :sales_total
- end
- end
-
- describe 'ReportsController.available_reports' do
- it 'contains sales_total' do
- expect(Spree::Admin::ReportsController.available_reports.key?(:sales_total)).to be true
- end
-
- it 'has the proper sales total report description' do
- expect(Spree::Admin::ReportsController.available_reports[:sales_total][:description]).to eql('Sales Total For All Orders')
- end
- end
-
- describe 'ReportsController.add_available_report!' do
- context 'when adding the report name' do
- it 'contains the report' do
- Spree::Admin::ReportsController.add_available_report!(:some_report)
- expect(Spree::Admin::ReportsController.available_reports.key?(:some_report)).to be true
- end
- end
- end
-
- describe 'GET index' do
- it 'is ok' do
- get :index
- expect(response).to be_ok
- end
- end
-
- it 'responds to model_class as Spree::AdminReportsController' do
- expect(controller.send(:model_class)).to eql(Spree::Admin::ReportsController)
- end
-end
diff --git a/backend/spec/controllers/spree/admin/resource_controller_spec.rb b/backend/spec/controllers/spree/admin/resource_controller_spec.rb
deleted file mode 100644
index 72a1a4f83d..0000000000
--- a/backend/spec/controllers/spree/admin/resource_controller_spec.rb
+++ /dev/null
@@ -1,153 +0,0 @@
-require 'spec_helper'
-
-module Spree
- module Admin
- class DummyModelsController < Spree::Admin::ResourceController
- prepend_view_path('spec/test_views')
-
- def model_class
- Spree::DummyModel
- end
- end
- end
-end
-
-describe Spree::Admin::DummyModelsController, type: :controller do
- stub_authorization!
-
- after(:all) do
- Rails.application.reload_routes!
- end
-
- before do
- Spree::Core::Engine.routes.draw do
- namespace :admin do
- resources :dummy_models do
- post :update_positions, on: :member
- end
- end
- end
- end
-
- describe '#new' do
- subject do
- get :new
- end
-
- it 'succeeds' do
- subject
- expect(response).to be_successful
- end
- end
-
- describe '#edit' do
- subject do
- get :edit, params: { id: dummy_model.to_param }
- end
-
- let(:dummy_model) { Spree::DummyModel.create!(name: 'a dummy_model') }
-
- it 'succeeds' do
- subject
- expect(response).to be_successful
- end
- end
-
- describe '#create' do
- subject { post :create, params: params }
-
- let(:params) do
- { dummy_model: { name: 'a dummy_model' } }
- end
-
- it 'creates the resource' do
- expect { subject }.to change { Spree::DummyModel.count }.by(1)
- end
-
- context 'without any parameters' do
- let(:params) { {} }
-
- before do
- allow_any_instance_of(Spree::DummyModel).to receive(:name).and_return('some name')
- end
-
- it 'creates the resource' do
- expect { subject }.to change { Spree::DummyModel.count }.by(1)
- end
- end
- end
-
- describe '#update' do
- subject { put :update, params: params }
-
- let(:dummy_model) { Spree::DummyModel.create!(name: 'a dummy_model') }
-
- let(:params) do
- {
- id: dummy_model.to_param,
- dummy_model: { name: 'dummy_model renamed' }
- }
- end
-
- it 'updates the resource' do
- expect { subject }.to change { dummy_model.reload.name }.from('a dummy_model').to('dummy_model renamed')
- end
- end
-
- describe '#destroy' do
- subject do
- delete :destroy, params: params
- end
-
- let!(:dummy_model) { Spree::DummyModel.create!(name: 'a dummy_model') }
- let(:params) { { id: dummy_model.id } }
-
- it 'destroys the resource' do
- expect { subject }.to change { Spree::DummyModel.count }.from(1).to(0)
- end
- end
-
- describe '#update_positions' do
- subject do
- post :update_positions, params: {
- id: dummy_model_1.to_param,
- positions: { dummy_model_1.id => '2', dummy_model_2.id => '1' }, format: 'js'
- }
- end
-
- let(:dummy_model_1) { Spree::DummyModel.create!(name: 'dummy_model 1', position: 1) }
- let(:dummy_model_2) { Spree::DummyModel.create!(name: 'dummy_model 2', position: 2) }
-
- it 'updates the position of dummy_model 1' do
- expect { subject }.to change { dummy_model_1.reload.position }.from(1).to(2)
- end
-
- it 'updates the position of dummy_model 2' do
- expect { subject }.to change { dummy_model_2.reload.position }.from(2).to(1)
- end
-
- it 'touches updated_at' do
- Timecop.scale(3600) do
- expect { subject }.to change { dummy_model_1.reload.updated_at }
- end
- end
- end
-end
-
-module Spree
- module Submodule
- class Post < Spree::Base
- end
- end
- module Admin
- module Submodule
- class PostsController < Spree::Admin::ResourceController
- prepend_view_path('spec/test_views')
-
- def model_class
- Spree::Submodule::Post
- end
- end
- end
- end
-end
diff --git a/backend/spec/controllers/spree/admin/return_authorizations_controller_spec.rb b/backend/spec/controllers/spree/admin/return_authorizations_controller_spec.rb
deleted file mode 100644
index c34def6dd6..0000000000
--- a/backend/spec/controllers/spree/admin/return_authorizations_controller_spec.rb
+++ /dev/null
@@ -1,223 +0,0 @@
-require 'spec_helper'
-
-describe Spree::Admin::ReturnAuthorizationsController, type: :controller do
- stub_authorization!
-
- # Regression test for #1370 #3
- let!(:order) { create(:shipped_order, line_items_count: 3) }
- let!(:return_authorization_reason) { create(:return_authorization_reason) }
- let(:inventory_unit_1) { order.inventory_units.order('id asc')[0] }
- let(:inventory_unit_2) { order.inventory_units.order('id asc')[1] }
- let(:inventory_unit_3) { order.inventory_units.order('id asc')[2] }
-
- describe '#load_return_authorization_reasons' do
- let!(:inactive_rma_reason) { create(:return_authorization_reason, active: false) }
-
- context 'return authorization has an associated inactive reason' do
- let!(:other_inactive_rma_reason) { create(:return_authorization_reason, active: false) }
- let(:return_authorization) { create(:return_authorization, reason: inactive_rma_reason) }
-
- it 'loads all the active rma reasons' do
- get :edit, params: { id: return_authorization.to_param, order_id: return_authorization.order.to_param }
- expect(assigns(:reasons)).to include(return_authorization_reason)
- expect(assigns(:reasons)).to include(inactive_rma_reason)
- expect(assigns(:reasons)).not_to include(other_inactive_rma_reason)
- end
- end
-
- context 'return authorization has an associated active reason' do
- let(:return_authorization) { create(:return_authorization, reason: return_authorization_reason) }
-
- it 'loads all the active rma reasons' do
- get :edit, params: { id: return_authorization.to_param, order_id: return_authorization.order.to_param }
- expect(assigns(:reasons)).to eq [return_authorization_reason]
- end
- end
-
- context "return authorization doesn't have an associated reason" do
- it 'loads all the active rma reasons' do
- get :new, params: { order_id: order.to_param }
- expect(assigns(:reasons)).to eq [return_authorization_reason]
- end
- end
- end
-
- describe '#load_return_items' do
- shared_context 'without existing return items' do
- context 'without existing return items' do
- it 'has 3 new @form_return_items' do
- subject
- expect(assigns(:form_return_items).size).to eq 3
- expect(assigns(:form_return_items).select(&:new_record?).size).to eq 3
- end
- end
- end
-
- shared_context 'with existing return items' do
- context 'with existing return items' do
- let!(:return_item_1) { create(:return_item, inventory_unit: inventory_unit_1, return_authorization: return_authorization) }
-
- it 'has 1 existing return item and 2 new return items' do
- subject
- expect(assigns(:form_return_items).size).to eq 3
- expect(assigns(:form_return_items).select(&:persisted?)).to eq [return_item_1]
- expect(assigns(:form_return_items).select(&:new_record?).size).to eq 2
- end
- end
- end
-
- context '#new' do
- subject { get :new, params: { order_id: order.to_param } }
-
- include_context 'without existing return items'
- end
-
- context '#edit' do
- subject do
- get :edit, params: {
- id: return_authorization.to_param,
- order_id: order.to_param
- }
- end
-
- let(:return_authorization) { create(:return_authorization, order: order) }
-
- include_context 'without existing return items'
- include_context 'with existing return items'
- end
-
- context '#create failed' do
- subject do
- post :create, params: {
- return_authorization: { return_authorization_reason_id: -1 }, # invalid reason_id
- order_id: order.to_param
- }
- end
-
- include_context 'without existing return items'
- end
-
- context '#update failed' do
- subject do
- put :update, params: {
- return_authorization: { return_authorization_reason_id: -1 }, # invalid reason_id
- id: return_authorization.to_param,
- order_id: order.to_param
- }
- end
-
- let(:return_authorization) { create(:return_authorization, order: order) }
-
- include_context 'without existing return items'
- include_context 'with existing return items'
- end
- end
-
- describe '#load_reimbursement_types' do
- let(:order) { create(:order) }
- let!(:inactive_reimbursement_type) { create(:reimbursement_type, active: false) }
- let!(:first_active_reimbursement_type) { create(:reimbursement_type) }
- let!(:second_active_reimbursement_type) { create(:reimbursement_type) }
-
- before do
- get :new, params: { order_id: order.to_param }
- end
-
- it 'loads all the active reimbursement types' do
- expect(assigns(:reimbursement_types)).to include(first_active_reimbursement_type)
- expect(assigns(:reimbursement_types)).to include(second_active_reimbursement_type)
- expect(assigns(:reimbursement_types)).not_to include(inactive_reimbursement_type)
- end
- end
-
- context '#create' do
- subject { post :create, params: params }
-
- let(:stock_location) { create(:stock_location) }
-
- let(:params) do
- {
- order_id: order.to_param,
- return_authorization: return_authorization_params
- }
- end
-
- let(:return_authorization_params) do
- {
- memo: '',
- stock_location_id: stock_location.id,
- return_authorization_reason_id: return_authorization_reason.id
- }
- end
-
- it 'can create a return authorization' do
- subject
- expect(response).to redirect_to spree.admin_order_return_authorizations_path(order)
- end
- end
-
- context '#update' do
- subject { put :update, params: params }
-
- let(:return_authorization) { create(:return_authorization, order: order) }
-
- let(:params) do
- {
- id: return_authorization.to_param,
- order_id: order.to_param,
- return_authorization: return_authorization_params
- }
- end
- let(:return_authorization_params) do
- {
- memo: '',
- return_items_attributes: return_items_params
- }
- end
-
- context 'adding an item' do
- let(:return_items_params) do
- {
- '0' => { inventory_unit_id: inventory_unit_1.to_param }
- }
- end
-
- context 'without existing items' do
- it 'creates a new item' do
- expect { subject }.to change { Spree::ReturnItem.count }.by(1)
- end
- end
-
- context 'with existing completed items' do
- let!(:completed_return_item) do
- create(:return_item, return_authorization: return_authorization,
- inventory_unit: inventory_unit_1,
- reception_status: 'received')
- end
-
- it 'does not create new items' do
- expect { subject }.not_to change { Spree::ReturnItem.count }
- expect(assigns[:return_authorization].errors['return_items.inventory_unit']).to eq ["#{inventory_unit_1.id} has already been taken by return item #{completed_return_item.id}"]
- end
- end
- end
-
- context 'removing an item' do
- let!(:return_item) do
- create(:return_item, return_authorization: return_authorization, inventory_unit: inventory_unit_1)
- end
-
- let(:return_items_params) do
- {
- '0' => { id: return_item.to_param, _destroy: '1' }
- }
- end
-
- context 'with existing items' do
- it 'removes the item' do
- expect { subject }.to change { Spree::ReturnItem.count }.by(-1)
- end
- end
- end
- end
-end
diff --git a/backend/spec/controllers/spree/admin/return_index_controller_spec.rb b/backend/spec/controllers/spree/admin/return_index_controller_spec.rb
deleted file mode 100644
index 28cb2b7aa2..0000000000
--- a/backend/spec/controllers/spree/admin/return_index_controller_spec.rb
+++ /dev/null
@@ -1,47 +0,0 @@
-require 'spec_helper'
-
-module Spree
- module Admin
- describe ReturnIndexController, type: :controller do
- stub_authorization!
-
- describe '#return_authorizations' do
- subject do
- get :return_authorizations
- end
-
- let(:return_authorization) { create(:return_authorization) }
-
- before { subject }
-
- it 'loads return authorizations' do
- expect(assigns(:collection)).to include(return_authorization)
- end
- end
-
- describe '#customer_returns' do
- subject do
- get :customer_returns
- end
-
- let(:customer_return) { create(:customer_return) }
-
- it 'loads customer returns' do
- subject
- expect(assigns(:collection)).to include(customer_return)
- end
-
- context 'when current store is different than customer return order store' do
- let(:new_store) { create(:store) }
-
- before { allow_any_instance_of(described_class).to receive(:current_store).and_return(new_store) }
-
- it 'should not load customer returns' do
- subject
- expect(assigns(:collection)).to be_empty
- end
- end
- end
- end
- end
-end
diff --git a/backend/spec/controllers/spree/admin/return_items_controller_spec.rb b/backend/spec/controllers/spree/admin/return_items_controller_spec.rb
deleted file mode 100644
index ddff3631a5..0000000000
--- a/backend/spec/controllers/spree/admin/return_items_controller_spec.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-require 'spec_helper'
-
-describe Spree::Admin::ReturnItemsController, type: :controller do
- stub_authorization!
-
- describe '#update' do
- subject do
- put :update, params: { id: return_item.to_param, return_item: { acceptance_status: new_acceptance_status } }
- end
-
- let(:customer_return) { create(:customer_return) }
- let(:return_item) { customer_return.return_items.first }
- let(:old_acceptance_status) { 'accepted' }
- let(:new_acceptance_status) { 'rejected' }
-
- it 'updates the return item' do
- expect do
- subject
- end.to change { return_item.reload.acceptance_status }.from(old_acceptance_status).to(new_acceptance_status)
- end
-
- it 'redirects to the custome return' do
- subject
- expect(response).to redirect_to spree.edit_admin_order_customer_return_path(customer_return.order, customer_return)
- end
- end
-end
diff --git a/backend/spec/controllers/spree/admin/shipping_methods_controller_spec.rb b/backend/spec/controllers/spree/admin/shipping_methods_controller_spec.rb
deleted file mode 100644
index 38600cb854..0000000000
--- a/backend/spec/controllers/spree/admin/shipping_methods_controller_spec.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-require 'spec_helper'
-
-describe Spree::Admin::ShippingMethodsController, type: :controller do
- stub_authorization!
-
- # Regression test for #1240
- it 'does not hard-delete shipping methods' do
- shipping_method = stub_model(Spree::ShippingMethod)
- allow(Spree::ShippingMethod).to receive_messages find: shipping_method
- expect(shipping_method.deleted_at).to be_nil
- delete :destroy, params: { id: 1 }
- expect(shipping_method.reload.deleted_at).not_to be_nil
- end
-end
diff --git a/backend/spec/controllers/spree/admin/stock_items_controller_spec.rb b/backend/spec/controllers/spree/admin/stock_items_controller_spec.rb
deleted file mode 100644
index 3289888d9b..0000000000
--- a/backend/spec/controllers/spree/admin/stock_items_controller_spec.rb
+++ /dev/null
@@ -1,32 +0,0 @@
-require 'spec_helper'
-
-module Spree
- module Admin
- describe StockItemsController, type: :controller do
- stub_authorization!
-
- let(:store) { Spree::Store.default }
- let(:store_2) { create(:store) }
-
- context 'formats' do
- let(:product) { create(:product, stores: [store]) }
- let(:product_2) { create(:product, stores: [store_2]) }
-
- let!(:stock_item) { create(:variant, product: product).stock_items.first }
- let!(:stock_item_2) { create(:variant, product: product_2).stock_items.first }
-
- it 'destroy stock item via js' do
- expect do
- delete :destroy, params: { format: :js, id: stock_item }
- end.to change(StockItem, :count).by(-1)
- end
-
- it 'cannot destroy stock from other store' do
- expect do
- delete :destroy, params: { format: :js, id: stock_item_2 }
- end.to raise_error(ActiveRecord::RecordNotFound)
- end
- end
- end
- end
-end
diff --git a/backend/spec/controllers/spree/admin/stock_locations_controller_spec.rb b/backend/spec/controllers/spree/admin/stock_locations_controller_spec.rb
deleted file mode 100644
index 175c47df95..0000000000
--- a/backend/spec/controllers/spree/admin/stock_locations_controller_spec.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-require 'spec_helper'
-
-module Spree
- module Admin
- describe StockLocationsController, type: :controller do
- stub_authorization!
-
- context 'with a default country present' do
- it 'can create a new stock location' do
- get :new
- expect(response).to be_successful
- end
- end
- end
- end
-end
diff --git a/backend/spec/controllers/spree/admin/stock_transfers_controller_spec.rb b/backend/spec/controllers/spree/admin/stock_transfers_controller_spec.rb
deleted file mode 100644
index 5adef25ccb..0000000000
--- a/backend/spec/controllers/spree/admin/stock_transfers_controller_spec.rb
+++ /dev/null
@@ -1,42 +0,0 @@
-require 'spec_helper'
-
-module Spree
- describe Admin::StockTransfersController, type: :controller do
- stub_authorization!
-
- let!(:stock_transfer1) do
- StockTransfer.create do |transfer|
- transfer.source_location_id = 1
- transfer.destination_location_id = 2
- transfer.reference = 'PO 666'
- end
- end
-
- let!(:stock_transfer2) do
- StockTransfer.create do |transfer|
- transfer.source_location_id = 3
- transfer.destination_location_id = 4
- transfer.reference = 'PO 666'
- end
- end
-
- context '#index' do
- it 'gets all transfers without search criteria' do
- get :index
- expect(assigns[:stock_transfers].count).to eq 2
- end
-
- it 'searches by source location' do
- get :index, params: { q: { source_location_id_eq: 1 } }
- expect(assigns[:stock_transfers].count).to eq 1
- expect(assigns[:stock_transfers]).to include(stock_transfer1)
- end
-
- it 'searches by destination location' do
- get :index, params: { q: { destination_location_id_eq: 4 } }
- expect(assigns[:stock_transfers].count).to eq 1
- expect(assigns[:stock_transfers]).to include(stock_transfer2)
- end
- end
- end
-end
diff --git a/backend/spec/controllers/spree/admin/store_credits_controller_spec.rb b/backend/spec/controllers/spree/admin/store_credits_controller_spec.rb
deleted file mode 100644
index 20f2c65cc9..0000000000
--- a/backend/spec/controllers/spree/admin/store_credits_controller_spec.rb
+++ /dev/null
@@ -1,63 +0,0 @@
-require 'spec_helper'
-
-module Spree
- module Admin
- describe StoreCreditsController, type: :controller do
- stub_authorization!
-
- let(:store) { Spree::Store.default }
- let(:user) { create(:user) }
-
- describe '#index' do
- let!(:store_credit_1) { create(:store_credit, user: user, store: store) }
- let!(:store_credit_2) { create(:store_credit, user: user, amount_used: 10, store: store) }
- let!(:store_credit_3) { create(:store_credit, user: user) }
- let!(:store_credit_4) { create(:store_credit, store: store, user: create(:user)) }
-
- it 'should assign only the store credits for user and current store' do
- get :index, params: { user_id: user.id }
- expect(assigns(:store_credits)).to include store_credit_1
- expect(assigns(:store_credits)).to include store_credit_2
- expect(assigns(:store_credits)).not_to include store_credit_3
- expect(assigns(:store_credits)).not_to include store_credit_4
- end
- end
-
- describe '#destroy' do
- subject(:send_request) do
- delete :destroy, params: { user_id: user.id, id: store_credit_to_destroy.id, format: :js }
- end
-
- context 'will successfully destroy store credit' do
- let(:store_credit_to_destroy) { create(:store_credit, user: user, store: store) }
-
- describe 'returns response' do
- before { send_request }
-
- it { expect(assigns(:store_credit)).to eq(store_credit_to_destroy) }
- it { expect(response).to have_http_status(:ok) }
- it { expect(flash[:success]).to eq(Spree.t('successfully_removed', resource: 'Store Credit')) }
- end
- end
-
- context 'cannot destroy store credit of other user' do
- let(:store_credit_to_destroy) { create(:store_credit) }
-
- it { expect { send_request }.to raise_error(ActiveRecord::RecordNotFound) }
- end
-
- context 'cannot destroy store credit from another store' do
- let(:store_credit_to_destroy) { create(:store_credit, user: user, store:create(:store)) }
-
- it { expect { send_request }.to raise_error(ActiveRecord::RecordNotFound) }
- end
-
- context 'cannot destroy store credit with used amount' do
- let(:store_credit_to_destroy) { create(:store_credit, store: store, user: user, amount_used: 10) }
-
- it { expect { send_request }.to raise_error(Spree::Admin::StoreCreditError) }
- end
- end
- end
- end
-end
diff --git a/backend/spec/controllers/spree/admin/stores_controller_spec.rb b/backend/spec/controllers/spree/admin/stores_controller_spec.rb
deleted file mode 100644
index 9d20cc9864..0000000000
--- a/backend/spec/controllers/spree/admin/stores_controller_spec.rb
+++ /dev/null
@@ -1,42 +0,0 @@
-require 'spec_helper'
-
-describe Spree::Admin::StoresController do
- stub_authorization!
-
- let!(:store) { create(:store) }
- let(:image_file) { Rack::Test::UploadedFile.new(Spree::Backend::Engine.root.join('spec', 'fixtures', 'thinking-cat.jpg')) }
- let(:store_with_logo) { create(:store, logo: image_file) }
-
- describe 'on :index' do
- it 'renders index' do
- get :index
-
- expect(response).to have_http_status(:ok)
- end
- end
-
- describe '#create' do
- it 'redirects to stores index page using the newly created store URL' do
- post :create, params: {
- store: { name: 'New Test Store',
- code: 'NTSS',
- mail_from_address: '[email protected]',
- url: 'http://test-new-store.lvh.me',
- default_locale: 'en',
- default_currency: 'USD',
- supported_currencies: ['USD,GBP'],
- supported_locales: ['en'] }
- }
-
- expect(response).to redirect_to('http://test-new-store.lvh.me/admin/stores')
- end
- end
-
- context 'update' do
- it 'can update logo' do
- put :update, params: { id: store.to_param, store: { logo: image_file } }
-
- expect(store.reload.logo.blob.filename).to eq(image_file.original_filename)
- end
- end
-end
diff --git a/backend/spec/controllers/spree/admin/tax_categories_controller_spec.rb b/backend/spec/controllers/spree/admin/tax_categories_controller_spec.rb
deleted file mode 100644
index 161cc9f141..0000000000
--- a/backend/spec/controllers/spree/admin/tax_categories_controller_spec.rb
+++ /dev/null
@@ -1,34 +0,0 @@
-require 'spec_helper'
-
-module Spree
- module Admin
- describe TaxCategoriesController, type: :controller do
- stub_authorization!
-
- describe 'GET #index' do
- subject { get :index }
-
- it 'is successful' do
- expect(subject).to be_successful
- end
- end
-
- describe 'PUT #update' do
- subject { put :update, params: { id: tax_category.id, tax_category: { name: 'Foo', tax_code: 'Bar' } } }
-
- let(:tax_category) { create :tax_category }
-
- it 'redirects' do
- expect(subject).to be_redirect
- end
-
- it 'updates' do
- subject
- tax_category.reload
- expect(tax_category.name).to eq('Foo')
- expect(tax_category.tax_code).to eq('Bar')
- end
- end
- end
- end
-end
diff --git a/backend/spec/controllers/spree/admin/taxonomies_controller_spec.rb b/backend/spec/controllers/spree/admin/taxonomies_controller_spec.rb
deleted file mode 100644
index 18f28f87f0..0000000000
--- a/backend/spec/controllers/spree/admin/taxonomies_controller_spec.rb
+++ /dev/null
@@ -1,91 +0,0 @@
-require 'spec_helper'
-
-describe Spree::Admin::TaxonomiesController, type: :controller do
- stub_authorization!
-
- let(:store) { create(:store) }
- let(:new_store) { create(:store) }
- let!(:taxonomy_1) { create(:taxonomy, store: store) }
- let!(:taxonomy_2) { create(:taxonomy, store: store) }
- let!(:taxonomy_3) { create(:taxonomy) }
-
- before do
- allow_any_instance_of(described_class).to receive(:current_store).and_return(store)
- end
-
- describe '#index' do
- it 'should assign only the store credits for user and current store' do
- get :index
- expect(assigns(:collection)).to include taxonomy_1
- expect(assigns(:collection)).to include taxonomy_2
- expect(assigns(:collection)).not_to include taxonomy_3
- end
- end
-
- context '#new' do
- it 'should create taxonomy' do
- get :new
- expect(response.status).to eq(200)
- end
- end
-
- describe '#create' do
- let(:request) { post :create, params: { taxonomy: { name: 'Shirts' } } }
-
- it 'should create taxonomy for current store' do
- expect{ request }.to change { store.taxonomies.count }.by(1)
- expect(response).to be_redirect
- end
-
- context 'different store' do
- subject(:create_request) { post(:create, params: {taxonomy: {name: 'Bags'}}) }
-
- before do
- allow_any_instance_of(described_class).to receive(:current_store).and_return(new_store)
- end
-
- it 'should not create taxonomy for store' do
- expect{ subject }.not_to change { store.taxonomies.reload.count }
- expect(response).to be_redirect
- end
-
- it 'should create taxonomy for new store' do
- expect{ subject }.to change { new_store.taxonomies.reload.count }.by(1)
- expect(response).to be_redirect
- end
- end
- end
-
- describe '#update' do
- it 'should allow to update current store taxonomy' do
- expect{ put(:update, params: { id: taxonomy_1.id, taxonomy: { name: 'Beverages' } }) }.to change{taxonomy_1.reload.name}.to('Beverages')
- end
-
- it 'should not allow to update not current store taxonomy' do
- expect{ put(:update, params: { id: taxonomy_3.id, taxonomy: { name: 'Shoes' } }) }.not_to change{taxonomy_3.reload.name}
- end
- end
-
- describe '#destroy' do
- before { delete :destroy, params: { id: taxonomy.id } }
-
- context 'when current store taxonomy' do
- let(:taxonomy) { taxonomy_1 }
-
- it 'should be able to destroy taxonomy' do
- expect(assigns(:object)).to eq(taxonomy)
- expect(response).to have_http_status(:found)
- expect(flash[:success]).to eq("Taxonomy \"#{taxonomy.name}\" has been successfully removed!")
- end
- end
-
- context 'when not current store taxonomy' do
- let(:taxonomy) { taxonomy_3 }
-
- it 'should be able to destroy taxonomy' do
- expect(assigns(:object)).to be_nil
- expect(flash[:error]).to eq("Taxonomy is not found")
- end
- end
- end
-end
diff --git a/backend/spec/controllers/spree/admin/taxons_controller_spec.rb b/backend/spec/controllers/spree/admin/taxons_controller_spec.rb
deleted file mode 100644
index 1306b9fa0d..0000000000
--- a/backend/spec/controllers/spree/admin/taxons_controller_spec.rb
+++ /dev/null
@@ -1,43 +0,0 @@
-require 'spec_helper'
-
-describe Spree::Admin::TaxonsController, type: :controller do
- stub_authorization!
-
- describe '#remove_icon' do
- let(:store) { Spree::Store.default }
- let!(:taxonomy) { create(:taxonomy, store: store) }
- let!(:taxon) { create(:taxon, taxonomy: taxonomy) }
- let!(:taxon_image) { Spree::TaxonImage.new }
- let!(:image_file) { File.open(Spree::Core::Engine.root + 'spec/fixtures' + 'thinking-cat.jpg') }
-
- before do
- allow_any_instance_of(described_class).to receive(:current_store).and_return(store)
- taxon_image.attachment.attach(io: image_file, filename: 'thinking-cat.jpg', content_type: 'image/jpeg')
- taxon.icon = taxon_image
- taxon.save!
- end
-
- it 'should remove current store taxon icon' do
- expect(taxon.icon).to eq(taxon_image)
-
- allow(taxon).to receive :remove_icon
- post :remove_icon, params: { taxonomy_id: taxonomy.id, id: taxon.id }
- taxon.reload
-
- expect(taxon.icon).to eq(nil)
- end
-
- context 'when different current store' do
- let!(:second_store) { create(:store) }
- let(:request) { post :remove_icon, params: { taxonomy_id: taxonomy.id, id: taxon.id } }
-
- before do
- allow_any_instance_of(described_class).to receive(:current_store).and_return(second_store)
- end
-
- it 'should not find taxonomy' do
- expect { request }.to raise_error(ActiveRecord::RecordNotFound)
- end
- end
- end
-end
diff --git a/backend/spec/controllers/spree/admin/users_controller_spec.rb b/backend/spec/controllers/spree/admin/users_controller_spec.rb
deleted file mode 100644
index f992cf0d92..0000000000
--- a/backend/spec/controllers/spree/admin/users_controller_spec.rb
+++ /dev/null
@@ -1,188 +0,0 @@
-require 'spec_helper'
-require 'spree/testing_support/bar_ability'
-
-describe Spree::Admin::UsersController, type: :controller do
- let(:store) { Spree::Store.default }
- let(:user) { create(:user) }
- let(:mock_user) { mock_model Spree.user_class }
-
- before do
- allow(controller).to receive_messages spree_current_user: user
- user.spree_roles.clear
- stub_const('Spree::User', user.class)
- end
-
- context '#show' do
- before do
- user.spree_roles << Spree::Role.find_or_create_by(name: 'admin')
- end
-
- it 'redirects to edit' do
- get :show, params: { id: user.id }
- expect(response).to redirect_to spree.edit_admin_user_path(user)
- end
- end
-
- context '#authorize_admin' do
- before { use_mock_user }
-
- it 'grant access to users with an admin role' do
- user.spree_roles << Spree::Role.find_or_create_by(name: 'admin')
- post :index
- expect(response).to render_template :index
- end
-
- it "allows admins to update a user's API key" do
- user.spree_roles << Spree::Role.find_or_create_by(name: 'admin')
- expect(mock_user).to receive(:generate_spree_api_key!).and_return(true)
- put :generate_api_key, params: { id: mock_user.id }
- expect(response).to redirect_to(spree.edit_admin_user_path(mock_user))
- end
-
- it "allows admins to clear a user's API key" do
- user.spree_roles << Spree::Role.find_or_create_by(name: 'admin')
- expect(mock_user).to receive(:clear_spree_api_key!).and_return(true)
- put :clear_api_key, params: { id: mock_user.id }
- expect(response).to redirect_to(spree.edit_admin_user_path(mock_user))
- end
-
- it 'deny access to users without an admin role' do
- allow(user).to receive_messages has_spree_role?: false
- post :index
- expect(response).to redirect_to(spree.admin_forbidden_path)
- end
-
- describe 'deny access to users with an bar role' do
- before do
- user.spree_roles << Spree::Role.find_or_create_by(name: 'bar')
- Spree::Ability.register_ability(BarAbility)
- end
-
- after do
- Spree::Ability.remove_ability(BarAbility)
- end
-
- it '#index' do
- post :index
- expect(response).to redirect_to(spree.admin_forbidden_path)
- end
-
- it '#update' do
- post :update, params: { id: '9' }
- expect(response).to redirect_to(spree.admin_forbidden_path)
- end
- end
- end
-
- describe '#create' do
- before do
- use_mock_user
- user.spree_roles << Spree::Role.find_or_create_by(name: 'admin')
- end
-
- it 'can create a shipping_address' do
- expect(Spree.user_class).to receive(:new).with(ActionController::Parameters.new(
- 'ship_address_attributes' => { 'city' => 'New York' }
- ).permit(ship_address_attributes: permitted_address_attributes))
- post :create, params: { user: { ship_address_attributes: { city: 'New York' } } }
- end
-
- it 'can create a billing_address' do
- expect(Spree.user_class).to receive(:new).with(ActionController::Parameters.new(
- 'bill_address_attributes' => { 'city' => 'New York' }
- ).permit(bill_address_attributes: permitted_address_attributes))
- post :create, params: { user: { bill_address_attributes: { city: 'New York' } } }
- end
-
- it 'redirects to user edit page' do
- post :create, params: { user: user.slice(*permitted_user_attributes) }
- expect(response).to redirect_to(spree.edit_admin_user_path(assigns[:user]))
- end
- end
-
- describe '#update' do
- before do
- use_mock_user
- user.spree_roles << Spree::Role.find_or_create_by(name: 'admin')
- end
-
- it 'allows shipping address attributes through' do
- expect(mock_user).to receive(:update).with(ActionController::Parameters.new(
- 'ship_address_attributes' => { 'city' => 'New York' }
- ).permit(ship_address_attributes: permitted_address_attributes))
- put :update, params: { id: mock_user.id, user: { ship_address_attributes: { city: 'New York' } } }
- end
-
- it 'allows billing address attributes through' do
- expect(mock_user).to receive(:update).with(ActionController::Parameters.new(
- 'bill_address_attributes' => { 'city' => 'New York' }
- ).permit(bill_address_attributes: permitted_address_attributes))
- put :update, params: { id: mock_user.id, user: { bill_address_attributes: { city: 'New York' } } }
- end
-
- it 'allows updating without password resetting' do
- expect(mock_user).to receive(:update).with(hash_not_including(password: '', password_confirmation: ''))
- put :update, params: { id: mock_user.id, user: { password: '', password_confirmation: '', email: '[email protected]' } }
- end
-
- it 'redirects to user edit page' do
- expect(mock_user).to receive(:update).with(hash_not_including(email: '')).and_return(true)
- put :update, params: { id: mock_user.id, user: { email: '[email protected]' } }
- expect(response).to redirect_to(spree.edit_admin_user_path(mock_user))
- end
-
- it 'render edit page when update got errors' do
- expect(mock_user).to receive(:update).with(hash_not_including(email: '')).and_return(false)
- put :update, params: { id: mock_user.id, user: { email: 'invalid_email' } }
- expect(response).to render_template(:edit)
- end
- end
-
- describe '#orders' do
- let!(:order) { create(:order, user: user, store: store) }
- let!(:order_2) { create(:order, user: user, store: create(:store)) }
-
- before do
- user.spree_roles << Spree::Role.find_or_create_by(name: 'admin')
- end
-
- it 'assigns a list of the users orders' do
- get :orders, params: { id: user.id }
- expect(assigns[:orders].count).to eq 1
- expect(assigns[:orders].first).to eq order
- end
-
- it 'assigns a ransack search for Spree::Order' do
- get :orders, params: { id: user.id }
- expect(assigns[:search]).to be_a Ransack::Search
- expect(assigns[:search].klass).to eq Spree::Order
- end
- end
-
- describe '#items' do
- let!(:order) { create(:order, user: user, store: store) }
- let!(:order_2) { create(:order, user: user, store: create(:store)) }
-
- before do
- user.spree_roles << Spree::Role.find_or_create_by(name: 'admin')
- end
-
- it 'assigns a list of the users orders' do
- get :items, params: { id: user.id }
- expect(assigns[:orders].count).to eq 1
- expect(assigns[:orders].first).to eq order
- end
-
- it 'assigns a ransack search for Spree::Order' do
- get :items, params: { id: user.id }
- expect(assigns[:search]).to be_a Ransack::Search
- expect(assigns[:search].klass).to eq Spree::Order
- end
- end
-end
-
-def use_mock_user
- allow(mock_user).to receive(:save).and_return(true)
- allow(Spree.user_class).to receive(:find).with(mock_user.id.to_s).and_return(mock_user)
- allow(Spree.user_class).to receive(:new).and_return(mock_user)
-end
diff --git a/backend/spec/controllers/spree/admin/variants_controller_spec.rb b/backend/spec/controllers/spree/admin/variants_controller_spec.rb
deleted file mode 100644
index b356c047d4..0000000000
--- a/backend/spec/controllers/spree/admin/variants_controller_spec.rb
+++ /dev/null
@@ -1,77 +0,0 @@
-require 'spec_helper'
-
-module Spree
- module Admin
- describe VariantsController, type: :controller do
- stub_authorization!
-
- let(:store) { Spree::Store.default }
- let(:product) { create(:product, stores: [store]) }
-
- describe '#index' do
- let!(:variant_1) { create(:variant, product: product) }
- let!(:variant_2) { create(:variant, product: product) }
- let!(:variant_3) { create(:variant, product: create(:product)) }
-
- context 'deleted is not requested' do
- it 'assigns the variants for a requested product' do
- get :index, params: { product_id: product.slug }
- expect(assigns(:collection)).to include variant_1
- expect(assigns(:collection)).to include variant_2
- expect(assigns(:collection)).not_to include variant_3
- end
- end
-
- context 'deleted is requested' do
- before { variant_2.destroy }
-
- it 'assigns only deleted variants for a requested product' do
- get :index, params: { product_id: product.slug, q: { deleted_at_null: '1' } }
- expect(assigns(:collection)).not_to include variant_1
- expect(assigns(:collection)).to include variant_2
- end
- end
- end
-
- describe '#destroy' do
- subject(:send_request) do
- delete :destroy, params: { product_id: product, id: variant, format: :js }
- end
-
- let(:variant) { create(:variant, product: product) }
-
- shared_examples 'correct response' do
- it { expect(assigns(:variant)).to eq(variant) }
- it { expect(response).to have_http_status(:ok) }
- end
-
- context 'will successfully destroy variant' do
- describe 'returns response' do
- before { send_request }
-
- it_behaves_like 'correct response'
- it { expect(flash[:success]).to eq(Spree.t('notice_messages.variant_deleted')) }
- end
- end
-
- context 'cannot destroy variant of other product' do
- let(:other_product) { create(:product, stores: [store]) }
- let(:variant) { create(:variant, product: other_product) }
-
- it { expect(send_request).to redirect_to(spree.admin_product_variants_path(product)) }
-
- it do
- send_request
- expect(flash[:error]).to eq('Variant is not found')
- end
- end
-
- context 'cannot destroy variant of product from different store' do
- let(:product) { create(:product, stores: [create(:store)]) }
-
- it { expect { send_request }.to raise_error(ActiveRecord::RecordNotFound) }
- end
- end
- end
- end
-end
diff --git a/backend/spec/features/admin/cms_pages/edit_feature_page_spec.rb b/backend/spec/features/admin/cms_pages/edit_feature_page_spec.rb
deleted file mode 100644
index a41b069779..0000000000
--- a/backend/spec/features/admin/cms_pages/edit_feature_page_spec.rb
+++ /dev/null
@@ -1,64 +0,0 @@
-require 'spec_helper'
-
-describe 'Edit Feature Page', type: :feature do
- stub_authorization!
-
- context 'when a user creates a Feature Page' do
- let!(:store_fp) { create(:store, default: true, name: 'Super Store', supported_locales: 'en,fr') }
-
- before do
- I18n.backend.store_translations(:fr,
- spree: {
- i18n: {
- this_file_language: 'Français (FR)'
- }
- })
- visit spree.new_admin_cms_page_path
- fill_in 'Title *', with: 'Homepage (English)'
- select 'Feature Page', from: 'cms_page[type]'
-
- click_on 'Create'
- end
-
- it 'saves the basic setting fields and generates a slug' do
- expect(page).to have_field('Title *', with: 'Homepage (English)')
- expect(page).to have_field('Slug', disabled: false)
- end
-
- it 'displays the Section Manager' do
- expect(page).to have_selector(:link_or_button, 'Add New Section')
- expect(page).to have_content('Mobile')
- expect(page).to have_content('Tablet')
- expect(page).to have_content('Desktop')
- expect(page).to have_content('Add your first section to this page by clicking the + Add New Section button above.')
- end
-
- it 'user can enter and exit full screen mode', js: true do
- find('[id="cmsSectionEditorFullScreen"]').click
-
- expect(page).to have_selector('body[data-sections-editor-full-screen]')
- end
-
- it 'displays the language of the page' do
- expect(page).to have_text ('English (US)')
- end
-
- it 'allows user to toggle visability' do
- expect(page).to have_text ('Visible')
-
- find(:xpath, '//*[@id="cms_page_visible"]/..').click
-
- expect(page).to have_text ('Draft Mode')
- end
-
- it 'allows user to switch language', js: true do
- find('[aria-controls="collapsePageSettings"]').click
-
- select2 'Français (FR)', from: 'Language'
-
- click_on 'Update'
-
- expect(page).to have_text('Français (FR)')
- end
- end
-end
diff --git a/backend/spec/features/admin/cms_pages/edit_homepage_spec.rb b/backend/spec/features/admin/cms_pages/edit_homepage_spec.rb
deleted file mode 100644
index 0320292e1a..0000000000
--- a/backend/spec/features/admin/cms_pages/edit_homepage_spec.rb
+++ /dev/null
@@ -1,66 +0,0 @@
-require 'spec_helper'
-
-describe 'Edit Homepage', type: :feature do
- stub_authorization!
-
- context 'when a user creates a Homepage' do
- let!(:store_hp) { create(:store, default: true, name: 'Super Store', supported_locales: 'en,fr') }
-
- before do
- I18n.backend.store_translations(:fr,
- spree: {
- i18n: {
- this_file_language: 'Français (FR)'
- }
- })
-
- visit spree.new_admin_cms_page_path
-
- fill_in 'Title *', with: 'Homepage (English)'
- select 'Homepage', from: 'cms_page[type]'
-
- click_on 'Create'
- end
-
- it 'saves the basic setting fields and generates a slug' do
- expect(page).to have_field('Title *', with: 'Homepage (English)')
- expect(page).to have_field('Slug', disabled: true)
- end
-
- it 'displays the Section Manager' do
- expect(page).to have_selector(:link_or_button, 'Add New Section')
- expect(page).to have_content('Mobile')
- expect(page).to have_content('Tablet')
- expect(page).to have_content('Desktop')
- expect(page).to have_content('Add your first section to this page by clicking the + Add New Section button above.')
- end
-
- it 'user can enter and exit full screen mode', js: true do
- find('[id="cmsSectionEditorFullScreen"]').click
-
- expect(page).to have_selector('body[data-sections-editor-full-screen]')
- end
-
- it 'displays the language of the page' do
- expect(page).to have_text ('English (US)')
- end
-
- it 'allows user to toggle visability' do
- expect(page).to have_text ('Visible')
-
- find(:xpath, '//*[@id="cms_page_visible"]/..').click
-
- expect(page).to have_text ('Draft Mode')
- end
-
- it 'allows user to switch language', js: true do
- find('[aria-controls="collapsePageSettings"]').click
-
- select2 'Français (FR)', from: 'Language'
-
- click_on 'Update'
-
- expect(page).to have_text('Français (FR)')
- end
- end
-end
diff --git a/backend/spec/features/admin/cms_pages/edit_standard_page_spec.rb b/backend/spec/features/admin/cms_pages/edit_standard_page_spec.rb
deleted file mode 100644
index c6dab71f78..0000000000
--- a/backend/spec/features/admin/cms_pages/edit_standard_page_spec.rb
+++ /dev/null
@@ -1,72 +0,0 @@
-require 'spec_helper'
-
-describe 'Edit Standard Page', type: :feature do
- stub_authorization!
-
- context 'when a user creates a Standard Page' do
- let!(:store_sp) { create(:store, default: true, name: 'Super Store', supported_locales: 'en,fr') }
-
- before do
- visit spree.new_admin_cms_page_path
- I18n.backend.store_translations(:fr,
- spree: {
- i18n: {
- this_file_language: 'Français (FR)'
- }
- })
-
- fill_in 'Title *', with: 'Privacy Policy'
- fill_in 'Meta Title', with: 'Meta-T-Content'
- fill_in 'Meta Description', with: 'Meta-Description-Content'
-
- click_on 'Create'
- end
-
- it 'saves the basic setting fields and generates a slug' do
- expect(page).to have_field('Title *', with: 'Privacy Policy')
- expect(page).to have_field('Slug', with: 'privacy-policy')
- expect(page).to have_field('Meta Title', with: 'Meta-T-Content')
- expect(page).to have_text ('Meta-Description-Content')
- end
-
- it 'slug should not be disabled' do
- expect(page).to have_field('Slug', disabled: false)
- end
-
- it 'loads the RTE', js: true do
- expect(page).to have_css '.tox-editor-container'
- end
-
- it 'displays the language of the page' do
- expect(page).to have_text ('English (US)')
- end
-
- it 'allows user to switch language', js: true do
- find('[aria-controls="collapsePageSettings"]').click
-
- select2 'Français (FR)', from: 'Language'
-
- click_on 'Update'
-
- expect(page).to have_text('Français (FR)')
- end
-
- it 'allows user to toggle visability', js: true do
- expect(page).to have_text ('Visible')
-
- find(:xpath, '//*[@id="cms_page_visible"]/..').click
-
- expect(page).to have_text ('Draft Mode')
- end
-
- it 'allows user to toggle more page settings enter data and save', js: true do
- find('[aria-controls="collapsePageSettings"]').click
- fill_in 'Meta Description', with: 'M-Descript'
-
- click_on 'Update'
-
- find('[aria-controls="collapsePageSettings"]').click
- expect(page).to have_text ('M-Descript')
- end
- end
-end
diff --git a/backend/spec/features/admin/cms_pages/index_pages_spec.rb b/backend/spec/features/admin/cms_pages/index_pages_spec.rb
deleted file mode 100644
index 4789f9bce9..0000000000
--- a/backend/spec/features/admin/cms_pages/index_pages_spec.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-require 'spec_helper'
-
-describe 'Pages Index', type: :feature do
- stub_authorization!
-
- context 'when no pages are present' do
- before do
- visit spree.admin_menus_path
- end
-
- it 'prompts the user to create a menu' do
- expect(page).to have_text 'You have no Menus, click the Add New Menu button to create your first Menu.'
- end
- end
-end
diff --git a/backend/spec/features/admin/cms_pages/new_page_spec.rb b/backend/spec/features/admin/cms_pages/new_page_spec.rb
deleted file mode 100644
index 9a48ee8b5e..0000000000
--- a/backend/spec/features/admin/cms_pages/new_page_spec.rb
+++ /dev/null
@@ -1,52 +0,0 @@
-require 'spec_helper'
-
-describe 'New Page', type: :feature do
- stub_authorization!
-
- context 'when a user creates a new page' do
- before do
- visit spree.new_admin_cms_page_path
- end
-
- it 'shows in the contextual header bar the user is creating a new page' do
- within('h1') do
- expect(page).to have_text Spree.t('admin.cms.new_page')
- end
- end
-
- it 'shows the breadcrumb link back to all pages' do
- expect(page).to have_text Spree.t('admin.cms.all_pages')
- end
-
- it 'has no missing translations' do
- expect(page).not_to have_css('.translation_missing', visible: :all)
- end
- end
-
- context 'when a user tries to create a new page with no title' do
- before do
- visit spree.new_admin_cms_page_path
- end
-
- it "warns that the title can't be blank" do
- click_on 'Create'
- expect(page).to have_text ("Title can't be blank")
- end
- end
-
- context 'when a user tries to create a page with a duplicate slug' do
- let!(:store_1) { create(:store, default: true) }
- let!(:cms_page) { create(:cms_standard_page, title: 'About Us', store: store_1) }
-
- before do
- visit spree.new_admin_cms_page_path
- end
-
- it 'warns the user that the slug has already been taken', js: true do
- fill_in 'Title *', with: 'About Us'
-
- click_on 'Create'
- expect(page).to have_text ('Slug has already been taken')
- end
- end
-end
diff --git a/backend/spec/features/admin/cms_sections/featured_article_spec.rb b/backend/spec/features/admin/cms_sections/featured_article_spec.rb
deleted file mode 100644
index c0bc5314fe..0000000000
--- a/backend/spec/features/admin/cms_sections/featured_article_spec.rb
+++ /dev/null
@@ -1,107 +0,0 @@
-require 'spec_helper'
-
-describe 'Featured Article section', type: :feature do
- stub_authorization!
-
- section_type = 'Featured Article'
-
- let!(:store) { Spree::Store.default }
- let!(:feature_page) { create(:cms_feature_page, store: store, title: 'Test Page') }
- let!(:taxon) { create(:taxon) }
- let!(:product) { create(:product) }
- let!(:cms_standard_page) { create(:cms_standard_page, store: store) }
- let!(:homepage) { create(:cms_homepage, store: store, title: 'Super Home Page') }
- let!(:section) { create(:cms_featured_article_section, cms_page: feature_page, name: "Test #{section_type}") }
-
- before do
- visit spree.edit_admin_cms_page_cms_section_path(feature_page, section)
- end
-
- context 'editing new page', js: true do
- it 'loads with correct defaults setings' do
- expect(page).to have_field('Name *', with: "Test #{section_type}")
- expect(page).to have_select('Section Type', selected: section_type)
- expect(page).to have_content("Options For: #{section_type}")
- expect(page).to have_select('Gutters', selected: 'No Gutters')
- end
-
- it 'saves WYSIWYG content to database' do
- rte_content = 'Ipsum blanditiis labore voluptates vero asperiores ullam excepturi'
-
- page.execute_script("$(tinymce.editors[0].setContent('#{rte_content}'))")
-
- click_on 'Update'
-
- expect(page).to have_field(id: 'cms_section_rte_content', with: "<p>#{rte_content}</p>", visible: :hidden, disabled: false)
- assert_admin_flash_alert_success('Section "Test Featured Article" has been successfully updated!')
- end
-
- it 'saves taxon path and loads it back into the view' do
- select2 taxon.name, from: 'Taxon', search: true
-
- click_on 'Update'
-
- expect(page).to have_content(taxon.permalink)
- assert_admin_flash_alert_success('Section "Test Featured Article" has been successfully updated!')
- end
-
- it 'saves product path and loads it back into the view' do
- select2 'Product', from: 'Link To'
-
- click_on 'Update'
-
- select2 product.name, from: 'Product', search: true
-
- click_on 'Update'
-
- expect(page).to have_content(product.slug)
- assert_admin_flash_alert_success('Section "Test Featured Article" has been successfully updated!')
- end
-
- it 'saves page path and loads it back into the view' do
- select2 'Page', from: 'Link To'
-
- click_on 'Update'
-
- select2 cms_standard_page.title, from: 'Page', search: true
-
- click_on 'Update'
-
- expect(page).to have_content(cms_standard_page.slug)
- assert_admin_flash_alert_success('Section "Test Featured Article" has been successfully updated!')
- end
-
- it 'does not display homepages in Link To Page results' do
- select2 'Page', from: 'Link To'
-
- click_on 'Update'
-
- select2_open label: 'Page'
- select2_search homepage.title, label: 'Page'
-
- wait_for_ajax do
- expect(page).to have_text('No results found')
- end
- end
-
- it 'allows admin to enter and save details' do
- fill_in 'Title', with: 'Trendy Styles'
- fill_in 'Subtitle', with: 'Shop Today'
- fill_in 'Button Text', with: 'Learn More'
- select2('Gutters', from: 'Gutters', exact_text: true)
-
- click_on 'Update'
-
- expect(page).to have_field('Title', with: 'Trendy Styles')
- expect(page).to have_field('Subtitle', with: 'Shop Today')
- expect(page).to have_field('Button Text', with: 'Learn More')
- expect(page).to have_select('Gutters', selected: 'Gutters')
- end
-
- it 'allows changing of the section name' do
- fill_in 'Name *', with: 'My New Section Name'
- click_on 'Update'
- expect(page).to have_field('Name *', with: 'My New Section Name')
- end
- end
-end
diff --git a/backend/spec/features/admin/cms_sections/hero_image_spec.rb b/backend/spec/features/admin/cms_sections/hero_image_spec.rb
deleted file mode 100644
index b5045eb92f..0000000000
--- a/backend/spec/features/admin/cms_sections/hero_image_spec.rb
+++ /dev/null
@@ -1,107 +0,0 @@
-require 'spec_helper'
-
-describe 'Hero Image section', type: :feature do
- stub_authorization!
-
- section_type = 'Hero Image'
-
- let!(:store) { Spree::Store.default }
- let!(:feature_page) { create(:cms_feature_page, store: store, title: 'Test Page') }
- let!(:taxon) { create(:taxon) }
- let!(:product) { create(:product) }
- let!(:cms_standard_page) { create(:cms_standard_page, store: store) }
- let!(:homepage) { create(:cms_homepage, store: store, title: 'Super Home Page') }
- let!(:section) { create(:cms_hero_image_section, cms_page: feature_page, name: "Test #{section_type}") }
- let(:file_path) { Rails.root + '../../spec/support/ror_ringer.jpeg' }
-
- before do
- visit spree.edit_admin_cms_page_cms_section_path(feature_page, section)
- end
-
- context 'editing new page', js: true do
- it 'loads with correct defaults setings' do
- expect(page).to have_field('Name *', with: "Test #{section_type}")
- expect(page).to have_select('Section Type', selected: section_type)
- expect(page).to have_content("Options For: #{section_type}")
- expect(page).to have_select('Gutters', selected: 'No Gutters')
- expect(page).to have_select('Fit To', selected: 'Screen')
- end
-
- it 'saves taxon path and loads it back into the view' do
- select2 taxon.name, from: 'Taxon', search: true
-
- click_on 'Update'
-
- expect(page).to have_content(taxon.permalink)
- assert_admin_flash_alert_success('Section "Test Hero Image" has been successfully updated!')
- end
-
- it 'admin should be able to add image' do
- attach_file('cms_section_image_one', file_path)
-
- click_button 'Update'
-
- expect(page).to have_content('successfully updated!')
- expect(page).to have_css('.admin-img-holder img')
- end
-
- it 'saves product path and loads it back into the view' do
- select2 'Product', from: 'Link To'
-
- click_on 'Update'
-
- select2 product.name, from: 'Product', search: true
-
- click_on 'Update'
-
- expect(page).to have_content(product.slug)
- assert_admin_flash_alert_success('Section "Test Hero Image" has been successfully updated!')
- end
-
- it 'saves page path and loads it back into the view' do
- select2 'Page', from: 'Link To'
-
- click_on 'Update'
-
- select2 cms_standard_page.title, from: 'Page', search: true
-
- click_on 'Update'
-
- expect(page).to have_content(cms_standard_page.slug)
- assert_admin_flash_alert_success('Section "Test Hero Image" has been successfully updated!')
- end
-
- it 'does not display homepages in Link To Page results' do
- select2 'Page', from: 'Link To'
-
- click_on 'Update'
-
- select2_open label: 'Page'
- select2_search homepage.title, label: 'Page'
-
- wait_for_ajax do
- expect(page).to have_text('No results found')
- end
- end
-
- it 'allows admin to enter and save details' do
- fill_in 'Title', with: 'Trendy Styles'
- fill_in 'Button Text', with: 'Learn More'
- select2('Gutters', from: 'Gutters', exact_text: true)
- select2('Container', from: 'Fit To', exact_text: true)
-
- click_on 'Update'
-
- expect(page).to have_field('Title', with: 'Trendy Styles')
- expect(page).to have_field('Button Text', with: 'Learn More')
- expect(page).to have_select('Fit To', selected: 'Container')
- expect(page).to have_select('Gutters', selected: 'Gutters')
- end
-
- it 'allows changing of the section name' do
- fill_in 'Name *', with: 'My New Section Name'
- click_on 'Update'
- expect(page).to have_field('Name *', with: 'My New Section Name')
- end
- end
-end
diff --git a/backend/spec/features/admin/cms_sections/image_gallery_spec.rb b/backend/spec/features/admin/cms_sections/image_gallery_spec.rb
deleted file mode 100644
index f965265ff6..0000000000
--- a/backend/spec/features/admin/cms_sections/image_gallery_spec.rb
+++ /dev/null
@@ -1,222 +0,0 @@
-require 'spec_helper'
-
-describe 'Image Gallery section', type: :feature do
- stub_authorization!
-
- section_type = 'Image Gallery'
-
- let!(:store) { Spree::Store.default }
- let!(:feature_page) { create(:cms_feature_page, store: store, title: 'Test Page') }
- let!(:section) { create(:cms_image_gallery_section, cms_page: feature_page, name: "Test #{section_type}") }
- let!(:taxonomy) { create(:taxon, name: 'Shirts', permalink: 'all-ts') }
- let!(:product) { create(:product, name: 'Zomg Shirt', slug: 'black-zomg-shirt') }
- let(:file_path) { Rails.root + '../../spec/support/ror_ringer.jpeg' }
-
- before do
- visit spree.edit_admin_cms_page_cms_section_path(feature_page, section)
- end
-
- context 'editing new page', js: true do
- it 'loads with correct defaults setings' do
- expect(page).to have_field('Name *', with: "Test #{section_type}")
- expect(page).to have_select('Section Type', selected: section_type)
- expect(page).to have_content("Options For: #{section_type}")
-
- within 'div#image_a_details' do
- expect(page).to have_content('Image A')
- expect(page).to have_content('Title')
-
- if Rails::VERSION::STRING >= '6.0'
- expect(page).to have_select('Link To', selected: 'Taxon')
- end
- end
-
- within 'div#image_b_details' do
- expect(page).to have_content('Image B')
- expect(page).to have_content('Title')
-
- if Rails::VERSION::STRING >= '6.0'
- expect(page).to have_select('Link To', selected: 'Taxon')
- end
- end
-
- within 'div#image_c_details' do
- expect(page).to have_content('Image C')
- expect(page).to have_content('Title')
-
- if Rails::VERSION::STRING >= '6.0'
- expect(page).to have_select('Link To', selected: 'Taxon')
- end
- end
-
- expect(page).to have_select('Layout Style', selected: 'Default')
- expect(page).to have_select('Fit To', selected: 'Container')
- expect(page).to have_select('Display labels', selected: 'Show')
- end
-
- it 'allows the selection of layout style and saves to database' do
- select2('Reversed', from: 'Layout Style')
- click_on 'Update'
- expect(page).to have_select('Layout Style', selected: 'Reversed')
- end
-
- it 'allows the selection of Fit To and saves to database' do
- select2('Screen', from: 'Fit To')
- click_on 'Update'
- expect(page).to have_select('Fit To', selected: 'Screen')
- end
-
- it 'allows the selection of Display Labels and saves to database' do
- select2('Hide', from: 'Display labels')
- click_on 'Update'
- expect(page).to have_select('Display labels', selected: 'Hide')
- end
-
- it 'allows changing of the section name' do
- fill_in 'Name *', with: 'My New Section Name'
- click_on 'Update'
- expect(page).to have_field('Name *', with: 'My New Section Name')
- end
-
- context 'Editing Image A' do
- it 'allows admin to enter and save details' do
- within 'div#image_a_details' do
- fill_in 'Title', with: 'Trendy Styles'
- end
-
- select2('Shirts', css: '#cms_section_link_one_field', search: true)
-
- click_on 'Update'
-
- within 'div#image_a_details' do
- expect(page).to have_field('Title', with: 'Trendy Styles')
-
- wait_for_ajax do
- expect(page).to have_select('Link To Taxon', selected: 'Shirts', value: 'all-ts', visible: :all)
- end
- end
- end
-
- if Rails::VERSION::STRING >= '6.0'
- it 'allows admin to change the link type and save a product' do
- select2('Product', css: '#cms_section_link_type_one_field')
-
- click_on 'Update'
-
- select2('Zomg Shirt', css: '#cms_section_link_one_field', search: true)
-
- click_on 'Update'
-
- within 'div#image_a_details' do
- wait_for_ajax do
- expect(page).to have_select('Link To Product', selected: 'Zomg Shirt', value: 'black-zomg-shirt', visible: :all)
- end
- end
- end
- end
-
- it 'admin should be able to add image' do
- attach_file('cms_section_image_one', file_path)
-
- click_button 'Update'
-
- expect(page).to have_content('successfully updated!')
- expect(page).to have_css('.admin-img-holder img')
- end
- end
-
- context 'Editing Image B' do
- it 'allows admin to enter and save details' do
- within 'div#image_b_details' do
- fill_in 'Title', with: 'Trendy Styles'
- end
-
- select2('Shirts', css: '#cms_section_link_two_field', search: true)
-
- click_on 'Update'
-
- within 'div#image_b_details' do
- expect(page).to have_field('Title', with: 'Trendy Styles')
-
- wait_for_ajax do
- expect(page).to have_select('Link To Taxon', selected: 'Shirts', value: 'all-ts', visible: :all)
- end
- end
- end
-
- if Rails::VERSION::STRING >= '6.0'
- it 'allows admin to change the link type and save a product' do
- select2('Product', css: '#cms_section_link_type_two_field')
-
- click_on 'Update'
-
- select2('Zomg Shirt', css: '#cms_section_link_two_field', search: true)
-
- click_on 'Update'
-
- within 'div#image_b_details' do
- wait_for_ajax do
- expect(page).to have_select('Link To Product', selected: 'Zomg Shirt', value: 'black-zomg-shirt', visible: :all)
- end
- end
- end
- end
-
- it 'admin should be able to add image' do
- attach_file('cms_section_image_two', file_path)
-
- click_button 'Update'
-
- expect(page).to have_content('successfully updated!')
- expect(page).to have_css('.admin-img-holder img')
- end
- end
-
- context 'Editing Image C' do
- it 'allows admin to enter and save details' do
- within 'div#image_c_details' do
- fill_in 'Title', with: 'Trendy Styles'
- end
-
- select2('Shirts', css: '#cms_section_link_three_field', search: true)
-
- click_on 'Update'
-
- within 'div#image_c_details' do
- expect(page).to have_field('Title', with: 'Trendy Styles')
-
- wait_for_ajax do
- expect(page).to have_select('Link To Taxon', selected: 'Shirts', value: 'all-ts', visible: :all)
- end
- end
- end
-
- if Rails::VERSION::STRING >= '6.0'
- it 'allows admin to change the link type and save a product' do
- select2('Product', css: '#cms_section_link_type_three_field')
-
- click_on 'Update'
-
- select2('Zomg Shirt', css: '#cms_section_link_three_field', search: true)
-
- click_on 'Update'
-
- within 'div#image_c_details' do
- wait_for_ajax do
- expect(page).to have_select('Link To Product', selected: 'Zomg Shirt', value: 'black-zomg-shirt', visible: :all)
- end
- end
- end
- end
-
- it 'admin should be able to add image' do
- attach_file('cms_section_image_three', file_path)
-
- click_button 'Update'
-
- expect(page).to have_content('successfully updated!')
- expect(page).to have_css('.admin-img-holder img')
- end
- end
- end
-end
diff --git a/backend/spec/features/admin/cms_sections/product_carousel_spec.rb b/backend/spec/features/admin/cms_sections/product_carousel_spec.rb
deleted file mode 100644
index bd890fb362..0000000000
--- a/backend/spec/features/admin/cms_sections/product_carousel_spec.rb
+++ /dev/null
@@ -1,39 +0,0 @@
-require 'spec_helper'
-
-describe 'Product Carousel section', type: :feature do
- stub_authorization!
-
- section_type = 'Product Carousel'
-
- let!(:store) { Spree::Store.default }
- let!(:feature_page) { create(:cms_feature_page, store: store, title: 'Test Page') }
- let!(:taxon) { create(:taxon) }
- let!(:section) { create(:cms_product_carousel_section, cms_page: feature_page, name: "Test #{section_type}") }
-
- before do
- visit spree.edit_admin_cms_page_cms_section_path(feature_page, section)
- end
-
- context 'editing new page', js: true do
- it 'loads with correct defaults setings' do
- expect(page).to have_field('Name *', with: "Test #{section_type}")
- expect(page).to have_select('Section Type', selected: section_type)
- expect(page).to have_content("Options For: #{section_type}")
- end
-
- it 'saves taxon path and loads it back into the view' do
- select2 taxon.name, from: 'Taxon', search: true
-
- click_on 'Update'
-
- expect(page).to have_content(taxon.permalink)
- assert_admin_flash_alert_success('Section "Test Product Carousel" has been successfully updated!')
- end
-
- it 'allows changing of the section name' do
- fill_in 'Name *', with: 'My New Section Name'
- click_on 'Update'
- expect(page).to have_field('Name *', with: 'My New Section Name')
- end
- end
-end
diff --git a/backend/spec/features/admin/cms_sections/rich_text_content_spec.rb b/backend/spec/features/admin/cms_sections/rich_text_content_spec.rb
deleted file mode 100644
index 72d663bb67..0000000000
--- a/backend/spec/features/admin/cms_sections/rich_text_content_spec.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-require 'spec_helper'
-
-describe 'Rich Text Content section', type: :feature do
- stub_authorization!
-
- section_type = 'Rich Text Content'
-
- let!(:store) { Spree::Store.default }
- let!(:feature_page) { create(:cms_feature_page, store: store, title: 'Test Page') }
- let!(:section) { create(:cms_rich_text_content_section, cms_page: feature_page, name: "Test #{section_type}") }
-
- before do
- visit spree.edit_admin_cms_page_cms_section_path(feature_page, section)
- end
-
- context 'editing new page', js: true do
- it 'loads with correct defaults setings' do
- expect(page).to have_field('Name *', with: "Test #{section_type}")
- expect(page).to have_select('Section Type', selected: section_type)
- expect(page).to have_content("Options For: #{section_type}")
- end
-
- it 'saves WYSIWYG content to database' do
- rte_content = 'Ipsum blanditiis labore voluptates vero asperiores ullam excepturi'
-
- page.execute_script("$(tinymce.editors[0].setContent('#{rte_content}'))")
-
- click_on 'Update'
-
- expect(page).to have_field(id: 'cms_section_rte_content', with: "<p>#{rte_content}</p>", visible: :hidden, disabled: false)
- assert_admin_flash_alert_success('Section "Test Rich Text Content" has been successfully updated!')
- end
-
-
- it 'allows changing of the section name' do
- fill_in 'Name *', with: 'My New Section Name'
- click_on 'Update'
- expect(page).to have_field('Name *', with: 'My New Section Name')
- end
- end
-end
diff --git a/backend/spec/features/admin/cms_sections/side_by_side_images_spec.rb b/backend/spec/features/admin/cms_sections/side_by_side_images_spec.rb
deleted file mode 100644
index a526d85cf4..0000000000
--- a/backend/spec/features/admin/cms_sections/side_by_side_images_spec.rb
+++ /dev/null
@@ -1,165 +0,0 @@
-require 'spec_helper'
-
-describe 'Image Side By Side Images section', type: :feature do
- stub_authorization!
-
- section_type = 'Side By Side Images'
-
- let!(:store) { Spree::Store.default }
- let!(:feature_page) { create(:cms_feature_page, store: store, title: 'Test Page') }
- let!(:section) { create(:cms_side_by_side_images_section, cms_page: feature_page, name: "Test #{section_type}") }
- let!(:taxonomy) { create(:taxon, name: 'Shirts', permalink: 'all-ts') }
- let!(:product) { create(:product, name: 'Zomg Shirt', slug: 'black-zomg-shirt') }
- let(:file_path) { Rails.root + '../../spec/support/ror_ringer.jpeg' }
-
- before do
- visit spree.edit_admin_cms_page_cms_section_path(feature_page, section)
- end
-
- context 'editing new page', js: true do
- it 'loads with correct defaults setings' do
- expect(page).to have_field('Name *', with: "Test #{section_type}")
- expect(page).to have_select('Section Type', selected: section_type)
- expect(page).to have_content("Options For: #{section_type}")
-
- within 'div#left_image_details' do
- expect(page).to have_content('Left Image')
- expect(page).to have_field('Title')
- expect(page).to have_field('Subtitle')
-
- if Rails::VERSION::STRING >= '6.0'
- expect(page).to have_select('Link To', selected: 'Taxon')
- end
- end
-
- within 'div#right_image_details' do
- expect(page).to have_content('Right Image')
- expect(page).to have_field('Title')
- expect(page).to have_field('Subtitle')
-
- if Rails::VERSION::STRING >= '6.0'
- expect(page).to have_select('Link To', selected: 'Taxon')
- end
- end
-
- expect(page).to have_select('Fit To', selected: 'Container')
- expect(page).to have_select('Set Gutters', selected: 'Gutters')
- end
-
- it 'allows the selection of Fit To and saves to database' do
- select2('Screen', from: 'Fit To')
- click_on 'Update'
- expect(page).to have_select('Fit To', selected: 'Screen')
- end
-
- it 'allows the selection of Gutters and saves to database' do
- select2('No Gutters', from: 'Set Gutters')
- click_on 'Update'
- expect(page).to have_select('Set Gutters', selected: 'No Gutters')
- end
-
- it 'allows changing of the section name' do
- fill_in 'Name *', with: 'My New Section Name'
- click_on 'Update'
- expect(page).to have_field('Name *', with: 'My New Section Name')
- end
-
- context 'Editing Left Image' do
- it 'allows admin to enter and save details' do
- within 'div#left_image_details' do
- fill_in 'Title', with: 'Trendy Styles'
- fill_in 'Subtitle', with: 'Shop Today'
- end
-
- select2('Shirts', css: '#cms_section_link_one_field', search: true)
-
- click_on 'Update'
-
- within 'div#left_image_details' do
- expect(page).to have_field('Title', with: 'Trendy Styles')
- expect(page).to have_field('Subtitle', with: 'Shop Today')
-
- wait_for_ajax do
- expect(page).to have_select('Link To Taxon', selected: 'Shirts', value: 'all-ts', visible: :all)
- end
- end
- end
-
- if Rails::VERSION::STRING >= '6.0'
- it 'allows admin to change the link type and save a product' do
- select2('Product', css: '#cms_section_link_type_one_field')
-
- click_on 'Update'
-
- select2('Zomg Shirt', css: '#cms_section_link_one_field', search: true)
-
- click_on 'Update'
-
- within 'div#left_image_details' do
- wait_for_ajax do
- expect(page).to have_select('Link To Product', selected: 'Zomg Shirt', value: 'black-zomg-shirt', visible: :all)
- end
- end
- end
- end
-
- it 'admin should be able to add image' do
- attach_file('cms_section_image_one', file_path)
-
- click_button 'Update'
-
- expect(page).to have_content('successfully updated!')
- expect(page).to have_css('.admin-img-holder img')
- end
- end
-
- context 'Editing Right Image' do
- it 'allows admin to enter and save details' do
- within 'div#right_image_details' do
- fill_in 'Title', with: 'Trendy Styles'
- fill_in 'Subtitle', with: 'Shop Today'
- end
-
- select2('Shirts', css: '#cms_section_link_one_field', search: true)
-
- click_on 'Update'
-
- within 'div#right_image_details' do
- expect(page).to have_field('Title', with: 'Trendy Styles')
- expect(page).to have_field('Subtitle', with: 'Shop Today')
-
- wait_for_ajax do
- expect(page).to have_select('Link To Taxon', selected: 'Shirts', value: 'all-ts', visible: :all)
- end
- end
- end
-
- if Rails::VERSION::STRING >= '6.0'
- it 'allows admin to change the link type and save a product' do
- select2('Product', css: '#cms_section_link_type_one_field')
-
- click_on 'Update'
-
- select2('Zomg Shirt', css: '#cms_section_link_one_field', search: true)
-
- click_on 'Update'
-
- within 'div#right_image_details' do
- wait_for_ajax do
- expect(page).to have_select('Link To Product', selected: 'Zomg Shirt', value: 'black-zomg-shirt', visible: :all)
- end
- end
- end
- end
-
- it 'admin should be able to add image' do
- attach_file('cms_section_image_one', file_path)
-
- click_button 'Update'
-
- expect(page).to have_content('successfully updated!')
- expect(page).to have_css('.admin-img-holder img')
- end
- end
- end
-end
diff --git a/backend/spec/features/admin/configuration/countries_spec.rb b/backend/spec/features/admin/configuration/countries_spec.rb
deleted file mode 100644
index c6ac79bb76..0000000000
--- a/backend/spec/features/admin/configuration/countries_spec.rb
+++ /dev/null
@@ -1,33 +0,0 @@
-require 'spec_helper'
-
-module Spree
- describe 'Countries', type: :feature do
- stub_authorization!
-
- it 'deletes a state', js: true do
- visit spree.admin_countries_path
- click_link 'New Country'
-
- fill_in 'Name', with: 'Brazil'
- fill_in 'ISO Name', with: 'BRAZIL'
- fill_in 'ISO Alpha-2', with: 'BR'
- fill_in 'ISO Alpha-3', with: 'BRL'
- check 'States Required'
- uncheck 'Zip Code Required'
-
- click_button 'Create'
-
- expect(page).to have_content('Brazil')
- expect(page).to have_content('BRL')
- expect(page).to have_content('YES')
- expect(page).to have_content('NO')
-
- accept_confirm do
- click_icon :delete
- end
- expect(page).to have_content('has been successfully removed!')
-
- expect { Country.find(country.id) }.to raise_error(StandardError)
- end
- end
-end
diff --git a/backend/spec/features/admin/configuration/general_settings_spec.rb b/backend/spec/features/admin/configuration/general_settings_spec.rb
deleted file mode 100644
index b50a65751e..0000000000
--- a/backend/spec/features/admin/configuration/general_settings_spec.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-require 'spec_helper'
-
-describe 'General Settings', type: :feature do
- stub_authorization!
-
- before do
- create(:store, name: 'Test Store', url: 'test.example.com', mail_from_address: '[email protected]')
- visit spree.edit_admin_general_settings_path
- end
-
- context 'clearing the cache', js: true do
- it 'clears the cache' do
- expect(page).not_to have_content(Spree.t(:clear_cache_ok))
- visit spree.edit_admin_general_settings_path
- expect(page).not_to have_content(Spree.t(:clear_cache_ok))
- expect(page).to have_content(Spree.t(:clear_cache_warning))
-
- page.accept_confirm do
- click_button 'Clear Cache'
- end
-
- expect(page).to have_content(Spree.t(:clear_cache_ok))
- end
- end
-end
diff --git a/backend/spec/features/admin/configuration/payment_methods_spec.rb b/backend/spec/features/admin/configuration/payment_methods_spec.rb
deleted file mode 100644
index c292914c0b..0000000000
--- a/backend/spec/features/admin/configuration/payment_methods_spec.rb
+++ /dev/null
@@ -1,110 +0,0 @@
-require 'spec_helper'
-
-describe 'Payment Methods', type: :feature do
- stub_authorization!
-
- let(:store) { Spree::Store.default }
- let!(:store_1) { create(:store) }
- let!(:store_2) { create(:store) }
- let!(:store_3) { create(:store, url: 'another-store.lvh.me') }
-
- let!(:payment_method_one) { create(:payment_method, stores: [store]) }
- let!(:payment_method_two) { create(:payment_method, name: 'Should Be MIA', stores: [store_3]) }
-
- before do
- visit spree.admin_payment_methods_path
- end
-
- context 'managine payment methods by store' do
- it 'only displays payment methods for current store' do
- within('table#listing_payment_methods') do
- expect(page).to have_content(payment_method_one.name)
- expect(page).not_to have_content(payment_method_two.name)
-
- Capybara.app_host = 'http://another-store.lvh.me'
-
- visit spree.admin_payment_methods_path
-
- expect(page).not_to have_content(payment_method_one.name)
- expect(page).to have_content(payment_method_two.name)
-
- Capybara.app_host = nil
- end
- end
- end
-
- context 'admin visiting payment methods listing page' do
- it 'displays existing payment methods' do
- create(:check_payment_method)
- refresh
-
- within('table#listing_payment_methods') do
- expect(all('th')[1].text).to eq('Name')
- expect(all('th')[2].text).to eq('Provider')
- expect(all('th')[3].text).to eq('Display')
- expect(all('th')[4].text).to eq('Active')
- end
-
- within('table#listing_payment_methods') do
- expect(page).to have_content('Check')
- end
- end
- end
-
- context 'admin creating a new payment method', js: true do
- it 'is able to create a new payment method' do
- within find('#contentHeader') do
- click_link 'admin_new_payment_methods_link'
- end
-
- expect(page).to have_content('New Payment Method')
- fill_in 'payment_method_name', with: 'check90'
- fill_in 'payment_method_description', with: 'check90 desc'
- select 'PaymentMethod::Check', from: 'gtwy-type'
- click_button 'Create'
- expect(page).to have_content('successfully created!')
-
- expect(page).to have_select('payment_method_store_ids', selected: store.unique_name)
- end
- end
-
- context 'admin editing a payment method', js: true do
- before do
- visit spree.edit_admin_payment_method_path(check_payment_method)
- end
-
- let!(:check_payment_method) { create(:check_payment_method, name: 'Check') }
-
- it 'is able to edit an existing payment method' do
- fill_in 'payment_method_name', with: 'Payment 99'
- click_button 'Update'
- expect(page).to have_content('successfully updated!')
- expect(page).to have_field('payment_method_name', with: 'Payment 99')
-
- expect(check_payment_method.reload.stores).to contain_exactly(store)
- end
-
- it 'is able to associate payment method with 2 stores' do
- expect(page).to have_content('Check')
-
- select2_open label: 'Stores'
- select2_search store_1.unique_name, from: 'Stores'
- select2_select store_1.unique_name, from: 'Stores', match: :first
-
- select2_open label: 'Stores'
- select2_search store_3.unique_name, from: 'Stores'
- select2_select store_3.unique_name, from: 'Stores', match: :first
-
- click_button 'Update'
- expect(page).to have_content('successfully updated!')
-
- expect(check_payment_method.reload.stores).to contain_exactly(store, store_1, store_3)
- end
-
- it 'displays validation errors' do
- fill_in 'payment_method_name', with: ''
- click_button 'Update'
- expect(page).to have_content("Name can't be blank")
- end
- end
-end
diff --git a/backend/spec/features/admin/configuration/roles_spec.rb b/backend/spec/features/admin/configuration/roles_spec.rb
deleted file mode 100644
index 7298f8b9e1..0000000000
--- a/backend/spec/features/admin/configuration/roles_spec.rb
+++ /dev/null
@@ -1,50 +0,0 @@
-require 'spec_helper'
-
-describe 'Roles', type: :feature do
- stub_authorization!
-
- before do
- create(:role, name: 'admin')
- create(:role, name: 'user')
- visit spree.admin_path
- click_link 'Configuration'
- # Crap workaround for animation to finish expanding so click doesn't hit ReimbursementTypes.
- sleep 1
- click_link 'Roles'
- end
-
- context 'show' do
- it 'displays existing roles' do
- within_row(1) { expect(page).to have_content('admin') }
- within_row(2) { expect(page).to have_content('user') }
- end
- end
-
- context 'create' do
- it 'is able to create a new role' do
- within find('#contentHeader') do
- click_link 'admin_new_role_link'
- end
-
- expect(page).to have_content('New Role')
- fill_in 'role_name', with: 'blogger'
- click_button 'Create'
- expect(page).to have_content('successfully created!')
- end
- end
-
- context 'edit' do
- it 'is not able to edit the admin role' do
- within_row(1) do
- expect(find('td:nth-child(2)')).not_to have_selector(:css, '.icon-edit')
- expect(find('td:nth-child(2)')).not_to have_selector(:css, '.icon-delete')
- end
- end
- it 'is able to edit the user role' do
- within_row(2) do
- expect(find('td:nth-child(2)')).to have_selector(:css, '.icon-edit')
- expect(find('td:nth-child(2)')).to have_selector(:css, '.icon-delete')
- end
- end
- end
-end
diff --git a/backend/spec/features/admin/configuration/shipping_methods_spec.rb b/backend/spec/features/admin/configuration/shipping_methods_spec.rb
deleted file mode 100644
index 2690476b55..0000000000
--- a/backend/spec/features/admin/configuration/shipping_methods_spec.rb
+++ /dev/null
@@ -1,60 +0,0 @@
-require 'spec_helper'
-
-describe 'Shipping Methods', type: :feature do
- stub_authorization!
- let!(:zone) { create(:global_zone) }
- let!(:shipping_method) { create(:shipping_method, zones: [zone]) }
-
- before do
- # HACK: To work around no email prompting on check out
- allow_any_instance_of(Spree::Order).to receive_messages(require_email: false)
- create(:check_payment_method)
-
- visit spree.admin_shipping_methods_path
- end
-
- context 'show' do
- it 'displays existing shipping methods' do
- within_row(1) do
- expect(column_text(1)).to eq(shipping_method.name)
- expect(column_text(2)).to eq(zone.name)
- expect(column_text(3)).to eq('Flat rate')
- expect(column_text(4)).to eq('Both')
- end
- end
- end
-
- context 'create' do
- it 'is able to create a new shipping method' do
- within find('#contentHeader') do
- click_link 'New Shipping Method'
- end
-
- fill_in 'shipping_method_name', with: 'bullock cart'
- select 'Both', from: 'Display'
-
- within('#shipping_method_categories_field', match: :first) do
- check first("input[type='checkbox']")['name']
- end
-
- click_on 'Create'
- expect(page).to have_current_path(spree.edit_admin_shipping_method_path(Spree::ShippingMethod.last))
- end
- end
-
- # Regression test for #1331
- context 'update' do
- it 'can change the calculator', js: true do
- within('#listing_shipping_methods') do
- click_icon :edit
- end
-
- expect(page).to have_css('.calculator-settings-warning', visible: :hidden)
- select2 'Flexible Rate', from: 'Calculator'
- expect(page).to have_css('.calculator-settings-warning')
-
- click_button 'Update'
- expect(page).not_to have_content('Shipping method is not found')
- end
- end
-end
diff --git a/backend/spec/features/admin/configuration/states_spec.rb b/backend/spec/features/admin/configuration/states_spec.rb
deleted file mode 100755
index 6f433dac2f..0000000000
--- a/backend/spec/features/admin/configuration/states_spec.rb
+++ /dev/null
@@ -1,69 +0,0 @@
-require 'spec_helper'
-
-describe 'States', type: :feature do
- stub_authorization!
-
- let!(:country) { create(:country, states_required: true) }
-
- before do
- @hungary = Spree::Country.create!(name: 'Hungary', iso_name: 'Hungary', iso: 'HU', iso3: 'HUN', states_required: true)
- end
-
- def go_to_states_page
- visit spree.admin_country_states_path(country)
- expect(page).to have_selector('#new_state_link')
- page.execute_script('$.fx.off = true')
- end
-
- context 'admin visiting states listing' do
- let!(:state) { create(:state, country: country) }
-
- it 'correctly displays the states' do
- visit spree.admin_country_states_path(country)
- expect(page).to have_content(state.name)
- end
- end
-
- context 'creating and editing states', js: true do
- it 'allows an admin to edit existing states' do
- go_to_states_page
- choose_country(country.name)
-
- click_link 'new_state_link'
- fill_in 'state_name', with: 'Calgary'
- fill_in 'Abbreviation', with: 'CL'
- click_button 'Create'
- expect(page).to have_content('successfully created!')
- expect(page).to have_content('Calgary')
- end
-
- it 'allows an admin to create states for non default countries' do
- go_to_states_page
- choose_country(@hungary.name)
-
- click_link 'new_state_link'
- fill_in 'state_name', with: 'Pest megye'
- fill_in 'Abbreviation', with: 'PE'
- click_button 'Create'
- expect(page).to have_content('successfully created!')
- expect(page).to have_content('Pest megye')
- expect(page).to have_css('.form-group[data-hook="country"]', text: 'Hungary')
- end
-
- it 'shows validation errors' do
- go_to_states_page
- choose_country(country.name)
-
- click_link 'new_state_link'
-
- fill_in 'state_name', with: ''
- fill_in 'Abbreviation', with: ''
- click_button 'Create'
- expect(page).to have_content("Name can't be blank")
- end
-
- def choose_country(country)
- select2 country, css: '.form-group[data-hook="country"]'
- end
- end
-end
diff --git a/backend/spec/features/admin/configuration/stock_locations_spec.rb b/backend/spec/features/admin/configuration/stock_locations_spec.rb
deleted file mode 100644
index 9e1bafd532..0000000000
--- a/backend/spec/features/admin/configuration/stock_locations_spec.rb
+++ /dev/null
@@ -1,48 +0,0 @@
-require 'spec_helper'
-
-describe 'Stock Locations', type: :feature do
- stub_authorization!
- let!(:stock_location) { create(:stock_location) }
-
- before do
- visit spree.admin_stock_locations_path
- end
-
- it 'can create a new stock location' do
- within find('#contentHeader') do
- click_link 'New Stock Location'
- end
-
- fill_in 'Name', with: 'London'
- check 'Active'
- click_button 'Create'
-
- expect(page).to have_content('successfully created')
- expect(page).to have_content('London')
- end
-
- it 'can delete an existing stock location', js: true do
- refresh
- expect(page).to have_css('#listing_stock_locations', text: stock_location.name)
- accept_confirm do
- click_icon :delete
- end
- expect(page).not_to have_css('#listing_stock_locations tbody tr')
- refresh
- wait_for { !page.has_text?('No Stock Locations found') }
- expect(page).to have_content('No Stock Locations found')
- end
-
- it 'can update an existing stock location', js: true do
- refresh
-
- expect(page).to have_content(stock_location.name)
-
- click_icon :edit
- fill_in 'Name', with: 'London'
- click_button 'Update'
-
- expect(page).to have_content('successfully updated')
- expect(page).to have_content('London')
- end
-end
diff --git a/backend/spec/features/admin/configuration/stock_movement_spec.rb b/backend/spec/features/admin/configuration/stock_movement_spec.rb
deleted file mode 100644
index 5919224315..0000000000
--- a/backend/spec/features/admin/configuration/stock_movement_spec.rb
+++ /dev/null
@@ -1,48 +0,0 @@
-require 'spec_helper'
-
-describe 'Stock Movements', type: :feature do
- stub_authorization!
- let(:store) { Spree::Store.default }
- let!(:stock_location) { create(:stock_location_with_items) }
- let(:stock_item) { stock_location.stock_items.first }
- let!(:stock_movement) { create(:stock_movement, stock_item: stock_item, quantity: 10) }
-
- describe 'listing' do
- before do
- visit spree.admin_stock_locations_path
- within "#spree_stock_location_#{stock_location.id}" do
- click_on 'Stock Movements'
- end
- end
-
- it 'renders list of stock movements for this stock location' do
- expect(page).to have_content(stock_item.variant.name)
- expect(page).to have_content(stock_item.variant.options_text)
- expect(page).to have_content(stock_movement.quantity)
- end
- end
-
- describe 'creation', js: true do
- let!(:product) { create(:product_in_stock, stores: [store]) }
-
- before do
- visit spree.admin_stock_location_stock_movements_path(stock_location.id)
- click_on 'New Stock Movement', match: :first
- end
-
- it 'creates new stock movement' do
- fill_in 'Quantity', with: 10
-
- select2_open label: 'Stock Item'
- select2_search product.name, from: 'Stock Item'
- select2_select product.name, from: 'Stock Item', match: :first
-
- click_button 'Create'
-
- expect(page).to have_content(product.name)
- expect(page).to have_content(10)
-
- expect(page).to have_content('has been successfully created!')
- end
- end
-end
diff --git a/backend/spec/features/admin/configuration/store_credit_categories_spec.rb b/backend/spec/features/admin/configuration/store_credit_categories_spec.rb
deleted file mode 100644
index 02c0eacaa8..0000000000
--- a/backend/spec/features/admin/configuration/store_credit_categories_spec.rb
+++ /dev/null
@@ -1,50 +0,0 @@
-require 'spec_helper'
-
-describe 'Store Credit Categories', type: :feature, js: true do
- stub_authorization!
-
- before do
- visit spree.admin_path
- click_link 'Configuration'
- end
-
- context 'admin visiting store credit categories list' do
- it 'displays existing store credit categories' do
- create(:store_credit_category)
- click_link 'Store Credit Categories'
-
- within_row(1) { expect(page).to have_content('Exchange') }
- end
- end
-
- context 'admin creating a new store credit category' do
- before do
- click_link 'Store Credit Categories'
- click_link 'admin_new_store_credit_category_link'
- end
-
- it 'is able to create a new store credit category' do
- expect(page).to have_content('New Store Credit Category')
- fill_in 'store_credit_category_name', with: 'Return'
- click_button 'Create'
- expect(page).to have_content('successfully created!')
- end
-
- it 'shows validation errors if there are any' do
- click_button 'Create'
- expect(page).to have_content("Name can't be blank")
- end
- end
-
- context 'admin editing a store credit category' do
- it 'is able to update an existing store credit category' do
- create(:store_credit_category)
- click_link 'Store Credit Categories'
- within_row(1) { click_icon :edit }
- fill_in 'store_credit_category_name', with: 'Return'
- click_button 'Update'
- expect(page).to have_content('successfully updated!')
- expect(page).to have_content('Return')
- end
- end
-end
diff --git a/backend/spec/features/admin/configuration/stores_spec.rb b/backend/spec/features/admin/configuration/stores_spec.rb
deleted file mode 100644
index 63c49fb53d..0000000000
--- a/backend/spec/features/admin/configuration/stores_spec.rb
+++ /dev/null
@@ -1,215 +0,0 @@
-require 'spec_helper'
-
-describe 'Stores admin', type: :feature do
- stub_authorization!
-
- let(:store) { Spree::Store.default }
- let(:zone) { create(:zone, name: 'EU_VAT') }
- let!(:no_limits) { create(:zone, name: 'No Limits') }
-
- before { store.update!(checkout_zone: zone) }
-
- describe 'visiting the stores page', js: true do
- before do
- I18n.backend.store_translations(:fr,
- spree: {
- i18n: {
- this_file_language: 'Français (FR)'
- }
- })
- store.update(
- name: 'My Store',
- url: 'example.com',
- supported_currencies: 'USD,EUR',
- default_locale: 'en',
- supported_locales: 'en,fr'
- )
- end
-
- it 'is on the stores page' do
- visit spree.admin_stores_path
-
- store_table = page.find('table')
- row_count = store_table.all(:css, 'tr').size
- expect(row_count).to eq 2
- expect(Spree::Store.count).to eq 1
- expect(store_table).to have_content('My Store')
- expect(store_table).to have_content('example.com')
- expect(store_table).to have_content('EUR, USD')
- expect(store_table).to have_content('English (US), Français (FR)')
- end
- end
-
- describe 'creating store' do
- context 'with checkout_zone set as preference in spree config file', js: true do
- let!(:zone) { create(:zone, name: 'Asia') }
-
- before do
- store.update(checkout_zone_id: nil)
- Spree::Config[:checkout_zone] = 'Asia'
- end
-
- it 'sets default zone' do
- visit spree.admin_stores_path
-
- click_link 'New Store'
-
- expect(page).to have_current_path(spree.new_admin_store_path)
- expect(page).to have_selector(:id, 'select2-store_checkout_zone_id-container', text: 'Asia')
- end
- end
-
- context 'without checkout_zone set as preference in spree config file', js: true do
- before do
- store.update(checkout_zone_id: nil)
- Spree::Config.preference_default(:checkout_zone)
- end
-
- it 'sets default zone' do
- visit spree.admin_stores_path
-
- click_link 'New Store'
-
- expect(page).to have_current_path(spree.new_admin_store_path)
- expect(page).to have_selector(:id, 'select2-store_checkout_zone_id-container', text: 'No Limits')
- end
- end
-
- it 'sets default currency value', js: true do
- visit spree.admin_stores_path
-
- click_link 'New Store'
-
- expect(page).to have_current_path(spree.new_admin_store_path)
- expect(page).to have_selector(:id, 'select2-store_default_currency-container', text: 'United States Dollar (USD)')
- end
-
- it 'saving store' do
- visit spree.admin_stores_path
-
- within '#contentHeaderRow' do
- click_link 'New Store'
- end
- page.fill_in 'store_name', with: 'Spree Example Test'
- page.fill_in 'store_url', with: 'test.localhost'
- page.fill_in 'store_code', with: 'spree'
- page.fill_in 'store_mail_from_address', with: '[email protected]'
- page.fill_in 'store_customer_support_email', with: '[email protected]'
- select 'EUR', from: 'Default currency'
- select 'GBP', from: 'Supported Currencies'
- unselect 'USD', from: 'Supported Currencies'
- select 'GBP', from: 'Supported Currencies'
-
- select 'English (US)', from: 'Default locale'
-
- click_button 'Create'
-
- expect(page).to have_current_path spree.admin_stores_path
- expect(page).to have_content('Spree Example Test (spree)')
-
- row_count = page.all(:css, 'table tr').size
- expect(row_count).to eq 2
- expect(Spree::Store.count).to eq 2
-
- store = Spree::Store.last
-
- expect(store.default_currency).to eq 'EUR'
- expect(store.supported_currencies_list.map(&:iso_code)).to contain_exactly('EUR', 'GBP')
- expect(store.default_locale).to eq 'en'
- end
- end
-
- describe 'updating store', js: true do
- let(:updated_name) { 'New Store Name' }
- let(:new_currency) { 'EUR' }
-
- it do
- visit spree.admin_stores_path
-
- within_row(1) do
- click_icon :edit
- end
- page.fill_in 'store_name', with: updated_name
- select2 new_currency, from: 'Default currency'
- click_button 'Update'
-
- expect(page).to have_current_path spree.admin_stores_path
- store_table = page.find('table')
- expect(store_table).to have_content(updated_name)
- expect(store_table).to have_content(new_currency)
- store.reload
- expect(store.name).to eq updated_name
- expect(store.default_currency).to eq new_currency
- end
-
- it 'lets me enable new order notifications by setting a notification email address' do
- store_owner_email = '[email protected]'
- visit spree.admin_stores_path
-
- within_row(1) do
- click_icon :edit
- end
- page.fill_in 'store_new_order_notifications_email', with: store_owner_email
- click_button 'Update'
-
- store.reload
- expect(store.new_order_notifications_email).to eq(store_owner_email)
- end
-
- describe 'uploading a favicon' do
- let(:favicon) { file_fixture('favicon.ico') }
-
- before do
- visit spree.admin_stores_path
-
- within_row(1) { click_icon :edit }
- attach_file('Favicon', favicon)
-
- click_on 'Update'
- end
-
- it 'allows uploading a favicon' do
- expect(page).to have_content('Store "Spree Test Store" has been successfully updated!')
- expect(store.reload.favicon_image.attached?).to be(true)
- end
-
- context 'when a favicon is invalid' do
- let(:favicon) { file_fixture('icon_512x512.png') }
-
- it 'prevents uploading a favicon and displays an error message' do
- expect(page).to have_content('Unable to update store.: Favicon image must be less than or equal to 256 x 256 pixel')
- expect(store.reload.favicon_image.attached?).to be(false) if Rails.version.to_f > 5.2
- end
- end
- end
- end
-
- describe 'deleting store', js: true do
- let!(:second_store) { create(:store) }
-
- it 'updates store in lifetime stats' do
- visit spree.admin_stores_path
-
- accept_confirm do
- page.all('.icon-delete', minimum: 2)[1].click
- end
- expect(page).to have_content('has been successfully removed!')
-
- expect(Spree::Store.find_by_id(second_store.id)).to be_nil
- end
- end
-
- describe 'setting default store', js: true do
- let!(:store1) { create(:store, default: false) }
-
- it 'sets a store as default' do
- visit spree.admin_stores_path
- within_row(2) do
- click_icon :save
- end
-
- expect(store.reload.default).to eq false
- expect(store1.reload.default).to eq true
- end
- end
-end
diff --git a/backend/spec/features/admin/configuration/tax_categories_spec.rb b/backend/spec/features/admin/configuration/tax_categories_spec.rb
deleted file mode 100644
index be43a41b47..0000000000
--- a/backend/spec/features/admin/configuration/tax_categories_spec.rb
+++ /dev/null
@@ -1,58 +0,0 @@
-require 'spec_helper'
-
-describe 'Tax Categories', type: :feature do
- stub_authorization!
-
- before do
- visit spree.admin_path
- click_link 'Configuration'
- end
-
- context 'admin visiting tax categories list' do
- it 'displays the existing tax categories' do
- create(:tax_category, name: 'Clothing', tax_code: 'CL001', description: 'For Clothing')
- click_link 'Tax Categories'
- within('h1') { expect(page).to have_content('Tax Categories') }
- within_row(1) do
- expect(column_text(1)).to eq('Clothing')
- expect(column_text(2)).to eq('CL001')
- expect(column_text(3)).to eq('For Clothing')
- expect(column_text(4)).to eq('No')
- end
- end
- end
-
- context 'admin creating new tax category' do
- before do
- click_link 'Tax Categories'
- within find('#contentHeader') do
- click_link 'admin_new_tax_categories_link'
- end
- end
-
- it 'is able to create new tax category' do
- expect(page).to have_content('New Tax Category')
- fill_in 'tax_category_name', with: 'sports goods'
- fill_in 'tax_category_description', with: 'sports goods desc'
- click_button 'Create'
- expect(page).to have_content('successfully created!')
- end
-
- it 'shows validation errors if there are any' do
- click_button 'Create'
- expect(page).to have_content("Name can't be blank")
- end
- end
-
- context 'admin editing a tax category' do
- it 'is able to update an existing tax category', js: true do
- create(:tax_category)
- click_link 'Tax Categories'
- within_row(1) { click_icon :edit }
- fill_in 'tax_category_description', with: 'desc 99'
- click_button 'Update'
- expect(page).to have_content('successfully updated!')
- expect(page).to have_content('desc 99')
- end
- end
-end
diff --git a/backend/spec/features/admin/configuration/tax_rates_spec.rb b/backend/spec/features/admin/configuration/tax_rates_spec.rb
deleted file mode 100644
index e6039f5806..0000000000
--- a/backend/spec/features/admin/configuration/tax_rates_spec.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-require 'spec_helper'
-
-describe 'Tax Rates', type: :feature do
- stub_authorization!
-
- before { create(:tax_rate, calculator: stub_model(Spree::Calculator)) }
-
- # Regression test for #1422
- it 'can create a new tax rate' do
- visit spree.admin_path
- click_link 'Configuration'
- click_link 'Tax Rates'
- within find('#contentHeader') do
- click_link 'New Tax Rate'
- end
- fill_in 'Rate', with: '0.05'
- click_button 'Create'
- expect(page).to have_content('Tax Rate has been successfully created!')
- end
-end
diff --git a/backend/spec/features/admin/configuration/zones_spec.rb b/backend/spec/features/admin/configuration/zones_spec.rb
deleted file mode 100644
index 4de54f7eb8..0000000000
--- a/backend/spec/features/admin/configuration/zones_spec.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-require 'spec_helper'
-
-describe 'Zones', type: :feature do
- stub_authorization!
-
- before do
- Spree::Zone.delete_all
- visit spree.admin_path
- click_link 'Configuration'
- end
-
- context 'show' do
- it 'displays existing zones' do
- create(:zone, name: 'eastern', description: 'zone is eastern')
- create(:zone, name: 'western', description: 'cool san fran')
- click_link 'Zones'
-
- within_row(1) { expect(page).to have_content('eastern') }
- within_row(2) { expect(page).to have_content('western') }
-
- click_link 'zones_order_by_description_title'
-
- within_row(1) { expect(page).to have_content('western') }
- within_row(2) { expect(page).to have_content('eastern') }
- end
- end
-
- context 'create' do
- it 'allows an admin to create a new zone' do
- click_link 'Zones'
- within find('#contentHeader') do
- click_link 'admin_new_zone_link'
- end
- expect(page).to have_content('New Zone')
- fill_in 'zone_name', with: 'japan'
- fill_in 'zone_description', with: 'japanese time zone'
- click_button 'Create'
- expect(page).to have_content('successfully created!')
- end
- end
-end
diff --git a/backend/spec/features/admin/general_settings/prices_settings_updating_spec.rb b/backend/spec/features/admin/general_settings/prices_settings_updating_spec.rb
deleted file mode 100644
index a3d3ff0d8e..0000000000
--- a/backend/spec/features/admin/general_settings/prices_settings_updating_spec.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-require 'spec_helper'
-
-describe 'Updating currencies settings', type: :feature, js: true do
- let!(:store) { create(:store, default: true) }
- stub_authorization!
-
- describe 'clearing cache' do
- it 'returns flash alert of type success' do
- visit spree.edit_admin_general_settings_path
-
- click_button 'Clear Cache'
- page.accept_alert
-
- assert_admin_flash_alert_success('Cache was flushed.')
- end
- end
-end
diff --git a/backend/spec/features/admin/homepage_spec.rb b/backend/spec/features/admin/homepage_spec.rb
deleted file mode 100644
index 9fe4323705..0000000000
--- a/backend/spec/features/admin/homepage_spec.rb
+++ /dev/null
@@ -1,115 +0,0 @@
-require 'spec_helper'
-
-describe 'Homepage', type: :feature do
- context 'as admin user' do
- stub_authorization!
-
- context 'visiting the homepage' do
- before do
- visit spree.admin_path
- end
-
- it "has header text 'Orders'" do
- within('h1') { expect(page).to have_content('Orders') }
- end
-
- it 'has a link to orders' do
- expect(page).to have_link('Orders', href: '/admin/orders')
- end
-
- it 'has a link to products' do
- expect(page).to have_link('Products', href: '/admin/products')
- end
-
- it 'has a link to stock' do
- expect(page).to have_link('Stock', href: '#sidebar-stock')
- end
-
- it 'has a link to reports' do
- expect(page).to have_link('Reports', href: '/admin/reports')
- end
-
- it 'has a link to configuration' do
- expect(page).to have_link('Configuration', href: '#sidebar-configuration')
- end
-
- it 'has a link to return authorizations' do
- within('.sidebar') { expect(page).to have_link('Return Authorizations', href: '/admin/return_authorizations') }
- end
-
- it 'has a link to customer returns' do
- within('.sidebar') { expect(page).to have_link('Customer Returns', href: '/admin/customer_returns') }
- end
-
- context 'version number' do
- it 'is displayed' do
- within('.sidebar') { expect(page).to have_content(Spree.version) }
- end
-
- context 'if turned off' do
- before { Spree::Backend::Config[:admin_show_version] = false }
-
- it 'is not displayed' do
- visit spree.admin_path
- within('.sidebar') { expect(page).not_to have_content(Spree.version) }
- end
- end
- end
- end
-
- context 'visiting the products tab' do
- before do
- visit spree.admin_products_path
- end
-
- it 'has a link to products' do
- within('.sidebar') { expect(page).to have_link('Products', href: '/admin/products') }
- end
-
- it 'has a link to option types' do
- within('.sidebar') { expect(page).to have_link('Option Types', href: '/admin/option_types') }
- end
-
- it 'has a link to properties' do
- within('.sidebar') { expect(page).to have_link('Properties', href: '/admin/properties') }
- end
-
- it 'has a link to prototypes' do
- within('.sidebar') { expect(page).to have_link('Prototypes', href: '/admin/prototypes') }
- end
- end
-
- context 'visiting the stock tab' do
- before do
- visit spree.admin_stock_transfers_path
- end
-
- it 'has a link to stock transfers' do
- within('.sidebar') { expect(page).to have_link('Stock Transfers', href: '/admin/stock_transfers') }
- end
-
- it 'has a link to stock locations' do
- within('.sidebar') { expect(page).to have_link('Stock Locations', href: '/admin/stock_locations') }
- end
- end
- end
-
- context 'as fakedispatch user' do
- before do
- allow_any_instance_of(Spree::Admin::BaseController).to receive(:spree_current_user).and_return(nil)
- end
-
- custom_authorization! do |_user|
- can [:admin, :edit, :index, :read], Spree::Order
- end
-
- it 'only displays tabs fakedispatch has access to' do
- visit spree.admin_path
- expect(page).to have_link('Orders')
- expect(page).not_to have_link('Products')
- expect(page).not_to have_link('Promotions')
- expect(page).not_to have_link('Reports')
- expect(page).not_to have_link('Configurations')
- end
- end
-end
diff --git a/backend/spec/features/admin/locale_spec.rb b/backend/spec/features/admin/locale_spec.rb
deleted file mode 100644
index f139b5186c..0000000000
--- a/backend/spec/features/admin/locale_spec.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-require 'spec_helper'
-
-describe 'setting locale', type: :feature do
- stub_authorization!
-
- before do
- I18n.locale = I18n.default_locale
- I18n.backend.store_translations(:fr,
- date: {
- month_names: []
- },
- spree: {
- admin: {
- tab: { orders: 'Ordres' }
- },
- listing_orders: 'Ordres'
- })
- Spree::Backend::Config[:locale] = 'fr'
- end
-
- after do
- I18n.locale = I18n.default_locale
- Spree::Backend::Config[:locale] = 'en'
- end
-
- it 'is in french' do
- visit spree.admin_path
- click_link 'Ordres'
- expect(page).to have_content('Ordres')
- end
-end
diff --git a/backend/spec/features/admin/menus/edit_menu_spec.rb b/backend/spec/features/admin/menus/edit_menu_spec.rb
deleted file mode 100644
index e4143f1e22..0000000000
--- a/backend/spec/features/admin/menus/edit_menu_spec.rb
+++ /dev/null
@@ -1,118 +0,0 @@
-require 'spec_helper'
-
-describe 'Menu Edit', type: :feature do
- stub_authorization!
-
- let!(:main_menu) { create(:menu, name: 'Main Menu') }
- let!(:menu_item) { create(:menu_item, name: 'Link To Somewhere', menu: main_menu, parent: main_menu.root) }
- let(:file_path) { Rails.root + '../../spec/support/ror_ringer.jpeg' }
-
- context 'when link to URL the user can' do
- before do
- visit spree.edit_admin_menu_menu_item_path(main_menu, menu_item)
- end
-
- it 'set to open in a new window' do
- find('label', text: 'Open this link in a new window').click
- click_on 'Update'
-
- assert_admin_flash_alert_success('Menu item "Link To Somewhere" has been successfully updated!')
- expect(page).to have_checked_field('menu_item_new_window')
- end
- end
-
- context 'setting a home page link', js: true do
- before do
- visit spree.edit_admin_menu_menu_item_path(main_menu, menu_item)
- end
-
- it 'allows you to switch to home page link' do
- select2 'Home Page', from: 'Link To'
- expect(page).to have_text 'Click the Update button below to change the link field.'
- click_on 'Update'
-
- assert_admin_flash_alert_success('Menu item "Link To Somewhere" has been successfully updated!')
- expect(page).to have_text 'This link takes you to your stores home page.'
- end
- end
-
- context 'setting the link to a product link', js: true do
- let!(:product_1) { create(:product, name: 'Blue Shoes') }
- let!(:product_2) { create(:product, name: 'Black Socks') }
- let!(:product_3) { create(:product, name: 'Green Shirt') }
-
- before do
- visit spree.edit_admin_menu_menu_item_path(main_menu, menu_item)
- end
-
- it 'allows you to switch to select a product and save' do
- select2 'Product', from: 'Link To'
- expect(page).to have_text 'Click the Update button below to change the link field.'
- click_on 'Update'
-
- select2 product_2.name, from: 'Product', search: true
- click_on 'Update'
-
- assert_admin_flash_alert_success('Menu item "Link To Somewhere" has been successfully updated!')
- expect(page).to have_css('span.select2-selection', text: product_2.name)
- expect(page).to have_text("/products/#{product_2.slug}")
- end
- end
-
- context 'setting the link to a Taxon link', js: true do
- let!(:taxon_1) { create(:taxon) }
- let!(:taxon_2) { create(:taxon) }
- let!(:taxon_3) { create(:taxon) }
-
- before do
- visit spree.edit_admin_menu_menu_item_path(main_menu, menu_item)
- end
-
- it 'allows you to select a Taxon and save' do
- select2 'Taxon', from: 'Link To'
- expect(page).to have_text 'Click the Update button below to change the link field.'
- click_on 'Update'
-
- select2 taxon_2.name, from: 'Taxon', search: true
- click_on 'Update'
-
- assert_admin_flash_alert_success('Menu item "Link To Somewhere" has been successfully updated!')
- expect(page).to have_css('span.select2-selection', text: taxon_2.pretty_name)
- expect(page).to have_text("/t/#{taxon_2.permalink}")
- end
- end
-
- context 'trying to save a menu item without a name' do
- before do
- visit spree.edit_admin_menu_menu_item_path(main_menu, menu_item)
- end
-
- it 'prompts you to enter a name' do
- fill_in 'Name', with: ''
-
- click_on 'Update'
-
- expect(page).to have_text "Name can't be blank"
- end
- end
-
- context 'when admin adds and removes an image icon' do
- before do
- visit spree.edit_admin_menu_menu_item_path(main_menu, menu_item)
- end
-
- it 'adds menu_item icon and removes when clicked' do
- attach_file('menu_item_icon_attributes_attachment', file_path)
-
- click_button 'Update'
-
- expect(page).to have_content('successfully updated!')
- expect(page).to have_css('#menuItemImgContainer img')
-
- click_link 'Remove Image'
-
- expect(page).to have_content('Image has been successfully removed')
- expect(page).not_to have_css('#menuItemImgContainer img')
- end
- end
-end
diff --git a/backend/spec/features/admin/menus/index_menu_spec.rb b/backend/spec/features/admin/menus/index_menu_spec.rb
deleted file mode 100644
index 66e38dede9..0000000000
--- a/backend/spec/features/admin/menus/index_menu_spec.rb
+++ /dev/null
@@ -1,102 +0,0 @@
-require 'spec_helper'
-
-describe 'Menus Index', type: :feature do
- stub_authorization!
-
- context 'when no menus are present' do
- before do
- visit spree.admin_menus_path
- end
-
- it 'prompts the user to create a menu' do
- expect(page).to have_text Spree.t('admin.navigation.you_have_no_menus')
- end
- end
-
- context 'when menus are present' do
- let!(:other_store) { create(:store) }
- let!(:main_menu) { create(:menu, name: 'Main Menu') }
- let!(:main_menu_fr) { create(:menu, name: 'Main Menu FR', locale: 'fr') }
- let!(:footer_menu) { create(:menu, name: 'Footer Menu', location: 'footer') }
-
- let!(:main_menu_other_store) { create(:menu, name: 'Other Store Main Menu', store: other_store) }
-
- before do
- visit spree.admin_menus_path
- I18n.backend.store_translations(:fr,
- spree: {
- i18n: {
- this_file_language: 'Français (FR)'
- }
- })
- end
-
- it 'lists each menu' do
- within_table('menusTable') do
- expect(page).to have_text 'Main Menu'
- expect(page).to have_text 'Footer Menu'
- end
- end
-
- it 'does not list menus from other store' do
- within_table('menusTable') do
- expect(page).not_to have_text 'Other Store Main Menu'
- end
- end
-
- it 'does not prompt you to create your first menu' do
- expect(page).not_to have_text Spree.t('admin.navigation.you_have_no_menus')
- end
-
- it 'has no missing translations' do
- expect(page).not_to have_css('.translation_missing', visible: :all)
- end
-
- describe 'when filtering', js: true do
- it 'is able to filter by name' do
- click_on 'Filter'
- fill_in 'Name', with: 'Main Menu FR'
- click_on 'Search'
-
- expect(page).to have_text 'Main Menu FR'
- expect(page).not_to have_text 'Footer Menu'
- end
-
- it 'is able to filter by language' do
- click_on 'Filter'
- select2 'Français (FR)', from: 'Language'
- click_on 'Search'
-
- expect(page).to have_text 'Main Menu FR'
- expect(page).not_to have_text 'Footer Menu'
- end
-
- it 'is able to filter by location' do
- click_on 'Filter'
- select2 'Footer', from: 'Location'
- click_on 'Search'
-
- expect(page).to have_text 'Footer Menu'
- expect(page).not_to have_text 'Main Menu'
- end
- end
- end
-
- context 'when a user clicks Add New Menu' do
- before do
- visit spree.admin_menus_path
- within('div#contentHeader') do
- click_on 'Add New Menu'
- end
- end
-
- it 'they are taken to the new menu page' do
- within('h1') do
- expect(page).to have_text Spree.t('admin.navigation.new_menu')
- end
-
- expect(page).to have_text Spree.t('admin.navigation.new_menu')
- fill_in 'Name', with: 'My Super Menu'
- end
- end
-end
diff --git a/backend/spec/features/admin/menus/new_menu_spec.rb b/backend/spec/features/admin/menus/new_menu_spec.rb
deleted file mode 100644
index cf3cfd0094..0000000000
--- a/backend/spec/features/admin/menus/new_menu_spec.rb
+++ /dev/null
@@ -1,76 +0,0 @@
-require 'spec_helper'
-
-describe 'New Menu', type: :feature do
- stub_authorization!
-
- context 'when user visits new menu page' do
- before do
- visit spree.new_admin_menu_path
- end
-
- it 'shows in the contextual header bar the user is creating a new menu' do
- within('h1') do
- expect(page).to have_text Spree.t('admin.navigation.new_menu')
- end
- end
-
- it 'shows the breadcrumb link back to all menus' do
- expect(page).to have_text Spree.t('admin.navigation.all_menus')
- end
-
- it 'has no missing translations' do
- expect(page).not_to have_css('.translation_missing', visible: :all)
- end
- end
-
- context 'when a user tries to create a menu with no name' do
- before do
- visit spree.new_admin_menu_path
- end
-
- it "warns that the Name can't be blank" do
- click_on 'Create'
- expect(page).to have_text ("Name can't be blank")
- end
- end
-
- context 'when a user tries to create a menu with a duplicate location within scope of stores and language', js: true do
- let!(:main_menu) { create(:menu, name: 'Main Menu') }
-
- before do
- visit spree.new_admin_menu_path
- end
-
- it 'warns the user that the location has already been taken' do
- fill_in 'Name', with: 'Main Menu'
-
- select2 'Header', from: 'Location'
- click_on 'Create'
- expect(page).to have_text ('Location has already been taken')
- end
- end
-
- context 'user can create a new menu', js: true do
- before do
- visit spree.new_admin_menu_path
- end
-
- it 'with stores' do
- fill_in 'Name', with: 'Main Menu'
-
- select2 'Footer', from: 'Location'
- click_on 'Create'
-
- assert_admin_flash_alert_success('Menu "Main Menu" has been successfully created!')
- expect(page).to have_text 'Main Menu has no items. Click the Add New Item button to begin adding links to this menu.'
- expect(page).to have_selector('a', text: Spree.t('admin.navigation.add_new_item'))
-
- expect(page).not_to have_css('.translation_missing', visible: :all)
-
- # Tests that root name is in sync with menu name.
- fill_in 'Name', with: 'X14dP'
- click_on 'Update'
- expect(page).to have_text 'X14dP has no items. Click the Add New Item button to begin adding links to this menu.'
- end
- end
-end
diff --git a/backend/spec/features/admin/option_types/edit_option_type_spec.rb b/backend/spec/features/admin/option_types/edit_option_type_spec.rb
deleted file mode 100644
index bf93ee694a..0000000000
--- a/backend/spec/features/admin/option_types/edit_option_type_spec.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-require 'spec_helper'
-
-describe 'Option Type edit spec', type: :feature, js: true do
- stub_authorization!
-
- let(:option_type) { create(:option_type, filterable: false) }
-
- context 'editing option type' do
- before do
- visit spree.edit_admin_option_type_path(option_type)
- end
-
- it 'allows to update filtering attribute of option type' do
- expect(page).to have_unchecked_field('option_type_filterable')
-
- check('option_type_filterable')
- click_button 'Update'
-
- expect(page).to have_content 'successfully updated!'
-
- within("#spree_option_type_#{option_type.id}") { click_icon(:edit) }
- expect(page).to have_checked_field('option_type_filterable')
- end
- end
-end
diff --git a/backend/spec/features/admin/orders/adjustments_promotions_spec.rb b/backend/spec/features/admin/orders/adjustments_promotions_spec.rb
deleted file mode 100644
index e068e363f7..0000000000
--- a/backend/spec/features/admin/orders/adjustments_promotions_spec.rb
+++ /dev/null
@@ -1,75 +0,0 @@
-require 'spec_helper'
-
-describe 'Adjustments Promotions', type: :feature do
- stub_authorization!
-
- before do
- create(:promotion_with_item_adjustment,
- name: '$10 off',
- path: 'test',
- code: '10_off',
- starts_at: 1.day.ago,
- expires_at: 1.day.from_now,
- adjustment_rate: 10)
-
- order = create(:order_with_totals)
- line_item = order.line_items.first
- # so we can be sure of a determinate price in our assertions
- line_item.update_column(:price, 10)
-
- visit spree.admin_order_adjustments_path(order)
- end
-
- context 'admin adding a promotion' do
- context 'successfully' do
- it 'creates a new adjustment', js: true do
- fill_in 'coupon_code', with: '10_off'
- click_button 'Add Coupon Code'
- expect(page).to have_content('$10 off')
- expect(page).to have_content('-$10.00')
- end
- end
-
- context 'for non-existing promotion' do
- it 'shows an error message', js: true do
- fill_in 'coupon_code', with: 'does_not_exist'
- click_button 'Add Coupon Code'
- expect(page).to have_content("doesn't exist.")
- end
- end
-
- context 'for already applied promotion' do
- it 'shows an error message', js: true do
- fill_in 'coupon_code', with: '10_off'
- click_button 'Add Coupon Code'
- expect(page).to have_content('-$10.00')
-
- fill_in 'coupon_code', with: '10_off'
- click_button 'Add Coupon Code'
- expect(page).to have_content('already been applied')
- end
- end
- end
-
- context 'admin is able to add promotion code after removing one before' do
- it 'allows to add previously deleted promotion', js: true do
- fill_in 'coupon_code', with: '10_off'
- click_button 'Add Coupon Code'
- expect(page).to have_content('$10 off')
- expect(page).to have_content('-$10.00')
-
- accept_confirm do
- within_row(1) do
- click_icon(:delete)
- end
- end
- expect(page).not_to have_content('$10 off')
- expect(page).not_to have_content('-$10.00')
-
- fill_in 'coupon_code', with: '10_off'
- click_button 'Add Coupon Code'
- expect(page).to have_content('$10 off')
- expect(page).to have_content('-$10.00')
- end
- end
-end
diff --git a/backend/spec/features/admin/orders/adjustments_spec.rb b/backend/spec/features/admin/orders/adjustments_spec.rb
deleted file mode 100644
index 23929cc04a..0000000000
--- a/backend/spec/features/admin/orders/adjustments_spec.rb
+++ /dev/null
@@ -1,121 +0,0 @@
-require 'spec_helper'
-
-describe 'Adjustments', type: :feature do
- stub_authorization!
-
- let(:store) { Spree::Store.default }
- let!(:order) { create(:completed_order_with_totals, line_items_count: 5, store: store) }
- let!(:line_item) do
- line_item = order.line_items.first
- # so we can be sure of a determinate price in our assertions
- line_item.update_column(:price, 10)
- line_item
- end
-
- before do
- create(:tax_adjustment,
- adjustable: line_item,
- state: 'closed',
- order: order,
- label: 'VAT 5%',
- amount: 10)
-
- order.adjustments.create!(order: order, label: 'Rebate', amount: 10)
-
- # To ensure the order totals are correct
- order.update_totals
- order.persist_totals
-
- visit spree.admin_orders_path
- within_row(1) { click_on order.number }
- click_on 'Adjustments'
- end
-
- after do
- order.reload.all_adjustments.each do |adjustment|
- expect(adjustment.order_id).to equal(order.id)
- end
- end
-
- context 'admin managing adjustments' do
- it 'displays the correct values for existing order adjustments' do
- within_row(1) do
- expect(column_text(2)).to eq('VAT 5%')
- expect(column_text(3)).to eq('$10.00')
- end
- end
-
- it 'only shows eligible adjustments' do
- expect(page).not_to have_content('ineligible')
- end
- end
-
- context 'admin creating a new adjustment' do
- before do
- within find('#contentHeader') do
- click_link 'New Adjustment'
- end
- end
-
- context 'successfully' do
- it 'creates a new adjustment' do
- fill_in 'adjustment_amount', with: '10'
- fill_in 'adjustment_label', with: 'rebate'
- click_button 'Continue'
- expect(page).to have_content('successfully created!')
- expect(page).to have_content('Total: $80.00')
- end
- end
-
- context 'with validation errors' do
- it 'does not create a new adjustment' do
- fill_in 'adjustment_amount', with: ''
- fill_in 'adjustment_label', with: ''
- click_button 'Continue'
- expect(page).to have_content("Label can't be blank")
- end
- end
- end
-
- context 'admin editing an adjustment', js: true do
- before do
- within_row(2) { click_icon :edit }
- end
-
- context 'successfully' do
- it 'updates the adjustment' do
- fill_in 'adjustment_amount', with: '99'
- fill_in 'adjustment_label', with: 'rebate 99'
- click_button 'Continue'
- expect(page).to have_content('successfully updated!')
- expect(page).to have_content('rebate 99')
- within('.adjustments') do
- expect(page).to have_content('$99.00')
- end
-
- expect(page).to have_content('Total: $159.00')
- end
- end
-
- context 'with validation errors' do
- it 'does not update the adjustment' do
- fill_in 'adjustment_amount', with: ''
- fill_in 'adjustment_label', with: ''
- click_button 'Continue'
- expect(page).to have_content("Label can't be blank")
- end
- end
- end
-
- context 'deleting an adjustment' do
- it 'updates the total', js: true do
- accept_confirm do
- within_row(2) do
- click_icon(:delete)
- end
- end
-
- expect(page).to have_content(/Total: ?\$170\.00/)
- end
- end
-end
diff --git a/backend/spec/features/admin/orders/cancelling_and_resuming_spec.rb b/backend/spec/features/admin/orders/cancelling_and_resuming_spec.rb
deleted file mode 100644
index a61cd3a0ab..0000000000
--- a/backend/spec/features/admin/orders/cancelling_and_resuming_spec.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-require 'spec_helper'
-
-describe 'Cancelling + Resuming', type: :feature do
- stub_authorization!
-
- let(:user) { double(id: 123, has_spree_role?: true, spree_api_key: 'fake', email: '[email protected]') }
- let(:order) do
- order = create(:order)
- order.update_columns(state: 'complete', completed_at: Time.current)
- order
- end
-
- before do
- allow_any_instance_of(Spree::Admin::BaseController).to receive(:try_spree_current_user).and_return(user)
- end
-
- it 'can cancel an order' do
- visit spree.edit_admin_order_path(order.number)
- within find('#contentHeader') do
- click_button 'Cancel'
- end
-
- expect(page).to have_css('.additional-info .state', text: 'canceled')
- end
-
- context 'with a cancelled order' do
- before do
- order.update_column(:state, 'canceled')
- end
-
- it 'can resume an order' do
- visit spree.edit_admin_order_path(order.number)
- within find('#contentHeader') do
- click_button 'Resume'
- end
-
- expect(page).to have_css('.additional-info .state', text: 'resumed')
- end
- end
-end
diff --git a/backend/spec/features/admin/orders/customer_details_spec.rb b/backend/spec/features/admin/orders/customer_details_spec.rb
deleted file mode 100644
index 1816649c9b..0000000000
--- a/backend/spec/features/admin/orders/customer_details_spec.rb
+++ /dev/null
@@ -1,160 +0,0 @@
-require 'spec_helper'
-
-describe 'Customer Details', type: :feature, js: true do
- stub_authorization!
-
- let(:store) { Spree::Store.default }
- let!(:country) { store.default_country }
- let!(:state) { create(:state, name: 'Alabama', country: country, abbr: 'AL') }
- let!(:order) { create(:order, state: 'complete', completed_at: '2011-02-01 12:36:15', store: store) }
- let!(:product) { create(:product_in_stock, stores: [store]) }
- # We need a unique name that will appear for the customer dropdown
- let!(:ship_address) { create(:address, country: country, state: state, first_name: 'Rumpelstiltskin') }
- let!(:bill_address) { create(:address, country: country, state: state, first_name: 'Rumpelstiltskin') }
-
- let!(:user) { create(:user, email: '[email protected]', ship_address: ship_address, bill_address: bill_address) }
-
- before do
- create(:shipping_method, display_on: 'front_end')
- end
-
- # Value attribute is dynamically set via JS, so not observable via a CSS/XPath selector
- # As the browser might take time to make the values visible in the dom we need to
- # "intelligiently" wait for that event o prevent a race.
- def expect_form_value(selector, value)
- expect(page).to have_css(selector){ |n| n.value.eql?(value) }
- end
-
- context 'brand new order' do
- before do
- allow(Spree.user_class).to receive(:find_by).and_return(user)
- visit spree.new_admin_order_path
- end
- # Regression test for #3335 & #5317
-
- it 'associates a user when not using guest checkout' do
- select2 product.name, from: Spree.t(:name_or_sku), search: true
-
- within('table.stock-levels') do
- fill_in 'variant_quantity', with: 1
- click_icon :add
- end
- expect(page).to have_css('.card', text: 'Order Line Items')
-
- click_link 'Customer'
- select2 '[email protected]', css: '#customer-search-field', search: true
- # 5317 - Address prefills using user's default.
- expect_form_value('#order_bill_address_attributes_firstname', user.bill_address.firstname)
- expect_form_value('#order_bill_address_attributes_lastname', user.bill_address.lastname)
- expect_form_value('#order_bill_address_attributes_address1', user.bill_address.address1)
- expect_form_value('#order_bill_address_attributes_address2', user.bill_address.address2)
- expect_form_value('#order_bill_address_attributes_city', user.bill_address.city)
- expect_form_value('#order_bill_address_attributes_zipcode', user.bill_address.zipcode)
- expect(page).to have_css('#bcountry', text: user.bill_address.country_name.to_s)
- expect(page).to have_css('#bstate', text: user.bill_address.state_name.to_s)
- expect_form_value('#order_bill_address_attributes_phone', user.bill_address.phone)
- wait_for { !page.has_button?('Update') }
- click_button 'Update'
- expect(Spree::Order.last.user).to eq(user)
- end
- end
-
- context 'editing an order' do
- before do
- configure_spree_preferences do |config|
- config.default_country_id = country.id
- config.company = true
- end
-
- allow(Spree.user_class).to receive(:find_by).and_return(user)
- visit spree.admin_orders_path
- within('table#listing_orders') { click_icon(:edit) }
- end
-
- context 'selected country has no state' do
- before { create(:country, iso: 'BRA', name: 'Brazil', states_required: true) }
-
- it 'changes state field to text input' do
- click_link 'Customer'
-
- within('#billing') do
- select2 'Brazil', from: 'Country'
- fill_in 'order_bill_address_attributes_state_name', with: 'Piaui'
- end
-
- click_button 'Update'
- expect(page).to have_field('order_bill_address_attributes_state_name', with: 'Piaui')
- end
- end
-
- it 'is able to update customer details for an existing order' do
- order.ship_address = create(:address)
- order.save!
-
- click_link 'Customer'
- within('#shipping') { fill_in_address 'ship' }
- within('#billing') { fill_in_address 'bill' }
-
- click_button 'Update'
- click_link 'Customer'
-
- # Regression test for #2950 + #2433
- # This act should transition the state of the order as far as it will go too
- within('#order_tab_summary') do
- expect(page).to have_css('.state', text: 'COMPLETE')
- end
- end
-
- it 'shows validation errors' do
- click_link 'Customer'
- click_button 'Update'
- expect(page).to have_content("Shipping address first name can't be blank")
- end
-
- it 'updates order email for an existing order with a user' do
- order.update_columns(ship_address_id: ship_address.id, bill_address_id: bill_address.id, state: 'confirm', completed_at: nil)
- previous_user = order.user
- click_link 'Customer'
- fill_in 'order_email', with: '[email protected]'
- expect(order.user_id).to eq previous_user.id
- expect(order.user.email).to eq previous_user.email
- expect { click_button 'Update' }.to change { order.reload.email }.to '[email protected]'
- end
-
- # Regression test for #942
- context 'errors when no shipping methods are available' do
- before do
- Spree::ShippingMethod.delete_all
- end
-
- specify do
- click_link 'Customer'
- # Need to fill in valid information so it passes validations
- fill_in 'order_ship_address_attributes_firstname', with: 'John 99'
- fill_in 'order_ship_address_attributes_lastname', with: 'Doe'
- fill_in 'order_ship_address_attributes_lastname', with: 'Company'
- fill_in 'order_ship_address_attributes_address1', with: '100 first lane'
- fill_in 'order_ship_address_attributes_address2', with: '#101'
- fill_in 'order_ship_address_attributes_city', with: 'Bethesda'
- fill_in 'order_ship_address_attributes_zipcode', with: '20170'
-
- select2 'Alabama', css: '#sstate'
- fill_in 'order_ship_address_attributes_phone', with: '123-456-7890'
- expect { click_button 'Update' }.not_to raise_error
- end
- end
- end
-
- def fill_in_address(kind = 'bill')
- fill_in 'First Name', with: 'John 99'
- fill_in 'Last Name', with: 'Doe'
- fill_in 'Company', with: 'Company'
- fill_in 'Address', with: '100 first lane'
- fill_in 'Address (contd.)', with: '#101'
- select2 country.name, from: 'Country'
- fill_in 'City', with: 'Bethesda'
- fill_in 'Zip Code', with: '20170'
- select2 state.name, from: 'State'
- fill_in 'Phone', with: '123-456-7890'
- end
-end
diff --git a/backend/spec/features/admin/orders/line_items_spec.rb b/backend/spec/features/admin/orders/line_items_spec.rb
deleted file mode 100644
index 1989c439cf..0000000000
--- a/backend/spec/features/admin/orders/line_items_spec.rb
+++ /dev/null
@@ -1,53 +0,0 @@
-require 'spec_helper'
-
-# Tests for #3958's features
-describe 'Order Line Items', type: :feature, js: true do
- stub_authorization!
-
- before do
- # Removing the delivery step causes the order page to render a different
- # partial, called _line_items, which shows line items rather than shipments
- allow(Spree::Order).to receive_messages checkout_step_names: [:address, :payment, :confirm, :complete]
- end
-
- let(:store) { Spree::Store.default }
-
- let!(:order) do
- order = create(:order_with_line_items, line_items_count: 1, store: store)
- order.shipments.destroy_all
- order
- end
-
- it "can edit a line item's quantity" do
- visit spree.edit_admin_order_path(order)
- within('.line-items') do
- within_row(1) do
- find('.edit-line-item').click
- fill_in 'quantity', with: 10
- find('.save-line-item').click
- within '.line-item-qty-show' do
- expect(page).to have_content('10')
- end
- within '.line-item-total' do
- expect(page).to have_content('$199.90')
- end
- end
- end
- end
-
- it 'can delete a line item' do
- visit spree.edit_admin_order_path(order)
-
- product_name = find('.line-items tr:nth-child(1) .line-item-name').text
-
- within('.line-items') do
- within_row(1) do
- accept_confirm do
- find('.delete-line-item').click
- end
- end
- end
-
- expect(page).not_to have_content(product_name)
- end
-end
diff --git a/backend/spec/features/admin/orders/listing_spec.rb b/backend/spec/features/admin/orders/listing_spec.rb
deleted file mode 100644
index 44299b97fc..0000000000
--- a/backend/spec/features/admin/orders/listing_spec.rb
+++ /dev/null
@@ -1,323 +0,0 @@
-require 'spec_helper'
-
-describe 'Orders Listing', type: :feature do
- stub_authorization!
-
- let(:other_store) { create(:store, name: 'Other Store', url: 'another-store.lvh.me') }
-
- let(:order1) do
- create :order_with_line_items,
- created_at: 1.day.from_now,
- completed_at: 1.day.from_now,
- considered_risky: true,
- number: 'R100'
- end
-
- let(:order2) do
- create :order,
- created_at: 1.day.ago,
- completed_at: 1.day.ago,
- number: 'R200'
- end
-
- let(:order3) do
- create :order,
- store: other_store,
- created_at: 1.day.ago,
- completed_at: 1.day.ago,
- number: 'R300'
- end
-
- let(:order4) do
- create :order,
- store: other_store,
- created_at: 1.day.ago,
- completed_at: 1.day.ago,
- number: 'R400'
- end
-
- before do
- allow_any_instance_of(Spree::OrderInventory).to receive(:add_to_shipment)
- # create the order instances after stubbing the `add_to_shipment` method
- order1
- order2
- order3
- order4
- visit spree.admin_orders_path
- end
-
- describe 'listing orders' do
- it 'lists existing orders' do
- within_row(1) do
- expect(column_text(1)).to eq 'R100'
- expect(find('td:nth-child(3)')).to have_css '.badge-considered_risky'
- expect(column_text(4)).to eq 'cart'
- end
-
- within_row(2) do
- expect(column_text(1)).to eq 'R200'
- expect(find('td:nth-child(3)')).to have_css '.badge-considered_safe'
- end
- end
-
- it 'does not show the order that belongs to the other_store' do
- expect(page).not_to have_content('R300')
- expect(page).not_to have_content('R400')
- end
-
- it 'is able to sort the orders listing' do
- # default is completed_at desc
- within_row(1) { expect(page).to have_content('R100') }
- within_row(2) { expect(page).to have_content('R200') }
-
- click_link 'Completed At'
-
- # Completed at desc
- within_row(1) { expect(page).to have_content('R200') }
- within_row(2) { expect(page).to have_content('R100') }
-
- within('table#listing_orders thead') { click_link 'Number' }
-
- # number asc
- within_row(1) { expect(page).to have_content('R100') }
- within_row(2) { expect(page).to have_content('R200') }
- end
- end
-
- describe 'switching store', js: true do
- it 'shows orders from the current store only' do
- expect(page).to have_content('R100')
- expect(page).to have_content('R200')
-
- visit spree.admin_orders_path
-
- Capybara.app_host = 'http://another-store.lvh.me'
-
- find('a#storeSelectorDropdown').click
- within('.dropdown-menu') { click_link other_store.unique_name }
-
- expect(current_url).to match('another-store.lvh.me')
-
- expect(page).to have_content('R300')
- expect(page).to have_content('R400')
-
- expect(page).not_to have_content('R100')
- expect(page).not_to have_content('R200')
-
- Capybara.app_host = nil
- end
- end
-
- describe 'searching orders' do
- it 'is able to search orders' do
- fill_in 'q_number_cont', with: 'R200'
- click_on 'Filter Results'
- within_row(1) do
- expect(page).to have_content('R200')
- end
-
- # Ensure that the other order doesn't show up
- within('table#listing_orders') { expect(page).not_to have_content('R100') }
- end
-
- it 'returns both complete and incomplete orders when only complete orders is not checked' do
- Spree::Order.create! email: '[email protected]', completed_at: nil, state: 'cart'
- click_on 'Filter'
- uncheck 'q_completed_at_not_null'
- click_on 'Filter Results'
-
- expect(page).to have_content('R200')
- expect(page).to have_content('[email protected]')
- end
-
- it 'is able to filter risky orders' do
- # Check risky and filter
- check 'q_considered_risky_eq'
- click_on 'Filter Results'
-
- # Insure checkbox still checked
- expect(page).to have_checked_field(id: 'q_considered_risky_eq')
- # Insure we have the risky order, R100
- within_row(1) do
- expect(page).to have_content('R100')
- end
- # Insure the non risky order is not present
- expect(page).not_to have_content('R200')
- end
-
- it 'is able to filter on variant_sku' do
- click_on 'Filter'
- fill_in 'q_line_items_variant_sku_eq', with: order1.line_items.first.variant.sku
- click_on 'Filter Results'
-
- within_row(1) do
- expect(page).to have_content(order1.number)
- end
-
- expect(page).not_to have_content(order2.number)
- end
-
- context 'when pagination is really short' do
- before do
- @old_per_page = Spree::Backend::Config[:admin_orders_per_page]
- Spree::Backend::Config[:admin_orders_per_page] = 1
- end
-
- after do
- Spree::Backend::Config[:admin_orders_per_page] = @old_per_page
- end
-
- # Regression test for #4004
- it 'is able to go from page to page for incomplete orders' do
- Spree::Order.destroy_all
- 2.times { Spree::Order.create! email: '[email protected]', completed_at: nil, state: 'cart' }
- click_on 'Filter'
- uncheck 'q_completed_at_not_null'
- click_on 'Filter Results'
- within('.pagination', match: :first) do
- click_link '2'
- end
- expect(page).to have_content('[email protected]')
- expect(page).to have_unchecked_field(id: 'q_completed_at_not_null')
- end
- end
-
- it 'is able to search orders using only completed at input' do
- fill_in 'q_created_at_gt', with: Date.current
- click_on 'Filter Results'
-
- within_row(1) { expect(page).to have_content('R100') }
-
- # Ensure that the other order doesn't show up
- within('table#listing_orders') { expect(page).not_to have_content('R200') }
- end
-
- context 'filter on promotions' do
- let!(:promotion) { create(:promotion_with_item_adjustment) }
-
- before do
- order1.promotions << promotion
- order1.save
- visit spree.admin_orders_path
- end
-
- it 'only shows the orders with the selected promotion' do
- select promotion.name, from: 'Promotion'
- click_on 'Filter Results'
- within_row(1) { expect(page).to have_content('R100') }
- within('table#listing_orders') { expect(page).not_to have_content('R200') }
- end
- end
-
- it 'is able to apply a ransack filter by clicking a quickfilter icon', js: true do
- label_pending = page.find '.badge-pending'
- parent_td = label_pending.find(:xpath, '..')
-
- # Click the quick filter Pending for order #R100
- within(parent_td) do
- find('.js-add-filter').click
- end
-
- expect(page).to have_content('R100')
- expect(page).not_to have_content('R200')
- end
-
- context 'filter on shipment state' do
- it 'only shows the orders with the selected shipment state' do
- select Spree.t("payment_states.#{order1.shipment_state}"), from: 'Shipment State'
- click_on 'Filter Results'
- within_row(1) { expect(page).to have_content('R100') }
- within('table#listing_orders') { expect(page).not_to have_content('R200') }
- end
- end
-
- context 'filter on payment state' do
- it 'only shows the orders with the selected payment state' do
- select Spree.t("payment_states.#{order1.payment_state}"), from: 'Payment State'
- click_on 'Filter Results'
- within_row(1) { expect(page).to have_content('R100') }
- within('table#listing_orders') { expect(page).not_to have_content('R200') }
- end
- end
-
- # regression tests for https://github.com/spree/spree/issues/6888
- context 'per page dropdown', js: true do
- before do
- within('div.index-pagination-row', match: :first) do
- select '50', from: 'per_page'
- end
- expect(page).to have_select('per_page', selected: '50')
- expect(page).to have_selector(:css, 'select.per-page-selected-50')
- end
-
- it 'adds per_page parameter to url' do
- expect(page).to have_current_path(/per_page=50/)
- end
-
- it 'can be used with search filtering' do
- click_on 'Filter'
- fill_in 'q_number_cont', with: 'R200'
- click_on 'Filter Results'
- expect(page).not_to have_content('R100')
- within_row(1) { expect(page).to have_content('R200') }
- expect(page).to have_current_path(/per_page=50/)
- expect(page).to have_select('per_page', selected: '50')
- within('div.index-pagination-row', match: :first) do
- select '75', from: 'per_page'
- end
- expect(page).to have_current_path(/per_page=75/)
- expect(page).to have_select('per_page', selected: '75')
- expect(page).to have_selector(:css, 'select.per-page-selected-75')
- expect(page).not_to have_content('R100')
- within_row(1) { expect(page).to have_content('R200') }
- end
- end
-
- context 'filtering orders', js: true do
- let(:promotion) { create(:promotion_with_item_adjustment) }
-
- before do
- order1.promotions << promotion
- order1.save
- visit spree.admin_orders_path
- end
-
- it 'renders selected filters' do
- click_on 'Filter'
-
- within('#table-filter') do
- select2 'cart', from: 'Status'
- select2 'paid', from: 'Payment State'
- select2 'pending', from: 'Shipment State'
- fill_in 'q_number_cont', with: 'R100'
- fill_in 'q_email_cont', with: '[email protected]'
- fill_in 'q_line_items_variant_sku_eq', with: 'BAG-00001'
- select2 'Promo', from: 'Promotion'
- fill_in 'q_bill_address_firstname_start', with: 'John'
- fill_in 'q_bill_address_lastname_start', with: 'Smith'
- select2 'spree', from: 'Channel'
- end
-
- fill_in_date_picker('q_created_at_gt', { year: 2018, month: 1, day: 18 })
- fill_in_date_picker('q_created_at_lt', { year: 2019, month: 3, day: 25 })
-
- click_on 'Filter Results'
-
- within('.table-active-filters') do
- expect(page).to have_content('Start: 2018-01-18')
- expect(page).to have_content('Stop: 2019-03-25')
- expect(page).to have_content('Order Number: R100')
- expect(page).to have_content('Status: cart')
- expect(page).to have_content('Payment State: paid')
- expect(page).to have_content('Shipment State: pending')
- expect(page).to have_content('First Name Begins With: John')
- expect(page).to have_content('Last Name Begins With: Smith')
- expect(page).to have_content('Promotion: Promo')
- expect(page).to have_content('Email: [email protected]')
- expect(page).to have_content('SKU: BAG-00001')
- expect(page).to have_content('Channel: spree')
- end
- end
- end
- end
-end
diff --git a/backend/spec/features/admin/orders/log_entries_spec.rb b/backend/spec/features/admin/orders/log_entries_spec.rb
deleted file mode 100644
index 039a738dbb..0000000000
--- a/backend/spec/features/admin/orders/log_entries_spec.rb
+++ /dev/null
@@ -1,63 +0,0 @@
-require 'spec_helper'
-
-describe 'Log entries', type: :feature do
- stub_authorization!
-
- let(:store) { Spree::Store.default }
- let(:order) { create(:order, store: store) }
- let!(:payment) { create(:payment, order: order) }
-
- context 'with a successful log entry' do
- before do
- response = ActiveMerchant::Billing::Response.new(
- true,
- 'Transaction successful',
- transid: 'ABCD1234'
- )
-
- payment.log_entries.create(
- source: payment.source,
- details: response.to_yaml
- )
- end
-
- it 'shows a successful attempt' do
- visit spree.admin_order_payments_path(order)
- find("#payment_#{payment.id} a", text: payment.number).click
- within find('#contentHeader') do
- click_link 'Logs'
- end
-
- within('#listing_log_entries') do
- expect(page).to have_content('Transaction successful')
- end
- end
- end
-
- context 'with a failed log entry' do
- before do
- response = ActiveMerchant::Billing::Response.new(
- false,
- 'Transaction failed',
- transid: 'ABCD1234'
- )
-
- payment.log_entries.create(
- source: payment.source,
- details: response.to_yaml
- )
- end
-
- it 'shows a failed attempt' do
- visit spree.admin_order_payments_path(order)
- find("#payment_#{payment.id} a", text: payment.number).click
- within find('#contentHeader') do
- click_link 'Logs'
- end
-
- within('#listing_log_entries') do
- expect(page).to have_content('Transaction failed')
- end
- end
- end
-end
diff --git a/backend/spec/features/admin/orders/new_order_spec.rb b/backend/spec/features/admin/orders/new_order_spec.rb
deleted file mode 100644
index 8607813bd6..0000000000
--- a/backend/spec/features/admin/orders/new_order_spec.rb
+++ /dev/null
@@ -1,202 +0,0 @@
-require 'spec_helper'
-
-describe 'New Order', type: :feature do
- let!(:product) { create(:product_in_stock, stores: [store]) }
- let!(:state) { create(:state) }
- let!(:user) { create(:user, ship_address: create(:address), bill_address: create(:address)) }
- let(:order) { Spree::Order.last }
- let(:store) { Spree::Store.default }
-
- stub_authorization!
-
- before do
- create(:check_payment_method)
- create(:shipping_method)
- # create default store
- allow(Spree.user_class).to receive(:find_by).and_return(user)
- visit spree.new_admin_order_path
- end
-
- it 'does check if you have a billing address before letting you add shipments' do
- click_on 'Shipments'
- expect(page).to have_content 'Please fill in customer info'
- expect(page).to have_current_path(spree.edit_admin_order_customer_path(order))
- end
-
- it 'sets proper currency and store' do
- expect(order.store).to eq(store)
- expect(order.currency).to eq(store.default_currency)
- end
-
- it 'completes new order successfully without using the cart', js: true do
- select2 product.name, from: Spree.t(:name_or_sku), search: true
-
- click_icon :add
- expect(page).to have_css('.card', text: 'Order Line Items')
-
- click_on 'Customer'
- select_customer
-
- check 'order_use_billing'
- fill_in_address
- click_on 'Update'
-
- click_on 'Payments'
- click_on 'Update'
-
- expect(page).to have_current_path(spree.admin_order_payments_path(order))
- click_icon 'capture'
-
- click_on 'Shipments'
- click_on 'Ship'
-
- expect(page).to have_content('shipped')
- end
-
- context 'adding new item to the order', js: true do
- it 'inventory items show up just fine and are also registered as shipments' do
- select2 product.name, from: Spree.t(:name_or_sku), search: true
-
- within('table.stock-levels') do
- fill_in 'variant_quantity', with: 2
- click_icon :add
- end
-
- within('.line-items') do
- expect(page).to have_content(product.name)
- expect(page).to have_content(product.price_in(store.default_currency).display_price.to_s)
- end
-
- click_on 'Customer'
- select_customer
-
- check 'order_use_billing'
- fill_in_address
- click_on 'Update'
-
- click_on 'Shipments'
-
- within('.stock-contents') do
- expect(page).to have_content(product.name)
- end
- end
- end
-
- context 'skipping to shipping without having an address', js: true do
- it 'prompts you with a flash notice to: Please fill in customer info' do
- click_on 'Shipments'
- assert_admin_flash_alert_notice('Please fill in customer info')
- end
- end
-
- context "adding new item to the order which isn't available", js: true do
- before do
- product.update(available_on: nil)
- select2 product.name, from: Spree.t(:name_or_sku), search: true
- end
-
- it 'inventory items is displayed' do
- expect(page).to have_content(product.name)
- expect(page).to have_css('#stock_details')
- end
-
- context 'on increase in quantity the product should be removed from order' do
- before do
- accept_alert do
- within('table.stock-levels') do
- fill_in 'variant_quantity', with: 2
- click_icon :add
- end
- end
- end
-
- it { expect(page).not_to have_css('#stock_details') }
- end
- end
-
- # Regression test for #3958
- context 'without a delivery step', js: true do
- before do
- allow(Spree::Order).to receive_messages checkout_step_names: [:address, :payment, :confirm, :complete]
- end
-
- it 'can still see line items' do
- select2 product.name, from: Spree.t(:name_or_sku), search: true
- click_icon :add
- within('.line-items') do
- within('.line-item-name') do
- expect(page).to have_content(product.name)
- end
- within('.line-item-qty-show') do
- expect(page).to have_content('1')
- end
- within('.line-item-price') do
- expect(page).to have_content(product.price)
- end
- end
- end
- end
-
- # Regression test for #3336
- context 'start by customer address' do
- it 'completes order fine', js: true do
- click_on 'Customer'
- select_customer
-
- check 'order_use_billing'
- fill_in_address
- click_on 'Update'
-
- click_on 'Shipments'
- select2 product.name, from: Spree.t(:name_or_sku), search: true
- click_icon :add
- expect(page).not_to have_content('Your order is empty')
-
- click_on 'Payments'
- click_on 'Continue'
-
- expect(page).to have_css('.additional-info .state', text: 'COMPLETE')
- end
- end
-
- # Regression test for #5327
- context 'customer with default credit card', js: true do
- before do
- allow(Spree.user_class).to receive(:find_by).and_return(user)
- create(:credit_card, default: true, user: user)
- end
-
- it 'transitions to delivery not to complete' do
- select2 product.name, from: Spree.t(:name_or_sku), search: true
-
- within('table.stock-levels') do
- fill_in 'variant_quantity', with: 1
- click_icon :add
- end
- expect(page).not_to have_content('Your order is empty')
-
- click_link 'Customer'
- select_customer
- wait_for { !page.has_button?('Update') }
- click_button 'Update'
- expect(order.state).to eq 'delivery'
- end
- end
-
- def fill_in_address(kind = 'bill')
- fill_in 'First Name', with: 'John 99'
- fill_in 'Last Name', with: 'Doe'
- fill_in 'Address', with: '100 first lane'
- fill_in 'Address (contd.)', with: '#101'
- fill_in 'City', with: 'Bethesda'
- fill_in 'Zip Code', with: '20170'
- select2 state.name, css: '#bstate'
- fill_in 'Phone', with: '123-456-7890'
- end
-
- def select_customer
- within 'div#select-customer' do
- select2 user.email, css: '#customer-search-field', search: true
- end
- end
-end
diff --git a/backend/spec/features/admin/orders/order_details_spec.rb b/backend/spec/features/admin/orders/order_details_spec.rb
deleted file mode 100644
index 71cd053381..0000000000
--- a/backend/spec/features/admin/orders/order_details_spec.rb
+++ /dev/null
@@ -1,681 +0,0 @@
-require 'spec_helper'
-
-describe 'Order Details', type: :feature, js: true do
- let(:store) { Spree::Store.default }
- let!(:stock_location) { create(:stock_location_with_items) }
- let!(:product) { create(:product, name: 'spree t-shirt', price: 20.00, stores: [store]) }
- let(:order) { create(:order, state: 'complete', completed_at: '2011-02-01 12:36:15', number: 'R100', store: store) }
- let(:fresh_order) { create(:order, store: store) }
- let(:state) { create(:state) }
-
- before do
- create(:shipping_method, name: 'Default')
- order.shipments.create!(stock_location_id: stock_location.id)
- Spree::Cart::AddItem.call(order: order, variant: product.master, quantity: 2)
- end
-
- context 'as Admin' do
- stub_authorization!
-
- context 'cart edit page' do
- before do
- product.master.stock_items.first.update_column(:count_on_hand, 100)
- visit spree.cart_admin_order_path(order)
- end
-
- it 'allows me to edit order details' do
- expect(page).to have_content('spree t-shirt')
- expect(page).to have_content('$40.00')
-
- within_row(1) do
- click_icon :edit
- fill_in 'quantity', with: '1'
- end
- click_icon :save
-
- within('#order_total') do
- expect(page).to have_content('$20.00')
- end
- end
-
- it 'can add an item to a shipment' do
- select2 'spree t-shirt', from: Spree.t(:name_or_sku), search: true
-
- within('table.stock-levels') do
- fill_in 'variant_quantity', with: 2
- click_icon :add
- end
-
- within('#order_total') do
- expect(page).to have_content('$80.00')
- end
- end
-
- it 'can remove an item from a shipment' do
- expect(page).to have_content('spree t-shirt')
-
- within_row(1) do
- accept_confirm do
- click_icon :delete
- end
- end
-
- # Click "ok" on confirmation dialog
- expect(page).not_to have_content('spree t-shirt')
- end
-
- # Regression test for #3862
- it 'can cancel removing an item from a shipment' do
- expect(page).to have_content('spree t-shirt')
-
- within_row(1) do
- # Click "cancel" on confirmation dialog
- dismiss_confirm do
- click_icon :delete
- end
- end
-
- expect(page).to have_content('spree t-shirt')
- end
-
- it 'can add tracking information' do
- visit spree.edit_admin_order_path(order)
-
- within('.show-tracking') do
- click_icon :edit
- end
- fill_in 'tracking', with: 'FOOBAR'
- click_icon :save
-
- expect(page).not_to have_css('input[name=tracking]')
- expect(page).to have_content('Tracking: FOOBAR')
- end
-
- it 'can change the shipping method' do
- order = create(:completed_order_with_totals)
- visit spree.edit_admin_order_path(order)
- within('table.table tr.show-method') do
- click_icon :edit
- end
- select2 'Default', from: 'Shipping Method'
- click_icon :save
-
- expect(page).not_to have_css('#selected_shipping_rate_id')
- expect(page).to have_content('Default')
- end
-
- it 'can assign a back-end only shipping method' do
- create(:shipping_method, name: 'Backdoor', display_on: 'back_end')
- order = create(
- :completed_order_with_totals,
- shipping_method_filter: Spree::ShippingMethod::DISPLAY_ON_BACK_END
- )
- visit spree.edit_admin_order_path(order)
- within('table tr.show-method') do
- click_icon :edit
- end
- select2 'Backdoor', from: 'Shipping Method'
- click_icon :save
-
- expect(page).not_to have_css('#selected_shipping_rate_id')
- expect(page).to have_content('Backdoor')
- end
-
- it 'will show the variant sku', js: false do
- order = create(:completed_order_with_totals)
- visit spree.edit_admin_order_path(order)
- sku = order.line_items.first.variant.sku
- expect(page).to have_content("SKU: #{sku}")
- end
-
- context 'with special_instructions present' do
- before do
- order.update_column(:special_instructions, 'Very special instructions here')
- end
-
- it 'will show the special_instructions', js: false do
- visit spree.edit_admin_order_path(order)
- expect(page).to have_content('Very special instructions here')
- end
- end
-
- context 'when not tracking inventory' do
- let(:tote) { create(:product, name: 'Tote', price: 15.00) }
-
- context "variant doesn't track inventory" do
- before do
- tote.master.update_column :track_inventory, false
- # make sure there's no stock level for any item
- tote.master.stock_items.update_all count_on_hand: 0, backorderable: false
- end
-
- it 'adds variant to order just fine' do
- select2 tote.name, from: Spree.t(:name_or_sku), search: true
-
- within('table.stock-levels') do
- fill_in 'variant_quantity', with: 1
- click_icon :add
- end
-
- within('.line-items') do
- expect(page).to have_content(tote.name)
- end
- end
- end
-
- context "site doesn't track inventory" do
- before do
- Spree::Config[:track_inventory_levels] = false
- tote.master.update_column(:track_inventory, true)
- # make sure there's no stock level for any item
- tote.master.stock_items.update_all count_on_hand: 0, backorderable: true
- end
-
- after { Spree::Config[:track_inventory_levels] = true }
-
- it 'adds variant to order just fine' do
- select2 tote.name, from: Spree.t(:name_or_sku), search: true
- within('table.stock-levels') do
- fill_in 'variant_quantity', with: 1
- click_icon :add
- end
-
- within('.line-items') do
- expect(page).to have_content(tote.name)
- end
- end
- end
- end
-
- context 'variant out of stock and not backorderable' do
- let(:tote) { create(:product, name: 'Tote', price: 15.00) }
-
- before do
- tote.master.stock_items.first.update(backorderable: false)
- tote.master.stock_items.first.update(count_on_hand: 0)
- end
-
- it 'does not add a product to the order' do
- select2 tote.name, from: Spree.t(:name_or_sku), search: true
-
- within('table.stock-levels') do
- expect(page).to have_content(Spree.t(:out_of_stock))
- end
- end
- end
- end
-
- context 'Shipment edit page' do
- let!(:stock_location2) { create(:stock_location_with_items, name: 'Clarksville') }
-
- before do
- product.master.stock_items.first.update_column(:backorderable, true)
- product.master.stock_items.first.update_column(:count_on_hand, 100)
- product.master.stock_items.last.update_column(:count_on_hand, 100)
- end
-
- context 'splitting to location' do
- before { visit spree.edit_admin_order_path(order) }
-
- it 'should warn you if you have not selected a location or shipment' do
- within_row(1) { click_icon :split }
- accept_alert 'Please select the split destination' do
- click_icon :save
- end
- end
-
- context 'there is enough stock at the other location' do
- it 'allows me to make a split' do
- expect(order.shipments.count).to eq(1)
- expect(order.shipments.first.inventory_units_for(product.master).sum(&:quantity)).to eq(2)
-
- within_row(1) { click_icon 'split' }
- select2 stock_location2.name, css: '.stock-item-split', search: true, match: :first
- click_icon :save
-
- expect(page).to have_css('#order-form-wrapper div', id: /^shipment_\d$/).exactly(2).times
-
- order.reload
-
- expect(order.shipments.count).to eq(2)
- expect(order.shipments.last.backordered?).to eq(false)
- expect(order.shipments.first.inventory_units_for(product.master).sum(&:quantity)).to eq(1)
- expect(order.shipments.last.inventory_units_for(product.master).sum(&:quantity)).to eq(1)
- end
-
- it 'allows me to make a transfer via splitting off all stock' do
- expect(order.shipments.first.stock_location.id).to eq(stock_location.id)
-
- within_row(1) { click_icon 'split' }
- select2 stock_location2.name, css: '.stock-item-split', search: true, match: :first
- fill_in 'item_quantity', with: 2
- click_icon :save
-
- expect(page).not_to have_css('tr.stock-item-split')
- order.reload
-
- expect(order.shipments.count).to eq(1)
- expect(order.shipments.last.backordered?).to eq(false)
- expect(order.shipments.first.inventory_units_for(product.master).sum(&:quantity)).to eq(2)
- expect(order.shipments.first.stock_location.id).to eq(stock_location2.id)
- end
-
- it 'does not allow to split more than in the original shipment' do
- expect(order.shipments.first.stock_location.id).to eq(stock_location.id)
-
- within_row(1) { click_icon 'split' }
- select2 stock_location2.name, css: '.stock-item-split', search: true, match: :first
- fill_in 'item_quantity', with: 5
- click_icon :save
-
- expect(page).not_to have_css('tr.stock-item-split')
- order.reload
-
- expect(order.shipments.count).to eq(1)
- expect(order.shipments.last.backordered?).to eq(false)
- expect(order.shipments.first.inventory_units_for(product.master).sum(&:quantity)).to eq(2)
- expect(order.shipments.first.stock_location.id).to eq(stock_location2.id)
- end
-
- it 'does not split anything if the input quantity is garbage' do
- expect(order.shipments.first.stock_location.id).to eq(stock_location.id)
-
- within_row(1) { click_icon 'split' }
- select2 stock_location2.name, css: '.stock-item-split', search: true, match: :first
- fill_in 'item_quantity', with: 'ff'
-
- page.accept_confirm 'quantity is negative' do
- click_icon :save
- end
-
- expect(order.shipments.count).to eq(1)
- expect(order.shipments.first.inventory_units_for(product.master).sum(&:quantity)).to eq(2)
- expect(order.shipments.first.stock_location.id).to eq(stock_location.id)
- end
-
- it 'does not allow less than or equal to zero qty' do
- expect(order.shipments.first.stock_location.id).to eq(stock_location.id)
-
- within_row(1) { click_icon 'split' }
- select2 stock_location2.name, css: '.stock-item-split', search: true, match: :first
- fill_in 'item_quantity', with: 0
-
- page.accept_confirm 'quantity is negative' do
- click_icon :save
- end
-
- expect(order.shipments.count).to eq(1)
- expect(order.shipments.first.inventory_units_for(product.master).sum(&:quantity)).to eq(2)
- expect(order.shipments.first.stock_location.id).to eq(stock_location.id)
-
- fill_in 'item_quantity', with: -1
-
- page.accept_confirm 'quantity is negative' do
- click_icon :save
- end
-
- expect(order.shipments.count).to eq(1)
- expect(order.shipments.first.inventory_units_for(product.master).sum(&:quantity)).to eq(2)
- expect(order.shipments.first.stock_location.id).to eq(stock_location.id)
- end
-
- context 'A shipment has shipped' do
- it 'does not show or let me back to the cart page, nor show the shipment edit buttons', js: false do
- order = create(:order, state: 'payment')
- order.shipments.create!(stock_location_id: stock_location.id, state: 'shipped')
-
- visit spree.cart_admin_order_path(order)
-
- expect(page).to have_current_path(spree.edit_admin_order_path(order))
- expect(page).not_to have_text 'Cart'
- end
- end
- end
-
- context 'there is not enough stock at the other location' do
- context 'and it cannot backorder' do
- it 'does not allow me to split stock' do
- product.master.stock_items.last.update_column(:backorderable, false)
- product.master.stock_items.last.update_column(:count_on_hand, 0)
-
- within_row(1) { click_icon 'split' }
- select2 stock_location2.name, css: '.stock-item-split', search: true, match: :first
- fill_in 'item_quantity', with: 2
-
- click_icon :save
- alert_text = page.driver.browser.switch_to.alert.text
- expect(alert_text).to eq('Desired shipment has not enough stock in desired stock location')
- accept_alert { order.reload }
-
- expect(order.shipments.count).to eq(1)
- expect(order.shipments.first.inventory_units_for(product.master).sum(&:quantity)).to eq(2)
- expect(order.shipments.first.stock_location.id).to eq(stock_location.id)
- end
- end
-
- context 'but it can backorder' do
- it 'allows me to split and backorder the stock' do
- product.master.stock_items.last.update_column(:count_on_hand, 0)
- product.master.stock_items.last.update_column(:backorderable, true)
-
- within_row(1) { click_icon 'split' }
- select2 stock_location2.name, css: '.stock-item-split', search: true, match: :first
- fill_in 'item_quantity', with: 2
-
- click_icon :save
- expect(page).not_to have_css('tr.stock-item-split')
-
- order.reload
- expect(order.shipments.count).to eq(1)
- expect(order.shipments.first.inventory_units_for(product.master).sum(&:quantity)).to eq(2)
- expect(order.shipments.first.stock_location.id).to eq(stock_location2.id)
- end
- end
- end
-
- context 'multiple items in cart' do
- it 'has no problem splitting if multiple items are in the from shipment' do
- Spree::Cart::AddItem.call(order: order, variant: create(:variant), quantity: 2)
- expect(order.shipments.count).to eq(1)
- expect(order.shipments.first.manifest.count).to eq(2)
-
- within_row(1) { click_icon 'split' }
- select2 stock_location2.name, css: '.stock-item-split', search: true, match: :first
- click_icon :save
-
- expect(page).to have_css('#order-form-wrapper div', id: /^shipment_\d$/).exactly(2).times
-
- order.reload
- expect(order.shipments.count).to eq(2)
- expect(order.shipments.last.backordered?).to eq(false)
- expect(order.shipments.first.inventory_units_for(product.master).sum(&:quantity)).to eq(1)
- expect(order.shipments.last.inventory_units_for(product.master).sum(&:quantity)).to eq(1)
- end
- end
-
- context 'when not tracking inventory' do
- let(:tote) { create(:product, name: 'Tote', price: 15.00) }
-
- context "variant doesn't track inventory" do
- before do
- tote.master.update_column :track_inventory, false
- # make sure there's no stock level for any item
- tote.master.stock_items.update_all count_on_hand: 0, backorderable: false
- end
-
- it 'adds variant to order just fine' do
- select2 tote.name, from: Spree.t(:name_or_sku), search: true
- within('table.stock-levels tbody tr', match: :first) do
- fill_in 'stock_item_quantity', match: :first, with: 1
- click_icon :add
- end
-
- expect(page).to have_content(order.number)
- expect(page).to have_css('[data-hook="add_product_name"]', text: 'Name or SKU (enter at least first 3 characters of product name)')
-
- within('[data-hook=admin_order_form_fields]') do
- expect(page).to have_content(tote.name)
- end
- end
- end
-
- context "site doesn't track inventory" do
- before do
- Spree::Config[:track_inventory_levels] = false
- tote.master.update_column(:track_inventory, true)
- # make sure there's no stock level for any item
- tote.master.stock_items.update_all count_on_hand: 0, backorderable: true
- end
-
- after { Spree::Config[:track_inventory_levels] = true }
-
- it 'adds variant to order just fine' do
- select2 tote.name, from: Spree.t(:name_or_sku), search: true
- within('table.stock-levels') do
- fill_in 'stock_item_quantity', match: :first, with: 1
- click_icon :add
- end
-
- within('[data-hook=admin_order_form_fields]') do
- expect(page).to have_content(tote.name)
- end
- end
- end
- end
-
- context 'variant out of stock and not backorderable' do
- before do
- product.master.stock_items.first.update_column(:backorderable, false)
- product.master.stock_items.first.update_column(:count_on_hand, 0)
- end
-
- it 'displays out of stock instead of add button' do
- select2 product.name, from: Spree.t(:name_or_sku), search: true
-
- within('table.stock-levels') do
- expect(page).to have_content(Spree.t(:out_of_stock))
- end
- end
- end
- end
-
- context 'splitting to shipment' do
- before do
- @shipment2 = order.shipments.create(stock_location_id: stock_location2.id)
- visit spree.edit_admin_order_path(order)
- end
-
- it 'deletes the old shipment if enough are split off' do
- expect(order.shipments.count).to eq(2)
-
- within_row(1) { click_icon 'split' }
- select2 @shipment2.number, css: '.stock-item-split', search: true, match: :first
- fill_in 'item_quantity', with: 2
-
- click_icon :save
-
- expect(page).to have_css('#order-form-wrapper div', id: /^shipment_\d$/).once
- order.reload
- expect(order.shipments.count).to eq(1)
- expect(order.shipments.last.inventory_units_for(product.master).sum(&:quantity)).to eq(2)
- end
-
- context 'receiving shipment can not backorder' do
- before { product.master.stock_items.last.update_column(:backorderable, false) }
-
- it 'does not allow a split if the receiving shipment qty plus the incoming is greater than the count_on_hand' do
- expect(order.shipments.count).to eq(2)
-
- within_row(1) { click_icon 'split' }
- select2 @shipment2.number, css: '.stock-item-split', search: true, match: :first
- fill_in 'item_quantity', with: 1
-
- click_icon :save
- expect(page).not_to have_css('tr.stock-item-split')
-
- within_row(1) { click_icon 'split' }
- select2 @shipment2.number, css: '.stock-item-split', search: true, match: :first
- fill_in 'item_quantity', with: 200
-
- click_icon :save
- alert_text = page.driver.browser.switch_to.alert.text
- expect(alert_text).to eq('Desired shipment has not enough stock in desired stock location')
- accept_alert { order.reload }
-
- expect(order.shipments.count).to eq(2)
- expect(order.shipments.first.inventory_units_for(product.master).sum(&:quantity)).to eq(1)
- expect(order.shipments.last.inventory_units_for(product.master).sum(&:quantity)).to eq(1)
- end
-
- it 'does not allow a shipment to split stock to itself' do
- within_row(1) { click_icon 'split' }
- select2 order.shipments.first.number, css: '.stock-item-split', search: true, match: :first
- fill_in 'item_quantity', with: 1
-
- page.accept_confirm 'target shipment is the same as original shipment' do
- click_icon :save
- end
-
- order.reload
- expect(order.shipments.count).to eq(2)
- expect(order.shipments.first.inventory_units_for(product.master).sum(&:quantity)).to eq(2)
- end
-
- it 'splits fine if more than one line_item is in the receiving shipment' do
- variant2 = create(:variant)
- Spree::Cart::AddItem.call(order: order, variant: variant2, quantity: 2, options: { shipment: @shipment2 })
-
- within_row(1) { click_icon 'split' }
- select2 @shipment2.number, css: '.stock-item-split', search: true, match: :first
- fill_in 'item_quantity', with: 1
- click_icon :save
-
- expect(page).to have_css("#shipment_#{@shipment2.id} tr.stock-item").twice
-
- expect(order.shipments.count).to eq(2)
- expect(order.shipments.first.inventory_units_for(product.master).sum(&:quantity)).to eq 1
- expect(order.shipments.last.inventory_units_for(product.master).sum(&:quantity)).to eq 1
- expect(order.shipments.first.inventory_units_for(variant2).sum(&:quantity)).to eq 0
- expect(order.shipments.last.inventory_units_for(variant2).sum(&:quantity)).to eq 2
- end
- end
-
- context 'receiving shipment can backorder' do
- it 'adds more to the backorder' do
- product.master.stock_items.last.update_column(:backorderable, true)
- product.master.stock_items.last.update_column(:count_on_hand, 0)
- expect(@shipment2.reload.backordered?).to eq(false)
-
- within_row(1) { click_icon 'split' }
- select2 @shipment2.number, css: '.stock-item-split', search: true, match: :first
- fill_in 'item_quantity', with: 1
-
- click_icon :save
- expect(page).not_to have_css('tr.stock-item-split')
-
- expect(@shipment2.reload.backordered?).to eq(true)
-
- within_row(1) { click_icon 'split' }
- select2 @shipment2.number, css: '.stock-item-split', search: true, match: :first
- fill_in 'item_quantity', with: 1
- click_icon :save
-
- expect(page).to have_css('#order-form-wrapper div', id: /^shipment_\d$/).once
-
- expect(order.shipments.count).to eq(1)
- expect(order.shipments.last.inventory_units_for(product.master).sum(&:quantity)).to eq(2)
- expect(@shipment2.reload.backordered?).to eq(true)
- end
- end
- end
-
- context 'display order summary', js: false do
- before do
- visit spree.cart_admin_order_path(order)
- end
-
- it 'contains elements' do
- within('.additional-info') do
- expect(page).to have_content('complete')
- expect(page).to have_content('spree')
- expect(page).to have_content('backorder')
- expect(page).to have_content('balance due')
- end
- end
- end
- end
- end
-
- context 'with only read permissions' do
- before do
- allow_any_instance_of(Spree::Admin::BaseController).to receive(:spree_current_user).and_return(nil)
- end
-
- custom_authorization! do |_user|
- can [:admin, :index, :read, :edit], Spree::Order
- end
-
- it 'does not display forbidden links' do
- visit spree.edit_admin_order_path(order)
-
- expect(page).not_to have_button('cancel')
- expect(page).not_to have_button('Resend')
-
- # Order Tabs
- expect(page).not_to have_link('Details')
- expect(page).not_to have_link('Customer')
- expect(page).not_to have_link('Adjustments')
- expect(page).not_to have_link('Payments')
- expect(page).not_to have_link('Returns')
-
- # Order item actions
- expect(page).not_to have_css('.delete-item')
- expect(page).not_to have_css('.split-item')
- expect(page).not_to have_css('.edit-item')
- expect(page).not_to have_css('.edit-tracking')
-
- expect(page).not_to have_css('#add-line-item')
- end
- end
-
- context 'as Fakedispatch' do
- custom_authorization! do |_user|
- # allow dispatch to :admin, :index, and :edit on Spree::Order
- can [:admin, :edit, :index, :read], Spree::Order
- # allow dispatch to :index, :show, :create and :update shipments on the admin
- can [:admin, :manage, :read, :ship], Spree::Shipment
- end
-
- before do
- allow(Spree.user_class).to receive(:find_by).
- with(hash_including(:spree_api_key)).
- and_return(Spree.user_class.new)
- end
-
- it 'does not display order tabs or edit buttons without ability', js: false do
- visit spree.edit_admin_order_path(order)
-
- # Order Form
- expect(page).not_to have_css('.edit-item')
- # Order Tabs
- expect(page).not_to have_link('Details')
- expect(page).not_to have_link('Customer')
- expect(page).not_to have_link('Adjustments')
- expect(page).not_to have_link('Payments')
- expect(page).not_to have_link('Returns')
- end
-
- it 'can add tracking information' do
- visit spree.edit_admin_order_path(order)
- within('table.stock-contents tr:nth-child(5)', match: :first) do
- click_icon :edit
- end
- fill_in 'tracking', with: 'FOOBAR'
- click_icon :save
-
- expect(page).not_to have_css('input[name=tracking]')
- expect(page).to have_content('Tracking: FOOBAR')
- end
-
- it 'can change the shipping method' do
- order = create(:completed_order_with_totals)
- visit spree.edit_admin_order_path(order)
- within('table.table tr.show-method') do
- click_icon :edit
- end
- select2 'Default', from: 'Shipping Method'
- click_icon :save
-
- expect(page).not_to have_css('#selected_shipping_rate_id')
- expect(page).to have_content('Default')
- end
-
- it 'can ship' do
- order = create(:order_ready_to_ship)
- order.refresh_shipment_rates
- visit spree.edit_admin_order_path(order)
- click_on 'Ship'
- expect(page).to have_css('.shipment-state', text: 'shipped')
- end
- end
-end
diff --git a/backend/spec/features/admin/orders/payments_spec.rb b/backend/spec/features/admin/orders/payments_spec.rb
deleted file mode 100644
index 7085e26d90..0000000000
--- a/backend/spec/features/admin/orders/payments_spec.rb
+++ /dev/null
@@ -1,237 +0,0 @@
-require 'spec_helper'
-
-describe 'Payments', type: :feature, js: true do
- stub_authorization!
-
- context 'with a pre-existing payment' do
- let!(:payment) do
- create(:payment,
- order: order,
- amount: order.outstanding_balance,
- payment_method: create(:credit_card_payment_method),
- state: state)
- end
-
- let(:order) { create(:completed_order_with_totals, number: 'R100', line_items_count: 5) }
- let(:state) { 'checkout' }
-
- before do
- visit spree.edit_admin_order_path(order)
- click_link 'Payments'
- end
-
- # Regression tests for #1453
- context 'with a check payment' do
- let(:order) { create(:completed_order_with_totals, number: 'R100') }
-
- let!(:payment) do
- create(:payment,
- order: order,
- amount: order.outstanding_balance,
- payment_method: create(:check_payment_method)) # Check
- end
-
- it 'capturing a check payment from a new order' do
- click_icon(:capture)
- expect(page).not_to have_content('Cannot perform requested operation')
- expect(page).to have_content('Payment Updated')
- end
-
- it 'voids a check payment from a new order' do
- click_icon(:void)
- expect(page).to have_content('Payment Updated')
- end
- end
-
- it 'lists all captures for a payment' do
- Spree::ShippingMethod.delete_all
- capture_amount = order.outstanding_balance / 2 * 100
- payment.capture!(capture_amount)
-
- visit spree.admin_order_payment_path(order, payment)
- expect(page).to have_content 'Capture events'
- within '#capture_events' do
- within_row(1) do
- expect(page).to have_content(capture_amount / 100)
- end
- end
- end
-
- it 'lists and create payments for an order' do
- within_row(1) do
- expect(column_text(3)).to eq('$150.00')
- expect(column_text(4)).to eq('Credit Card')
- expect(column_text(6)).to eq('CHECKOUT')
- end
-
- click_icon :void
- expect(page).to have_css('#payment_status', exact_text: 'BALANCE DUE')
- expect(page).to have_content('Payment Updated')
-
- within_row(1) do
- expect(column_text(3)).to eq('$150.00')
- expect(column_text(4)).to eq('Credit Card')
- expect(column_text(6)).to eq('VOID')
- end
- within find('#contentHeader') do
- click_on 'New Payment'
- end
- expect(page).to have_content('New Payment')
- click_button 'Update'
- expect(page).to have_content('successfully created!')
-
- click_icon(:capture)
-
- expect(page).to have_css('#payment_status', exact_text: 'PAID')
- expect(page).not_to have_selector('#new_payment_section')
- end
-
- # Regression test for #1269
- it 'cannot create a payment for an order with no payment methods', js: false do
- Spree::PaymentMethod.delete_all
- order.payments.delete_all
- within find('#contentHeader') do
- click_on 'New Payment'
- end
-
- expect(page).to have_content('You cannot create a payment for an order without any payment methods defined.')
- expect(page).to have_content('Please define some payment methods first.')
- end
-
- %w[checkout pending].each do |state|
- context "payment is #{state.inspect}" do
- let(:state) { state }
-
- it 'allows the amount to be edited by clicking on the edit button then saving' do
- within_row(1) do
- click_icon(:edit)
- fill_in('amount', with: '$1')
- click_icon(:save)
- expect(page).to have_selector('td.amount span', text: '$1.00')
- expect(payment.reload.amount).to eq(1.00)
- end
- end
-
- it 'allows the amount to be edited by clicking on the amount then saving' do
- within_row(1) do
- find('td.amount span').click
- fill_in('amount', with: '$1.01')
- click_icon(:save)
- expect(page).to have_selector('td.amount span', text: '$1.01')
- expect(payment.reload.amount).to eq(1.01)
- end
- end
-
- it 'allows the amount change to be cancelled by clicking on the cancel button' do
- within_row(1) do
- click_icon(:edit)
-
- find('td.amount input').send_keys([:backspace] * 6, '$1')
-
- click_icon(:cancel)
- expect(page).to have_selector('td.amount span', text: '$150.00')
- expect(payment.reload.amount).to eq(150.00)
- end
- end
-
- it 'displays an error when the amount is invalid' do
- within_row(1) do
- click_icon(:edit)
- fill_in('amount', with: 'invalid')
- click_icon(:save)
- end
-
- assert_admin_flash_alert_error('Invalid resource. Please fix errors and try again.')
- expect(page).to have_field('amount', with: 'invalid')
- expect(payment.reload.amount).to eq(150.00)
- end
- end
- end
-
- context 'payment is completed', js: false do
- let(:state) { 'completed' }
-
- it 'does not allow the amount to be edited' do
- within_row(1) do
- expect(page).not_to have_selector('td.amount span')
- end
- end
- end
- end
-
- context 'with no prior payments' do
- let(:order) { create(:order_with_line_items, line_items_count: 1) }
- let!(:payment_method) { create(:credit_card_payment_method) }
-
- # Regression tests for #4129
- context 'with a credit card payment method' do
- before do
- visit spree.admin_order_payments_path(order)
- end
-
- it 'is able to create a new credit card payment with valid information' do
- fill_in 'Card Number', with: '4111 1111 1111 1111'
- fill_in 'Name', with: 'Test User'
- fill_in 'Expiration', with: "09 / #{Time.current.year + 1}"
- fill_in 'Card Varification Code (CVC)', with: '007'
- # Regression test for #4277
- expect(page).to have_field(class: 'ccType', type: :hidden, with: 'visa')
- click_button 'Continue'
- expect(page).to have_content('Payment has been successfully created!')
- end
-
- it 'is unable to create a new payment with invalid information' do
- click_button 'Continue'
- expect(page).to have_content('Payment could not be created.')
- expect(page).to have_content("Number can't be blank")
- expect(page).to have_content("Name can't be blank")
- expect(page).to have_content("Verification Value can't be blank")
- expect(page).to have_content('Month is not a number')
- expect(page).to have_content('Year is not a number')
- end
- end
-
- context 'user existing card' do
- let!(:cc) do
- create(:credit_card, user_id: order.user_id, payment_method: payment_method, gateway_customer_profile_id: 'BGS-RFRE')
- end
-
- before { visit spree.admin_order_payments_path(order) }
-
- it 'is able to reuse customer payment source', js: false do
- expect(page).to have_checked_field(id: "card_#{cc.id}")
- click_button 'Continue'
- expect(page).to have_content('Payment has been successfully created!')
- end
- end
-
- context 'with a check' do
- let!(:payment_method) { create(:check_payment_method) }
-
- before do
- visit spree.admin_order_payments_path(order.reload)
- end
-
- it 'can successfully be created and captured' do
- click_on 'Continue'
- expect(page).to have_content('Payment has been successfully created!')
- click_icon(:capture)
- expect(page).to have_content('Payment Updated')
- end
- end
-
- context 'store_credit payment' do
- let!(:payment_method) { create(:store_credit_payment_method) }
- let!(:category) { create(:store_credit_category, name: 'Default') }
-
- before do
- create(:store_credit, user: order.user, category: category, amount: 500, store: order.store)
- visit spree.new_admin_order_payment_path(order.reload)
- choose("payment_payment_method_id_#{payment_method.id}")
- click_button 'Continue'
- end
-
- it { expect(page).to have_content('successfully created') }
- end
- end
-end
diff --git a/backend/spec/features/admin/orders/risk_analysis_spec.rb b/backend/spec/features/admin/orders/risk_analysis_spec.rb
deleted file mode 100644
index da477ffb98..0000000000
--- a/backend/spec/features/admin/orders/risk_analysis_spec.rb
+++ /dev/null
@@ -1,52 +0,0 @@
-require 'spec_helper'
-
-describe 'Order Risk Analysis', type: :feature do
- stub_authorization!
-
- let(:store) { Spree::Store.default }
- let!(:order) do
- create(:completed_order_with_pending_payment, store: store)
- end
-
- def visit_order
- visit spree.admin_path
- click_link 'Orders'
- within_row(1) do
- click_link order.number
- end
- end
-
- context 'the order is considered risky' do
- before do
- allow_any_instance_of(Spree::Admin::BaseController).to receive_messages try_spree_current_user: create(:user)
-
- order.payments.first.update_column(:avs_response, 'X')
- order.considered_risky!
- visit_order
- end
-
- it "displays 'Risk Analysis' box" do
- expect(page).to have_content 'Risk Analysis'
- end
-
- it 'can be approved' do
- within find('#contentHeader') do
- click_button('Approve')
- end
-
- expect(page).to have_content 'Approver'
- expect(page).to have_content 'Approved at'
- expect(page).to have_content 'Status: complete'
- end
- end
-
- context 'the order is not considered risky' do
- before do
- visit_order
- end
-
- it "does not display 'Risk Analysis' box" do
- expect(page).not_to have_content 'Risk Analysis'
- end
- end
-end
diff --git a/backend/spec/features/admin/orders/shipments_spec.rb b/backend/spec/features/admin/orders/shipments_spec.rb
deleted file mode 100644
index f1b3dc859a..0000000000
--- a/backend/spec/features/admin/orders/shipments_spec.rb
+++ /dev/null
@@ -1,69 +0,0 @@
-require 'spec_helper'
-
-describe 'Shipments', type: :feature do
- stub_authorization!
-
- let(:store) { Spree::Store.default }
- let!(:order) { create(:order_ready_to_ship, number: 'R100', state: 'complete', line_items_count: 5, store: store) }
-
- # Regression test for #4025
- context 'a shipment without a shipping method' do
- before do
- order.shipments.each do |s|
- # Deleting the shipping rates causes there to be no shipping methods
- s.shipping_rates.delete_all
- end
- end
-
- it 'can still be displayed' do
- expect { visit spree.edit_admin_order_path(order) }.not_to raise_error
- end
- end
-
- context 'shipping an order', js: true do
- before do
- visit spree.admin_orders_path
- within_row(1) do
- click_link 'R100'
- end
- end
-
- it 'can ship a completed order' do
- click_on 'Ship'
-
- expect(page).to have_content('shipped package')
- expect(order.reload.shipment_state).to eq('shipped')
- end
- end
-
- context 'moving variants between shipments', js: true do
- before do
- create(:stock_location, name: 'LA')
- visit spree.admin_orders_path
- within_row(1) do
- click_link 'R100'
- end
- end
-
- it 'can move a variant to a new and to an existing shipment' do
- expect(order.shipments.count).to eq(1)
-
- # Non existing shipment
- within_row(1) { click_icon :split }
- select2 'LA', css: '.stock-item-split', search: true, match: :first
- click_icon :save
- wait_for_ajax
-
- expect(page).to have_css('#order-form-wrapper div', id: /^shipment_\d$/).exactly(2).times
- expect(page).to have_css("#shipment_#{order.shipments.first.id}")
-
- # Existing shipment
- within_row(2) { click_icon :split }
- select2 "LA(#{order.reload.shipments.last.number})", css: '.stock-item-split', search: true, match: :first
- click_icon :save
- wait_for_ajax
-
- expect(page).to have_css("#shipment_#{order.reload.shipments.last.id}")
- end
- end
-end
diff --git a/backend/spec/features/admin/orders/state_changes_spec.rb b/backend/spec/features/admin/orders/state_changes_spec.rb
deleted file mode 100644
index d23b7e3e85..0000000000
--- a/backend/spec/features/admin/orders/state_changes_spec.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-require 'spec_helper'
-
-describe 'Order - State Changes', type: :feature do
- stub_authorization!
-
- let(:store) { Spree::Store.default }
- let!(:order) { create(:order_with_line_items, store: store) }
-
- context 'for completed order' do
- before do
- order.next!
- visit spree.admin_order_state_changes_path(order)
- end
-
- it 'are viewable' do
- within_row(1) do
- within('td:nth-child(1)') { expect(page).to have_content('Order') }
- within('td:nth-child(2)') { expect(page).to have_content('cart') }
- within('td:nth-child(3)') { expect(page).to have_content('address') }
- end
- end
- end
-end
diff --git a/backend/spec/features/admin/products/edit/images_spec.rb b/backend/spec/features/admin/products/edit/images_spec.rb
deleted file mode 100644
index 5fe8f52a0b..0000000000
--- a/backend/spec/features/admin/products/edit/images_spec.rb
+++ /dev/null
@@ -1,88 +0,0 @@
-require 'spec_helper'
-
-describe 'Product Images', type: :feature, js: true do
- stub_authorization!
-
- let(:file_path) { Rails.root + '../../spec/support/ror_ringer.jpeg' }
-
- let(:store) { Spree::Store.default }
- let(:product) { create(:product, stores: [store]) }
-
- before do
- # Ensure attachment style keys are symbolized before running all tests
- # Otherwise this would result in this error:
- # undefined method `processors' for \"48x48>\
- Spree::Image.styles.symbolize_keys!
- allow(ENV).to receive(:[]).and_call_original
- end
-
- context 'uploading, editing, and deleting an image' do
- it 'allows an admin to upload and edit an image for a product' do
- product
- visit spree.admin_products_path
- click_icon(:edit)
- click_link 'Images'
- click_link 'new_image_link'
- attach_file('image_attachment', file_path)
- click_button 'Create'
- expect(page).to have_content('successfully created!')
-
- click_icon(:edit)
- fill_in 'image_alt', with: 'ruby on rails t-shirt'
- click_button 'Update'
- expect(page).to have_content('successfully updated!')
- expect(page).to have_content('ruby on rails t-shirt')
-
- accept_confirm do
- click_icon :delete
- end
-
- expect(page).to have_content('successfully removed!')
- expect(page).not_to have_content('ruby on rails t-shirt')
- end
- end
-
- # Regression test for #2228
- it 'sees variant images', js: false do
- variant = create(:variant, product: product)
- create_image(variant, File.open(file_path))
- visit spree.admin_product_images_path(product)
-
- expect(page).not_to have_content('No Images Found.')
- within('table.table') do
- expect(page).to have_content(variant.options_text)
-
- # ensure no duplicate images are displayed
- expect(page).to have_css('tbody tr', count: 1)
-
- # ensure variant header is displayed
- within('thead') do
- expect(page).to have_content('Variant')
- end
-
- # ensure variant header is displayed
- within('tbody') do
- expect(page).to have_content('Size: S')
- end
- end
- end
-
- it 'does not see variant column when product has no variants', js: false do
- create_image(product, File.open(file_path))
- visit spree.admin_product_images_path(product)
-
- expect(page).not_to have_content('No Images Found.')
- within('table.table') do
- # ensure no duplicate images are displayed
- expect(page).to have_css('tbody tr', count: 1)
-
- # ensure variant header is not displayed
- within('thead') do
- expect(page).not_to have_content('Variant')
- end
-
- # ensure correct cell count
- expect(page).to have_css('thead th', count: 3)
- end
- end
-end
diff --git a/backend/spec/features/admin/products/edit/products_spec.rb b/backend/spec/features/admin/products/edit/products_spec.rb
deleted file mode 100644
index d7eb9f3e25..0000000000
--- a/backend/spec/features/admin/products/edit/products_spec.rb
+++ /dev/null
@@ -1,60 +0,0 @@
-require 'spec_helper'
-
-describe 'Product Details', type: :feature, js: true do
- stub_authorization!
-
- let!(:product) { create(:product, name: 'Bún thịt nướng', sku: 'A100', description: 'lorem ipsum', available_on: '2013-08-14 01:02:03')}
-
- context 'editing a product with WYSIWYG disabled' do
- before do
- Spree::Backend::Config.product_wysiwyg_editor_enabled = false
- visit spree.admin_product_path(product)
- end
-
- after { Spree::Backend::Config.product_wysiwyg_editor_enabled = true }
-
- it 'displays the product description as a standard input field' do
- expect(page).to have_field(id: 'product_description', with: product.description)
- expect(page).not_to have_css('#product_description_ifr')
- end
- end
-
- context 'editing a product with WYSIWYG editer enabled' do
- before do
- Spree::Backend::Config.product_wysiwyg_editor_enabled = true
- visit spree.admin_product_path(product)
- end
-
- it 'displays the product details with a WYSIWYG editor for the product description input' do
- expect(page).to have_css('.content-header h1', text: 'Products / Bún thịt nướng')
- expect(page).to have_field(id: 'product_name', with: 'Bún thịt nướng')
- expect(page).to have_field(id: 'product_slug', with: 'bun-th-t-n-ng')
- expect(page).not_to have_field(id: 'product_description')
- expect(page).to have_css('#product_description_ifr')
- expect(page).to have_field(id: 'product_price', with: '19.99')
- expect(page).to have_field(id: 'product_cost_price', with: '17.00')
- expect(page).to have_field(id: 'product_available_on', type: :hidden, with: '2013-08-14')
- expect(page).to have_field(id: 'product_sku', with: 'A100')
- end
-
- it 'shows product description using wysiwyg editor' do
- expect(page).not_to have_field(id: 'product_description', with: 'lorem ipsum')
- expect(page).to have_css('#product_description_ifr')
- end
-
- it 'handles slug changes' do
- fill_in 'product_slug', with: 'random-slug-value'
- click_button 'Update'
- expect(page).to have_content('successfully updated!')
- end
-
- it 'has a link to preview a product' do
- allow(Spree::Core::Engine).to receive(:frontend_available?).and_return(true)
-
- click_link 'Details'
-
- expect(page).to have_css('#admin_preview_product')
- expect(page).to have_link Spree.t(:preview_product), href: "http://www.example.com/products/bun-th-t-n-ng"
- end
- end
-end
diff --git a/backend/spec/features/admin/products/edit/properties_spec.rb b/backend/spec/features/admin/products/edit/properties_spec.rb
deleted file mode 100644
index 0be8dd8be6..0000000000
--- a/backend/spec/features/admin/products/edit/properties_spec.rb
+++ /dev/null
@@ -1,43 +0,0 @@
-require 'spec_helper'
-
-describe 'Product Properties', type: :feature, js: true do
- stub_authorization!
-
- before do
- create(:product, stores: Spree::Store.all)
- visit spree.admin_products_path
- end
-
- context 'editing product properties' do
- it 'allows admin to create a new property' do
- within_row(1) { click_icon :edit }
-
- within('#sidebar') { click_link 'Properties' }
- fill_in 'product_product_properties_attributes_0_property_name', with: 'Material'
- fill_in 'product_product_properties_attributes_0_value', with: 'Leather'
- click_button 'Update'
-
- within('#sidebar') { click_link 'Properties' }
- expect(page).to have_content('Add Product Properties')
- expect(page).to have_content('SHOW PROPERTY')
- expect(page).to have_selector("input[value='Material']")
- expect(page).to have_selector("input[value='Leather']")
- expect(page).to have_field('product_product_properties_attributes_0_show_property', checked: true)
- end
-
- it 'allows admin to create a new property and not show the property on the storefront' do
- within_row(1) { click_icon :edit }
-
- within('#sidebar') { click_link 'Properties' }
- fill_in 'product_product_properties_attributes_0_property_name', with: 'gtin'
- fill_in 'product_product_properties_attributes_0_value', with: '9020188287332'
- find(:css, "#product_product_properties_attributes_0_show_property").set(false)
- click_button 'Update'
-
- within('#sidebar') { click_link 'Properties' }
- expect(page).to have_selector("input[value='gtin']")
- expect(page).to have_selector("input[value='9020188287332']")
- expect(page).to have_field('product_product_properties_attributes_0_show_property', checked: false)
- end
- end
-end
diff --git a/backend/spec/features/admin/products/edit/stores_spec.rb b/backend/spec/features/admin/products/edit/stores_spec.rb
deleted file mode 100644
index a0f4a57aa3..0000000000
--- a/backend/spec/features/admin/products/edit/stores_spec.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-require 'spec_helper'
-
-describe 'Edit Product Stores', type: :feature, js: true do
- stub_authorization!
-
- let(:store) { Spree::Store.default }
- let(:product) { create(:product, stores: [store]) }
- let!(:store_2) { create(:store) }
- let!(:store_3) { create(:store) }
-
- before do
- visit spree.edit_admin_product_path(product)
- end
-
- it 'allows assigning multiple stores' do
- select2 store_3.unique_name, from: 'Stores'
-
- click_button 'Update'
-
- expect(page).to have_content('successfully updated')
-
- expect(product.reload.stores).to contain_exactly(store, store_3)
- end
-end
diff --git a/backend/spec/features/admin/products/edit/taxons_spec.rb b/backend/spec/features/admin/products/edit/taxons_spec.rb
deleted file mode 100644
index 40bcce9c6d..0000000000
--- a/backend/spec/features/admin/products/edit/taxons_spec.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-require 'spec_helper'
-
-describe 'Product Taxons', type: :feature, js: true do
- stub_authorization!
-
- context 'managing taxons' do
- it 'allows an admin to manage taxons' do
- taxon_1 = create(:taxon)
- taxon_2 = create(:taxon, name: 'Clothing')
- product = create(:product, stores: Spree::Store.all)
- product.taxons << taxon_1
- visit spree.admin_product_path(product)
-
- expect(page).to have_css('.select2-selection__choice', text: "#{taxon_1.parent.name} -> #{taxon_1.name}")
-
- select2_open label: 'Taxons'
- select2_open label: 'Taxons'
-
- select2_search 'Clothing', from: 'Taxons'
- select2_select 'Clothing', from: 'Taxons', match: :first
- wait_for { !page.has_button?('Update') }
- click_button 'Update'
-
- expect(page).to have_css('.select2-selection__choice', text: taxon_1.name).
- and have_css('.select2-selection__choice', text: taxon_2.name)
- end
- end
-end
diff --git a/backend/spec/features/admin/products/edit/variants_spec.rb b/backend/spec/features/admin/products/edit/variants_spec.rb
deleted file mode 100644
index 57ae444fe0..0000000000
--- a/backend/spec/features/admin/products/edit/variants_spec.rb
+++ /dev/null
@@ -1,101 +0,0 @@
-require 'spec_helper'
-
-describe 'Product Variants', type: :feature, js: true do
- stub_authorization!
-
- before do
- create(:product, stores: Spree::Store.all)
- visit spree.admin_products_path
- end
-
- context 'editing variant option types' do
- it 'allows an admin to create option types for a variant' do
- within_row(1) { click_icon :edit }
-
- within('#sidebar') { click_link 'Variants' }
- expect(page).to have_content('To add variants, you must first define')
- end
-
- it 'allows admin to create a variant if there are option types' do
- within_row(1) { click_icon :edit }
-
- within('#sidebar') { click_link 'Variants' }
- click_link 'Option Values'
- click_link 'new_option_type_link'
- fill_in 'option_type_name', with: 'shirt colors'
- fill_in 'option_type_presentation', with: 'colors'
- click_button 'Create'
- expect(page).to have_content('successfully created!')
-
- page.find('#option_type_option_values_attributes_0_name').set('color')
- page.find('#option_type_option_values_attributes_0_presentation').set('black')
- click_button 'Update'
- expect(page).to have_content('successfully updated!')
-
- visit spree.admin_products_path
- within_row(1) { click_icon :edit }
-
- select2_open label: 'Option Types'
- select2_search 'shirt', label: 'Option Types'
- select2_select 'shirt', from: 'Option Types', match: :first
-
- wait_for { !page.has_button?('Update') }
- click_button 'Update'
- expect(page).to have_content('successfully updated!')
-
- within('#sidebar') { click_link 'Variants' }
- click_link 'New Variant'
-
- select2 'black', from: 'Colors'
- fill_in 'variant_sku', with: 'A100'
- click_button 'Create'
- expect(page).to have_content('successfully created!')
-
- within('.table') do
- expect(page).to have_content('19.99')
- expect(page).to have_content('black')
- expect(page).to have_content('A100')
- end
- end
-
- it 'allows admin to edit a variants compare at price' do
- within_row(1) { click_icon :edit }
-
- within('#sidebar') { click_link 'Variants' }
- click_link 'Option Values'
- click_link 'new_option_type_link'
- fill_in 'option_type_name', with: 'shirt colors'
- fill_in 'option_type_presentation', with: 'colors'
- click_button 'Create'
-
- page.find('#option_type_option_values_attributes_0_name').set('color')
- page.find('#option_type_option_values_attributes_0_presentation').set('black')
- click_button 'Update'
-
- visit spree.admin_products_path
- within_row(1) { click_icon :edit }
-
- select2_open label: 'Option Types'
- select2_search 'shirt', label: 'Option Types'
- select2_select 'shirt', from: 'Option Types', match: :first
-
- wait_for { !page.has_button?('Update') }
- click_button 'Update'
-
- within('#sidebar') { click_link 'Variants' }
- click_link 'New Variant'
-
- select2_open label: 'Colors'
- select2_search 'black', label: 'Colors'
- select2_select 'black', from: 'Colors', match: :first
- fill_in 'variant_sku', with: 'A100'
- click_button 'Create'
-
- within_row(1) { click_icon :edit }
- fill_in 'variant_compare_at_price', with: '99.99'
- click_button 'Update'
-
- expect(page).to have_content('successfully updated!')
- end
- end
-end
diff --git a/backend/spec/features/admin/products/option_types_spec.rb b/backend/spec/features/admin/products/option_types_spec.rb
deleted file mode 100644
index d6041cd4f1..0000000000
--- a/backend/spec/features/admin/products/option_types_spec.rb
+++ /dev/null
@@ -1,86 +0,0 @@
-require 'spec_helper'
-
-describe 'Option Types', type: :feature, js: true do
- stub_authorization!
-
- before do
- visit spree.admin_path
- click_link 'Products'
- end
-
- context 'listing option types' do
- it 'lists existing option types' do
- create(:option_type, name: 'tshirt-color', presentation: 'Color')
- create(:option_type, name: 'tshirt-size', presentation: 'Size')
- click_link 'Option Types'
- within('table#listing_option_types') do
- expect(page).to have_content('Color')
- expect(page).to have_content('tshirt-color')
- expect(page).to have_content('Size')
- expect(page).to have_content('tshirt-size')
- end
- end
- end
-
- context 'creating a new option type' do
- it 'allows an admin to create a new option type' do
- click_link 'Option Types'
- click_link 'new_option_type_link'
- expect(page).to have_content('New Option Type')
- fill_in 'option_type_name', with: 'shirt colors'
- fill_in 'option_type_presentation', with: 'colors'
- click_button 'Create'
- expect(page).to have_content('successfully created!')
-
- page.find('#option_type_option_values_attributes_0_name').set('color')
- page.find('#option_type_option_values_attributes_0_presentation').set('black')
-
- click_button 'Update'
- expect(page).to have_content('successfully updated!')
- end
- end
-
- context 'editing an existing option type' do
- it 'allows an admin to update an existing option type' do
- create(:option_type, name: 'tshirt-color', presentation: 'Color')
- create(:option_type, name: 'tshirt-size', presentation: 'Size')
- click_link 'Option Types'
- within('table#listing_option_types') { click_icon :edit }
- fill_in 'option_type_name', with: 'foo-size 99'
- click_button 'Update'
- expect(page).to have_content('successfully updated!')
- expect(page).to have_content('foo-size 99')
- end
- end
-
- # Regression test for #3204
- it 'can remove a non-persisted option value from an option type' do
- create(:option_type)
- click_link 'Option Types'
- within('table#listing_option_types') { click_icon :edit }
-
- expect(page).to have_css('tbody#sortVert tr', count: 1)
-
- # Add a new option type
- click_link 'Add Option Value'
- expect(page).to have_css('tbody#sortVert tr', count: 2)
-
- # Remove default option type
- within('tbody#sortVert') do
- click_icon :delete
- end
- # Check that there was no HTTP request
- expect(page).not_to have_css('div#progress[style]')
- # Assert that the field is hidden automatically
- expect(page).to have_css('tbody#sortVert tr', count: 1)
-
- # Remove added option type
- within('tbody#sortVert') do
- click_icon :delete
- end
- # Check that there was no HTTP request
- expect(page).not_to have_css('div#progress[style]')
- # Assert that the field is hidden automatically
- expect(page).not_to have_css('tbody#option_values tr')
- end
-end
diff --git a/backend/spec/features/admin/products/products_spec.rb b/backend/spec/features/admin/products/products_spec.rb
deleted file mode 100644
index 776b020a4e..0000000000
--- a/backend/spec/features/admin/products/products_spec.rb
+++ /dev/null
@@ -1,536 +0,0 @@
-# coding: utf-8
-require 'spec_helper'
-
-describe 'Products', type: :feature do
- let(:store) { Spree::Store.default }
- let(:other_store) { create(:store, name: 'Other Store', url: 'another-store.lvh.me') }
-
- context 'as admin user' do
- stub_authorization!
-
- def build_option_type_with_values(name, values)
- ot = FactoryBot.create(:option_type, name: name)
- values.each do |val|
- ot.option_values.create(name: val.downcase, presentation: val)
- end
- ot
- end
-
- context 'listing products' do
- context 'sorting' do
- before do
- create(:product, name: 'apache baseball cap', price: 10)
- create(:product, name: 'zomg shirt', price: 5)
- create(:product, name: 'Long T-Shirt', price: 15, stores: [other_store])
- end
-
- it 'lists existing products with correct sorting by name' do
- visit spree.admin_products_path
- # Name ASC
- within_row(1) { expect(page).to have_content('apache baseball cap') }
- within_row(2) { expect(page).to have_content('zomg shirt') }
-
- # Name DESC
- click_link 'admin_products_listing_name_title'
- within_row(1) { expect(page).to have_content('zomg shirt') }
- within_row(2) { expect(page).to have_content('apache baseball cap') }
- end
-
- it 'lists existing products with correct sorting by price' do
- visit spree.admin_products_path
- # Name ASC (default)
- within_row(1) { expect(page).to have_content('apache baseball cap') }
- within_row(2) { expect(page).to have_content('zomg shirt') }
-
- # Price DESC
- click_link 'admin_products_listing_price_title'
- within_row(1) { expect(page).to have_content('zomg shirt') }
- within_row(2) { expect(page).to have_content('apache baseball cap') }
- end
-
- it 'does not list the product that belongs to other store' do
- visit spree.admin_products_path
-
- expect(page).not_to have_content('Long T-Shirt')
- end
-
- it 'lists product from the current store' do
- Capybara.app_host = 'http://another-store.lvh.me'
-
- visit spree.admin_products_path
-
- expect(page).not_to have_content('apache baseball cap')
- expect(page).not_to have_content('zomg shirt')
- expect(page).to have_content('Long T-Shirt')
-
- Capybara.app_host = nil
- end
- end
-
- context 'currency displaying' do
- context 'using Russian Rubles' do
- before do
- Spree::Config[:currency] = 'RUB'
- Spree::Store.default.update!(default_currency: 'RUB')
- create(:product, name: 'Just a product', price: 19.99)
- end
-
- # Regression test for #2737
- context 'uses руб as the currency symbol' do
- it 'on the products listing page' do
- visit spree.admin_products_path
- within_row(1) { expect(page).to have_content('19.99 ₽') }
- end
- end
- end
- end
- end
-
- context 'searching products' do
- it 'is able to search deleted products' do
- create(:product, name: 'apache baseball cap', deleted_at: '2011-01-06 18:21:13')
- create(:product, name: 'zomg shirt')
-
- visit spree.admin_products_path
- expect(page).to have_content('zomg shirt')
- expect(page).not_to have_content('apache baseball cap')
-
- find('label', text: 'Show Deleted').click
- click_on 'Search'
-
- expect(page).to have_content('zomg shirt')
- expect(page).to have_content('apache baseball cap')
-
- find('label', text: 'Show Deleted').click
- click_on 'Search'
-
- expect(page).to have_content('zomg shirt')
- expect(page).not_to have_content('apache baseball cap')
- end
-
- it 'is able to search products by their properties' do
- create(:product, name: 'apache baseball cap', sku: 'A100')
- create(:product, name: 'apache baseball cap2', sku: 'B100')
- create(:product, name: 'zomg shirt')
-
- visit spree.admin_products_path
- fill_in 'q_search_by_name', with: 'ap'
- click_on 'Search'
-
- expect(page).to have_content('apache baseball cap')
- expect(page).to have_content('apache baseball cap2')
- expect(page).not_to have_content('zomg shirt')
-
- fill_in 'q_variants_including_master_sku_cont', with: 'A1'
- click_on 'Search'
-
- expect(page).to have_content('apache baseball cap')
- expect(page).not_to have_content('apache baseball cap2')
- expect(page).not_to have_content('zomg shirt')
- end
- end
-
- context 'creating a new product from a prototype', js: true do
- def build_option_type_with_values(name, values)
- ot = FactoryBot.create(:option_type, name: name)
- values.each do |val|
- ot.option_values.create(name: val.downcase, presentation: val)
- end
- ot
- end
-
- let(:product_attributes) do
- # FactoryBot.attributes_for is un-deprecated!
- # https://github.com/thoughtbot/factory_bot/issues/274#issuecomment-3592054
- FactoryBot.attributes_for(:simple_product)
- end
-
- let(:prototype) do
- size = build_option_type_with_values('size', %w(Small Medium Large))
- FactoryBot.create(:prototype, name: 'Size', option_types: [size])
- end
-
- let(:option_values_hash) do
- hash = {}
- prototype.option_types.each do |i|
- hash[i.id.to_s] = i.option_value_ids
- end
- hash
- end
-
- before do
- @option_type_prototype = prototype
- @property_prototype = create(:prototype, name: 'Random')
- @shipping_category = create(:shipping_category)
- visit spree.admin_products_path
- within find('#contentHeader') do
- click_link 'admin_new_product'
- end
- within('#new_product') do
- expect(page).to have_content('SKU')
- end
- end
-
- it 'allows an admin to create a new product and variants from a prototype' do
- fill_in 'product_name', with: 'Baseball Cap'
- fill_in 'product_sku', with: 'B100'
- fill_in 'product_price', with: '100'
-
- fill_in_date_picker('product_available_on', { year: 2012, month: 1, day: 24 })
-
- select2 'Size', from: 'Prototype'
- check 'Large'
- select2 @shipping_category.name, css: '#product_shipping_category_field'
-
- click_button 'Create'
-
- expect(page).to have_content('successfully created!')
- expect(page).to have_field(id: 'product_available_on', type: :hidden, with: '2012-01-24')
- expect(Spree::Product.last.variants.length).to eq(1)
- end
-
- it 'does not display variants when prototype does not contain option types' do
- select2 'Random', from: 'Prototype'
-
- fill_in 'product_name', with: 'Baseball Cap'
-
- expect(page).not_to have_content('Variants')
- end
-
- context 'with html5 validations' do
- it 'keeps option values selected if validation fails' do
- fill_in 'product_name', with: 'Baseball Cap'
- fill_in 'product_sku', with: 'B100'
- fill_in 'product_price', with: '100'
- select2 'Size', from: 'Prototype'
- check 'Large'
- click_button 'Create'
-
- expect(page).to have_css('#product_shipping_category_field') do |el|
- el['validationMessage'] == 'Please select an item in the list.'
- end
- expect(page).to have_checked_field('Size')
- expect(page).to have_checked_field('Large')
- expect(page).to have_unchecked_field('Small')
- end
- end
-
- context 'without html5 validations' do
- it 'keeps option values selected if validation fails' do
- disable_html5_validation
- fill_in 'product_name', with: 'Baseball Cap'
- fill_in 'product_sku', with: 'B100'
- fill_in 'product_price', with: '100'
- select2 'Size', from: 'Prototype'
- check 'Large'
- click_button 'Create'
- expect(page).to have_content("Shipping Category can't be blank")
- expect(page).to have_checked_field('Size')
- expect(page).to have_checked_field('Large')
- expect(page).to have_unchecked_field('Small')
- end
- end
- end
-
- context 'creating a new product' do
- before do
- store.update!(default_currency: 'EUR')
- @shipping_category = create(:shipping_category)
- visit spree.admin_products_path
- within find('#contentHeader') do
- click_link 'admin_new_product'
- end
-
- within('#new_product') do
- expect(page).to have_content('SKU')
- end
- end
-
- let(:product) { Spree::Product.last }
-
- it 'allows an admin to create a new product' do
- fill_in 'product_name', with: 'Baseball Cap'
- fill_in 'product_sku', with: 'B100'
- fill_in 'product_price', with: '100'
- fill_in 'product_available_on', with: '2012/01/24'
- select @shipping_category.name, from: 'product_shipping_category_id'
- click_button 'Create'
-
- expect(page).to have_content('successfully created!')
- expect(page).to have_field('product_price', with: '100.00')
- expect(page).to have_select('product_cost_currency', selected: 'Euro (EUR)')
-
- expect(product.master.prices.last.currency).to eq('EUR')
- expect(product.stores).to eq([store])
-
- click_button 'Update'
- expect(page).to have_content('successfully updated!')
- end
-
- it 'shows validation errors' do
- fill_in 'product_name', with: 'Baseball Cap'
- fill_in 'product_sku', with: 'B100'
- fill_in 'product_price', with: '100'
- click_button 'Create'
- expect(page).to have_content("Shipping Category can't be blank")
- end
-
- context 'using a locale with a different decimal format ' do
- before do
- # change English locale's separator and delimiter to match 19,99 format
- I18n.backend.store_translations(:en,
- number: {
- currency: {
- format: {
- separator: ',',
- delimiter: '.'
- }
- }
- })
- end
-
- after do
- # revert changes to English locale
- I18n.backend.store_translations(:en,
- number: {
- currency: {
- format: {
- separator: '.',
- delimiter: ','
- }
- }
- })
- end
-
- it 'shows localized price value on validation errors', js: true do
- fill_in 'product_price', with: '19,99'
- click_button 'Create'
- expect(page).to have_field(id: 'product_price', with: '19,99')
- end
- end
-
- # Regression test for #2097
- it 'can set the count on hand to a null value' do
- fill_in 'product_name', with: 'Baseball Cap'
- fill_in 'product_price', with: '100'
- select @shipping_category.name, from: 'product_shipping_category_id'
- click_button 'Create'
- expect(page).to have_content('successfully created!')
- click_button 'Update'
- expect(page).to have_content('successfully updated!')
- end
- end
-
- context 'cloning a product', js: true do
- it 'allows an admin to clone a product' do
- create(:product, stores: Spree::Store.all)
-
- visit spree.admin_products_path
- within_row(1) do
- click_icon :clone
- end
-
- expect(page).to have_content('Product has been cloned')
- end
-
- context 'cloning a deleted product' do
- it 'allows an admin to clone a deleted product' do
- create(:product, name: 'apache baseball cap')
-
- visit spree.admin_products_path
- click_on 'Filter'
- find('label', text: 'Show Deleted').click
- click_on 'Search'
-
- expect(page).to have_content('apache baseball cap')
-
- within_row(1) do
- click_icon :clone
- end
-
- expect(page).to have_content('Product has been cloned')
- end
- end
- end
-
- context 'updating a product' do
- let(:product) { create(:product, stores: Spree::Store.all) }
-
- let(:prototype) do
- size = build_option_type_with_values('size', %w(Small Medium Large))
- FactoryBot.create(:prototype, name: 'Size', option_types: [size])
- end
-
- before do
- @option_type_prototype = prototype
- @property_prototype = create(:prototype, name: 'Random')
- end
-
- it 'parses correctly available_on' do
- visit spree.admin_product_path(product)
- fill_in 'product_available_on', with: '2012/12/25'
- click_button 'Update'
- expect(page).to have_content('successfully updated!')
- expect(Spree::Product.last.available_on.to_s).to eq('2012-12-25 00:00:00 UTC')
- end
-
- it 'adds option_types when selecting a prototype', js: true do
- visit spree.admin_product_path(product)
- within('#sidebar') do
- click_link 'Properties'
- end
- click_link 'Select From Prototype'
-
- within("#prototypes tr#row_#{prototype.id}") do
- click_link 'Select'
- end
-
- within(:css, 'tr.product_property:first-child') do
- expect(page).to have_field(id: /property_name$/, with: 'baseball_cap_color')
- end
- end
-
- context 'using a locale with a different decimal format' do
- before do
- # change English locale's separator and delimiter to match 19,99 format
- I18n.backend.store_translations(
- :en,
- number: {
- currency: {
- format: {
- separator: ',',
- delimiter: '.'
- }
- },
- format: {
- separator: ',',
- delimiter: '.'
- }
- }
- )
- end
-
- after do
- # revert changes to English locale
- I18n.backend.store_translations(
- :en,
- number: {
- currency: {
- format: {
- separator: '.',
- delimiter: ','
- }
- },
- format: {
- separator: '.',
- delimiter: ','
- }
- }
- )
- end
-
- it 'parses correctly decimal values like weight' do
- visit spree.admin_product_path(product)
- fill_in 'product_weight', with: '1'
- click_button 'Update'
- weight_prev = find('#product_weight').value
- click_button 'Update'
- expect(page).to have_field(id: 'product_weight', with: weight_prev)
- end
- end
- end
-
- context 'deleting a product', js: true do
- let!(:product) { create(:product, stores: Spree::Store.all) }
-
- it 'is still viewable' do
- visit spree.admin_products_path
- accept_confirm do
- click_icon :delete
- end
- expect(page).to have_content('Product has been deleted')
-
- click_on 'Filter'
- # This will show our deleted product
- find('label', text: 'Show Deleted').click
- click_on 'Search'
- click_link(product.name, match: :first)
- expect(page).to have_field(id: 'product_price') do |field|
- field.value.to_f == product.price.to_f
- end
- end
- end
-
- context 'filtering products', js: true do
- it 'renders selected filters' do
- visit spree.admin_products_path
-
- click_on 'Filter'
-
- within('#table-filter') do
- fill_in 'q_search_by_name', with: 'Backpack'
- fill_in 'q_variants_including_master_sku_cont', with: 'BAG-00001'
- end
-
- click_on 'Search'
-
- within('.table-active-filters') do
- expect(page).to have_content('Name: Backpack')
- expect(page).to have_content('SKU: BAG-00001')
- end
- end
- end
-
- context 'editing product compare at price', js: true do
- let!(:product) { create(:product, stores: Spree::Store.all) }
-
- it 'lets admin edit compare at price for product' do
- visit spree.admin_products_path
- within_row(1) { click_icon :edit }
-
- fill_in 'product_compare_at_price', with: '99.99'
- click_button 'Update'
-
- expect(page).to have_content 'successfully updated!'
- end
- end
- end
-
- context 'with only product permissions' do
- before do
- allow_any_instance_of(Spree::Admin::BaseController).to receive(:spree_current_user).and_return(nil)
- end
-
- custom_authorization! do |_user|
- can [:admin, :update, :read], Spree::Product
- end
- let!(:product) { create(:product, stores: Spree::Store.all) }
-
- it 'only displays accessible links on index' do
- visit spree.admin_products_path
-
- expect(page).to have_link('Products')
- expect(page).not_to have_link('Option Types')
- expect(page).not_to have_link('Properties')
- expect(page).not_to have_link('Prototypes')
- expect(page).not_to have_link('New Product')
- expect(page).not_to have_css('.icon-clone')
- expect(page).to have_css('.icon-edit')
- expect(page).not_to have_css('.delete-resource')
- end
-
- it 'only displays accessible links on edit' do
- visit spree.admin_product_path(product)
-
- # product tabs should be hidden
- expect(page).to have_link('Details')
- expect(page).not_to have_link('Images')
- expect(page).not_to have_link('Variants')
- expect(page).not_to have_link('Properties')
- expect(page).not_to have_link('Stock Management')
-
- # no create permission
- expect(page).not_to have_link('New Product')
- end
- end
-end
diff --git a/backend/spec/features/admin/products/properties_spec.rb b/backend/spec/features/admin/products/properties_spec.rb
deleted file mode 100644
index 3bc61dc579..0000000000
--- a/backend/spec/features/admin/products/properties_spec.rb
+++ /dev/null
@@ -1,169 +0,0 @@
-require 'spec_helper'
-
-describe 'Properties', type: :feature, js: true do
- stub_authorization!
-
- before do
- visit spree.admin_products_path
- end
-
- context 'Property index' do
- before do
- create(:property, name: 'shirt size', presentation: 'size', filterable: true)
- create(:property, name: 'shirt fit', presentation: 'fit', filterable: false)
- visit spree.admin_properties_path
- end
-
- context 'listing product properties' do
- it 'lists the existing product properties' do
- within_row(1) do
- expect(column_text(1)).to eq('shirt size')
- expect(column_text(2)).to eq('size')
- end
-
- within_row(2) do
- expect(column_text(1)).to eq('shirt fit')
- expect(column_text(2)).to eq('fit')
- end
- end
- end
-
- context 'searching properties' do
- it 'lists properties matching search query' do
- click_on 'Filter'
- fill_in 'q_name_cont', with: 'size'
- click_on 'Search'
-
- expect(page).to have_content('shirt size')
- expect(page).not_to have_content('shirt fit')
- end
-
- it 'search by filterable status' do
- click_on 'Filter'
- select 'Filterable', from: 'Filterable Status'
-
- click_on 'Search'
-
- expect(page).to have_content('shirt size')
- expect(page).not_to have_content('shirt fit')
- end
-
- it 'renders selected filters' do
- click_on 'Filter'
-
- within('#table-filter') do
- fill_in 'q_name_cont', with: 'color'
- fill_in 'q_presentation_cont', with: 'shade'
- end
-
- click_on 'Search'
-
- within('.table-active-filters') do
- expect(page).to have_content('Name: color')
- expect(page).to have_content('Presentation: shade')
- end
- end
- end
- end
-
- context 'creating a property' do
- it 'allows an admin to create a new product property' do
- visit spree.admin_properties_path
- click_link 'new_property_link'
- within('.content-header') { expect(page).to have_content('New Property') }
-
- fill_in 'property_name', with: 'color of band'
- fill_in 'property_presentation', with: 'color'
- click_button 'Create'
- expect(page).to have_content('successfully created!')
- end
- end
-
- context 'editing a property' do
- before do
- create(:property)
- visit spree.admin_properties_path
- within_row(1) { click_icon :edit }
- end
-
- it 'allows an admin to edit an existing product property' do
- fill_in 'property_name', with: 'model 99'
- click_button 'Update'
- expect(page).to have_content('successfully updated!')
- expect(page).to have_content('model 99')
- end
-
- it 'shows validation errors' do
- fill_in 'property_name', with: ''
- click_button 'Update'
- expect(page).to have_content("Name can't be blank")
- end
- end
-
- context 'linking a property to a product' do
- before do
- create(:product, stores: Spree::Store.all)
- visit spree.admin_products_path
- click_icon :edit
- within('#sidebar') do
- click_link 'Properties'
- end
- end
-
- # Regression test for #2279
- it 'successfully create and then remove product property' do
- fill_in_property
-
- expect(page).to have_css('tbody#sortVert tr:nth-child(2)')
- expect(page).to have_css('tbody#sortVert tr').twice
-
- delete_product_property
-
- check_property_row_count(1)
- end
-
- # Regression test for #4466
- it 'successfully remove and create a product property at the same time' do
- fill_in_property
-
- fill_in 'product_product_properties_attributes_1_property_name', with: 'New Property'
- fill_in 'product_product_properties_attributes_1_value', with: 'New Value'
-
- delete_product_property
-
- # Give fadeOut time to complete
- expect(page).not_to have_selector('#product_product_properties_attributes_0_property_name')
- expect(page).not_to have_selector('#product_product_properties_attributes_0_value')
-
- click_button 'Update'
-
- expect(page).not_to have_content('Product is not found')
-
- check_property_row_count(2)
- end
-
- def fill_in_property
- fill_in 'product_product_properties_attributes_0_property_name', with: 'A Property'
- fill_in 'product_product_properties_attributes_0_value', with: 'A Value'
- click_button 'Update'
- within('#sidebar') do
- click_link 'Properties'
- end
- end
-
- def delete_product_property
- accept_confirm do
- click_icon :delete
- end
- expect(page.document).to have_content('successfully removed!').
- or have_content('Cannot delete record')
- end
-
- def check_property_row_count(expected_row_count)
- within('#sidebar') do
- click_link 'Properties'
- end
- expect(page).to have_css('tbody#sortVert tr', count: expected_row_count)
- end
- end
-end
diff --git a/backend/spec/features/admin/products/prototypes_spec.rb b/backend/spec/features/admin/products/prototypes_spec.rb
deleted file mode 100644
index 7a800ce499..0000000000
--- a/backend/spec/features/admin/products/prototypes_spec.rb
+++ /dev/null
@@ -1,140 +0,0 @@
-require 'spec_helper'
-
-describe 'Prototypes', type: :feature, js: true do
- stub_authorization!
-
- context 'listing prototypes' do
- it 'is able to list existing prototypes' do
- create(:property, name: 'model', presentation: 'Model')
- create(:property, name: 'brand', presentation: 'Brand')
- create(:property, name: 'shirt_fabric', presentation: 'Fabric')
- create(:property, name: 'shirt_sleeve_length', presentation: 'Sleeve')
- create(:property, name: 'mug_type', presentation: 'Type')
- create(:property, name: 'bag_type', presentation: 'Type')
- create(:property, name: 'manufacturer', presentation: 'Manufacturer')
- create(:property, name: 'bag_size', presentation: 'Size')
- create(:property, name: 'mug_size', presentation: 'Size')
- create(:property, name: 'gender', presentation: 'Gender')
- create(:property, name: 'shirt_fit', presentation: 'Fit')
- create(:property, name: 'bag_material', presentation: 'Material')
- create(:property, name: 'shirt_type', presentation: 'Type')
- p = create(:prototype, name: 'Shirt')
- %w(brand gender manufacturer model shirt_fabric shirt_fit shirt_sleeve_length shirt_type).each do |prop|
- p.properties << Spree::Property.find_by(name: prop)
- end
- p = create(:prototype, name: 'Mug')
- %w(mug_size mug_type).each do |prop|
- p.properties << Spree::Property.find_by(name: prop)
- end
- p = create(:prototype, name: 'Bag')
- %w(bag_type bag_material).each do |prop|
- p.properties << Spree::Property.find_by(name: prop)
- end
-
- visit spree.admin_path
- click_link 'Products'
- click_link 'Prototypes'
-
- within_row(1) { expect(column_text(1)).to eq 'Shirt' }
- within_row(2) { expect(column_text(1)).to eq 'Mug' }
- within_row(3) { expect(column_text(1)).to eq 'Bag' }
- end
- end
-
- context 'creating a prototype' do
- it 'allows an admin to create a new product prototype' do
- visit spree.admin_path
- click_link 'Products'
- click_link 'Prototypes'
-
- click_link 'new_prototype_link'
- within('.content-header') do
- expect(page).to have_content('New Prototype')
- end
- fill_in 'prototype_name', with: 'male shirts'
- click_button 'Create'
- expect(page).to have_content('successfully created!')
-
- visit spree.admin_prototypes_path
- within_row(1) { click_icon :edit }
- fill_in 'prototype_name', with: 'Shirt 99'
- click_button 'Update'
- expect(page).to have_content('successfully updated!')
- expect(page).to have_content('Shirt 99')
- end
-
- context 'selecting taxons' do
- let(:prototype_name) { 'shirts' }
- let!(:store1) { Spree::Store.default }
- let!(:taxonomy1) { create(:taxonomy, name: 'Shirts', store: store1) }
- let!(:store2) { create(:store) }
- let!(:taxonomy2) { create(:taxonomy, name: 'Bags', store: store2) }
-
- it 'should be able to select only current store taxons' do
- visit spree.admin_path
- click_link 'Products'
- click_link 'Prototypes'
-
- click_link 'new_prototype_link'
- within('.content-header') do
- expect(page).to have_content('New Prototype')
- end
- fill_in 'prototype_name', with: prototype_name
-
- select2_open label: 'Taxons'
- expect(page).to have_content('Shirts')
- expect(page).not_to have_content('Bags')
- select2_select 'Shirts', from: 'Taxons'
-
- click_button 'Create'
-
- expect(page).to have_content('successfully created!')
- expect(Spree::Prototype.find_by(name: prototype_name).taxons).to match_array([taxonomy1.root])
- end
- end
- end
-
- context 'editing a prototype' do
- it 'allows to empty its properties' do
- model_property = create(:property, name: 'model', presentation: 'Model')
- brand_property = create(:property, name: 'brand', presentation: 'Brand')
-
- shirt_prototype = create(:prototype, name: 'Shirt', properties: [])
- %w(brand model).each do |prop|
- shirt_prototype.properties << Spree::Property.find_by(name: prop)
- end
-
- visit spree.admin_path
- click_link 'Products'
- click_link 'Prototypes'
-
- click_icon :edit
-
- first('span[class="select2-selection__choice__remove"]').click
- find('span[class="select2-selection__choice__remove"]').click
-
- click_button 'Update'
-
- click_icon :edit
- expect(page).to have_no_css('.select2-search-choice')
- end
- end
-
- it 'is deletable' do
- shirt_prototype = create(:prototype, name: 'Shirt', properties: [])
- shirt_prototype.taxons << create(:taxon)
-
- visit spree.admin_path
- click_link 'Products'
- click_link 'Prototypes'
-
- expect(page).to have_content('Shirt')
-
- accept_confirm do
- within("#spree_prototype_#{shirt_prototype.id}") do
- page.find('.delete-resource').click
- end
- end
- expect(page).to have_content("Prototype \"#{shirt_prototype.name}\" has been successfully removed!")
- end
-end
diff --git a/backend/spec/features/admin/products/stock_management_spec.rb b/backend/spec/features/admin/products/stock_management_spec.rb
deleted file mode 100644
index e25268246c..0000000000
--- a/backend/spec/features/admin/products/stock_management_spec.rb
+++ /dev/null
@@ -1,123 +0,0 @@
-require 'spec_helper'
-
-describe 'Stock Management', type: :feature, js: true do
- stub_authorization!
-
- context 'given a product with a variant and a stock location' do
- let!(:stock_location) { create(:stock_location, name: 'Default') }
- let!(:product) { create(:product, name: 'apache baseball cap', price: 10) }
- let!(:variant) { product.master }
-
- before do
- stock_location.stock_item(variant).update_column(:count_on_hand, 10)
- visit spree.stock_admin_product_path(product)
- end
-
- context "toggle backorderable for a variant's stock item" do
- let(:backorderable) { find_field(class: 'stock_item_backorderable') }
-
- before do
- expect(backorderable).to be_checked
- backorderable.uncheck
- wait_for_ajax
- end
-
- it 'persists the value when page reload' do
- refresh
- expect(backorderable).not_to be_checked
- end
- end
-
- context "toggle track inventory for a variant's stock item" do
- let(:track_inventory) { find_field(class: 'track_inventory_checkbox') }
-
- before do
- expect(track_inventory).to be_checked
- track_inventory.uncheck
- wait_for_ajax
- end
-
- it 'persists the value when page reloaded' do
- refresh
- expect(track_inventory).not_to be_checked
- end
- end
-
- # Regression test for #2896
- # The regression was that unchecking the last checkbox caused a redirect
- # to happen. By ensuring that we're still on an /admin/products URL, we
- # assert that the redirect is *not* happening.
- it 'can toggle backorderable for the second variant stock item' do
- new_location = create(:stock_location, name: 'Another Location')
- refresh
-
- new_location_backorderable = find_field(id: "stock_item_backorderable_#{new_location.id}", checked: true)
- new_location_backorderable.uncheck
- wait_for_ajax
-
- expect(page).to have_current_path(%r{/admin/products})
- end
-
- it 'can create a new stock movement' do
- fill_in 'stock_movement_quantity', with: 5
- click_button 'Add Stock'
-
- expect(page).to have_content('successfully created')
-
- within(:css, '.stock_location_info table') do
- expect(column_text(2)).to eq '15'
- end
- end
-
- it 'can create a new negative stock movement' do
- fill_in 'stock_movement_quantity', with: -5
- click_button 'Add Stock'
-
- expect(page).to have_content('successfully created')
-
- within(:css, '.stock_location_info table') do
- expect(column_text(2)).to eq '5'
- end
- end
-
- context 'with multiple variants' do
- let!(:variant) { create(:variant, product: product, sku: 'SPREEC') }
-
- before do
- variant.stock_items.first.update_column(:count_on_hand, 30)
- refresh
- end
-
- it 'can create a new stock movement for the specified variant' do
- fill_in 'stock_movement_quantity', with: 10
- select2 'SPREEC', from: 'Variant'
- click_button 'Add Stock'
-
- expect(page).to have_content('successfully created')
-
- within('#listing_product_stock tr', text: 'SPREEC') do
- within('table') do
- expect(column_text(2)).to eq '40'
- end
- end
- end
- end
-
- # Regression test for #3304
- context 'with no stock location' do
- let(:product) { create(:product, name: 'apache baseball cap', price: 10) }
- let(:variant) { create(:variant, product: product, sku: 'FOOBAR') }
-
- before do
- Spree::StockLocation.delete_all
-
- visit spree.stock_admin_product_path(product)
- end
-
- it 'redirects to stock locations page', js: false do
- expect(page).to have_content(Spree.t(:stock_management_requires_a_stock_location))
- expect(page).to have_current_path(%r{admin/stock_locations})
- end
- end
- end
-end
diff --git a/backend/spec/features/admin/products/taxonomies_spec.rb b/backend/spec/features/admin/products/taxonomies_spec.rb
deleted file mode 100644
index 5f0b91ad18..0000000000
--- a/backend/spec/features/admin/products/taxonomies_spec.rb
+++ /dev/null
@@ -1,52 +0,0 @@
-require 'spec_helper'
-
-describe 'Taxonomies', type: :feature, js: true do
- stub_authorization!
-
- before do
- visit spree.admin_path
- click_link 'Products'
- end
-
- context 'show' do
- it 'displays existing taxonomies' do
- create(:taxonomy, name: 'Brand')
- create(:taxonomy, name: 'Categories')
- visit spree.admin_taxonomies_path
- within_row(1) { expect(page).to have_content('Brand') }
- within_row(2) { expect(page).to have_content('Categories') }
- end
- end
-
- context 'create' do
- before do
- click_link 'Taxonomies'
- click_link 'admin_new_taxonomy_link'
- end
-
- it 'allows an admin to create a new taxonomy' do
- expect(page).to have_content('New Taxonomy')
- fill_in 'taxonomy_name', with: 'sports'
- click_button 'Create'
- expect(page).to have_content('successfully created!')
- end
-
- it 'displays validation errors' do
- fill_in 'taxonomy_name', with: ''
- click_button 'Create'
- expect(page).to have_content("can't be blank")
- end
- end
-
- context 'edit' do
- it 'allows an admin to update an existing taxonomy' do
- create(:taxonomy)
- click_link 'Taxonomies'
- within_row(1) { click_icon :edit }
- fill_in 'taxonomy_name', with: 'sports 99'
- click_button 'Update'
- expect(page).to have_content('successfully updated!')
- expect(page).to have_content('sports 99')
- end
- end
-end
diff --git a/backend/spec/features/admin/products/variant_prices_spec.rb b/backend/spec/features/admin/products/variant_prices_spec.rb
deleted file mode 100644
index 446d2ac53a..0000000000
--- a/backend/spec/features/admin/products/variant_prices_spec.rb
+++ /dev/null
@@ -1,53 +0,0 @@
-require 'spec_helper'
-
-describe 'Variant Prices', type: :feature, js: true do
- stub_authorization!
- let(:store) { Spree::Store.default }
- let!(:store2) { create(:store, default: false, default_currency: 'GBP') }
-
- before do
- store.update(supported_currencies: 'USD,EUR')
- end
-
- let!(:product) { create(:product, stores: Spree::Store.all) }
-
- context 'with USD and EUR as currencies' do
- it 'allows to save a price for each currency' do
- visit spree.admin_product_path(product)
- click_link 'Prices'
- expect(page).to have_content 'USD'
- expect(page).to have_content 'EUR'
- expect(page).to have_content 'GBP'
-
- fill_in "vp_#{product.master.id}_USD_price", with: '29.95'
- fill_in "vp_#{product.master.id}_EUR_price", with: '21.94'
- fill_in "vp_#{product.master.id}_GBP_price", with: '19.94'
-
- click_button 'Update'
- expect(page).to have_content 'Prices successfully saved'
- expect(product.master.price_in('USD').amount).to eq(29.95)
- expect(product.master.price_in('EUR').amount).to eq(21.94)
- expect(product.master.price_in('GBP').amount).to eq(19.94)
- end
-
- it 'allows to save a compare to price for each currency' do
- visit spree.admin_product_path(product)
- click_link 'Prices'
- expect(page).to have_content 'COMPARE AT PRICE'
-
- fill_in "vp_#{product.master.id}_USD_price", with: '29.95'
- fill_in "vp_#{product.master.id}_EUR_price", with: '21.94'
- fill_in "vp_#{product.master.id}_GBP_price", with: '19.94'
-
- fill_in "vp_#{product.master.id}_USD_compare_at_price", with: '59.95'
- fill_in "vp_#{product.master.id}_EUR_compare_at_price", with: '51.94'
- fill_in "vp_#{product.master.id}_GBP_compare_at_price", with: '49.94'
-
- click_button 'Update'
- expect(page).to have_content 'Prices successfully saved'
- expect(product.master.price_in('USD').compare_at_amount).to eq(59.95)
- expect(product.master.price_in('EUR').compare_at_amount).to eq(51.94)
- expect(product.master.price_in('GBP').compare_at_amount).to eq(49.94)
- end
- end
-end
diff --git a/backend/spec/features/admin/products/variant_spec.rb b/backend/spec/features/admin/products/variant_spec.rb
deleted file mode 100644
index 23566b1f76..0000000000
--- a/backend/spec/features/admin/products/variant_spec.rb
+++ /dev/null
@@ -1,76 +0,0 @@
-require 'spec_helper'
-
-describe 'Variants', type: :feature do
- stub_authorization!
-
- let(:product) { create(:product_with_option_types, price: '1.99', cost_price: '1.00', weight: '2.5', height: '3.0', width: '1.0', depth: '1.5') }
-
- context 'creating a new variant' do
- it 'allows an admin to create a new variant', js: true do
- product.options.each do |option|
- create(:option_value, option_type: option.option_type)
- end
-
- visit spree.admin_products_path
- within_row(1) { click_icon :edit }
- click_link 'Variants'
- click_on 'Add One'
- expect(page).to have_field(id: 'variant_price', with: '1.99')
- expect(page).to have_field(id: 'variant_cost_price', with: '1.00')
- expect(page).to have_field(id: 'variant_weight', with: '2.50')
- expect(page).to have_field(id: 'variant_height', with: '3.00')
- expect(page).to have_field(id: 'variant_width', with: '1.00')
- expect(page).to have_field(id: 'variant_depth', with: '1.50')
- expect(page).to have_css('.form-group[data-hook="tax_category"]', text: 'None')
- end
- end
-
- context 'listing variants' do
- context "there's fewer than 26 variants" do
- it 'displays pagination' do
- visit spree.admin_product_variants_path(product)
- expect(product.variants.size < 26).to be_truthy
- expect(page).not_to have_css('.pagination.d-inline-flex')
- expect(page).to have_css('select[name="per_page"]')
- end
- end
-
- context "there's variants than in preference variants_per_page" do
- before { create_list(:variant, (default_per_page + 1), product: product) }
- let(:default_per_page) { Spree::Backend::Config[:variants_per_page] }
-
- it 'allows to change number of displayed variants', js: true do
- second_page_link_selector = "a[href='#{spree.admin_product_variants_path(product, page: 2)}']"
- visit spree.admin_product_variants_path(product)
- expect(page).to have_css(second_page_link_selector)
- page.select('50', from: 'per_page')
- expect(page).to have_current_path(spree.admin_product_variants_path(product, per_page: 50))
- expect(page).not_to have_css(second_page_link_selector)
- end
-
- it 'allows to go to the second page' do
- visit spree.admin_product_variants_path(product)
- page.click_link('2')
- expect(page).to have_current_path(spree.admin_product_variants_path(product, page: 2))
- end
- end
-
- context 'currency displaying' do
- context 'using Russian Rubles' do
- before do
- Spree::Config[:currency] = 'RUB'
- Spree::Store.default.update!(default_currency: 'RUB')
- create(:variant, product: product, price: 19.99)
- end
-
- # Regression test for #2737
- context 'uses руб as the currency symbol' do
- it 'on the products listing page' do
- visit spree.admin_product_variants_path(product)
- within_row(1) { expect(page).to have_content('19.99 ₽') }
- end
- end
- end
- end
- end
-end
diff --git a/backend/spec/features/admin/promotions/adjustments_spec.rb b/backend/spec/features/admin/promotions/adjustments_spec.rb
deleted file mode 100644
index 992ac11c71..0000000000
--- a/backend/spec/features/admin/promotions/adjustments_spec.rb
+++ /dev/null
@@ -1,280 +0,0 @@
-require 'spec_helper'
-
-describe 'Promotion Adjustments', type: :feature, js: true do
- stub_authorization!
-
- context 'coupon promotions' do
- before do
- visit spree.new_admin_promotion_path
- end
-
- it 'allows an admin to create a flat rate discount coupon promo' do
- fill_in 'Name', with: 'Promotion'
- fill_in 'Code', with: 'order'
- click_button 'Create'
- promotion = Spree::Promotion.find_by(name: 'Promotion')
- expect(page).to have_content(promotion.name)
-
- select2 'Item total', from: 'Add rule of type'
- within('#rule_fields') { click_button 'Add' }
-
- fill_in id: 'promotion_promotion_rules_attributes_1_preferred_amount_min', with: 30
- fill_in id: 'promotion_promotion_rules_attributes_1_preferred_amount_max', with: 60
- wait_for { !page.has_button?('Update') }
- within('#rule_fields') { click_button 'Update' }
-
- select2 'Create whole-order adjustment', from: 'Add action of type'
- within('#action_fields') { click_button 'Add' }
- select2 'Flat Rate', from: 'Calculator', search: true, match: :first
- wait_for { !page.has_button?('Update') }
- within('#actions_container') { click_button 'Update' }
-
- within('.calculator-fields') { fill_in 'Amount', with: 5 }
- wait_for { !page.has_button?('Update') }
- within('#actions_container') { click_button 'Update' }
-
- expect(promotion.code).to eq('order')
-
- first_rule = promotion.rules.first
- expect(first_rule.class).to eq(Spree::Promotion::Rules::ItemTotal)
- expect(first_rule.preferred_amount_min).to eq(30)
- expect(first_rule.preferred_amount_max).to eq(60)
-
- first_action = promotion.actions.first
- expect(first_action.class).to eq(Spree::Promotion::Actions::CreateAdjustment)
- first_action_calculator = first_action.calculator
- expect(first_action_calculator.class).to eq(Spree::Calculator::FlatRate)
- expect(first_action_calculator.preferred_amount).to eq(5)
- end
-
- it 'allows an admin to create a single user coupon promo with flat rate discount' do
- fill_in 'Name', with: 'Promotion'
- fill_in 'Limit usage to', with: '1'
- fill_in 'Code', with: 'single_use'
- click_button 'Create'
- promotion = Spree::Promotion.find_by(name: 'Promotion')
- expect(page).to have_content(promotion.name)
-
- select2 'Create whole-order adjustment', from: 'Add action of type'
- within('#action_fields') { click_button 'Add' }
- select2 'Flat Rate', from: 'Calculator', search: true, match: :first
- wait_for { !page.has_button?('Update') }
- within('#actions_container') { click_button 'Update' }
- within('#action_fields') { fill_in 'Amount', with: '5' }
- wait_for { !page.has_button?('Update') }
- within('#actions_container') { click_button 'Update' }
-
- expect(promotion.usage_limit).to eq(1)
- expect(promotion.code).to eq('single_use')
-
- first_action = promotion.actions.first
- expect(first_action.class).to eq(Spree::Promotion::Actions::CreateAdjustment)
- first_action_calculator = first_action.calculator
- expect(first_action_calculator.class).to eq(Spree::Calculator::FlatRate)
- expect(first_action_calculator.preferred_amount).to eq(5)
- end
-
- it 'allows an admin to create an automatic promo with flat percent discount' do
- fill_in 'Name', with: 'Promotion'
- click_button 'Create'
- promotion = Spree::Promotion.find_by(name: 'Promotion')
-
- expect(page).to have_content(promotion.name)
-
- select2 'Create whole-order adjustment', from: 'Add action of type'
- within('#action_fields') { click_button 'Add' }
- select2 'Flat Percent', from: 'Calculator'
- wait_for { !page.has_button?('Update') }
- within('#actions_container') { click_button 'Update' }
- within('.calculator-fields') { fill_in 'Flat Percent', with: '10' }
- wait_for { !page.has_button?('Update') }
- within('#actions_container') { click_button 'Update' }
-
- expect(promotion.code).to be_blank
-
- first_action = promotion.actions.first
- expect(first_action.class).to eq(Spree::Promotion::Actions::CreateAdjustment)
- first_action_calculator = first_action.calculator
- expect(first_action_calculator.class).to eq(Spree::Calculator::FlatPercentItemTotal)
- expect(first_action_calculator.preferred_flat_percent).to eq(10)
- end
-
- it 'allows an admin to create an product promo with percent per item discount' do
- create(:product, name: 'RoR Mug')
-
- fill_in 'Name', with: 'Promotion'
- click_button 'Create'
- promotion = Spree::Promotion.find_by(name: 'Promotion')
-
- expect(page).to have_content(promotion.name)
-
- select2 'Product(s)', from: 'Add rule of type'
- within('#rule_fields') { click_button 'Add' }
- select2 'RoR Mug', from: 'Choose products', search: true
- wait_for { !page.has_button?('Update') }
- within('#rule_fields') { click_button 'Update' }
-
- select2 'Create per-line-item adjustment', from: 'Add action of type'
- within('#action_fields') { click_button 'Add' }
- select2 'Percent Per Item', from: 'Calculator'
- wait_for { !page.has_button?('Update') }
- within('#actions_container') { click_button 'Update' }
- within('.calculator-fields') { fill_in 'Percent', with: '10' }
- wait_for { !page.has_button?('Update') }
- within('#actions_container') { click_button 'Update' }
-
- expect(promotion.code).to be_blank
-
- first_rule = promotion.rules.first
- expect(first_rule.class).to eq(Spree::Promotion::Rules::Product)
- expect(first_rule.products.map(&:name)).to include('RoR Mug')
-
- first_action = promotion.actions.first
- expect(first_action.class).to eq(Spree::Promotion::Actions::CreateItemAdjustments)
- first_action_calculator = first_action.calculator
- expect(first_action_calculator.class).to eq(Spree::Calculator::PercentOnLineItem)
- expect(first_action_calculator.preferred_percent).to eq(10)
- end
-
- it 'allows an admin to create an automatic promotion with free shipping (no code)' do
- fill_in 'Name', with: 'Promotion'
- click_button 'Create'
-
- promotion = Spree::Promotion.find_by(name: 'Promotion')
- expect(page).to have_content(promotion.name)
-
- select2 'Free shipping', from: 'Add action of type'
- within('#action_fields') { click_button 'Add' }
- expect(page).to have_content('Makes all shipments for the order free')
-
- expect(promotion.code).to be_blank
-
- first_action = promotion.actions.first
- expect(first_action.class).to eq(Spree::Promotion::Actions::FreeShipping)
- end
-
- it 'allows an admin to create an automatic promo requiring a landing page to be visited' do
- fill_in 'Name', with: 'Promotion'
- fill_in 'Path', with: 'content/cvv'
- click_button 'Create'
- promotion = Spree::Promotion.find_by(name: 'Promotion')
-
- expect(page).to have_content(promotion.name)
-
- select2 'Create whole-order adjustment', from: 'Add action of type'
- within('#action_fields') { click_button 'Add' }
- select2 'Flat Rate', from: 'Calculator', search: true, match: :first
- wait_for { !page.has_button?('Update') }
- within('#actions_container') { click_button 'Update' }
- within('.calculator-fields') { fill_in 'Amount', with: '4' }
- wait_for { !page.has_button?('Update') }
- within('#actions_container') { click_button 'Update' }
-
- expect(promotion.path).to eq('content/cvv')
- expect(promotion.code).to be_blank
- expect(promotion.rules).to be_blank
-
- first_action = promotion.actions.first
- expect(first_action.class).to eq(Spree::Promotion::Actions::CreateAdjustment)
- first_action_calculator = first_action.calculator
- expect(first_action_calculator.class).to eq(Spree::Calculator::FlatRate)
- expect(first_action_calculator.preferred_amount).to eq(4)
- end
-
- it "allows an admin to create a promotion that adds a 'free' item to the cart" do
- create(:product, name: 'RoR Mug')
- fill_in 'Name', with: 'Promotion'
- fill_in 'Code', with: 'complex'
- click_button 'Create'
- promotion = Spree::Promotion.find_by(name: 'Promotion')
-
- expect(page).to have_content(promotion.name)
-
- select2 'Create line items', from: 'Add action of type'
-
- within('#action_fields') { click_button 'Add' }
-
- select2_open label: 'Variant'
- select2_search 'RoR Mug', label: 'Variant'
- select2_select 'RoR Mug', from: 'Variant', match: :first
-
- wait_for { !page.has_button?('Update') }
- within('#actions_container') { click_button 'Update' }
-
- select2 'Create whole-order adjustment', from: 'Add action of type'
- within('#new_promotion_action_form') { click_button 'Add' }
- select2 'Flat Rate', from: 'Calculator', search: true, match: :first
- wait_for { !page.has_button?('Update') }
- within('#actions_container') { click_button 'Update' }
- within('.create_adjustment .calculator-fields') { fill_in 'Amount', with: '40.00' }
- wait_for { !page.has_button?('Update') }
- within('#actions_container') { click_button 'Update' }
-
- expect(promotion.code).to eq('complex')
-
- first_action = promotion.actions.first
- expect(first_action.class).to eq(Spree::Promotion::Actions::CreateLineItems)
- expect(first_action.promotion_action_line_items).not_to be_empty
- end
-
- it 'ceasing to be eligible for a promotion with item total rule then becoming eligible again' do
- fill_in 'Name', with: 'Promotion'
- click_button 'Create'
- promotion = Spree::Promotion.find_by(name: 'Promotion')
-
- expect(page).to have_content(promotion.name)
-
- select2 'Item total', from: 'Add rule of type'
- within('#rule_fields') { click_button 'Add' }
- fill_in id: 'promotion_promotion_rules_attributes_1_preferred_amount_min', with: '50'
- fill_in id: 'promotion_promotion_rules_attributes_1_preferred_amount_max', with: '150'
- wait_for { !page.has_button?('Update') }
- within('#rule_fields') { click_button 'Update' }
-
- select2 'Create whole-order adjustment', from: 'Add action of type'
- within('#action_fields') { click_button 'Add' }
- select2 'Flat Rate', from: 'Calculator', search: true, match: :first
- wait_for { !page.has_button?('Update') }
- within('#actions_container') { click_button 'Update' }
- within('.calculator-fields') { fill_in 'Amount', with: '5' }
- wait_for { !page.has_button?('Update') }
- within('#actions_container') { click_button 'Update' }
-
- first_rule = promotion.rules.first
- expect(first_rule.class).to eq(Spree::Promotion::Rules::ItemTotal)
- expect(first_rule.preferred_amount_min).to eq(50)
- expect(first_rule.preferred_amount_max).to eq(150)
-
- first_action = promotion.actions.first
- expect(first_action.class).to eq(Spree::Promotion::Actions::CreateAdjustment)
- expect(first_action.calculator.class).to eq(Spree::Calculator::FlatRate)
- expect(first_action.calculator.preferred_amount).to eq(5)
- end
- end
-
- context 'filtering promotions' do
- let!(:promotion_category) { create(:promotion_category, name: 'Welcome Category') }
-
- it 'renders selected filters' do
- visit spree.admin_promotions_path
-
- click_on 'Filter'
-
- within('#table-filter') do
- fill_in 'q_name_cont', with: 'welcome'
- fill_in 'q_code_cont', with: 'rx01welcome'
- fill_in 'q_path_cont', with: 'path_promo'
- select2 'Welcome Category', from: 'Promotion Category'
- end
-
- click_on 'Filter Results'
-
- within('.table-active-filters') do
- expect(page).to have_content('Name: welcome')
- expect(page).to have_content('Code: rx01welcome')
- expect(page).to have_content('Path: path_promo')
- expect(page).to have_content('Promotion Category: Welcome Category')
- end
- end
- end
-end
diff --git a/backend/spec/features/admin/promotions/option_value_rule_spec.rb b/backend/spec/features/admin/promotions/option_value_rule_spec.rb
deleted file mode 100644
index c2d8f6b9d0..0000000000
--- a/backend/spec/features/admin/promotions/option_value_rule_spec.rb
+++ /dev/null
@@ -1,70 +0,0 @@
-require 'spec_helper'
-
-describe 'Promotion with option value rule', type: :feature do
- stub_authorization!
-
- let(:variant) { create :variant }
- let!(:product) { variant.product }
- let!(:option_value) { variant.option_values.first }
-
- let(:promotion) { create :promotion }
-
- before do
- visit spree.edit_admin_promotion_path(promotion)
- end
-
- it 'adding an option value rule', js: true do
- select2 'Option Value(s)', from: 'Add rule of type'
- within('#rule_fields') { click_button 'Add' }
-
- within('#rules .promotion-block') do
- click_button 'Add'
-
- expect(page).to have_content('Product')
- expect(page).to have_content('Option Values')
- end
-
- within('.promo-rule-option-value') do
- select2 product.name, css: '.product-select', search: true
- select2 option_value.name, css: '.option-value-select', search: true
- end
-
- wait_for { !page.has_button?('Update') }
- within('#rules_container') { click_button 'Update' }
-
- first_rule = promotion.rules.reload.first
- expect(first_rule.class).to eq Spree::Promotion::Rules::OptionValue
- expect(first_rule.preferred_eligible_values).to eq Hash[product.id => [option_value.id]]
- end
-
- context 'with an existing option value rule' do
- let(:variant1) { create :variant }
- let(:variant2) { create :variant }
-
- before do
- rule = Spree::Promotion::Rules::OptionValue.new
- rule.promotion = promotion
- rule.preferred_eligible_values = Hash[
- variant1.product_id => variant1.option_values.pluck(:id),
- variant2.product_id => variant2.option_values.pluck(:id)
- ]
- rule.save!
-
- visit spree.edit_admin_promotion_path(promotion)
- end
-
- it 'deleting a product', js: true do
- within('.promo-rule-option-value:last-child') do
- find('.delete').click
- end
-
- wait_for { !page.has_button?('Update') }
- within('#rule_fields') { click_button 'Update' }
-
- first_rule = promotion.rules.reload.first
- expect(first_rule.preferred_eligible_values).to eq(
- Hash[variant1.product_id => variant1.option_values.pluck(:id)]
- )
- end
- end
-end
diff --git a/backend/spec/features/admin/promotions/promotion_spec.rb b/backend/spec/features/admin/promotions/promotion_spec.rb
deleted file mode 100644
index 67d1a30149..0000000000
--- a/backend/spec/features/admin/promotions/promotion_spec.rb
+++ /dev/null
@@ -1,52 +0,0 @@
-require 'spec_helper'
-
-describe 'Create New Promotion', type: :feature, js: true do
- stub_authorization!
-
- let(:store) { Spree::Store.default }
- let!(:store_2) { create(:store) }
-
- context 'coupon promotions' do
- before do
- visit spree.new_admin_promotion_path
- end
-
- it 'Checkbox generates random promotion code' do
- fill_in 'Name', with: 'Promotion 1'
- check 'Generate coupon code'
-
- click_button 'Create'
-
- promotion = store.promotions.find_by!(name: 'Promotion 1')
- expect(page).to have_field(id: 'promotion_code', with: promotion.code)
- expect(promotion.stores).to eq([store])
- end
-
- it 'Allows you to set a promotion with start and end time' do
- fill_in 'Name', with: 'Promotion 2'
-
- fill_in_date_picker('promotion_starts_at', { year: 2012, month: 1, day: 18, hour: 16, minute: 45 })
- fill_in_date_picker('promotion_expires_at', { year: 2013, month: 3, day: 25, hour: 22, minute: 10 })
-
- fill_in 'Code', with: 'Random 2323'
-
- click_button 'Create'
-
- promotion = store.promotions.last
- expect(promotion.starts_at).to eq(DateTime.new(2012, 1, 18, 16, 45))
- expect(promotion.expires_at).to eq(DateTime.new(2013, 3, 25, 22, 10))
- end
-
- it 'allows assigning multiple stores' do
- fill_in 'Name', with: 'Promotion 3'
- select2 store_2.unique_name, from: 'Stores'
-
- click_button 'Create'
-
- expect(page).to have_content('successfully created')
-
- promotion = store.promotions.find_by!(name: 'Promotion 3')
- expect(promotion.stores).to contain_exactly(store, store_2)
- end
- end
-end
diff --git a/backend/spec/features/admin/promotions/taxon_rule_spec.rb b/backend/spec/features/admin/promotions/taxon_rule_spec.rb
deleted file mode 100644
index a7a0475bab..0000000000
--- a/backend/spec/features/admin/promotions/taxon_rule_spec.rb
+++ /dev/null
@@ -1,50 +0,0 @@
-require 'spec_helper'
-
-describe 'Promotion with taxon rule', type: :feature do
- stub_authorization!
-
- let!(:taxons) { create_list(:taxon, 2) }
- let!(:taxon1) { taxons.first }
- let!(:taxon2) { taxons.second }
-
- let!(:promotion) { create :promotion }
-
- before do
- visit spree.edit_admin_promotion_path(promotion)
- end
-
- context 'when there are no taxon rules' do
- it 'adding a taxon rule', js: true do
- select2 'Taxon(s)', from: 'Add rule of type'
- within('#rule_fields') { click_button 'Add' }
-
- within('.promotion_rule') do
- select2 taxon1.name, css: '.taxons_rule_taxons', search: true
- select2 taxon2.name, css: '.taxons_rule_taxons', search: true
- end
-
- within('#rules_container') { click_button 'Update' }
-
- first_rule = promotion.rules.reload.first
- expect(first_rule.class).to eq Spree::Promotion::Rules::Taxon
- expect(first_rule.taxons).to contain_exactly(taxon1, taxon2)
- end
- end
-
- context 'when there is a taxon rule' do
- before do
- rule = Spree::Promotion::Rules::Taxon.new(promotion: promotion)
- rule.save!
- rule.update!(taxons: taxons)
-
- visit spree.edit_admin_promotion_path(promotion)
- end
-
- it 'displays taxon names', js: true do
- within('.promotion_rule') do
- expect(page).to have_content(taxon1.name)
- expect(page).to have_content(taxon2.name)
- end
- end
- end
-end
diff --git a/backend/spec/features/admin/promotions/tiered_calculator_spec.rb b/backend/spec/features/admin/promotions/tiered_calculator_spec.rb
deleted file mode 100644
index b748ba6378..0000000000
--- a/backend/spec/features/admin/promotions/tiered_calculator_spec.rb
+++ /dev/null
@@ -1,68 +0,0 @@
-require 'spec_helper'
-
-describe 'Tiered Calculator Promotions' do
- stub_authorization!
-
- let(:promotion) { create :promotion }
-
- before do
- visit spree.edit_admin_promotion_path(promotion)
- end
-
- it 'adding a tiered percent calculator', js: true do
- select2 'Create whole-order adjustment', from: 'Add action of type'
- within('#action_fields') { click_button 'Add' }
-
- select2 'Tiered Percent', from: 'Calculator'
- within('#actions_container') { click_button 'Update' }
-
- within('#actions_container .settings') do
- expect(page).to have_content('Base Percent')
- expect(page).to have_content('Tiers')
-
- click_button 'Add'
- end
-
- fill_in 'Base Percent', with: 5
-
- within('.tier') do
- fill_in(class: 'js-base-input', with: '100')
- fill_in(class: 'js-value-input', with: '10')
- end
- within('#actions_container') { click_button 'Update' }
-
- first_action = promotion.actions.first
- expect(first_action.class).to eq Spree::Promotion::Actions::CreateAdjustment
-
- first_action_calculator = first_action.calculator
- expect(first_action_calculator.class).to eq Spree::Calculator::TieredPercent
- expect(first_action_calculator.preferred_base_percent).to eq 5
- expect(first_action_calculator.preferred_tiers).to eq Hash[100.0 => 10.0]
- end
-
- context 'with an existing tiered flat rate calculator' do
- let(:promotion) { create :promotion, :with_order_adjustment }
-
- before do
- action = promotion.actions.first
-
- action.calculator = Spree::Calculator::TieredFlatRate.new
- action.calculator.preferred_base_amount = 5
- action.calculator.preferred_tiers = Hash[100 => 10, 200 => 15, 300 => 20]
- action.calculator.save!
-
- visit spree.edit_admin_promotion_path(promotion)
- end
-
- it 'deleting a tier', js: true do
- within('.tier:nth-child(2)') do
- click_icon :delete
- end
-
- within('#actions_container') { click_button 'Update' }
-
- calculator = promotion.actions.first.calculator
- expect(calculator.preferred_tiers).to eq Hash[100.0 => 10.0, 300.0 => 20.0]
- end
- end
-end
diff --git a/backend/spec/features/admin/promotions/user_rule_spec.rb b/backend/spec/features/admin/promotions/user_rule_spec.rb
deleted file mode 100644
index 39a82ca957..0000000000
--- a/backend/spec/features/admin/promotions/user_rule_spec.rb
+++ /dev/null
@@ -1,69 +0,0 @@
-require 'spec_helper'
-
-describe 'Promotion with user rule', type: :feature, js: true do
- stub_authorization!
-
- let!(:first_user) { create(:user, email: '[email protected]') }
- let!(:second_user) { create(:user, email: '[email protected]') }
- let!(:third_user) { create(:user, email: '[email protected]') }
- let!(:fourth_user) { create(:user, email: '[email protected]') }
- let!(:fifth_user) { create(:user, email: '[email protected]') }
-
- before do
- visit spree.new_admin_promotion_path
- end
-
- it 'creates new promotion with user rule' do
- fill_in 'Name', with: 'User promotion'
- click_button 'Create'
-
- expect(page).to have_content('Promotion "User promotion" has been successfully created!')
-
- select2 'User', from: 'Add rule of type', match: :first
- within('#rule_fields') { click_button 'Add' }
-
- select2_open label: 'Choose users'
- select2_search 'first', label: 'Choose users'
-
- expect(page).to have_content('[email protected]')
-
- expect(page).not_to have_content('[email protected]')
- expect(page).not_to have_content('[email protected]')
-
- select2_select '[email protected]', from: 'Choose users', match: :first
-
- wait_for { !page.has_button?('Update') }
- within('#rules_container') { click_button 'Update' }
-
- expect(page).to have_content('Promotion "User promotion" has been successfully updated!')
- end
-
- it 'user dropdown shows user emails that matches user query #1' do
- fill_in 'Name', with: 'User promotion'
- click_button 'Create'
-
- select2 'User', from: 'Add rule of type', match: :first
- within('#rule_fields') { click_button 'Add' }
-
- select2_open label: 'Choose users'
- select2_search 'example', label: 'Choose users'
-
- expect(page).to have_content('[email protected]')
- expect(page).to have_content('[email protected]')
- expect(page).to have_content('[email protected]')
- end
-
- it 'user dropdown shows user emails that matches user query #2' do
- fill_in 'Name', with: 'User promotion'
- click_button 'Create'
-
- select2 'User', from: 'Add rule of type', match: :first
- within('#rule_fields') { click_button 'Add' }
-
- select2_open label: 'Choose users'
- select2_search 'test', label: 'Choose users'
-
- expect(page).to have_content('[email protected]')
- expect(page).to have_content('[email protected]')
- end
-end
diff --git a/backend/spec/features/admin/properties/edit_property_spec.rb b/backend/spec/features/admin/properties/edit_property_spec.rb
deleted file mode 100644
index d130cdbe87..0000000000
--- a/backend/spec/features/admin/properties/edit_property_spec.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-require 'spec_helper'
-
-describe 'Property edit spec', type: :feature, js: true do
- stub_authorization!
-
- let(:property) { create(:property, filterable: false) }
-
- context 'editing option type' do
- before do
- visit spree.edit_admin_property_path(property)
- end
-
- it 'allows to update filtering attribute of option type' do
- expect(page).to have_unchecked_field('property_filterable')
-
- check('property_filterable')
- click_button 'Update'
-
- expect(page).to have_content 'successfully updated!'
-
- within("#spree_property_#{property.id}") { click_icon(:edit) }
- expect(page).to have_checked_field('property_filterable')
- end
- end
-end
diff --git a/backend/spec/features/admin/refund_reasons/refund_reasons_spec.rb b/backend/spec/features/admin/refund_reasons/refund_reasons_spec.rb
deleted file mode 100644
index d28a1968b6..0000000000
--- a/backend/spec/features/admin/refund_reasons/refund_reasons_spec.rb
+++ /dev/null
@@ -1,62 +0,0 @@
-require 'spec_helper'
-
-describe 'RefundReason', type: :feature, js: true do
- stub_authorization!
-
- let!(:amount) { 100.0 }
- let!(:payment_amount) { amount * 2 }
- let!(:payment_method) { create(:credit_card_payment_method) }
- let!(:payment) { create(:payment, amount: payment_amount, payment_method: payment_method) }
- let!(:refund_reason) { create(:default_refund_reason, name: 'Reason #1', mutable: true) }
- let!(:refund_reason2) { create(:refund_reason, name: 'Reason #2', mutable: true) }
-
- before do
- create(:refund, payment: payment, amount: amount, reason: refund_reason, transaction_id: nil)
- visit spree.admin_refund_reasons_path
- end
-
- describe 'destroy' do
- it 'has refund reasons' do
- within('.table #refund_reasons') do
- expect(page).to have_content(refund_reason.name)
- expect(page).to have_content(refund_reason2.name)
- end
- end
-
- context 'should not destroy an associated option type' do
- before { within_row(1) { delete_product_property } }
-
- it 'has persisted refund reasons' do
- within('.table #refund_reasons') do
- expect(page).to have_content(refund_reason.name)
- expect(page).to have_content(refund_reason2.name)
- end
- end
-
- it(js: false) { expect(Spree::RefundReason.all).to include(refund_reason) }
- it(js: false) { expect(Spree::RefundReason.all).to include(refund_reason2) }
- end
-
- context 'should allow an admin to destroy a non associated option type' do
- before { within_row(2) { delete_product_property } }
-
- it 'has persisted refund reasons' do
- within('.table #refund_reasons') do
- expect(page).to have_content(refund_reason.name)
- expect(page).not_to have_content(refund_reason2.name)
- end
- end
-
- it(js: false) { expect(Spree::RefundReason.all).to include(refund_reason) }
- it(js: false) { expect(Spree::RefundReason.all).not_to include(refund_reason2) }
- end
-
- def delete_product_property
- accept_confirm do
- click_icon :delete
- end
- expect(page.document).to have_content('successfully removed!').
- or have_content('Cannot delete record')
- end
- end
-end
diff --git a/backend/spec/features/admin/reimbursement_type/edit_reimbursement_type_spec.rb b/backend/spec/features/admin/reimbursement_type/edit_reimbursement_type_spec.rb
deleted file mode 100644
index 0ca1a842cd..0000000000
--- a/backend/spec/features/admin/reimbursement_type/edit_reimbursement_type_spec.rb
+++ /dev/null
@@ -1,36 +0,0 @@
-require 'spec_helper'
-
-describe 'edit reimbursement type', type: :feature do
- stub_authorization!
- let(:r_type) do
- create(:reimbursement_type,
- name: 'Exchange',
- type: 'Spree::ReimbursementType::Exchange',
- active: true,
- mutable: true)
- end
-
- before do
- visit "/admin/reimbursement_types/#{r_type.id}/edit"
- end
-
- context 'with valid attributes' do
- it 'change name, active and mutable' do
- fill_in 'Name', with: 'New Credit'
- uncheck 'Mutable'
- uncheck 'Active'
-
- expect { click_button 'Create' }.not_to change(Spree::ReimbursementType, :count)
-
- r_type.reload
-
- expect(r_type.active).to eq false
- expect(r_type.mutable).to eq false
- expect(page).to have_content('New Credit')
- end
- end
-
- it 'view should have select field' do
- expect(page).not_to have_css('div#reimbursement_type_type_field.form-group.field')
- end
-end
diff --git a/backend/spec/features/admin/reimbursement_type/new_reimbursement_type_spec.rb b/backend/spec/features/admin/reimbursement_type/new_reimbursement_type_spec.rb
deleted file mode 100644
index bc0faa2a78..0000000000
--- a/backend/spec/features/admin/reimbursement_type/new_reimbursement_type_spec.rb
+++ /dev/null
@@ -1,62 +0,0 @@
-require 'spec_helper'
-
-describe 'new reimbursement type', type: :feature do
- stub_authorization!
-
- before do
- visit '/admin/reimbursement_types/new'
- end
-
- it 'view should have select field' do
- expect(page).to have_css('div#reimbursement_type_type_field.form-group.field')
- end
-
- context 'with valid attributes' do
- it 'credit type' do
- fill_in 'Name', with: 'Credit'
- select 'Spree::ReimbursementType::Credit', from: 'reimbursement_type_type'
-
- expect { click_button 'Create' }.to change(Spree::ReimbursementType, :count).by(1)
-
- expect(page).to have_content('Credit')
- end
-
- it 'exchange type' do
- fill_in 'Name', with: 'Exchange'
- select 'Spree::ReimbursementType::Exchange', from: 'reimbursement_type_type'
-
- expect { click_button 'Create' }.to change(Spree::ReimbursementType, :count).by(1)
-
- expect(page).to have_content('Exchange')
- end
-
- it 'original payment type' do
- fill_in 'Name', with: 'OriginalPayment'
- select 'Spree::ReimbursementType::OriginalPayment', from: 'reimbursement_type_type'
-
- expect { click_button 'Create' }.to change(Spree::ReimbursementType, :count).by(1)
-
- expect(page).to have_content('OriginalPayment')
- end
-
- it 'store credit type' do
- fill_in 'Name', with: 'StoreCredit'
- select 'Spree::ReimbursementType::StoreCredit', from: 'reimbursement_type_type'
-
- expect { click_button 'Create' }.to change(Spree::ReimbursementType, :count).by(1)
-
- expect(page).to have_content('StoreCredit')
- end
- end
-
- context 'with invalid params' do
- it 'without name' do
- fill_in 'Name', with: ''
- select 'Spree::ReimbursementType::StoreCredit', from: 'reimbursement_type_type'
-
- expect { click_button 'Create' }.not_to change(Spree::ReimbursementType, :count)
-
- expect(page).to have_content("Name can't be blank")
- end
- end
-end
diff --git a/backend/spec/features/admin/reports_spec.rb b/backend/spec/features/admin/reports_spec.rb
deleted file mode 100644
index c150e5e2fc..0000000000
--- a/backend/spec/features/admin/reports_spec.rb
+++ /dev/null
@@ -1,61 +0,0 @@
-require 'spec_helper'
-
-describe 'Reports', type: :feature do
- stub_authorization!
-
- context 'visiting the admin reports page' do
- it 'has the right content' do
- visit spree.admin_path
- click_link 'Reports'
- click_link 'Sales Total'
-
- expect(page).to have_content('Sales Totals')
- expect(page).to have_content('Item Total')
- expect(page).to have_content('Adjustment Total')
- expect(page).to have_content('Sales Total')
- end
- end
-
- context 'searching the admin reports page' do
- before do
- order = create(:order)
- order.update_columns(adjustment_total: 100)
- order.completed_at = Time.current
- order.save!
-
- order = create(:order)
- order.update_columns(adjustment_total: 200)
- order.completed_at = Time.current
- order.save!
-
- # incomplete order
- order = create(:order)
- order.update_columns(adjustment_total: 50)
- order.save!
-
- order = create(:order)
- order.update_columns(adjustment_total: 200)
- order.completed_at = 3.years.ago
- order.created_at = 3.years.ago
- order.save!
-
- order = create(:order)
- order.update_columns(adjustment_total: 200)
- order.completed_at = 3.years.from_now
- order.created_at = 3.years.from_now
- order.save!
- end
-
- it 'allows me to search for reports' do
- visit spree.admin_path
- click_link 'Reports'
- click_link 'Sales Total'
-
- fill_in 'q_completed_at_gt', with: 1.week.ago
- fill_in 'q_completed_at_lt', with: 1.week.from_now
- click_button 'Search'
-
- expect(page).to have_content('$300.00')
- end
- end
-end
diff --git a/backend/spec/features/admin/return_authorization_reasons/return_authorization_reasons_spec.rb b/backend/spec/features/admin/return_authorization_reasons/return_authorization_reasons_spec.rb
deleted file mode 100644
index 63be258abf..0000000000
--- a/backend/spec/features/admin/return_authorization_reasons/return_authorization_reasons_spec.rb
+++ /dev/null
@@ -1,67 +0,0 @@
-require 'spec_helper'
-
-describe 'ReturnAuthorizationReason', type: :feature, js: true do
- stub_authorization!
-
- let(:store) { Spree::Store.default }
- let!(:order) { create(:shipped_order, store: store) }
- let!(:stock_location) { create(:stock_location) }
- let!(:rma_reason) { create(:return_authorization_reason, name: 'Defect #1', mutable: true) }
- let!(:rma_reason2) { create(:return_authorization_reason, name: 'Defect #2', mutable: true) }
-
- before do
- create(
- :return_authorization,
- order: order,
- stock_location: stock_location,
- reason: rma_reason
- )
-
- visit spree.admin_return_authorization_reasons_path
- end
-
- describe 'destroy' do
- it 'has return authorization reasons' do
- within('.table #return_authorization_reasons') do
- expect(page).to have_content(rma_reason.name)
- expect(page).to have_content(rma_reason2.name)
- end
- end
-
- context 'should not destroy an associated option type' do
- before { within_row(1) { delete_product_property } }
-
- it 'has persisted return authorization reasons' do
- within('.table #return_authorization_reasons') do
- expect(page).to have_content(rma_reason.name)
- expect(page).to have_content(rma_reason2.name)
- end
- end
-
- it(js: false) { expect(Spree::ReturnAuthorizationReason.all).to include(rma_reason) }
- it(js: false) { expect(Spree::ReturnAuthorizationReason.all).to include(rma_reason2) }
- end
-
- context 'should allow an admin to destroy a non associated option type' do
- before { within_row(2) { delete_product_property } }
-
- it 'has persisted return authorization reasons' do
- within('.table #return_authorization_reasons') do
- expect(page).to have_content(rma_reason.name)
- expect(page).not_to have_content(rma_reason2.name)
- end
- end
-
- it(js: false) { expect(Spree::ReturnAuthorizationReason.all).to include(rma_reason) }
- it(js: false) { expect(Spree::ReturnAuthorizationReason.all).not_to include(rma_reason2) }
- end
-
- def delete_product_property
- accept_confirm do
- click_icon :delete
- end
- expect(page.document).to have_content('successfully removed!').
- or have_content('Cannot delete record')
- end
- end
-end
diff --git a/backend/spec/features/admin/returns/customer_returns_spec.rb b/backend/spec/features/admin/returns/customer_returns_spec.rb
deleted file mode 100644
index bc74a9a1b7..0000000000
--- a/backend/spec/features/admin/returns/customer_returns_spec.rb
+++ /dev/null
@@ -1,95 +0,0 @@
-require 'spec_helper'
-
-describe 'Customer Returns', type: :feature do
- stub_authorization!
- let!(:customer_return) { create(:customer_return, created_at: Time.current) }
-
- describe 'listing' do
- let!(:customer_return_2) { create(:customer_return, created_at: Time.current - 1.day) }
-
- before do
- visit spree.admin_customer_returns_path
- end
-
- it 'lists sorted by created_at' do
- within_row(1) { expect(page).to have_content(customer_return.number) }
- within_row(2) { expect(page).to have_content(customer_return_2.number) }
- end
-
- it 'displays pre tax total' do
- within_row(1) { expect(page).to have_content(customer_return.display_pre_tax_total.to_html) }
- end
-
- it 'displays order number' do
- within_row(1) { expect(page).to have_content(customer_return.order.number) }
- end
-
- it 'displays customer return number' do
- within_row(1) { expect(page).to have_content(customer_return.number) }
- end
-
- it 'displays status' do
- within_row(1) { expect(page).to have_content(Spree.t(:incomplete)) }
- end
-
- it 'has edit link' do
- expect(page).to have_css('.icon-edit')
- end
- end
-
- describe 'searching' do
- let!(:customer_return_2) { create(:customer_return) }
-
- before do
- visit spree.admin_customer_returns_path
- end
-
- it 'searches on number' do
- click_on 'Filter'
- fill_in 'q_number_cont', with: customer_return.number
- click_on 'Search'
-
- expect(page).to have_content(customer_return.number)
- expect(page).not_to have_content(customer_return_2.number)
-
- click_on 'Filter'
- fill_in 'q_number_cont', with: customer_return_2.number
- click_on 'Search'
-
- expect(page).to have_content(customer_return_2.number)
- expect(page).not_to have_content(customer_return.number)
- end
-
- it 'renders selected filters', js: true do
- click_on 'Filter'
-
- within('#table-filter') do
- fill_in 'q_number_cont', with: 'RX001-01'
- end
-
- click_on 'Search'
-
- within('.table-active-filters') do
- expect(page).to have_content('Number: RX001-01')
- end
- end
- end
-
- describe 'link' do
- describe 'order number' do
- it 'opens orders edit page' do
- visit spree.admin_customer_returns_path
- click_link customer_return.order.number
- expect(page).to have_content("Orders / #{customer_return.order.number}")
- end
- end
-
- describe 'customer return number' do
- it 'opens customer return edit page' do
- visit spree.admin_customer_returns_path
- click_link customer_return.number
- expect(page).to have_content("Customer Return ##{customer_return.number}")
- end
- end
- end
-end
diff --git a/backend/spec/features/admin/returns/return_authorizations_spec.rb b/backend/spec/features/admin/returns/return_authorizations_spec.rb
deleted file mode 100644
index 492e7a8567..0000000000
--- a/backend/spec/features/admin/returns/return_authorizations_spec.rb
+++ /dev/null
@@ -1,167 +0,0 @@
-require 'spec_helper'
-
-describe 'Return Authorizations', type: :feature do
- stub_authorization!
-
- describe 'listing' do
- let!(:return_authorization) { create(:return_authorization, created_at: Time.current) }
- let!(:return_authorization_2) { create(:return_authorization, created_at: Time.current - 1.day) }
-
- before do
- visit spree.admin_return_authorizations_path
- end
-
- it 'lists return authorizations sorted by created_at' do
- within_row(1) { expect(page).to have_content(return_authorization.number) }
- within_row(2) { expect(page).to have_content(return_authorization_2.number) }
- end
-
- it 'displays order number' do
- within_row(1) { expect(page).to have_content(return_authorization.order.number) }
- end
-
- it 'displays return authorization number' do
- within_row(1) { expect(page).to have_content(return_authorization.number) }
- end
-
- it 'displays state' do
- return_authorization_state = Spree.t("return_authorization_states.#{return_authorization.state}")
- within_row(1) { expect(page).to have_content(return_authorization_state) }
- end
-
- it 'has edit link' do
- expect(page).to have_css('.icon-edit')
- end
- end
-
- describe 'searching' do
- let!(:return_authorization) { create(:return_authorization, state: 'authorized') }
- let!(:return_authorization_2) { create(:return_authorization, state: 'canceled') }
-
- before do
- visit spree.admin_return_authorizations_path
- end
-
- it 'searches on number' do
- click_on 'Filter'
- fill_in 'q_number_cont', with: return_authorization.number
- click_on 'Search'
-
- expect(page).to have_content(return_authorization.number)
- expect(page).not_to have_content(return_authorization_2.number)
-
- click_on 'Filter'
- fill_in 'q_number_cont', with: return_authorization_2.number
- click_on 'Search'
-
- expect(page).to have_content(return_authorization_2.number)
- expect(page).not_to have_content(return_authorization.number)
- end
-
- it 'searches on status' do
- click_on 'Filter'
- select Spree.t("return_authorization_states.#{return_authorization.state}"), from: 'Status'
- click_on 'Search'
-
- expect(page).to have_content(return_authorization.number)
- expect(page).not_to have_content(return_authorization_2.number)
-
- click_on 'Filter'
- select Spree.t("return_authorization_states.#{return_authorization_2.state}"), from: 'Status'
- click_on 'Search'
-
- expect(page).to have_content(return_authorization_2.number)
- expect(page).not_to have_content(return_authorization.number)
- end
-
- it 'renders selected filters', js: true do
- click_on 'Filter'
-
- within('#table-filter') do
- fill_in 'q_number_cont', with: 'RX001-01'
- select2 'Authorized', from: 'Status'
- end
-
- click_on 'Search'
-
- within('.table-active-filters') do
- expect(page).to have_content('Number: RX001-01')
- expect(page).to have_content('Status: Authorized')
- end
- end
- end
-
- describe 'link' do
- let!(:return_authorization) { create(:return_authorization) }
-
- describe 'order number' do
- it 'opens orders edit page' do
- visit spree.admin_return_authorizations_path
- click_link return_authorization.order.number
- expect(page).to have_content("Orders / #{return_authorization.order.number}")
- end
- end
-
- describe 'return authorization number' do
- it 'opens return authorization edit page' do
- visit spree.admin_return_authorizations_path
- click_link return_authorization.number
- expect(page).to have_content(return_authorization.number)
- end
- end
-
- describe 'authorized' do
- let!(:return_authorization) { create(:return_authorization, state: 'authorized') }
- let!(:return_authorization_2) { create(:return_authorization, state: 'canceled') }
-
- it 'only shows authorized return authorizations' do
- visit spree.admin_return_authorizations_path
- within('#spreePageTabs') do
- click_link 'Authorized'
- end
-
- expect(page).to have_content(return_authorization.number)
- expect(page).not_to have_content(return_authorization_2.number)
- end
-
- it 'preselects authorized status in filter' do
- visit spree.admin_return_authorizations_path
- within('#spreePageTabs') do
- click_link 'Authorized'
- end
-
- within('#table-filter') do
- return_authorization_state = Spree.t("return_authorization_states.#{return_authorization.state}")
- expect(page).to have_select('Status', selected: return_authorization_state)
- end
- end
- end
-
- describe 'canceled' do
- let!(:return_authorization) { create(:return_authorization, state: 'canceled') }
- let!(:return_authorization_2) { create(:return_authorization, state: 'authorized') }
-
- it 'only shows canceled return authorizations' do
- visit spree.admin_return_authorizations_path
- within('#spreePageTabs') do
- click_link 'Canceled'
- end
-
- expect(page).to have_content(return_authorization.number)
- expect(page).not_to have_content(return_authorization_2.number)
- end
-
- it 'preselects canceled status in filter' do
- visit spree.admin_return_authorizations_path
- within('#spreePageTabs') do
- click_link 'Canceled'
- end
-
- within('#table-filter') do
- return_authorization_state = Spree.t("return_authorization_states.#{return_authorization.state}")
- expect(page).to have_select('Status', selected: return_authorization_state)
- end
- end
- end
- end
-end
diff --git a/backend/spec/features/admin/stock_transfer_spec.rb b/backend/spec/features/admin/stock_transfer_spec.rb
deleted file mode 100644
index bf5a34596c..0000000000
--- a/backend/spec/features/admin/stock_transfer_spec.rb
+++ /dev/null
@@ -1,124 +0,0 @@
-require 'spec_helper'
-
-describe 'Stock Transfers', type: :feature, js: true do
- stub_authorization!
-
- it 'shows variants with options text' do
- create(:stock_location_with_items, name: 'NY')
-
- product = Spree::Product.first
- variant = create(:variant, product: product)
- variant.set_option_value('Color', 'Green')
-
- visit spree.admin_stock_transfers_path
- click_on 'New Stock Transfer'
-
- select2_open label: 'Variant'
- select2_search variant.sku, from: 'Variant'
- select2_select variant.name, from: 'Variant', match: :first
-
- content = "#{variant.name} (#{variant.options_text}) - #{variant.sku}"
- expect(page).to have_content(content)
- end
-
- it 'transfer between 2 locations' do
- create(:stock_location_with_items, name: 'NY') # source_location
- create(:stock_location, name: 'SF') # destination_location
-
- variant = Spree::Variant.last
-
- visit spree.admin_stock_transfers_path
- click_on 'New Stock Transfer'
- fill_in 'reference', with: 'PO 666'
-
- select2_open label: 'Variant'
- select2_search variant.name, from: 'Variant'
- select2_select variant.name, from: 'Variant', match: :first
-
- click_button 'Add'
- click_button 'Transfer Stock'
-
- expect(page).to have_content('Reference PO 666')
- expect(page).to have_content('NY')
- expect(page).to have_content('SF')
- expect(page).to have_content(variant.name)
-
- transfer = Spree::StockTransfer.last
- expect(transfer.stock_movements.size).to eq 2
- end
-
- it 'does not transfer if variant is not available on hand' do
- create(:stock_location_with_items, name: 'NY') # source_location
- create(:stock_location, name: 'SF') # destination_location
-
- product = create(:product, stores: Spree::Store.all)
- Spree::StockLocation.first.stock_items.where(variant_id: product.master.id).first.adjust_count_on_hand(0)
-
- visit spree.admin_stock_transfers_path
- click_on 'New Stock Transfer'
- fill_in 'reference', with: 'PO 666'
-
- select2_open label: 'Variant'
- select2_search product.master.name, from: 'Variant'
- select2_select product.master.name, from: 'Variant', match: :first
-
- click_button 'Add'
- click_button 'Transfer Stock'
-
- expect(page).to have_content('Some variants are not available')
- end
-
- describe 'received stock transfer' do
- def it_is_received_stock_transfer(page)
- expect(page).to have_content('Reference PO 666')
- expect(page).not_to have_selector('#stock-location-source')
- expect(page).to have_selector('#stock-location-destination')
-
- transfer = Spree::StockTransfer.last
- expect(transfer.stock_movements.size).to eq 1
- expect(transfer.source_location).to be_nil
- end
-
- it 'receive stock to a single location' do
- create(:stock_location_with_items, name: 'NY') # source_location
- create(:stock_location, name: 'SF') # destination_location
-
- variant = Spree::Variant.last
-
- visit spree.new_admin_stock_transfer_path
-
- fill_in 'reference', with: 'PO 666'
- check 'transfer_receive_stock'
- select2 'NY', from: 'Destination'
-
- select2_open label: 'Variant'
- select2_search variant.name, from: 'Variant'
- select2_select variant.name, from: 'Variant', match: :first
-
- click_button 'Add'
- click_button 'Transfer Stock'
-
- it_is_received_stock_transfer page
- end
-
- it 'forced to only receive there is only one location' do
- create(:stock_location_with_items, name: 'NY') # source_location
- variant = Spree::Variant.last
-
- visit spree.new_admin_stock_transfer_path
-
- fill_in 'reference', with: 'PO 666'
-
- select2 'NY', from: 'Destination'
-
- select2_open label: 'Variant'
- select2_search variant.name, from: 'Variant'
- select2_select variant.name, from: 'Variant', match: :first
-
- click_button 'Add'
- click_button 'Transfer Stock'
-
- it_is_received_stock_transfer page
- end
- end
-end
diff --git a/backend/spec/features/admin/store_credits_spec.rb b/backend/spec/features/admin/store_credits_spec.rb
deleted file mode 100644
index 3a9f621b6a..0000000000
--- a/backend/spec/features/admin/store_credits_spec.rb
+++ /dev/null
@@ -1,145 +0,0 @@
-require 'spec_helper'
-
-describe 'Store credits admin', type: :feature do
- stub_authorization!
-
- let(:store) { Spree::Store.default }
- let!(:admin_user) { create(:admin_user) }
- let!(:store_credit) { create(:store_credit, store: store) }
-
- before do
- allow(Spree.user_class).to receive(:find_by).and_return(store_credit.user)
- end
-
- describe 'visiting the store credits page' do
- before do
- visit spree.admin_path
- click_link 'Users'
- end
-
- it 'is on the store credits page' do
- click_link store_credit.user.email
- click_link 'Store Credits'
- expect(page).to have_current_path(spree.admin_user_store_credits_path(store_credit.user))
-
- store_credit_table = page.find('table', match: :first)
- expect(store_credit_table).to have_css('tr').once
- expect(store_credit_table).to have_content(Spree::Money.new(store_credit.amount, currency: store_credit.currency).to_s)
- expect(store_credit_table).to have_content(Spree::Money.new(store_credit.amount_used, currency: store_credit.currency).to_s)
- expect(store_credit_table).to have_content(store_credit.category_name)
- expect(store_credit_table).to have_content(store_credit.created_by_email)
- end
- end
-
- describe 'creating store credit' do
- before do
- visit spree.admin_path
- click_link 'Users'
- click_link store_credit.user.email
- click_link 'Store Credits'
- allow_any_instance_of(Spree::Admin::StoreCreditsController).to receive(:try_spree_current_user).and_return(admin_user)
- end
-
- describe 'with default currency' do
- let!(:store) { create(:store) }
-
- before do
- allow_any_instance_of(Spree::Admin::StoreCreditsController).to receive(:current_store).and_return(store)
- end
-
- it 'creates store credit and associate it with the user and store' do
- within find('#contentHeader') do
- click_link 'Add Store Credit'
- end
-
- page.fill_in 'store_credit_amount', with: '102.00'
- select 'Exchange', from: 'store_credit_category_id'
- click_button 'Create'
-
- expect(page).to have_current_path(spree.admin_user_store_credits_path(store_credit.user))
-
- store_credit_table = page.find('table', match: :first)
- expect(store_credit_table).to have_css('tr').twice
- expect(Spree::StoreCredit.count).to eq 2
- expect(Spree::StoreCredit.last.store).to eq(store)
- end
- end
-
- describe 'with selected currency' do
- it 'creates store credit and associate it with the user' do
- within find('#contentHeader') do
- click_link 'Add Store Credit'
- end
-
- page.fill_in 'store_credit_amount', with: '100.00'
- select 'EUR', from: 'store_credit_currency'
- select 'Exchange', from: 'store_credit_category_id'
- click_button 'Create'
-
- expect(page).to have_current_path(spree.admin_user_store_credits_path(store_credit.user))
-
- store_credit_table = page.find('table', match: :first)
- expect(store_credit_table).to have_css('tr').twice
- expect(Spree::StoreCredit.count).to eq 2
- expect(Spree::StoreCredit.last.currency).to eq 'EUR'
- expect(store_credit_table).to have_content('€100.00')
- end
- end
- end
-
- describe 'updating store credit' do
- let(:updated_amount) { '99.0' }
-
- before do
- visit spree.admin_path
- click_link 'Users'
- click_link store_credit.user.email
- click_link 'Store Credits'
- allow_any_instance_of(Spree::Admin::StoreCreditsController).to receive(:try_spree_current_user).and_return(admin_user)
- end
-
- it 'creates store credit and associate it with the user' do
- click_link 'Edit'
- page.fill_in 'store_credit_amount', with: updated_amount
- click_button 'Update'
-
- expect(page).to have_current_path(spree.admin_user_store_credits_path(store_credit.user))
- store_credit_table = page.first('table')
- expect(store_credit_table).to have_content(Spree::Money.new(updated_amount, currency: store_credit.currency).to_s)
- expect(store_credit.reload.amount.to_f).to eq updated_amount.to_f
- end
- end
-
- describe 'deleting store credit', js: true do
- before do
- visit spree.admin_path
- click_link 'Users'
- click_link store_credit.user.email
- click_link 'Store Credits'
- allow_any_instance_of(Spree::Admin::StoreCreditsController).to receive(:try_spree_current_user).and_return(admin_user)
- end
-
- it 'updates store credit in lifetime stats' do
- accept_confirm do
- click_icon :delete
- end
- expect(page).to have_css('#user-lifetime-stats #store_credit', text: Spree::Money.new(0).to_s)
- end
- end
-
- describe 'non-existent user' do
- before do
- visit spree.admin_path
- click_link 'Users'
- click_link store_credit.user.email
- store_credit.user.destroy
- allow(Spree.user_class).to receive(:find_by).and_return(nil)
- click_link 'Store Credits'
- allow_any_instance_of(Spree::Admin::StoreCreditsController).to receive(:try_spree_current_user).and_return(admin_user)
- end
-
- it 'displays flash withe error' do
- expect(page).to have_content(Spree.t(:user_not_found))
- end
- end
-end
diff --git a/backend/spec/features/admin/store_selector_spec.rb b/backend/spec/features/admin/store_selector_spec.rb
deleted file mode 100644
index 8e27bca061..0000000000
--- a/backend/spec/features/admin/store_selector_spec.rb
+++ /dev/null
@@ -1,59 +0,0 @@
-require 'spec_helper'
-
-describe 'Admin store switcher', type: :feature, js: true do
- stub_authorization!
-
- let!(:admin_user) { create(:admin_user) }
- let!(:store_one) { Spree::Store.default }
- let!(:store_two) { create(:store, url: 'www.example-one.com') }
- let!(:store_three) { create(:store, url: 'www.example-two.com') }
- let(:port) { Capybara.current_session.server.port }
-
- context 'on the orders page of admin' do
- before do
- visit spree.admin_path
- end
-
- it 'allows to change the url to the seleted store and returns you to orders page' do
- find('a#storeSelectorDropdown').click
-
- expect(page).to have_selector(:css, "a[href*='#{store_one.formatted_url}:#{port}/admin/orders']")
- expect(page).to have_selector(:css, "a[href*='#{store_two.formatted_url}:#{port}/admin/orders']")
- expect(page).to have_selector(:css, "a[href*='#{store_three.formatted_url}:#{port}/admin/orders']")
- end
- end
-
- context 'on the products page of admin' do
- before do
- visit spree.admin_products_path
- end
-
- it 'allows to change the store store and returns you to products page' do
- find('a#storeSelectorDropdown').click
-
- expect(page).to have_selector(:css, "a[href*='#{store_one.formatted_url}:#{port}/admin/products']")
- expect(page).to have_selector(:css, "a[href*='#{store_two.formatted_url}:#{port}/admin/products']")
- expect(page).to have_selector(:css, "a[href*='#{store_three.formatted_url}:#{port}/admin/products']")
- end
- end
-
- context 'can add new store using + Add New Store link' do
- before do
- visit spree.admin_path
- end
-
- it 'displays the link in the store selector dropdown' do
- find('a#storeSelectorDropdown').click
- expect(page).to have_selector(:css, "a[href*='#{spree.new_admin_store_path(@user)}']")
- end
-
- it 'takes you to the add new store page when clicked' do
- expect(page).not_to have_text('Stores / New Store')
-
- find('a#storeSelectorDropdown').click
- find('a#addNewStoreLink').click
-
- expect(page).to have_text('Stores / New Store')
- end
- end
-end
diff --git a/backend/spec/features/admin/store_spec.rb b/backend/spec/features/admin/store_spec.rb
deleted file mode 100644
index 18a762042f..0000000000
--- a/backend/spec/features/admin/store_spec.rb
+++ /dev/null
@@ -1,173 +0,0 @@
-require 'spec_helper'
-
-describe 'Stores', type: :feature do
- stub_authorization!
-
- context 'creating new store' do
- before do
- create(:zone, name: 'No Limits')
-
- visit spree.admin_path
-
- click_link 'Configurations'
- click_link 'Stores'
- within '#contentHeaderRow' do
- click_link 'New Store'
- end
- end
-
- after { Capybara.app_host = nil }
-
- it 'has required fields' do
- expect(page).to have_field(id: 'store_name')
- expect(page).to have_field(id: 'store_code')
- expect(page).to have_field(id: 'store_url')
- expect(page).to have_field(id: 'store_mail_from_address')
- end
-
- it 'has footer info fields' do
- expect(page).to have_field(id: 'store_description')
- expect(page).to have_field(id: 'store_address')
- expect(page).to have_field(id: 'store_contact_phone')
- end
-
- it 'has seo fields' do
- expect(page).to have_field(id: 'store_seo_title')
- expect(page).to have_field(id: 'store_meta_description')
- expect(page).to have_field(id: 'store_meta_keywords')
- expect(page).to have_field(id: 'store_seo_robots')
- end
-
- it 'creates a new store' do
- fill_in 'Name', with: 'Store name'
- fill_in 'Code', with: 'example_store'
- fill_in 'URL', with: 'http://another-store.lvh.me'
- fill_in 'Mail from address', with: '[email protected]'
-
- click_button 'Create'
-
- Capybara.app_host = 'http://another-store.lvh.me'
-
- expect(page).to have_content('http://another-store.lvh.me')
- expect(page).to have_content('example_store')
- expect(page).to have_content('Stores')
- end
-
- it 'creates a new store with footer and seo data' do
- fill_in 'Name', with: 'Store name'
- fill_in 'Code', with: 'example_store'
- fill_in 'URL', with: 'http://one-another-store.lvh.me'
- fill_in 'Mail from address', with: '[email protected]'
- fill_in 'Description', with: 'New store description'
- fill_in 'Address', with: 'New store address 123, City 123'
- fill_in 'Contact phone', with: '123123123'
- fill_in 'Customer Support Email', with: '[email protected]'
- fill_in 'SEO Title', with: 'Spree Store meta title'
- fill_in 'Meta Description', with: 'Spree Store meta description'
- fill_in 'Meta Keywords', with: 'Spree, Store'
- fill_in 'SEO Robots', with: 'noindex'
-
- click_button 'Create'
-
- Capybara.app_host = 'http://one-another-store.lvh.me'
-
- expect(page).to have_content('http://one-another-store.lvh.me')
- expect(page).to have_content('Stores')
- end
- end
-
- context 'editing existing store', js: true do
- let!(:updated_zone) { create(:zone, name: 'EU_VAT') }
-
- before do
- @zone = create(:zone, name: 'No Limits')
- create(:store, name: 'Some existing store', checkout_zone_id: @zone.id)
-
- visit spree.admin_path
-
- click_link 'Configurations'
- click_link 'Stores'
- end
-
- it 'edits existing store' do
- within_row(1) { click_icon :edit }
- fill_in 'Mail from address', with: '[email protected]'
- click_button 'Update'
-
- expect(page).to have_content('successfully updated!')
- end
-
- it 'edits existing stores footer info' do
- within_row(1) { click_icon :edit }
- fill_in 'Description', with: 'Some edited description'
- click_button 'Update'
-
- expect(page).to have_content('successfully updated!')
- end
- end
-
- context 'with checkout_zone preference set in spree config file', js: true do
- let!(:store) { create(:store, name: 'Some existing store') }
- let!(:zone) { create(:zone, name: 'Asia') }
-
- before do
- Spree::Config[:checkout_zone] = 'Asia'
-
- visit spree.admin_path
-
- click_link 'Configurations'
- click_link 'Stores'
- end
-
- it 'edits existing store' do
- within_row(1) { click_icon :edit }
- fill_in 'Mail from address', with: '[email protected]'
- click_button 'Update'
-
- expect(page).to have_content('successfully updated!')
- end
- end
-
- context 'with checkout_zone_id attribute set for store', js: true do
- let!(:store) { create(:store, name: 'Some existing store', checkout_zone_id: zone.id) }
- let!(:zone) { create(:zone, name: 'Asia') }
-
- before do
- Spree::Config.preference_default(:checkout_zone)
-
- visit spree.admin_path
-
- click_link 'Configurations'
- click_link 'Stores'
- end
-
- it 'edits existing store' do
- within_row(1) { click_icon :edit }
- fill_in 'Mail from address', with: '[email protected]'
- click_button 'Update'
-
- expect(page).to have_content('successfully updated!')
- end
- end
-
- context 'without checkout_zone_id attribute and checkout_zone preference', js: true do
- let!(:store) { create(:store, name: 'Some existing store', checkout_zone_id: nil) }
-
- before do
- Spree::Config.preference_default(:checkout_zone)
-
- visit spree.admin_path
-
- click_link 'Configurations'
- click_link 'Stores'
- end
-
- it 'edits existing store' do
- within_row(1) { click_icon :edit }
- fill_in 'Mail from address', with: '[email protected]'
- click_button 'Update'
-
- expect(page).to have_content('successfully updated!')
- end
- end
-end
diff --git a/backend/spec/features/admin/taxons_spec.rb b/backend/spec/features/admin/taxons_spec.rb
deleted file mode 100644
index 99772a0ba7..0000000000
--- a/backend/spec/features/admin/taxons_spec.rb
+++ /dev/null
@@ -1,106 +0,0 @@
-require 'spec_helper'
-
-describe 'Taxonomies and taxons', type: :feature, js: true do
- stub_authorization!
-
- let(:taxonomy) { create(:taxonomy, name: 'Hello') }
- let(:file_path) { Rails.root + '../../spec/support/ror_ringer.jpeg' }
-
- context 'when WYSIWYG editor is in enabled' do
- it 'displays the WYSIWYG editor for the taxon description input' do
- visit spree.edit_admin_taxonomy_taxon_path(taxonomy, taxonomy.root.id)
-
- expect(page).not_to have_css('#taxon_description')
- expect(page).to have_css('#taxon_description_ifr')
- end
- end
-
- context 'when WYSIWYG editor is disabled' do
- before { Spree::Backend::Config.taxon_wysiwyg_editor_enabled = false }
-
- after { Spree::Backend::Config.taxon_wysiwyg_editor_enabled = true }
-
- it 'displays the taxon description as a standard input field' do
- visit spree.edit_admin_taxonomy_taxon_path(taxonomy, taxonomy.root.id)
-
- expect(page).to have_css('#taxon_description')
- expect(page).not_to have_css('#taxon_description_ifr')
- end
- end
-
- it 'admin should be able to edit taxon' do
- visit spree.edit_admin_taxonomy_taxon_path(taxonomy, taxonomy.root_id)
-
- fill_in 'taxon_name', with: 'Shirt'
-
- fill_in 'permalink_part', with: 'shirt-rails'
- click_button 'Update'
- expect(page).to have_content('Taxon "Shirt" has been successfully updated!')
- end
-
- it 'taxon without name should not be updated' do
- visit spree.edit_admin_taxonomy_taxon_path(taxonomy, taxonomy.root_id)
-
- fill_in 'taxon_name', with: ''
-
- fill_in 'permalink_part', with: 'shirt-rails'
- click_button 'Update'
- expect(page).to have_content("Name can't be blank")
- end
-
- it 'admin should be able to remove a product from a taxon', js: true do
- taxon_1 = create(:taxon, name: 'Clothing')
- product = create(:product, stores: Spree::Store.all)
- product.taxons << taxon_1
-
- visit spree.admin_taxons_path
- select_taxon_from_select2(taxon_1)
-
- find('.product').hover
- find('.product .dropdown-toggle').click
-
- click_link 'Remove'
-
- expect(page).not_to have_css('.product')
-
- refresh
- select_taxon_from_select2(taxon_1)
-
- expect(page).to have_content('No results')
- end
-
- it 'admin should be able to add taxon icon' do
- visit spree.edit_admin_taxonomy_taxon_path(taxonomy, taxonomy.root_id)
-
- attach_file('taxon_icon', file_path)
- click_button 'Update'
-
- expect(page).to have_content('successfully updated!')
-
- visit spree.edit_admin_taxonomy_taxon_path(taxonomy, taxonomy.root_id)
-
- expect(page).to have_css('#taxon_icon_field img')
- end
-
- it 'admin should be able to remove taxon icon' do
- add_icon_to_root_taxon
-
- visit spree.edit_admin_taxonomy_taxon_path(taxonomy, taxonomy.root_id)
-
- click_link 'Remove Image'
-
- expect(page).to have_content('Image has been successfully removed')
- end
-
- def select_taxon_from_select2(taxon)
- select2_open css: '.taxon-products-view'
- select2_search taxon.name, css: '.taxon-products-view'
- select2_select taxon.pretty_name, css: '.taxon-products-view'
- end
-
- def add_icon_to_root_taxon
- visit spree.edit_admin_taxonomy_taxon_path(taxonomy, taxonomy.root_id)
- attach_file('taxon_icon', file_path)
- click_button 'Update'
- end
-end
diff --git a/backend/spec/features/admin/users_spec.rb b/backend/spec/features/admin/users_spec.rb
deleted file mode 100644
index 23d72d6a7c..0000000000
--- a/backend/spec/features/admin/users_spec.rb
+++ /dev/null
@@ -1,339 +0,0 @@
-require 'spec_helper'
-
-describe 'Users', type: :feature do
- include Spree::BaseHelper
- stub_authorization!
- include Spree::Admin::BaseHelper
-
- let(:store) { Spree::Store.default }
- let!(:user_a) { create(:user_with_addresses, email: '[email protected]') }
- let!(:user_b) { create(:user_with_addresses, email: '[email protected]') }
-
- let!(:order) { create(:completed_order_with_totals, store: store, user: user_a, number: 'R123') }
- let!(:order_2) do
- create(:completed_order_with_totals, store: store, user: user_a, number: 'R456').tap do |o|
- li = o.line_items.last
- li.update_column(:price, li.price + 10)
- end
- end
- let!(:order_eur) { create(:completed_order_with_totals, store: store, user: user_a, currency: 'EUR') }
- let!(:order_gbp) { create(:completed_order_with_totals, store: store, user: user_a, currency: 'GBP') }
- let!(:orders) { Spree::Order.where(id: [order.id, order_2.id, order_eur.id, order_gbp.id]) }
-
- let!(:store_credit_usd) { create(:store_credit, amount: '100', store: store, user: user_a, currency: 'USD') }
- let!(:store_credit_eur) { create(:store_credit, amount: '90', store: store, user: user_a, currency: 'EUR') }
- let!(:store_credit_gbp) { create(:store_credit, amount: '80', store: store, user: user_a, currency: 'GBP') }
-
- shared_examples_for 'a user page' do
- context 'lifetime stats' do
- shared_examples_for 'has lifetime stats' do
- it 'has lifetime stats' do
- within('#user-lifetime-stats') do
- [:total_sales, :num_orders, :average_order_value, :member_since].each do |stat_name|
- expect(page).to have_content Spree.t(stat_name)
- end
-
- total_sales = "$#{order.total.to_i + order_2.total.to_i}.00 €#{order_eur.total.to_i}.00 £#{order_gbp.total.to_i}.00"
- total_average = "$#{(order.total.to_i + order_2.total.to_i)/2}.00 €#{order_eur.total.to_i}.00 £#{order_gbp.total.to_i}.00"
- total_credits = "$#{store_credit_usd.amount.to_i}.00 €#{store_credit_eur.amount.to_i}.00 £#{store_credit_gbp.amount.to_i}.00"
- expect(page).to have_content("Total Sales: #{total_sales}", normalize_ws: true)
- expect(page).to have_content("Average Order Value: #{total_average}", normalize_ws: true)
- expect(page).to have_content("Store Credits: #{total_credits}", normalize_ws: true)
- expect(page).to have_content("# Orders: #{orders.count}", normalize_ws: true)
- expect(page).to have_content("Member Since: #{pretty_time(user_a.created_at).gsub(/[[:space:]]+/, ' ')}", normalize_ws: true)
- end
- end
- end
-
- it_behaves_like 'has lifetime stats'
-
- context 'when other store order exits' do
- let(:new_store) { create(:store) }
- let!(:new_order) { create(:completed_order_with_totals, store: new_store, number: 'K999') }
-
- it { expect(Spree::Order.count).not_to eq(store.orders.count) }
-
- it_behaves_like 'has lifetime stats'
- end
- end
-
- it 'can go back to the users list' do
- expect(page).to have_link Spree.t(:users), href: spree.admin_users_path
- end
-
- it 'can navigate to the account page' do
- expect(page).to have_link Spree.t(:"admin.user.account"), href: spree.edit_admin_user_path(user_a)
- end
-
- it 'can navigate to the order history' do
- expect(page).to have_link Spree.t(:"admin.user.orders"), href: spree.orders_admin_user_path(user_a)
- end
-
- it 'can navigate to the items purchased' do
- expect(page).to have_link Spree.t(:"admin.user.items"), href: spree.items_admin_user_path(user_a)
- end
- end
-
- shared_examples_for 'a sortable attribute' do
- before { click_link sort_link }
-
- it 'can sort asc' do
- within_table(table_id) do
- expect(page).to have_text text_match_1
- expect(page).to have_text text_match_2
- expect(text_match_1).to appear_before text_match_2
- end
- end
-
- it 'can sort desc' do
- within_table(table_id) do
- click_link sort_link
-
- expect(page).to have_text text_match_1
- expect(page).to have_text text_match_2
- expect(text_match_2).to appear_before text_match_1
- end
- end
- end
-
- before do
- Spree::Config[:company] = true
- create(:country)
- stub_const('Spree::User', create(:user, email: '[email protected]').class)
- visit spree.admin_path
- click_link 'Users'
- end
-
- context 'users index' do
- context 'email' do
- it_behaves_like 'a sortable attribute' do
- let(:text_match_1) { user_a.email }
- let(:text_match_2) { user_b.email }
- let(:table_id) { 'listing_users' }
- let(:sort_link) { 'users_email_title' }
- end
- end
-
- it 'displays the correct results for a user search' do
- fill_in 'q_email_cont', with: user_a.email, visible: false
- click_button 'Search', visible: false
- within_table('listing_users') do
- expect(page).to have_text user_a.email
- expect(page).not_to have_text user_b.email
- end
- end
-
- context 'filtering users', js: true do
- it 'renders selected filters' do
- click_on 'Filter'
-
- within('#table-filter') do
- fill_in 'q_email_cont', with: '[email protected]'
- fill_in 'q_bill_address_firstname_cont', with: 'John'
- fill_in 'q_bill_address_lastname_cont', with: 'Doe'
- fill_in 'q_bill_address_company_cont', with: 'Company'
- end
-
- click_on 'Search'
-
- within('.table-active-filters') do
- expect(page).to have_content('Email: [email protected]')
- expect(page).to have_content('First Name: John')
- expect(page).to have_content('Last Name: Doe')
- expect(page).to have_content('Company: Company')
- end
- end
- end
- end
-
- context 'editing users' do
- before { click_link user_a.email }
-
- it_behaves_like 'a user page'
-
- it 'can edit the user email' do
- fill_in 'user_email', with: '[email protected]'
- click_button 'Update'
-
- expect(user_a.reload.email).to eq '[email protected]'
- expect(page).to have_text 'Account updated'
- expect(page).to have_field('user_email', with: '[email protected]')
- end
-
- it 'can edit the user password' do
- fill_in 'user_password', with: 'welcome'
- fill_in 'user_password_confirmation', with: 'welcome'
- click_button 'Update'
-
- expect(page).to have_text 'Account updated'
- end
-
- it 'can edit user roles' do
- Spree::Role.create name: 'admin'
- click_link 'Users', match: :first
- click_link user_a.email
-
- check 'user_spree_role_admin'
- click_button 'Update'
- expect(page).to have_text 'Account updated'
- expect(page).to have_checked_field('user_spree_role_admin')
- end
-
- it 'can edit user shipping address' do
- click_link 'Addresses'
-
- within('#admin_user_edit_addresses') do
- fill_in 'user_ship_address_attributes_address1', with: '1313 Mockingbird Ln'
- click_button 'Update'
- expect(page).to have_field('user_ship_address_attributes_address1', with: '1313 Mockingbird Ln')
- end
-
- expect(user_a.reload.ship_address.address1).to eq '1313 Mockingbird Ln'
- expect(user_a.ship_address.user_id).to eq user_a.id
- end
-
- it 'can edit user billing address' do
- click_link 'Addresses'
-
- within('#admin_user_edit_addresses') do
- fill_in 'user_bill_address_attributes_address1', with: '1313 Mockingbird Ln'
- click_button 'Update'
- expect(page).to have_field('user_bill_address_attributes_address1', with: '1313 Mockingbird Ln')
- end
-
- expect(user_a.reload.bill_address.address1).to eq '1313 Mockingbird Ln'
- expect(user_a.bill_address.user_id).to eq user_a.id
- end
-
- it 'can set shipping address to be the same as billing address' do
- click_link 'Addresses'
-
- within('#admin_user_edit_addresses') do
- find('#user_use_billing').click
- click_button 'Update'
- end
-
- expect(user_a.reload.ship_address == user_a.reload.bill_address).to eq true
- end
-
- context 'no api key exists' do
- it 'can generate a new api key' do
- within('#admin_user_edit_api_key') do
- expect(user_a.spree_api_key).to be_blank
- click_button Spree.t('generate_key', scope: 'api')
- end
-
- expect(user_a.reload.spree_api_key).to be_present
-
- within('#admin_user_edit_api_key') do
- expect(page).to have_css('#current-api-key', text: /Key: #{user_a.spree_api_key}/)
- end
- end
- end
-
- context 'an api key exists' do
- before do
- user_a.generate_spree_api_key!
- expect(user_a.reload.spree_api_key).to be_present
- refresh
- end
-
- it 'can clear an api key' do
- within('#admin_user_edit_api_key') do
- click_button Spree.t('clear_key', scope: 'api')
- end
-
- expect(user_a.reload.spree_api_key).to be_blank
- expect(page).not_to have_css('#current-api-key')
- end
-
- it 'can regenerate an api key' do
- old_key = user_a.spree_api_key
-
- within('#admin_user_edit_api_key') do
- click_button Spree.t('regenerate_key', scope: 'api')
- end
-
- expect(user_a.reload.spree_api_key).to be_present
- expect(user_a.reload.spree_api_key).not_to eq old_key
-
- within('#admin_user_edit_api_key') do
- expect(page).to have_css('#current-api-key', text: /Key: #{user_a.spree_api_key}/)
- end
- end
- end
- end
-
- context 'order history with sorting' do
- before do
- orders
- click_link user_a.email
- within('#sidebar') { click_link Spree.t(:"admin.user.orders") }
- end
-
- it_behaves_like 'a user page'
-
- context 'completed_at' do
- it_behaves_like 'a sortable attribute' do
- let(:text_match_1) { order_time(order.completed_at) }
- let(:text_match_2) { order_time(order_2.completed_at) }
- let(:table_id) { 'listing_orders' }
- let(:sort_link) { 'orders_completed_at_title' }
- end
- end
-
- [:number, :state, :total].each do |attr|
- context attr do
- it_behaves_like 'a sortable attribute' do
- let(:text_match_1) { order.send(attr).to_s }
- let(:text_match_2) { order_2.send(attr).to_s }
- let(:table_id) { 'listing_orders' }
- let(:sort_link) { "orders_#{attr}_title" }
- end
- end
- end
- end
-
- context 'items purchased with sorting' do
- before do
- orders
- click_link user_a.email
- within('#sidebar') { click_link Spree.t(:"admin.user.items") }
- end
-
- it_behaves_like 'a user page'
-
- context 'completed_at' do
- it_behaves_like 'a sortable attribute' do
- let(:text_match_1) { order_time(order.completed_at) }
- let(:text_match_2) { order_time(order_2.completed_at) }
- let(:table_id) { 'listing_items' }
- let(:sort_link) { 'orders_completed_at_title' }
- end
- end
-
- [:number, :state].each do |attr|
- context attr do
- it_behaves_like 'a sortable attribute' do
- let(:text_match_1) { order.send(attr).to_s }
- let(:text_match_2) { order_2.send(attr).to_s }
- let(:table_id) { 'listing_items' }
- let(:sort_link) { "orders_#{attr}_title" }
- end
- end
- end
-
- it 'has item attributes' do
- items = order.line_items | order_2.line_items
- expect(page).to have_table 'listing_items'
- within_table('listing_items') do
- items.each do |item|
- expect(page).to have_selector('.item-name', text: item.product.name)
- expect(page).to have_selector('.item-price', text: item.single_money.to_html)
- expect(page).to have_selector('.item-quantity', text: item.quantity)
- expect(page).to have_selector('.item-total', text: item.money.to_html)
- end
- end
- end
- end
-end
diff --git a/backend/spec/fixtures/files/favicon.ico b/backend/spec/fixtures/files/favicon.ico
deleted file mode 100644
index b5b89e3563..0000000000
Binary files a/backend/spec/fixtures/files/favicon.ico and /dev/null differ
diff --git a/backend/spec/fixtures/files/icon_512x512.png b/backend/spec/fixtures/files/icon_512x512.png
deleted file mode 100644
index 2d2f28266b..0000000000
Binary files a/backend/spec/fixtures/files/icon_512x512.png and /dev/null differ
diff --git a/backend/spec/fixtures/thinking-cat.jpg b/backend/spec/fixtures/thinking-cat.jpg
deleted file mode 100644
index 7e8524d367..0000000000
Binary files a/backend/spec/fixtures/thinking-cat.jpg and /dev/null differ
diff --git a/backend/spec/helpers/spree/admin/base_helper_spec.rb b/backend/spec/helpers/spree/admin/base_helper_spec.rb
deleted file mode 100644
index 2719dc3d10..0000000000
--- a/backend/spec/helpers/spree/admin/base_helper_spec.rb
+++ /dev/null
@@ -1,56 +0,0 @@
-require 'spec_helper'
-
-describe Spree::Admin::BaseHelper, type: :helper do
- include Spree::Admin::BaseHelper
-
- context '#datepicker_field_value' do
- it 'returns nil when date is empty' do
- date = nil
- expect(datepicker_field_value(date)).to be_nil
- end
-
- it 'returns a formatted date when date is present' do
- date = '2013-08-14'.to_time
- expect(datepicker_field_value(date)).to eq('2013/08/14')
- end
- end
-
- context '#plural_resource_name' do
- it 'returns correct form of class' do
- resource_class = Spree::Product
- expect(plural_resource_name(resource_class)).to eq('Products')
- end
- end
-
- context '#order_time' do
- it 'prints in a format' do
- time = Time.new(2016, 5, 6, 13, 33)
- expect(order_time(time)).to eq "2016-05-06 1:33 PM #{time.zone}"
- end
-
- it 'return empty stirng when nil is supplied' do
- expect(order_time(nil)).to eq ''
- end
- end
-
- describe '#admin_logout_link' do
- it 'returns nil if no logout route is defined' do
- expect(helper.admin_logout_link).to be_nil
- end
-
- context 'returns spree_logout_path if defined' do
- before { allow(helper).to receive(:spree_logout_path).and_return('/logout') }
-
- it { expect(helper.admin_logout_link).to eq('/logout') }
- end
-
- context 'spree.admin_logout_path if defined' do
- before do
- allow(helper).to receive(:spree_logout_path).and_return('/logout')
- allow(helper).to receive(:admin_logout_path).and_return('/admin/logout')
- end
-
- it { expect(helper.admin_logout_link).to eq('/admin/logout') }
- end
- end
-end
diff --git a/backend/spec/helpers/spree/admin/cms_helper_spec.rb b/backend/spec/helpers/spree/admin/cms_helper_spec.rb
deleted file mode 100644
index 3c69621b75..0000000000
--- a/backend/spec/helpers/spree/admin/cms_helper_spec.rb
+++ /dev/null
@@ -1,66 +0,0 @@
-require 'spec_helper'
-
-describe Spree::Admin::CmsHelper, type: :helper do
- include Spree::BaseHelper
-
- let!(:current_store) { create(:store) }
- let!(:standard_page) { create(:cms_standard_page) }
- let!(:feature_page) { create(:cms_feature_page) }
- let!(:home_page) { create(:cms_homepage) }
-
- describe '#cms_page_preview_url' do
- before do
- @standard_page = Spree::CmsPage.find(standard_page.id)
- @feature_page = Spree::CmsPage.find(feature_page.id)
- @home_page = Spree::CmsPage.find(home_page.id)
- end
-
- context 'standard_page' do
- it "returns the correct URL when page language matches the current store default language" do
- expect(cms_page_preview_url(@standard_page)).to eq("http://www.example.com/pages/#{@standard_page.slug}")
- end
-
- it "returns the language denomination in the URL when page language does not match the current store default language" do
- @standard_page.update!(locale: :fr)
- @standard_page.reload
-
- expect(cms_page_preview_url(@standard_page)).to eq("http://www.example.com/fr/pages/#{@standard_page.slug}")
-
- @standard_page.update!(locale: :en)
- @standard_page.reload
- end
- end
-
- context 'feature_page' do
- it "returns the correct URL when page language matches the current store default language" do
- expect(cms_page_preview_url(@feature_page)).to eq("http://www.example.com/pages/#{@feature_page.slug}")
- end
-
- it "returns the language denomination in the URL when page language does not match the current store default language" do
- @feature_page.update!(locale: :fr)
- @feature_page.reload
-
- expect(cms_page_preview_url(@feature_page)).to eq("http://www.example.com/fr/pages/#{@feature_page.slug}")
-
- @feature_page.update!(locale: :en)
- @feature_page.reload
- end
- end
-
- context 'home_page' do
- it "returns the correct URL when page language matches the current store default language" do
- expect(cms_page_preview_url(@home_page)).to eq("http://www.example.com")
- end
-
- it "returns the language denomination in the URL when page language does not match the current store default language" do
- @home_page.update!(locale: :fr)
- @home_page.reload
-
- expect(cms_page_preview_url(@home_page)).to eq("http://www.example.com/fr")
-
- @home_page.update!(locale: :en)
- @home_page.reload
- end
- end
- end
-end
diff --git a/backend/spec/helpers/spree/admin/navigation_helper_spec.rb b/backend/spec/helpers/spree/admin/navigation_helper_spec.rb
deleted file mode 100644
index 3e6db74ca5..0000000000
--- a/backend/spec/helpers/spree/admin/navigation_helper_spec.rb
+++ /dev/null
@@ -1,108 +0,0 @@
-require 'spec_helper'
-
-describe Spree::Admin::NavigationHelper, type: :helper do
- before do
- # `spree` route helper is not accessible in `type: :helper` hence extending it explicitly
- # https://github.com/rspec/rspec-rails/issues/1626
- helper.extend Spree::TestingSupport::UrlHelpers
-
- allow(controller).to receive(:controller_name).and_return('test')
- end
-
- describe '#tab' do
- before do
- allow(helper).to receive(:cannot?).and_return false
- end
-
- context 'creating an admin tab' do
- it "capitalizes the first letter of each word in the tab's label" do
- admin_tab = helper.tab(:orders)
- expect(admin_tab).to include('Orders')
- end
- end
-
- it 'accepts options with label and capitalize each word of it' do
- admin_tab = helper.tab(:orders, label: 'delivered orders')
- expect(admin_tab).to include('Delivered Orders')
- end
-
- it 'capitalizes words with unicode characters' do
- # overview
- admin_tab = helper.tab(:orders, label: 'přehled')
- expect(admin_tab).to include('Přehled')
- end
-
- describe 'selection' do
- context 'when match_path option is not supplied' do
- subject(:tab) { helper.tab(:orders) }
-
- it 'is selected if the controller matches' do
- allow(controller).to receive(:controller_name).and_return('orders')
- expect(subject).to include('selected')
- end
-
- it 'is not selected if the controller does not match' do
- allow(controller).to receive(:controller_name).and_return('bonobos')
- expect(subject).not_to include('selected')
- end
- end
-
- context 'when match_path option is supplied' do
- before do
- allow(helper).to receive(:request).and_return(double(ActionDispatch::Request, fullpath: '/admin/orders/edit/1'))
- end
-
- it 'is selected if the fullpath matches' do
- allow(controller).to receive(:controller_name).and_return('bonobos')
- tab = helper.tab(:orders, label: 'delivered orders', match_path: '/orders')
- expect(tab).to include('selected')
- end
-
- it 'is selected if the fullpath matches a regular expression' do
- allow(controller).to receive(:controller_name).and_return('bonobos')
- tab = helper.tab(:orders, label: 'delivered orders', match_path: /orders$|orders\//)
- expect(tab).to include('selected')
- end
-
- it 'is not selected if the fullpath does not match' do
- allow(controller).to receive(:controller_name).and_return('bonobos')
- tab = helper.tab(:orders, label: 'delivered orders', match_path: '/shady')
- expect(tab).not_to include('selected')
- end
-
- it 'is not selected if the fullpath does not match a regular expression' do
- allow(controller).to receive(:controller_name).and_return('bonobos')
- tab = helper.tab(:orders, label: 'delivered orders', match_path: /shady$|shady\//)
- expect(tab).not_to include('selected')
- end
- end
- end
- end
-
- describe '#klass_for' do
- it 'returns correct klass for Spree model' do
- expect(klass_for(:products)).to eq(Spree::Product)
- expect(klass_for(:product_properties)).to eq(Spree::ProductProperty)
- end
-
- it 'returns correct klass for non-spree model' do
- class MyUser
- end
- expect(klass_for(:my_users)).to eq(MyUser)
-
- Object.send(:remove_const, 'MyUser')
- end
-
- it 'returns correct namespaced klass for non-spree model' do
- module My
- class User
- end
- end
-
- expect(klass_for(:my_users)).to eq(My::User)
-
- My.send(:remove_const, 'User')
- Object.send(:remove_const, 'My')
- end
- end
-end
diff --git a/backend/spec/helpers/spree/admin/promotion_rules_helper_spec.rb b/backend/spec/helpers/spree/admin/promotion_rules_helper_spec.rb
deleted file mode 100644
index 6cbde1318e..0000000000
--- a/backend/spec/helpers/spree/admin/promotion_rules_helper_spec.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-require 'spec_helper'
-module Spree
- describe Spree::Admin::PromotionRulesHelper, type: :helper do
- it 'does not include existing rules in options' do
- promotion = build(:promotion)
- promotion.promotion_rules << Spree::Promotion::Rules::ItemTotal.new
-
- options = helper.options_for_promotion_rule_types(promotion)
- expect(options).not_to match(/ItemTotal/)
- end
- end
-end
diff --git a/backend/spec/helpers/spree/admin/stock_movements_helper_spec.rb b/backend/spec/helpers/spree/admin/stock_movements_helper_spec.rb
deleted file mode 100644
index 3e8ec2188b..0000000000
--- a/backend/spec/helpers/spree/admin/stock_movements_helper_spec.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-require 'spec_helper'
-
-describe Spree::Admin::StockMovementsHelper, type: :helper do
- describe '#pretty_originator' do
- context 'transfering between two locations' do
- let(:destination_location) { create(:stock_location_with_items) }
- let(:source_location) { create(:stock_location_with_items) }
- let(:stock_item) { source_location.stock_items.order(:id).first }
- let(:variant) { stock_item.variant }
-
- before do
- @stock_transfer = Spree::StockTransfer.create(reference: 'PO123')
- variants = { variant => 5 }
- @stock_transfer.transfer(source_location,
- destination_location,
- variants)
- helper.pretty_originator(@stock_transfer.stock_movements.last)
- end
-
- it 'returns link to stock transfer' do
- expect(helper.pretty_originator(@stock_transfer.stock_movements.last)).to match(@stock_transfer.number)
- end
- end
- end
-end
diff --git a/backend/spec/helpers/spree/admin/stores_helper_spec.rb b/backend/spec/helpers/spree/admin/stores_helper_spec.rb
deleted file mode 100644
index 90fc73c41a..0000000000
--- a/backend/spec/helpers/spree/admin/stores_helper_spec.rb
+++ /dev/null
@@ -1,43 +0,0 @@
-require 'spec_helper'
-
-describe Spree::Admin::StoresHelper, type: :helper do
- describe '#selected_checkout_zone' do
- let!(:store) { Spree::Store.default }
- let!(:country) { store.default_country }
- let!(:country_zone) { create(:zone, name: 'CountryZone', kind: 'country') }
-
- context 'with set preference checkout_zone in spree config file' do
- before do
- country_zone.members.create(zoneable: country)
- Spree::Config[:checkout_zone] = country_zone.name
- end
-
- it 'return countries' do
- expect(selected_checkout_zone(store)).to eq Spree::Zone.find_by(name: Spree::Config[:checkout_zone])
- end
- end
-
- context 'with checkout_zone_id set on store' do
- before do
- Spree::Config.preference_default(:checkout_zone)
- country_zone.members.create(zoneable: country)
- store.update(checkout_zone_id: country_zone.id)
- end
-
- it 'return countries' do
- expect(selected_checkout_zone(store)).to eq country_zone
- end
- end
-
- context 'checkout_zone is not set via preference or store' do
- before do
- Spree::Config.preference_default(:checkout_zone)
- store.update(checkout_zone_id: nil)
- end
-
- it 'return nil' do
- expect(selected_checkout_zone(store)).to eq nil
- end
- end
- end
-end
diff --git a/backend/spec/lib/spree/core_spec.rb b/backend/spec/lib/spree/core_spec.rb
deleted file mode 100644
index c629eda897..0000000000
--- a/backend/spec/lib/spree/core_spec.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-require 'spec_helper'
-
-describe Spree do
- describe '.admin_path' do
- it { expect(described_class.admin_path).to eq(Spree::Backend::Config[:admin_path]) }
- end
-
- describe '.admin_path=' do
- let!(:original_admin_path) { described_class.admin_path }
- let(:new_admin_path) { '/admin-secret-path' }
-
- before do
- described_class.admin_path = new_admin_path
- end
-
- after do
- described_class.admin_path = original_admin_path
- end
-
- it { expect(described_class.admin_path).to eq(new_admin_path) }
- it { expect(Spree::Backend::Config[:admin_path]).to eq(new_admin_path) }
- end
-end
diff --git a/backend/spec/models/spree/resource_spec.rb b/backend/spec/models/spree/resource_spec.rb
deleted file mode 100644
index ddbf48b048..0000000000
--- a/backend/spec/models/spree/resource_spec.rb
+++ /dev/null
@@ -1,48 +0,0 @@
-require 'spec_helper'
-
-module Spree
- class Test
- end
- module Submodule
- class Test
- end
- end
-end
-
-module Spree
- module Admin
- describe Resource, type: :model do
- let(:resource_base) { Resource.new('spree/admin/test', 'test', 'widget') }
- let(:resource_submodule) { Resource.new('spree/admin/submodule/test', 'test', 'widget') }
- let(:resource_object_name) { Resource.new('spree/admin/test', 'test', 'gadget', 'widget') }
-
- it 'can get base model class' do
- expect(resource_base.model_class).to eq(Spree::Test)
- end
-
- it 'can get submodule class' do
- expect(resource_submodule.model_class).to eq(Spree::Submodule::Test)
- end
-
- it 'can get base model name (only used for parent)' do
- expect(resource_base.model_name).to eq('widget')
- end
-
- it 'can get submodule model name (only used for parent)' do
- expect(resource_submodule.model_name).to eq('widget')
- end
-
- it 'can get base object name' do
- expect(resource_base.object_name).to eq('test')
- end
-
- it 'can get submodule object name' do
- expect(resource_submodule.object_name).to eq('submodule_test')
- end
-
- it 'can get overridden object name' do
- expect(resource_object_name.object_name).to eq('widget')
- end
- end
- end
-end
diff --git a/backend/spec/routing/admin_path_spec.rb b/backend/spec/routing/admin_path_spec.rb
deleted file mode 100644
index 365511ba29..0000000000
--- a/backend/spec/routing/admin_path_spec.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-require 'spec_helper'
-
-module Spree
- module Admin
- RSpec.describe 'AdminPath', type: :routing do
- it 'shoud route to admin by default' do
- expect(spree.admin_path).to eq('/admin')
- end
-
- it 'routes to the the configured path' do
- Spree.admin_path = '/secret'
- Rails.application.reload_routes!
- expect(spree.admin_path).to eq('/secret')
-
- # restore the path for other tests
- Spree.admin_path = '/admin'
- Rails.application.reload_routes!
- expect(spree.admin_path).to eq('/admin')
- end
- end
- end
-end
diff --git a/backend/spec/spec_helper.rb b/backend/spec/spec_helper.rb
deleted file mode 100644
index 125040b3f3..0000000000
--- a/backend/spec/spec_helper.rb
+++ /dev/null
@@ -1,155 +0,0 @@
-if ENV['COVERAGE']
- # Run Coverage report
- require 'simplecov'
- SimpleCov.start 'rails' do
- add_group 'Libraries', 'lib/spree'
-
- add_filter '/bin/'
- add_filter '/db/'
- add_filter '/script/'
- add_filter '/spec/'
- add_filter '/lib/generators/'
-
- coverage_dir "#{ENV['COVERAGE_DIR']}/backend" if ENV['COVERAGE_DIR']
- end
-end
-
-# This file is copied to ~/spec when you run 'ruby script/generate rspec'
-# from the project root directory.
-ENV['RAILS_ENV'] ||= 'test'
-
-begin
- require File.expand_path('../dummy/config/environment', __FILE__)
-rescue LoadError
- puts 'Could not load dummy application. Please ensure you have run `bundle exec rake test_app`'
- exit
-end
-
-require 'rspec/rails'
-
-# Requires supporting files with custom matchers and macros, etc,
-# in ./support/ and its subdirectories.
-Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
-
-require 'capybara-select-2'
-require 'database_cleaner'
-require 'ffaker'
-
-require 'spree/testing_support/authorization_helpers'
-require 'spree/testing_support/factories'
-require 'spree/testing_support/preferences'
-require 'spree/testing_support/controller_requests'
-require 'spree/testing_support/flash'
-require 'spree/testing_support/url_helpers'
-require 'spree/testing_support/order_walkthrough'
-require 'spree/testing_support/capybara_ext'
-require 'spree/testing_support/capybara_config'
-require 'spree/testing_support/rspec_retry_config'
-require 'spree/testing_support/image_helpers'
-require 'spree/testing_support/flatpickr_capybara'
-
-require 'spree/core/controller_helpers/strong_parameters'
-require 'webdrivers'
-
-RSpec.configure do |config|
- config.color = true
- config.default_formatter = 'doc'
- config.fail_fast = ENV['FAIL_FAST'] || false
- config.infer_spec_type_from_file_location!
- config.mock_with :rspec
- config.raise_errors_for_deprecations!
-
- # If you're not using ActiveRecord, or you'd prefer not to run each of your
- # examples within a transaction, comment the following line or assign false
- # instead of true.
- config.use_transactional_fixtures = false
-
- config.before :suite do
- Capybara.match = :smart
- DatabaseCleaner.clean_with :truncation
- # Force jobs to be executed in a synchronous way
- ActiveJob::Base.queue_adapter = :inline
- end
-
- config.before do
- Rails.cache.clear
- WebMock.disable!
- DatabaseCleaner.strategy = if RSpec.current_example.metadata[:js]
- :truncation
- else
- :transaction
- end
- # TODO: Find out why open_transactions ever gets below 0
- # See issue #3428
- ApplicationRecord.connection.increment_open_transactions if ApplicationRecord.connection.open_transactions < 0
-
- DatabaseCleaner.start
- reset_spree_preferences
-
- country = create(:country, name: 'United States of America', iso_name: 'UNITED STATES', iso: 'US', states_required: true)
- Spree::Config[:default_country_id] = country.id
-
- create(:store, default: true)
- end
-
- config.after(:each, type: :feature) do |example|
- missing_translations = page.body.scan(/translation missing: #{I18n.locale}\.(.*?)[\s<\"&]/)
- if missing_translations.any?
- puts "Found missing translations: #{missing_translations.inspect}"
- puts "In spec: #{example.location}"
- end
- end
-
- config.append_after do
- DatabaseCleaner.clean
- end
-
- config.include CapybaraSelect2
- config.include CapybaraSelect2::Helpers
- config.include FactoryBot::Syntax::Methods
-
- config.include Spree::TestingSupport::Preferences
- config.include Spree::TestingSupport::UrlHelpers
- config.include Spree::TestingSupport::ControllerRequests, type: :controller
- config.include Spree::TestingSupport::Flash
- config.include Spree::TestingSupport::ImageHelpers
- config.include Spree::TestingSupport::FlatpickrCapybara
-
- config.include Spree::Core::ControllerHelpers::StrongParameters, type: :controller
-
- config.order = :random
- Kernel.srand config.seed
-
- config.filter_run_including focus: true unless ENV['CI']
- config.run_all_when_everything_filtered = true
-end
-
-module Spree
- module TestingSupport
- module Flash
- def assert_admin_flash_alert_success(message)
- message_content = convert_flash(message)
-
- within('#FlashAlertsContainer', visible: :all) do
- expect(page).to have_css('span[data-alert-type="success"]', text: message_content, visible: :all)
- end
- end
-
- def assert_admin_flash_alert_error(message)
- message_content = convert_flash(message)
-
- within('#FlashAlertsContainer', visible: :all) do
- expect(page).to have_css('span[data-alert-type="error"]', text: message_content, visible: :all)
- end
- end
-
- def assert_admin_flash_alert_notice(message)
- message_content = convert_flash(message)
-
- within('#FlashAlertsContainer', visible: :all) do
- expect(page).to have_css('span[data-alert-type="notice"]', text: message_content, visible: :all)
- end
- end
- end
- end
-end
diff --git a/backend/spec/support/appear_before_matcher.rb b/backend/spec/support/appear_before_matcher.rb
deleted file mode 100644
index 85701baa0c..0000000000
--- a/backend/spec/support/appear_before_matcher.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-require 'rspec/expectations'
-
-RSpec::Matchers.define :appear_before do |expected|
- match do |actual|
- raise 'Page instance required to use the appear_before matcher' unless page
-
- page.body.index(actual) <= page.body.index(expected)
- end
-end
diff --git a/backend/spec/support/ror_ringer.jpeg b/backend/spec/support/ror_ringer.jpeg
deleted file mode 100644
index 68009b1b7a..0000000000
Binary files a/backend/spec/support/ror_ringer.jpeg and /dev/null differ
diff --git a/backend/spec/test_views/spree/admin/dummy_models/edit.html.erb b/backend/spec/test_views/spree/admin/dummy_models/edit.html.erb
deleted file mode 100644
index 366226fb97..0000000000
--- a/backend/spec/test_views/spree/admin/dummy_models/edit.html.erb
+++ /dev/null
@@ -1 +0,0 @@
-edit
diff --git a/backend/spec/test_views/spree/admin/dummy_models/new.html.erb b/backend/spec/test_views/spree/admin/dummy_models/new.html.erb
deleted file mode 100644
index 3e757656cf..0000000000
--- a/backend/spec/test_views/spree/admin/dummy_models/new.html.erb
+++ /dev/null
@@ -1 +0,0 @@
-new
diff --git a/backend/spec/test_views/spree/admin/submodule/posts/edit.html.erb b/backend/spec/test_views/spree/admin/submodule/posts/edit.html.erb
deleted file mode 100644
index 8491ab9f80..0000000000
--- a/backend/spec/test_views/spree/admin/submodule/posts/edit.html.erb
+++ /dev/null
@@ -1 +0,0 @@
-edit
\ No newline at end of file
diff --git a/backend/spec/test_views/spree/admin/submodule/posts/new.html.erb b/backend/spec/test_views/spree/admin/submodule/posts/new.html.erb
deleted file mode 100644
index 3e5126c4e7..0000000000
--- a/backend/spec/test_views/spree/admin/submodule/posts/new.html.erb
+++ /dev/null
@@ -1 +0,0 @@
-new
\ No newline at end of file
diff --git a/backend/spree_backend.gemspec b/backend/spree_backend.gemspec
deleted file mode 100644
index 48f8974b74..0000000000
--- a/backend/spree_backend.gemspec
+++ /dev/null
@@ -1,43 +0,0 @@
-# encoding: UTF-8
-require_relative '../core/lib/spree/core/version.rb'
-
-Gem::Specification.new do |s|
- s.platform = Gem::Platform::RUBY
- s.name = 'spree_backend'
- s.version = Spree.version
- s.authors = ['Sean Schofield', 'Spark Solutions']
- s.email = '[email protected]'
- s.summary = 'Admin Dashboard for Spree eCommerce platform'
- s.description = 'Admin Dashboard for Spree eCommerce platform'
- s.homepage = 'https://spreecommerce.org'
- s.license = 'BSD-3-Clause'
-
- s.metadata = {
- "bug_tracker_uri" => "https://github.com/spree/spree/issues",
- "changelog_uri" => "https://github.com/spree/spree/releases/tag/v#{s.version}",
- "documentation_uri" => "https://dev-docs.spreecommerce.org/",
- "source_code_uri" => "https://github.com/spree/spree/tree/v#{s.version}",
- }
-
- s.required_ruby_version = '>= 2.5'
-
- s.files = `git ls-files`.split("\n").reject { |f| f.match(/^spec/) && !f.match(/^spec\/fixtures/) }
- s.require_path = 'lib'
- s.requirements << 'none'
-
- s.add_dependency 'spree_api', ">= #{s.version}"
- s.add_dependency 'spree_core', ">= #{s.version}"
-
- s.add_dependency 'babel-transpiler', '~> 0.7'
- s.add_dependency 'bootstrap', '~> 4.0'
- s.add_dependency 'glyphicons', '~> 1.0'
- s.add_dependency 'flatpickr', '~> 4.6'
- s.add_dependency 'inline_svg', '~> 1.5'
- s.add_dependency 'jquery-rails', '~> 4.3'
- s.add_dependency 'jquery-ui-rails', '~> 6.0'
- s.add_dependency 'responders'
- s.add_dependency 'sass-rails', '>= 5'
- s.add_dependency 'select2-rails', '~> 4.0'
- s.add_dependency 'sprockets', '~> 4.0'
- s.add_dependency 'tinymce-rails'
-end
diff --git a/backend/vendor/assets/javascripts/cleave.js b/backend/vendor/assets/javascripts/cleave.js
deleted file mode 100644
index 6362647dc4..0000000000
--- a/backend/vendor/assets/javascripts/cleave.js
+++ /dev/null
@@ -1,8 +0,0 @@
-/*!
- * cleave.js - 1.6.0
- * https://github.com/nosir/cleave.js
- * Apache License Version 2.0
- *
- * Copyright (C) 2012-2020 Max Huang https://github.com/nosir/
- */
-!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Cleave=t():e.Cleave=t()}(this,function(){return function(e){function t(i){if(r[i])return r[i].exports;var n=r[i]={exports:{},id:i,loaded:!1};return e[i].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){(function(t){"use strict";var i=function(e,t){var r=this,n=!1;if("string"==typeof e?(r.element=document.querySelector(e),n=document.querySelectorAll(e).length>1):"undefined"!=typeof e.length&&e.length>0?(r.element=e[0],n=e.length>1):r.element=e,!r.element)throw new Error("[cleave.js] Please check the element");if(n)try{console.warn("[cleave.js] Multiple input fields matched, cleave.js will only take the first one.")}catch(a){}t.initValue=r.element.value,r.properties=i.DefaultProperties.assign({},t),r.init()};i.prototype={init:function(){var e=this,t=e.properties;return t.numeral||t.phone||t.creditCard||t.time||t.date||0!==t.blocksLength||t.prefix?(t.maxLength=i.Util.getMaxLength(t.blocks),e.isAndroid=i.Util.isAndroid(),e.lastInputValue="",e.isBackward="",e.onChangeListener=e.onChange.bind(e),e.onKeyDownListener=e.onKeyDown.bind(e),e.onFocusListener=e.onFocus.bind(e),e.onCutListener=e.onCut.bind(e),e.onCopyListener=e.onCopy.bind(e),e.initSwapHiddenInput(),e.element.addEventListener("input",e.onChangeListener),e.element.addEventListener("keydown",e.onKeyDownListener),e.element.addEventListener("focus",e.onFocusListener),e.element.addEventListener("cut",e.onCutListener),e.element.addEventListener("copy",e.onCopyListener),e.initPhoneFormatter(),e.initDateFormatter(),e.initTimeFormatter(),e.initNumeralFormatter(),void((t.initValue||t.prefix&&!t.noImmediatePrefix)&&e.onInput(t.initValue))):void e.onInput(t.initValue)},initSwapHiddenInput:function(){var e=this,t=e.properties;if(t.swapHiddenInput){var r=e.element.cloneNode(!0);e.element.parentNode.insertBefore(r,e.element),e.elementSwapHidden=e.element,e.elementSwapHidden.type="hidden",e.element=r,e.element.id=""}},initNumeralFormatter:function(){var e=this,t=e.properties;t.numeral&&(t.numeralFormatter=new i.NumeralFormatter(t.numeralDecimalMark,t.numeralIntegerScale,t.numeralDecimalScale,t.numeralThousandsGroupStyle,t.numeralPositiveOnly,t.stripLeadingZeroes,t.prefix,t.signBeforePrefix,t.tailPrefix,t.delimiter))},initTimeFormatter:function(){var e=this,t=e.properties;t.time&&(t.timeFormatter=new i.TimeFormatter(t.timePattern,t.timeFormat),t.blocks=t.timeFormatter.getBlocks(),t.blocksLength=t.blocks.length,t.maxLength=i.Util.getMaxLength(t.blocks))},initDateFormatter:function(){var e=this,t=e.properties;t.date&&(t.dateFormatter=new i.DateFormatter(t.datePattern,t.dateMin,t.dateMax),t.blocks=t.dateFormatter.getBlocks(),t.blocksLength=t.blocks.length,t.maxLength=i.Util.getMaxLength(t.blocks))},initPhoneFormatter:function(){var e=this,t=e.properties;if(t.phone)try{t.phoneFormatter=new i.PhoneFormatter(new t.root.Cleave.AsYouTypeFormatter(t.phoneRegionCode),t.delimiter)}catch(r){throw new Error("[cleave.js] Please include phone-type-formatter.{country}.js lib")}},onKeyDown:function(e){var t=this,r=e.which||e.keyCode;t.lastInputValue=t.element.value,t.isBackward=8===r},onChange:function(e){var t=this,r=t.properties,n=i.Util;t.isBackward=t.isBackward||"deleteContentBackward"===e.inputType;var a=n.getPostDelimiter(t.lastInputValue,r.delimiter,r.delimiters);t.isBackward&&a?r.postDelimiterBackspace=a:r.postDelimiterBackspace=!1,this.onInput(this.element.value)},onFocus:function(){var e=this,t=e.properties;e.lastInputValue=e.element.value,t.prefix&&t.noImmediatePrefix&&!e.element.value&&this.onInput(t.prefix),i.Util.fixPrefixCursor(e.element,t.prefix,t.delimiter,t.delimiters)},onCut:function(e){i.Util.checkFullSelection(this.element.value)&&(this.copyClipboardData(e),this.onInput(""))},onCopy:function(e){i.Util.checkFullSelection(this.element.value)&&this.copyClipboardData(e)},copyClipboardData:function(e){var t=this,r=t.properties,n=i.Util,a=t.element.value,o="";o=r.copyDelimiter?a:n.stripDelimiters(a,r.delimiter,r.delimiters);try{e.clipboardData?e.clipboardData.setData("Text",o):window.clipboardData.setData("Text",o),e.preventDefault()}catch(l){}},onInput:function(e){var t=this,r=t.properties,n=i.Util,a=n.getPostDelimiter(e,r.delimiter,r.delimiters);return r.numeral||!r.postDelimiterBackspace||a||(e=n.headStr(e,e.length-r.postDelimiterBackspace.length)),r.phone?(!r.prefix||r.noImmediatePrefix&&!e.length?r.result=r.phoneFormatter.format(e):r.result=r.prefix+r.phoneFormatter.format(e).slice(r.prefix.length),void t.updateValueState()):r.numeral?(r.prefix&&r.noImmediatePrefix&&0===e.length?r.result="":r.result=r.numeralFormatter.format(e),void t.updateValueState()):(r.date&&(e=r.dateFormatter.getValidatedDate(e)),r.time&&(e=r.timeFormatter.getValidatedTime(e)),e=n.stripDelimiters(e,r.delimiter,r.delimiters),e=n.getPrefixStrippedValue(e,r.prefix,r.prefixLength,r.result,r.delimiter,r.delimiters,r.noImmediatePrefix,r.tailPrefix,r.signBeforePrefix),e=r.numericOnly?n.strip(e,/[^\d]/g):e,e=r.uppercase?e.toUpperCase():e,e=r.lowercase?e.toLowerCase():e,r.prefix&&(r.tailPrefix?e+=r.prefix:e=r.prefix+e,0===r.blocksLength)?(r.result=e,void t.updateValueState()):(r.creditCard&&t.updateCreditCardPropsByValue(e),e=n.headStr(e,r.maxLength),r.result=n.getFormattedValue(e,r.blocks,r.blocksLength,r.delimiter,r.delimiters,r.delimiterLazyShow),void t.updateValueState()))},updateCreditCardPropsByValue:function(e){var t,r=this,n=r.properties,a=i.Util;a.headStr(n.result,4)!==a.headStr(e,4)&&(t=i.CreditCardDetector.getInfo(e,n.creditCardStrictMode),n.blocks=t.blocks,n.blocksLength=n.blocks.length,n.maxLength=a.getMaxLength(n.blocks),n.creditCardType!==t.type&&(n.creditCardType=t.type,n.onCreditCardTypeChanged.call(r,n.creditCardType)))},updateValueState:function(){var e=this,t=i.Util,r=e.properties;if(e.element){var n=e.element.selectionEnd,a=e.element.value,o=r.result;if(n=t.getNextCursorPosition(n,a,o,r.delimiter,r.delimiters),e.isAndroid)return void window.setTimeout(function(){e.element.value=o,t.setSelection(e.element,n,r.document,!1),e.callOnValueChanged()},1);e.element.value=o,r.swapHiddenInput&&(e.elementSwapHidden.value=e.getRawValue()),t.setSelection(e.element,n,r.document,!1),e.callOnValueChanged()}},callOnValueChanged:function(){var e=this,t=e.properties;t.onValueChanged.call(e,{target:{name:e.element.name,value:t.result,rawValue:e.getRawValue()}})},setPhoneRegionCode:function(e){var t=this,r=t.properties;r.phoneRegionCode=e,t.initPhoneFormatter(),t.onChange()},setRawValue:function(e){var t=this,r=t.properties;e=void 0!==e&&null!==e?e.toString():"",r.numeral&&(e=e.replace(".",r.numeralDecimalMark)),r.postDelimiterBackspace=!1,t.element.value=e,t.onInput(e)},getRawValue:function(){var e=this,t=e.properties,r=i.Util,n=e.element.value;return t.rawValueTrimPrefix&&(n=r.getPrefixStrippedValue(n,t.prefix,t.prefixLength,t.result,t.delimiter,t.delimiters,t.noImmediatePrefix,t.tailPrefix,t.signBeforePrefix)),n=t.numeral?t.numeralFormatter.getRawValue(n):r.stripDelimiters(n,t.delimiter,t.delimiters)},getISOFormatDate:function(){var e=this,t=e.properties;return t.date?t.dateFormatter.getISOFormatDate():""},getISOFormatTime:function(){var e=this,t=e.properties;return t.time?t.timeFormatter.getISOFormatTime():""},getFormattedValue:function(){return this.element.value},destroy:function(){var e=this;e.element.removeEventListener("input",e.onChangeListener),e.element.removeEventListener("keydown",e.onKeyDownListener),e.element.removeEventListener("focus",e.onFocusListener),e.element.removeEventListener("cut",e.onCutListener),e.element.removeEventListener("copy",e.onCopyListener)},toString:function(){return"[Cleave Object]"}},i.NumeralFormatter=r(1),i.DateFormatter=r(2),i.TimeFormatter=r(3),i.PhoneFormatter=r(4),i.CreditCardDetector=r(5),i.Util=r(6),i.DefaultProperties=r(7),("object"==typeof t&&t?t:window).Cleave=i,e.exports=i}).call(t,function(){return this}())},function(e,t){"use strict";var r=function(e,t,i,n,a,o,l,s,c,u){var d=this;d.numeralDecimalMark=e||".",d.numeralIntegerScale=t>0?t:0,d.numeralDecimalScale=i>=0?i:2,d.numeralThousandsGroupStyle=n||r.groupStyle.thousand,d.numeralPositiveOnly=!!a,d.stripLeadingZeroes=o!==!1,d.prefix=l||""===l?l:"",d.signBeforePrefix=!!s,d.tailPrefix=!!c,d.delimiter=u||""===u?u:",",d.delimiterRE=u?new RegExp("\\"+u,"g"):""};r.groupStyle={thousand:"thousand",lakh:"lakh",wan:"wan",none:"none"},r.prototype={getRawValue:function(e){return e.replace(this.delimiterRE,"").replace(this.numeralDecimalMark,".")},format:function(e){var t,i,n,a,o=this,l="";switch(e=e.replace(/[A-Za-z]/g,"").replace(o.numeralDecimalMark,"M").replace(/[^\dM-]/g,"").replace(/^\-/,"N").replace(/\-/g,"").replace("N",o.numeralPositiveOnly?"":"-").replace("M",o.numeralDecimalMark),o.stripLeadingZeroes&&(e=e.replace(/^(-)?0+(?=\d)/,"$1")),i="-"===e.slice(0,1)?"-":"",n="undefined"!=typeof o.prefix?o.signBeforePrefix?i+o.prefix:o.prefix+i:i,a=e,e.indexOf(o.numeralDecimalMark)>=0&&(t=e.split(o.numeralDecimalMark),a=t[0],l=o.numeralDecimalMark+t[1].slice(0,o.numeralDecimalScale)),"-"===i&&(a=a.slice(1)),o.numeralIntegerScale>0&&(a=a.slice(0,o.numeralIntegerScale)),o.numeralThousandsGroupStyle){case r.groupStyle.lakh:a=a.replace(/(\d)(?=(\d\d)+\d$)/g,"$1"+o.delimiter);break;case r.groupStyle.wan:a=a.replace(/(\d)(?=(\d{4})+$)/g,"$1"+o.delimiter);break;case r.groupStyle.thousand:a=a.replace(/(\d)(?=(\d{3})+$)/g,"$1"+o.delimiter)}return o.tailPrefix?i+a.toString()+(o.numeralDecimalScale>0?l.toString():"")+o.prefix:n+a.toString()+(o.numeralDecimalScale>0?l.toString():"")}},e.exports=r},function(e,t){"use strict";var r=function(e,t,r){var i=this;i.date=[],i.blocks=[],i.datePattern=e,i.dateMin=t.split("-").reverse().map(function(e){return parseInt(e,10)}),2===i.dateMin.length&&i.dateMin.unshift(0),i.dateMax=r.split("-").reverse().map(function(e){return parseInt(e,10)}),2===i.dateMax.length&&i.dateMax.unshift(0),i.initBlocks()};r.prototype={initBlocks:function(){var e=this;e.datePattern.forEach(function(t){"Y"===t?e.blocks.push(4):e.blocks.push(2)})},getISOFormatDate:function(){var e=this,t=e.date;return t[2]?t[2]+"-"+e.addLeadingZero(t[1])+"-"+e.addLeadingZero(t[0]):""},getBlocks:function(){return this.blocks},getValidatedDate:function(e){var t=this,r="";return e=e.replace(/[^\d]/g,""),t.blocks.forEach(function(i,n){if(e.length>0){var a=e.slice(0,i),o=a.slice(0,1),l=e.slice(i);switch(t.datePattern[n]){case"d":"00"===a?a="01":parseInt(o,10)>3?a="0"+o:parseInt(a,10)>31&&(a="31");break;case"m":"00"===a?a="01":parseInt(o,10)>1?a="0"+o:parseInt(a,10)>12&&(a="12")}r+=a,e=l}}),this.getFixedDateString(r)},getFixedDateString:function(e){var t,r,i,n=this,a=n.datePattern,o=[],l=0,s=0,c=0,u=0,d=0,m=0,p=!1;4===e.length&&"y"!==a[0].toLowerCase()&&"y"!==a[1].toLowerCase()&&(u="d"===a[0]?0:2,d=2-u,t=parseInt(e.slice(u,u+2),10),r=parseInt(e.slice(d,d+2),10),o=this.getFixedDate(t,r,0)),8===e.length&&(a.forEach(function(e,t){switch(e){case"d":l=t;break;case"m":s=t;break;default:c=t}}),m=2*c,u=l<=c?2*l:2*l+2,d=s<=c?2*s:2*s+2,t=parseInt(e.slice(u,u+2),10),r=parseInt(e.slice(d,d+2),10),i=parseInt(e.slice(m,m+4),10),p=4===e.slice(m,m+4).length,o=this.getFixedDate(t,r,i)),4!==e.length||"y"!==a[0]&&"y"!==a[1]||(d="m"===a[0]?0:2,m=2-d,r=parseInt(e.slice(d,d+2),10),i=parseInt(e.slice(m,m+2),10),p=2===e.slice(m,m+2).length,o=[0,r,i]),6!==e.length||"Y"!==a[0]&&"Y"!==a[1]||(d="m"===a[0]?0:4,m=2-.5*d,r=parseInt(e.slice(d,d+2),10),i=parseInt(e.slice(m,m+4),10),p=4===e.slice(m,m+4).length,o=[0,r,i]),o=n.getRangeFixedDate(o),n.date=o;var h=0===o.length?e:a.reduce(function(e,t){switch(t){case"d":return e+(0===o[0]?"":n.addLeadingZero(o[0]));case"m":return e+(0===o[1]?"":n.addLeadingZero(o[1]));case"y":return e+(p?n.addLeadingZeroForYear(o[2],!1):"");case"Y":return e+(p?n.addLeadingZeroForYear(o[2],!0):"")}},"");return h},getRangeFixedDate:function(e){var t=this,r=t.datePattern,i=t.dateMin||[],n=t.dateMax||[];return!e.length||i.length<3&&n.length<3?e:r.find(function(e){return"y"===e.toLowerCase()})&&0===e[2]?e:n.length&&(n[2]<e[2]||n[2]===e[2]&&(n[1]<e[1]||n[1]===e[1]&&n[0]<e[0]))?n:i.length&&(i[2]>e[2]||i[2]===e[2]&&(i[1]>e[1]||i[1]===e[1]&&i[0]>e[0]))?i:e},getFixedDate:function(e,t,r){return e=Math.min(e,31),t=Math.min(t,12),r=parseInt(r||0,10),(t<7&&t%2===0||t>8&&t%2===1)&&(e=Math.min(e,2===t?this.isLeapYear(r)?29:28:30)),[e,t,r]},isLeapYear:function(e){return e%4===0&&e%100!==0||e%400===0},addLeadingZero:function(e){return(e<10?"0":"")+e},addLeadingZeroForYear:function(e,t){return t?(e<10?"000":e<100?"00":e<1e3?"0":"")+e:(e<10?"0":"")+e}},e.exports=r},function(e,t){"use strict";var r=function(e,t){var r=this;r.time=[],r.blocks=[],r.timePattern=e,r.timeFormat=t,r.initBlocks()};r.prototype={initBlocks:function(){var e=this;e.timePattern.forEach(function(){e.blocks.push(2)})},getISOFormatTime:function(){var e=this,t=e.time;return t[2]?e.addLeadingZero(t[0])+":"+e.addLeadingZero(t[1])+":"+e.addLeadingZero(t[2]):""},getBlocks:function(){return this.blocks},getTimeFormatOptions:function(){var e=this;return"12"===String(e.timeFormat)?{maxHourFirstDigit:1,maxHours:12,maxMinutesFirstDigit:5,maxMinutes:60}:{maxHourFirstDigit:2,maxHours:23,maxMinutesFirstDigit:5,maxMinutes:60}},getValidatedTime:function(e){var t=this,r="";e=e.replace(/[^\d]/g,"");var i=t.getTimeFormatOptions();return t.blocks.forEach(function(n,a){if(e.length>0){var o=e.slice(0,n),l=o.slice(0,1),s=e.slice(n);switch(t.timePattern[a]){case"h":parseInt(l,10)>i.maxHourFirstDigit?o="0"+l:parseInt(o,10)>i.maxHours&&(o=i.maxHours+"");break;case"m":case"s":parseInt(l,10)>i.maxMinutesFirstDigit?o="0"+l:parseInt(o,10)>i.maxMinutes&&(o=i.maxMinutes+"")}r+=o,e=s}}),this.getFixedTimeString(r)},getFixedTimeString:function(e){var t,r,i,n=this,a=n.timePattern,o=[],l=0,s=0,c=0,u=0,d=0,m=0;return 6===e.length&&(a.forEach(function(e,t){switch(e){case"s":l=2*t;break;case"m":s=2*t;break;case"h":c=2*t}}),m=c,d=s,u=l,t=parseInt(e.slice(u,u+2),10),r=parseInt(e.slice(d,d+2),10),i=parseInt(e.slice(m,m+2),10),o=this.getFixedTime(i,r,t)),4===e.length&&n.timePattern.indexOf("s")<0&&(a.forEach(function(e,t){switch(e){case"m":s=2*t;break;case"h":c=2*t}}),m=c,d=s,t=0,r=parseInt(e.slice(d,d+2),10),i=parseInt(e.slice(m,m+2),10),o=this.getFixedTime(i,r,t)),n.time=o,0===o.length?e:a.reduce(function(e,t){switch(t){case"s":return e+n.addLeadingZero(o[2]);case"m":return e+n.addLeadingZero(o[1]);case"h":return e+n.addLeadingZero(o[0])}},"")},getFixedTime:function(e,t,r){return r=Math.min(parseInt(r||0,10),60),t=Math.min(t,60),e=Math.min(e,60),[e,t,r]},addLeadingZero:function(e){return(e<10?"0":"")+e}},e.exports=r},function(e,t){"use strict";var r=function(e,t){var r=this;r.delimiter=t||""===t?t:" ",r.delimiterRE=t?new RegExp("\\"+t,"g"):"",r.formatter=e};r.prototype={setFormatter:function(e){this.formatter=e},format:function(e){var t=this;t.formatter.clear(),e=e.replace(/[^\d+]/g,""),e=e.replace(/^\+/,"B").replace(/\+/g,"").replace("B","+"),e=e.replace(t.delimiterRE,"");for(var r,i="",n=!1,a=0,o=e.length;a<o;a++)r=t.formatter.inputDigit(e.charAt(a)),/[\s()-]/g.test(r)?(i=r,n=!0):n||(i=r);return i=i.replace(/[()]/g,""),i=i.replace(/[\s-]/g,t.delimiter)}},e.exports=r},function(e,t){"use strict";var r={blocks:{uatp:[4,5,6],amex:[4,6,5],diners:[4,6,4],discover:[4,4,4,4],mastercard:[4,4,4,4],dankort:[4,4,4,4],instapayment:[4,4,4,4],jcb15:[4,6,5],jcb:[4,4,4,4],maestro:[4,4,4,4],visa:[4,4,4,4],mir:[4,4,4,4],unionPay:[4,4,4,4],general:[4,4,4,4]},re:{uatp:/^(?!1800)1\d{0,14}/,amex:/^3[47]\d{0,13}/,discover:/^(?:6011|65\d{0,2}|64[4-9]\d?)\d{0,12}/,diners:/^3(?:0([0-5]|9)|[689]\d?)\d{0,11}/,mastercard:/^(5[1-5]\d{0,2}|22[2-9]\d{0,1}|2[3-7]\d{0,2})\d{0,12}/,dankort:/^(5019|4175|4571)\d{0,12}/,instapayment:/^63[7-9]\d{0,13}/,jcb15:/^(?:2131|1800)\d{0,11}/,jcb:/^(?:35\d{0,2})\d{0,12}/,maestro:/^(?:5[0678]\d{0,2}|6304|67\d{0,2})\d{0,12}/,mir:/^220[0-4]\d{0,12}/,visa:/^4\d{0,15}/,unionPay:/^(62|81)\d{0,14}/},getStrictBlocks:function(e){var t=e.reduce(function(e,t){return e+t},0);return e.concat(19-t)},getInfo:function(e,t){var i=r.blocks,n=r.re;t=!!t;for(var a in n)if(n[a].test(e)){var o=i[a];return{type:a,blocks:t?this.getStrictBlocks(o):o}}return{type:"unknown",blocks:t?this.getStrictBlocks(i.general):i.general}}};e.exports=r},function(e,t){"use strict";var r={noop:function(){},strip:function(e,t){return e.replace(t,"")},getPostDelimiter:function(e,t,r){if(0===r.length)return e.slice(-t.length)===t?t:"";var i="";return r.forEach(function(t){e.slice(-t.length)===t&&(i=t)}),i},getDelimiterREByDelimiter:function(e){return new RegExp(e.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),"g")},getNextCursorPosition:function(e,t,r,i,n){return t.length===e?r.length:e+this.getPositionOffset(e,t,r,i,n)},getPositionOffset:function(e,t,r,i,n){var a,o,l;return a=this.stripDelimiters(t.slice(0,e),i,n),o=this.stripDelimiters(r.slice(0,e),i,n),l=a.length-o.length,0!==l?l/Math.abs(l):0},stripDelimiters:function(e,t,r){var i=this;if(0===r.length){var n=t?i.getDelimiterREByDelimiter(t):"";return e.replace(n,"")}return r.forEach(function(t){t.split("").forEach(function(t){e=e.replace(i.getDelimiterREByDelimiter(t),"")})}),e},headStr:function(e,t){return e.slice(0,t)},getMaxLength:function(e){return e.reduce(function(e,t){return e+t},0)},getPrefixStrippedValue:function(e,t,r,i,n,a,o,l,s){if(0===r)return e;if(e===t&&""!==e)return"";if(s&&"-"==e.slice(0,1)){var c="-"==i.slice(0,1)?i.slice(1):i;return"-"+this.getPrefixStrippedValue(e.slice(1),t,r,c,n,a,o,l,s)}if(i.slice(0,r)!==t&&!l)return o&&!i&&e?e:"";if(i.slice(-r)!==t&&l)return o&&!i&&e?e:"";var u=this.stripDelimiters(i,n,a);return e.slice(0,r)===t||l?e.slice(-r)!==t&&l?u.slice(0,-r-1):l?e.slice(0,-r):e.slice(r):u.slice(r)},getFirstDiffIndex:function(e,t){for(var r=0;e.charAt(r)===t.charAt(r);)if(""===e.charAt(r++))return-1;return r},getFormattedValue:function(e,t,r,i,n,a){var o="",l=n.length>0,s="";return 0===r?e:(t.forEach(function(t,c){if(e.length>0){var u=e.slice(0,t),d=e.slice(t);s=l?n[a?c-1:c]||s:i,a?(c>0&&(o+=s),o+=u):(o+=u,u.length===t&&c<r-1&&(o+=s)),e=d}}),o)},fixPrefixCursor:function(e,t,r,i){if(e){var n=e.value,a=r||i[0]||" ";if(e.setSelectionRange&&t&&!(t.length+a.length<=n.length)){var o=2*n.length;setTimeout(function(){e.setSelectionRange(o,o)},1)}}},checkFullSelection:function(e){try{var t=window.getSelection()||document.getSelection()||{};return t.toString().length===e.length}catch(r){}return!1},setSelection:function(e,t,r){if(e===this.getActiveElement(r)&&!(e&&e.value.length<=t))if(e.createTextRange){var i=e.createTextRange();i.move("character",t),i.select()}else try{e.setSelectionRange(t,t)}catch(n){console.warn("The input element type does not support selection")}},getActiveElement:function(e){var t=e.activeElement;return t&&t.shadowRoot?this.getActiveElement(t.shadowRoot):t},isAndroid:function(){return navigator&&/android/i.test(navigator.userAgent)},isAndroidBackspaceKeydown:function(e,t){return!!(this.isAndroid()&&e&&t)&&t===e.slice(0,-1)}};e.exports=r},function(e,t){(function(t){"use strict";var r={assign:function(e,r){return e=e||{},r=r||{},e.creditCard=!!r.creditCard,e.creditCardStrictMode=!!r.creditCardStrictMode,e.creditCardType="",e.onCreditCardTypeChanged=r.onCreditCardTypeChanged||function(){},e.phone=!!r.phone,e.phoneRegionCode=r.phoneRegionCode||"AU",e.phoneFormatter={},e.time=!!r.time,e.timePattern=r.timePattern||["h","m","s"],e.timeFormat=r.timeFormat||"24",e.timeFormatter={},e.date=!!r.date,e.datePattern=r.datePattern||["d","m","Y"],e.dateMin=r.dateMin||"",e.dateMax=r.dateMax||"",e.dateFormatter={},e.numeral=!!r.numeral,e.numeralIntegerScale=r.numeralIntegerScale>0?r.numeralIntegerScale:0,e.numeralDecimalScale=r.numeralDecimalScale>=0?r.numeralDecimalScale:2,e.numeralDecimalMark=r.numeralDecimalMark||".",e.numeralThousandsGroupStyle=r.numeralThousandsGroupStyle||"thousand",e.numeralPositiveOnly=!!r.numeralPositiveOnly,e.stripLeadingZeroes=r.stripLeadingZeroes!==!1,e.signBeforePrefix=!!r.signBeforePrefix,e.tailPrefix=!!r.tailPrefix,e.swapHiddenInput=!!r.swapHiddenInput,e.numericOnly=e.creditCard||e.date||!!r.numericOnly,e.uppercase=!!r.uppercase,e.lowercase=!!r.lowercase,e.prefix=e.creditCard||e.date?"":r.prefix||"",e.noImmediatePrefix=!!r.noImmediatePrefix,e.prefixLength=e.prefix.length,e.rawValueTrimPrefix=!!r.rawValueTrimPrefix,e.copyDelimiter=!!r.copyDelimiter,e.initValue=void 0!==r.initValue&&null!==r.initValue?r.initValue.toString():"",e.delimiter=r.delimiter||""===r.delimiter?r.delimiter:r.date?"/":r.time?":":r.numeral?",":(r.phone," "),e.delimiterLength=e.delimiter.length,e.delimiterLazyShow=!!r.delimiterLazyShow,e.delimiters=r.delimiters||[],e.blocks=r.blocks||[],e.blocksLength=e.blocks.length,e.root="object"==typeof t&&t?t:window,e.document=r.document||e.root.document,e.maxLength=0,e.backspace=!1,e.result="",e.onValueChanged=r.onValueChanged||function(){},e}};e.exports=r}).call(t,function(){return this}())}])});
diff --git a/backend/vendor/assets/javascripts/handlebars.js b/backend/vendor/assets/javascripts/handlebars.js
deleted file mode 100644
index 870199af46..0000000000
--- a/backend/vendor/assets/javascripts/handlebars.js
+++ /dev/null
@@ -1,29 +0,0 @@
-/**!
-
- @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt Expat
- handlebars v5.0.0-alpha.1
-
-Copyright (C) 2011-2017 by Yehuda Katz
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-
-*/
-!function(a,b){"object"==typeof exports&&"object"==typeof module?module.exports=b():"function"==typeof define&&define.amd?define([],b):"object"==typeof exports?exports.Handlebars=b():a.Handlebars=b()}(this,function(){return function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={exports:{},id:d,loaded:!1};return a[d].call(e.exports,e,e.exports,b),e.loaded=!0,e.exports}var c={};return b.m=a,b.c=c,b.p="",b(0)}([function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(){var a=r();return a.compile=function(b,c){return k.compile(b,c,a)},a.precompile=function(b,c){return k.precompile(b,c,a)},a.AST=i["default"],a.Compiler=k.Compiler,a.JavaScriptCompiler=m["default"],a.Parser=j.parser,a.parse=j.parse,a}b.__esModule=!0;var f=c(1),g=d(f),h=c(19),i=d(h),j=c(20),k=c(25),l=c(26),m=d(l),n=c(23),o=d(n),p=c(18),q=d(p),r=g["default"].create,s=e();s.create=e,q["default"](s),s.Visitor=o["default"],s["default"]=s,b["default"]=s,a.exports=b["default"]},function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function f(){var a=new h.HandlebarsEnvironment;return n.extend(a,h),a.SafeString=j["default"],a.Exception=l["default"],a.Utils=n,a.escapeExpression=n.escapeExpression,a.VM=p,a.template=function(b){return p.template(b,a)},a}b.__esModule=!0;var g=c(2),h=e(g),i=c(16),j=d(i),k=c(4),l=d(k),m=c(3),n=e(m),o=c(17),p=e(o),q=c(18),r=d(q),s=f();s.create=f,r["default"](s),s["default"]=s,b["default"]=s,a.exports=b["default"]},function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b,c){this.helpers=a||{},this.partials=b||{},this.decorators=c||{},i.registerDefaultHelpers(this),j.registerDefaultDecorators(this)}b.__esModule=!0,b.HandlebarsEnvironment=e;var f=c(3),g=c(4),h=d(g),i=c(5),j=c(13),k=c(15),l=d(k),m="4.0.10";b.VERSION=m;var n=7;b.COMPILER_REVISION=n;var o={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0"};b.REVISION_CHANGES=o;var p="[object Object]";e.prototype={constructor:e,logger:l["default"],log:l["default"].log,registerHelper:function(a,b){if(f.toString.call(a)===p){if(b)throw new h["default"]("Arg not supported with multiple helpers");f.extend(this.helpers,a)}else this.helpers[a]=b},unregisterHelper:function(a){delete this.helpers[a]},registerPartial:function(a,b){if(f.toString.call(a)===p)f.extend(this.partials,a);else{if("undefined"==typeof b)throw new h["default"]('Attempting to register a partial called "'+a+'" as undefined');this.partials[a]=b}},unregisterPartial:function(a){delete this.partials[a]},registerDecorator:function(a,b){if(f.toString.call(a)===p){if(b)throw new h["default"]("Arg not supported with multiple decorators");f.extend(this.decorators,a)}else this.decorators[a]=b},unregisterDecorator:function(a){delete this.decorators[a]}};var q=l["default"].log;b.log=q,b.createFrame=f.createFrame,b.logger=l["default"]},function(a,b){"use strict";function c(a){return i[a]}function d(a){for(var b=1;b<arguments.length;b++)for(var c in arguments[b])Object.prototype.hasOwnProperty.call(arguments[b],c)&&(a[c]=arguments[b][c]);return a}function e(a,b){for(var c=0,d=a.length;c<d;c++)if(a[c]===b)return c;return-1}function f(a){if("string"!=typeof a){if(a&&a.toHTML)return a.toHTML();if(null==a)return"";if(!a)return a+"";a=""+a}return k.test(a)?a.replace(j,c):a}function g(a){return!a&&0!==a||!(!n(a)||0!==a.length)}function h(a){var b=d({},a);return b._parent=a,b}b.__esModule=!0,b.extend=d,b.indexOf=e,b.escapeExpression=f,b.isEmpty=g,b.createFrame=h;var i={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;","=":"&#x3D;"},j=/[&<>"'`=]/g,k=/[&<>"'`=]/,l=Object.prototype.toString;b.toString=l;var m=function(a){return"function"==typeof a};m(/x/)&&(b.isFunction=m=function(a){return"function"==typeof a&&"[object Function]"===l.call(a)}),b.isFunction=m;var n=Array.isArray||function(a){return!(!a||"object"!=typeof a)&&"[object Array]"===l.call(a)};b.isArray=n},function(a,b){"use strict";function c(a,b){var e=b&&b.loc,f=void 0,g=void 0;e&&(f=e.start.line,g=e.start.column,a+=" - "+f+":"+g);for(var h=Error.prototype.constructor.call(this,a),i=0;i<d.length;i++)this[d[i]]=h[d[i]];Error.captureStackTrace&&Error.captureStackTrace(this,c);try{e&&(this.lineNumber=f,Object.defineProperty?Object.defineProperty(this,"column",{value:g,enumerable:!0}):this.column=g)}catch(j){}}b.__esModule=!0;var d=["description","fileName","lineNumber","message","name","number","stack"];c.prototype=new Error,b["default"]=c,a.exports=b["default"]},function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){g["default"](a),i["default"](a),k["default"](a),m["default"](a),o["default"](a),q["default"](a),s["default"](a)}b.__esModule=!0,b.registerDefaultHelpers=e;var f=c(6),g=d(f),h=c(7),i=d(h),j=c(8),k=d(j),l=c(9),m=d(l),n=c(10),o=d(n),p=c(11),q=d(p),r=c(12),s=d(r)},function(a,b,c){"use strict";b.__esModule=!0;var d=c(3);b["default"]=function(a){a.registerHelper("blockHelperMissing",function(b,c){var e=c.inverse,f=c.fn;return b===!0?f(this):b===!1||null==b?e(this):d.isArray(b)?b.length>0?a.helpers.each(b,c):e(this):f(b,c)})},a.exports=b["default"]},function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}b.__esModule=!0;var e=c(3),f=c(4),g=d(f);b["default"]=function(a){a.registerHelper("each",function(a,b){function c(b,c,e){j&&(j.key=b,j.index=c,j.first=0===c,j.last=!!e),i+=d(a[b],{data:j,blockParams:[a[b],b]})}if(!b)throw new g["default"]("Must pass iterator to #each");var d=b.fn,f=b.inverse,h=0,i="",j=void 0;if(e.isFunction(a)&&(a=a.call(this)),b.data&&(j=e.createFrame(b.data)),a&&"object"==typeof a)if(e.isArray(a))for(var k=a.length;h<k;h++)h in a&&c(h,h,h===a.length-1);else{var l=void 0;for(var m in a)a.hasOwnProperty(m)&&(void 0!==l&&c(l,h-1),l=m,h++);void 0!==l&&c(l,h-1,!0)}return 0===h&&(i=f(this)),i})},a.exports=b["default"]},function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}b.__esModule=!0;var e=c(4),f=d(e);b["default"]=function(a){a.registerHelper("helperMissing",function(){if(1!==arguments.length)throw new f["default"]('Missing helper: "'+arguments[arguments.length-1].name+'"')})},a.exports=b["default"]},function(a,b,c){"use strict";b.__esModule=!0;var d=c(3);b["default"]=function(a){a.registerHelper("if",function(a,b){return d.isFunction(a)&&(a=a.call(this)),!b.hash.includeZero&&!a||d.isEmpty(a)?b.inverse(this):b.fn(this)}),a.registerHelper("unless",function(b,c){return a.helpers["if"].call(this,b,{fn:c.inverse,inverse:c.fn,hash:c.hash})})},a.exports=b["default"]},function(a,b){"use strict";b.__esModule=!0,b["default"]=function(a){a.registerHelper("log",function(){for(var b=[void 0],c=arguments[arguments.length-1],d=0;d<arguments.length-1;d++)b.push(arguments[d]);var e=1;null!=c.hash.level?e=c.hash.level:c.data&&null!=c.data.level&&(e=c.data.level),b[0]=e,a.log.apply(a,b)})},a.exports=b["default"]},function(a,b){"use strict";b.__esModule=!0,b["default"]=function(a){a.registerHelper("lookup",function(a,b){return a&&a[b]})},a.exports=b["default"]},function(a,b,c){"use strict";b.__esModule=!0;var d=c(3);b["default"]=function(a){a.registerHelper("with",function(a,b){d.isFunction(a)&&(a=a.call(this));var c=b.fn;if(d.isEmpty(a))return b.inverse(this);var e=b.data;return c(a,{data:e,blockParams:[a]})})},a.exports=b["default"]},function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){g["default"](a)}b.__esModule=!0,b.registerDefaultDecorators=e;var f=c(14),g=d(f)},function(a,b,c){"use strict";b.__esModule=!0;var d=c(3);b["default"]=function(a){a.registerDecorator("inline",function(a,b,c,e){var f=a;return b.partials||(b.partials={},f=function(e,f){var g=c.partials;c.partials=d.extend({},g,b.partials);var h=a(e,f);return c.partials=g,h}),b.partials[e.args[0]]=e.fn,f})},a.exports=b["default"]},function(a,b,c){"use strict";b.__esModule=!0;var d=c(3),e={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(a){if("string"==typeof a){var b=d.indexOf(e.methodMap,a.toLowerCase());a=b>=0?b:parseInt(a,10)}return a},log:function(a){if(a=e.lookupLevel(a),"undefined"!=typeof console&&e.lookupLevel(e.level)<=a){var b=e.methodMap[a];console[b]||(b="log");for(var c=arguments.length,d=Array(c>1?c-1:0),f=1;f<c;f++)d[f-1]=arguments[f];console[b].apply(console,d)}}};b["default"]=e,a.exports=b["default"]},function(a,b){"use strict";function c(a){this.string=a}b.__esModule=!0,c.prototype.toString=c.prototype.toHTML=function(){return""+this.string},b["default"]=c,a.exports=b["default"]},function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function f(a){var b=a&&a[0]||1,c=r.COMPILER_REVISION;if(b!==c){if(b<c){var d=r.REVISION_CHANGES[c],e=r.REVISION_CHANGES[b];throw new q["default"]("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+d+") or downgrade your runtime to an older version ("+e+").")}throw new q["default"]("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+a[1]+").")}}function g(a,b){function c(c,d,e){e.hash&&(d=o.extend({},d,e.hash)),c=b.VM.resolvePartial.call(this,c,d,e);var f=b.VM.invokePartial.call(this,c,d,e);if(null==f&&b.compile&&(e.partials[e.name]=b.compile(c,a.compilerOptions,b),f=e.partials[e.name](d,e)),null!=f){if(e.indent){for(var g=f.split("\n"),h=0,i=g.length;h<i&&(g[h]||h+1!==i);h++)g[h]=e.indent+g[h];f=g.join("\n")}return f}throw new q["default"]("The partial "+e.name+" could not be compiled when running in runtime-only mode")}function d(b){function c(b){return""+a.main(f,b,f.helpers,f.partials,g,i,h)}var d=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],g=d.data;e(d),!d.partial&&a.useData&&(g=l(b,g));var h=void 0,i=a.useBlockParams?[]:void 0;return a.useDepths&&(h=d.depths?b!=d.depths[0]?[b].concat(d.depths):d.depths:[b]),(c=m(a.main,c,f,d.depths||[],g,i))(b,d)}function e(c){c.partial?(f.helpers=c.helpers,f.partials=c.partials,f.decorators=c.decorators):(f.helpers=f.merge(c.helpers,b.helpers),a.usePartial&&(f.partials=f.merge(c.partials,b.partials)),(a.usePartial||a.useDecorators)&&(f.decorators=f.merge(c.decorators,b.decorators)))}if(!b)throw new q["default"]("No environment passed to template");if(!a||!a.main)throw new q["default"]("Unknown template object: "+typeof a);a.main.decorator=a.main_d,b.VM.checkRevision(a.compiler);var f={strict:function(a,b){if(!(b in a))throw new q["default"]('"'+b+'" not defined in '+a);return a[b]},lookup:function(a,b){for(var c=a.length,d=0;d<c;d++)if(a[d]&&null!=a[d][b])return a[d][b]},lambda:function(a,b){return"function"==typeof a?a.call(b):a},escapeExpression:o.escapeExpression,invokePartial:c,fn:function(b){var c=a[b];return c.decorator=a[b+"_d"],c},programs:[],program:function(a,b,c,d,e){var f=this.programs[a],g=this.fn(a);return b||e||d||c?f=h(this,a,g,b,c,d,e):f||(f=this.programs[a]=h(this,a,g)),f},data:function(a,b){for(;a&&b--;)a=a._parent;return a},merge:function(a,b){var c=a||b;return a&&b&&a!==b&&(c=o.extend({},b,a)),c},nullContext:Object.seal({}),noop:b.VM.noop,compilerInfo:a.compiler};return d.isTop=!0,d}function h(a,b,c,d,e,f,g){function h(b){var e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],h=g;return!g||b==g[0]||b===a.nullContext&&null===g[0]||(h=[b].concat(g)),c(a,b,a.helpers,a.partials,e.data||d,f&&[e.blockParams].concat(f),h)}return h=m(c,h,a,g,d,f),h.program=b,h.depth=g?g.length:0,h.blockParams=e||0,h}function i(a,b,c){return a?a.call||c.name||(c.name=a,a=c.partials[a]):a="@partial-block"===c.name?c.data["partial-block"]:c.partials[c.name],a}function j(a,b,c){var d=c.data&&c.data["partial-block"];c.partial=!0;var e=void 0;if(c.fn&&c.fn!==k&&!function(){c.data=r.createFrame(c.data);var a=c.fn;e=c.data["partial-block"]=function(b){var c=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return c.data=r.createFrame(c.data),c.data["partial-block"]=d,a(b,c)},a.partials&&(c.partials=o.extend({},c.partials,a.partials))}(),void 0===a&&e&&(a=e),void 0===a)throw new q["default"]("The partial "+c.name+" could not be found");if(a instanceof Function)return a(b,c)}function k(){return""}function l(a,b){return b&&"root"in b||(b=b?r.createFrame(b):{},b.root=a),b}function m(a,b,c,d,e,f){if(a.decorator){var g={};b=a.decorator(b,g,c,d&&d[0],e,f,d),o.extend(b,g)}return b}b.__esModule=!0,b.checkRevision=f,b.template=g,b.wrapProgram=h,b.resolvePartial=i,b.invokePartial=j,b.noop=k;var n=c(3),o=e(n),p=c(4),q=d(p),r=c(2)},function(a,b){(function(c){"use strict";b.__esModule=!0,b["default"]=function(a){var b="undefined"!=typeof c?c:window,d=b.Handlebars;a.noConflict=function(){return b.Handlebars===a&&(b.Handlebars=d),a}},a.exports=b["default"]}).call(b,function(){return this}())},function(a,b){"use strict";b.__esModule=!0;var c={helpers:{helperExpression:function(a){return"SubExpression"===a.type||("MustacheStatement"===a.type||"BlockStatement"===a.type)&&!!(a.params&&a.params.length||a.hash)},scopedId:function(a){return/^\.|this\b/.test(a.original)},simpleId:function(a){return 1===a.parts.length&&!c.helpers.scopedId(a)&&!a.depth}}};b["default"]=c,a.exports=b["default"]},function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if("Program"===a.type)return a;h["default"].yy=n,n.locInfo=function(a){return new n.SourceLocation(b&&b.srcName,a)};var c=new j["default"](b);return c.accept(h["default"].parse(a))}b.__esModule=!0,b.parse=f;var g=c(21),h=e(g),i=c(22),j=e(i),k=c(24),l=d(k),m=c(3);b.parser=h["default"];var n={};m.extend(n,l)},function(a,b){"use strict";b.__esModule=!0;var c=function(){function a(){this.yy={}}var b=function(a,b,c,d){for(c=c||{},d=a.length;d--;c[a[d]]=b);return c},c=[2,46],d=[1,20],e=[5,14,15,19,29,34,39,44,47,48,51,55,60],f=[1,35],g=[1,28],h=[1,29],i=[1,30],j=[1,31],k=[1,32],l=[1,34],m=[14,15,19,29,34,39,44,47,48,51,55,60],n=[14,15,19,29,34,44,47,48,51,55,60],o=[1,44],p=[14,15,19,29,34,47,48,51,55,60],q=[33,65,72,80,81,82,83,84,85],r=[23,33,54,65,68,72,75,80,81,82,83,84,85],s=[1,51],t=[23,33,54,65,68,72,75,80,81,82,83,84,85,87],u=[2,45],v=[54,65,72,80,81,82,83,84,85],w=[1,58],x=[1,59],y=[15,18],z=[1,67],A=[33,65,72,75,80,81,82,83,84,85],B=[23,65,72,80,81,82,83,84,85],C=[1,79],D=[65,68,72,80,81,82,83,84,85],E=[33,75],F=[23,33,54,68,72,75],G=[1,109],H=[1,121],I=[72,77],J={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,partialBlock:12,content:13,COMMENT:14,CONTENT:15,openRawBlock:16,rawBlock_repetition_plus0:17,END_RAW_BLOCK:18,OPEN_RAW_BLOCK:19,helperName:20,openRawBlock_repetition0:21,openRawBlock_option0:22,CLOSE_RAW_BLOCK:23,openBlock:24,block_option0:25,closeBlock:26,openInverse:27,block_option1:28,OPEN_BLOCK:29,openBlock_repetition0:30,openBlock_option0:31,openBlock_option1:32,CLOSE:33,OPEN_INVERSE:34,openInverse_repetition0:35,openInverse_option0:36,openInverse_option1:37,openInverseChain:38,OPEN_INVERSE_CHAIN:39,openInverseChain_repetition0:40,openInverseChain_option0:41,openInverseChain_option1:42,inverseAndProgram:43,INVERSE:44,inverseChain:45,inverseChain_option0:46,OPEN_ENDBLOCK:47,OPEN:48,mustache_repetition0:49,mustache_option0:50,OPEN_UNESCAPED:51,mustache_repetition1:52,mustache_option1:53,CLOSE_UNESCAPED:54,OPEN_PARTIAL:55,partialName:56,partial_repetition0:57,partial_option0:58,openPartialBlock:59,OPEN_PARTIAL_BLOCK:60,openPartialBlock_repetition0:61,openPartialBlock_option0:62,param:63,sexpr:64,OPEN_SEXPR:65,sexpr_repetition0:66,sexpr_option0:67,CLOSE_SEXPR:68,hash:69,hash_repetition_plus0:70,hashSegment:71,ID:72,EQUALS:73,blockParams:74,OPEN_BLOCK_PARAMS:75,blockParams_repetition_plus0:76,CLOSE_BLOCK_PARAMS:77,path:78,dataName:79,STRING:80,NUMBER:81,BOOLEAN:82,UNDEFINED:83,NULL:84,DATA:85,pathSegments:86,SEP:87,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"COMMENT",15:"CONTENT",18:"END_RAW_BLOCK",19:"OPEN_RAW_BLOCK",23:"CLOSE_RAW_BLOCK",29:"OPEN_BLOCK",33:"CLOSE",34:"OPEN_INVERSE",39:"OPEN_INVERSE_CHAIN",44:"INVERSE",47:"OPEN_ENDBLOCK",48:"OPEN",51:"OPEN_UNESCAPED",54:"CLOSE_UNESCAPED",55:"OPEN_PARTIAL",60:"OPEN_PARTIAL_BLOCK",65:"OPEN_SEXPR",68:"CLOSE_SEXPR",72:"ID",73:"EQUALS",75:"OPEN_BLOCK_PARAMS",77:"CLOSE_BLOCK_PARAMS",80:"STRING",81:"NUMBER",82:"BOOLEAN",83:"UNDEFINED",84:"NULL",85:"DATA",87:"SEP"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[13,1],[10,3],[16,5],[9,4],[9,4],[24,6],[27,6],[38,6],[43,2],[45,3],[45,1],[26,3],[8,5],[8,5],[11,5],[12,3],[59,5],[63,1],[63,1],[64,5],[69,1],[71,3],[74,3],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[56,1],[56,1],[79,2],[78,1],[86,3],[86,1],[6,0],[6,2],[17,1],[17,2],[21,0],[21,2],[22,0],[22,1],[25,0],[25,1],[28,0],[28,1],[30,0],[30,2],[31,0],[31,1],[32,0],[32,1],[35,0],[35,2],[36,0],[36,1],[37,0],[37,1],[40,0],[40,2],[41,0],[41,1],[42,0],[42,1],[46,0],[46,1],[49,0],[49,2],[50,0],[50,1],[52,0],[52,2],[53,0],[53,1],[57,0],[57,2],[58,0],[58,1],[61,0],[61,2],[62,0],[62,1],[66,0],[66,2],[67,0],[67,1],[70,1],[70,2],[76,1],[76,2]],performAction:function(a,b,c,d,e,f,g){var h=f.length-1;switch(e){case 1:return f[h-1];case 2:this.$=d.prepareProgram(f[h]);break;case 3:case 4:case 5:case 6:case 7:case 8:case 20:case 27:case 28:case 33:case 34:case 40:case 41:this.$=f[h];break;case 9:this.$={type:"CommentStatement",value:d.stripComment(f[h]),strip:d.stripFlags(f[h],f[h]),loc:d.locInfo(this._$)};break;case 10:this.$={type:"ContentStatement",original:f[h],value:f[h],loc:d.locInfo(this._$)};break;case 11:this.$=d.prepareRawBlock(f[h-2],f[h-1],f[h],this._$);break;case 12:this.$={path:f[h-3],params:f[h-2],hash:f[h-1]};break;case 13:this.$=d.prepareBlock(f[h-3],f[h-2],f[h-1],f[h],!1,this._$);break;case 14:this.$=d.prepareBlock(f[h-3],f[h-2],f[h-1],f[h],!0,this._$);break;case 15:this.$={open:f[h-5],path:f[h-4],params:f[h-3],hash:f[h-2],blockParams:f[h-1],strip:d.stripFlags(f[h-5],f[h])};break;case 16:case 17:this.$={path:f[h-4],params:f[h-3],hash:f[h-2],blockParams:f[h-1],strip:d.stripFlags(f[h-5],f[h])};break;case 18:this.$={strip:d.stripFlags(f[h-1],f[h-1]),program:f[h]};break;case 19:var i=d.prepareBlock(f[h-2],f[h-1],f[h],f[h],!1,this._$),j=d.prepareProgram([i],f[h-1].loc);j.chained=!0,this.$={strip:f[h-2].strip,program:j,chain:!0};break;case 21:this.$={path:f[h-1],strip:d.stripFlags(f[h-2],f[h])};break;case 22:case 23:this.$=d.prepareMustache(f[h-3],f[h-2],f[h-1],f[h-4],d.stripFlags(f[h-4],f[h]),this._$);break;case 24:this.$={type:"PartialStatement",name:f[h-3],params:f[h-2],hash:f[h-1],indent:"",strip:d.stripFlags(f[h-4],f[h]),loc:d.locInfo(this._$)};break;case 25:this.$=d.preparePartialBlock(f[h-2],f[h-1],f[h],this._$);break;case 26:this.$={path:f[h-3],params:f[h-2],hash:f[h-1],strip:d.stripFlags(f[h-4],f[h])};break;case 29:this.$={type:"SubExpression",path:f[h-3],params:f[h-2],hash:f[h-1],loc:d.locInfo(this._$)};break;case 30:this.$={type:"Hash",pairs:f[h],loc:d.locInfo(this._$)};break;case 31:this.$={type:"HashPair",key:d.id(f[h-2]),value:f[h],loc:d.locInfo(this._$)};break;case 32:this.$=d.id(f[h-1]);break;case 35:this.$={type:"StringLiteral",value:f[h],original:f[h],loc:d.locInfo(this._$)};break;case 36:this.$={type:"NumberLiteral",value:Number(f[h]),original:Number(f[h]),loc:d.locInfo(this._$)};break;case 37:this.$={type:"BooleanLiteral",value:"true"===f[h],original:"true"===f[h],loc:d.locInfo(this._$)};break;case 38:this.$={type:"UndefinedLiteral",original:void 0,value:void 0,loc:d.locInfo(this._$)};break;case 39:this.$={type:"NullLiteral",original:null,value:null,loc:d.locInfo(this._$)};break;case 42:this.$=d.preparePath(!0,f[h],this._$);break;case 43:this.$=d.preparePath(!1,f[h],this._$);break;case 44:f[h-2].push({part:d.id(f[h]),original:f[h],separator:f[h-1]}),this.$=f[h-2];break;case 45:this.$=[{part:d.id(f[h]),original:f[h]}];break;case 46:case 50:case 58:case 64:case 70:case 78:case 82:case 86:case 90:case 94:this.$=[];break;case 47:case 49:case 51:case 59:case 65:case 71:case 79:case 83:case 87:case 91:case 95:case 99:case 101:f[h-1].push(f[h]);break;case 48:case 98:case 100:this.$=[f[h]]}},table:[b([5,14,15,19,29,34,48,51,55,60],c,{3:1,4:2,6:3}),{1:[3]},{5:[1,4]},b([5,39,44,47],[2,2],{7:5,8:6,9:7,10:8,11:9,12:10,13:11,24:15,27:16,16:17,59:19,14:[1,12],15:d,19:[1,23],29:[1,21],34:[1,22],48:[1,13],51:[1,14],55:[1,18],60:[1,24]}),{1:[2,1]},b(e,[2,47]),b(e,[2,3]),b(e,[2,4]),b(e,[2,5]),b(e,[2,6]),b(e,[2,7]),b(e,[2,8]),b(e,[2,9]),{20:25,72:f,78:26,79:27,80:g,81:h,82:i,83:j,84:k,85:l,86:33},{20:36,72:f,78:26,79:27,80:g,81:h,82:i,83:j,84:k,85:l,86:33},b(m,c,{6:3,4:37}),b(n,c,{6:3,4:38}),{13:40,15:d,17:39},{20:42,56:41,64:43,65:o,72:f,78:26,79:27,80:g,81:h,82:i,83:j,84:k,85:l,86:33},b(p,c,{6:3,4:45}),b([5,14,15,18,19,29,34,39,44,47,48,51,55,60],[2,10]),{20:46,72:f,78:26,79:27,80:g,81:h,82:i,83:j,84:k,85:l,86:33},{20:47,72:f,78:26,79:27,80:g,81:h,82:i,83:j,84:k,85:l,86:33},{20:48,72:f,78:26,79:27,80:g,81:h,82:i,83:j,84:k,85:l,86:33},{20:42,56:49,64:43,65:o,72:f,78:26,79:27,80:g,81:h,82:i,83:j,84:k,85:l,86:33},b(q,[2,78],{49:50}),b(r,[2,33]),b(r,[2,34]),b(r,[2,35]),b(r,[2,36]),b(r,[2,37]),b(r,[2,38]),b(r,[2,39]),b(r,[2,43],{87:s}),{72:f,86:52},b(t,u),b(v,[2,82],{52:53}),{25:54,38:56,39:w,43:57,44:x,45:55,47:[2,54]},{28:60,43:61,44:x,47:[2,56]},{13:63,15:d,18:[1,62]},b(y,[2,48]),b(q,[2,86],{57:64}),b(q,[2,40]),b(q,[2,41]),{20:65,72:f,78:26,79:27,80:g,81:h,82:i,83:j,84:k,85:l,86:33},{26:66,47:z},b(A,[2,58],{30:68}),b(A,[2,64],{35:69}),b(B,[2,50],{21:70}),b(q,[2,90],{61:71}),{20:75,33:[2,80],50:72,63:73,64:76,65:o,69:74,70:77,71:78,72:C,78:26,79:27,80:g,81:h,82:i,83:j,84:k,85:l,86:33},{72:[1,80]},b(r,[2,42],{87:s}),{20:75,53:81,54:[2,84],63:82,64:76,65:o,69:83,70:77,71:78,72:C,78:26,79:27,80:g,81:h,82:i,83:j,84:k,85:l,86:33},{26:84,47:z},{47:[2,55]},b(m,c,{6:3,4:85}),{47:[2,20]},{20:86,72:f,78:26,79:27,80:g,81:h,82:i,83:j,84:k,85:l,86:33},b(p,c,{6:3,4:87}),{26:88,47:z},{47:[2,57]},b(e,[2,11]),b(y,[2,49]),{20:75,33:[2,88],58:89,63:90,64:76,65:o,69:91,70:77,71:78,72:C,78:26,79:27,80:g,81:h,82:i,83:j,84:k,85:l,86:33},b(D,[2,94],{66:92}),b(e,[2,25]),{20:93,72:f,78:26,79:27,80:g,81:h,82:i,83:j,84:k,85:l,86:33},b(E,[2,60],{78:26,79:27,86:33,20:75,64:76,70:77,71:78,31:94,63:95,69:96,65:o,72:C,80:g,81:h,82:i,83:j,84:k,85:l}),b(E,[2,66],{78:26,79:27,86:33,20:75,64:76,70:77,71:78,36:97,63:98,69:99,65:o,72:C,80:g,81:h,82:i,83:j,84:k,85:l}),{20:75,22:100,23:[2,52],63:101,64:76,65:o,69:102,70:77,71:78,72:C,78:26,79:27,80:g,81:h,82:i,83:j,84:k,85:l,86:33},{20:75,33:[2,92],62:103,63:104,64:76,65:o,69:105,70:77,71:78,72:C,78:26,79:27,80:g,81:h,82:i,83:j,84:k,85:l,86:33},{33:[1,106]},b(q,[2,79]),{33:[2,81]},b(r,[2,27]),b(r,[2,28]),b([23,33,54,68,75],[2,30],{71:107,72:[1,108]}),b(F,[2,98]),b(t,u,{73:G}),b(t,[2,44]),{54:[1,110]},b(v,[2,83]),{54:[2,85]},b(e,[2,13]),{38:56,39:w,43:57,44:x,45:112,46:111,47:[2,76]},b(A,[2,70],{40:113}),{47:[2,18]},b(e,[2,14]),{33:[1,114]},b(q,[2,87]),{33:[2,89]},{20:75,63:116,64:76,65:o,67:115,68:[2,96],69:117,70:77,71:78,72:C,78:26,79:27,80:g,81:h,82:i,83:j,84:k,85:l,86:33},{33:[1,118]},{32:119,33:[2,62],74:120,75:H},b(A,[2,59]),b(E,[2,61]),{33:[2,68],37:122,74:123,75:H},b(A,[2,65]),b(E,[2,67]),{23:[1,124]},b(B,[2,51]),{23:[2,53]},{33:[1,125]},b(q,[2,91]),{33:[2,93]},b(e,[2,22]),b(F,[2,99]),{73:G},{20:75,63:126,64:76,65:o,72:f,78:26,79:27,80:g,81:h,82:i,83:j,84:k,85:l,86:33},b(e,[2,23]),{47:[2,19]},{47:[2,77]},b(E,[2,72],{78:26,79:27,86:33,20:75,64:76,70:77,71:78,41:127,63:128,69:129,65:o,72:C,80:g,81:h,82:i,83:j,84:k,85:l}),b(e,[2,24]),{68:[1,130]},b(D,[2,95]),{68:[2,97]},b(e,[2,21]),{33:[1,131]},{33:[2,63]},{72:[1,133],76:132},{33:[1,134]},{33:[2,69]},{15:[2,12]},b(p,[2,26]),b(F,[2,31]),{33:[2,74],42:135,74:136,75:H},b(A,[2,71]),b(E,[2,73]),b(r,[2,29]),b(m,[2,15]),{72:[1,138],77:[1,137]},b(I,[2,100]),b(n,[2,16]),{33:[1,139]},{33:[2,75]},{33:[2,32]},b(I,[2,101]),b(m,[2,17])],defaultActions:{4:[2,1],55:[2,55],57:[2,20],61:[2,57],74:[2,81],83:[2,85],87:[2,18],91:[2,89],102:[2,53],105:[2,93],111:[2,19],112:[2,77],117:[2,97],120:[2,63],123:[2,69],124:[2,12],136:[2,75],137:[2,32]},parseError:function(a,b){if(!b.recoverable){var c=function(a,b){this.message=a,this.hash=b};throw c.prototype=new Error,new c(a,b)}this.trace(a)},parse:function(a){var b=this,c=[0],d=[null],e=[],f=this.table,g="",h=0,i=0,j=0,k=2,l=1,m=e.slice.call(arguments,1),n=Object.create(this.lexer),o={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(o.yy[p]=this.yy[p]);n.setInput(a,o.yy),o.yy.lexer=n,o.yy.parser=this,"undefined"==typeof n.yylloc&&(n.yylloc={});var q=n.yylloc;e.push(q);var r=n.options&&n.options.ranges;"function"==typeof o.yy.parseError?this.parseError=o.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var s,t,u,v,w,x,y,z,A,B=function(){var a;return a=n.lex()||l,"number"!=typeof a&&(a=b.symbols_[a]||a),a},C={};;){if(u=c[c.length-1],this.defaultActions[u]?v=this.defaultActions[u]:(null!==s&&"undefined"!=typeof s||(s=B()),v=f[u]&&f[u][s]),"undefined"==typeof v||!v.length||!v[0]){var D="";A=[];for(x in f[u])this.terminals_[x]&&x>k&&A.push("'"+this.terminals_[x]+"'");D=n.showPosition?"Parse error on line "+(h+1)+":\n"+n.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[s]||s)+"'":"Parse error on line "+(h+1)+": Unexpected "+(s==l?"end of input":"'"+(this.terminals_[s]||s)+"'"),this.parseError(D,{text:n.match,token:this.terminals_[s]||s,line:n.yylineno,loc:q,expected:A})}if(v[0]instanceof Array&&v.length>1)throw new Error("Parse Error: multiple actions possible at state: "+u+", token: "+s);switch(v[0]){case 1:c.push(s),d.push(n.yytext),e.push(n.yylloc),c.push(v[1]),s=null,t?(s=t,t=null):(i=n.yyleng,g=n.yytext,h=n.yylineno,q=n.yylloc,j>0&&j--);break;case 2:if(y=this.productions_[v[1]][1],C.$=d[d.length-y],C._$={first_line:e[e.length-(y||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(y||1)].first_column,last_column:e[e.length-1].last_column},r&&(C._$.range=[e[e.length-(y||1)].range[0],e[e.length-1].range[1]]),w=this.performAction.apply(C,[g,i,h,o.yy,v[1],d,e].concat(m)),"undefined"!=typeof w)return w;y&&(c=c.slice(0,-1*y*2),d=d.slice(0,-1*y),e=e.slice(0,-1*y)),c.push(this.productions_[v[1]][0]),d.push(C.$),e.push(C._$),z=f[c[c.length-2]][c[c.length-1]],c.push(z);break;case 3:return!0}}return!0}},K=function(){var a={EOF:1,parseError:function(a,b){if(!this.yy.parser)throw new Error(a);this.yy.parser.parseError(a,b)},setInput:function(a,b){return this.yy=b||this.yy||{},this._input=a,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var a=this._input[0];this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a;var b=a.match(/(?:\r\n?|\n).*/g);return b?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},unput:function(a){var b=a.length,c=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-b),this.offset-=b;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var e=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===d.length?this.yylloc.first_column:0)+d[d.length-c.length].length-c[0].length:this.yylloc.first_column-b},this.options.ranges&&(this.yylloc.range=[e[0],e[0]+this.yyleng-b]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(a){this.unput(this.match.slice(a))},pastInput:function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var a=this.pastInput(),b=new Array(a.length+1).join("-");return a+this.upcomingInput()+"\n"+b+"^"},test_match:function(a,b){var c,d,e;if(this.options.backtrack_lexer&&(e={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(e.yylloc.range=this.yylloc.range.slice(0))),d=a[0].match(/(?:\r\n?|\n).*/g),d&&(this.yylineno+=d.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:d?d[d.length-1].length-d[d.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+a[0].length},this.yytext+=a[0],this.match+=a[0],this.matches=a,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(a[0].length),this.matched+=a[0],c=this.performAction.call(this,this.yy,this,b,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),c)return c;if(this._backtrack){for(var f in e)this[f]=e[f];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,b,c,d;this._more||(this.yytext="",this.match="");for(var e=this._currentRules(),f=0;f<e.length;f++)if(c=this._input.match(this.rules[e[f]]),c&&(!b||c[0].length>b[0].length)){if(b=c,d=f,this.options.backtrack_lexer){if(a=this.test_match(c,e[f]),a!==!1)return a;if(this._backtrack){b=!1;continue}return!1}if(!this.options.flex)break}return b?(a=this.test_match(b,e[d]),a!==!1&&a):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var a=this.next();return a?a:this.lex()},begin:function(a){this.conditionStack.push(a)},popState:function(){var a=this.conditionStack.length-1;return a>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(a){return a=this.conditionStack.length-1-Math.abs(a||0),a>=0?this.conditionStack[a]:"INITIAL"},pushState:function(a){this.begin(a)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(a,b,c,d){function e(a,c){return b.yytext=b.yytext.substr(a,b.yyleng-c)}switch(c){case 0:if("\\\\"===b.yytext.slice(-2)?(e(0,1),this.begin("mu")):"\\"===b.yytext.slice(-1)?(e(0,1),this.begin("emu")):this.begin("mu"),b.yytext)return 15;
-break;case 1:return 15;case 2:return this.popState(),15;case 3:return this.begin("raw"),15;case 4:return this.popState(),"raw"===this.conditionStack[this.conditionStack.length-1]?15:(b.yytext=b.yytext.substr(5,b.yyleng-9),18);case 5:return 15;case 6:return this.popState(),14;case 7:return 65;case 8:return 68;case 9:return 19;case 10:return this.popState(),this.begin("raw"),23;case 11:return 55;case 12:return 60;case 13:return 29;case 14:return 47;case 15:return this.popState(),44;case 16:return this.popState(),44;case 17:return 34;case 18:return 39;case 19:return 51;case 20:return 48;case 21:this.unput(b.yytext),this.popState(),this.begin("com");break;case 22:return this.popState(),14;case 23:return 48;case 24:return 73;case 25:return 72;case 26:return 72;case 27:return 87;case 28:break;case 29:return this.popState(),54;case 30:return this.popState(),33;case 31:return b.yytext=e(1,2).replace(/\\"/g,'"'),80;case 32:return b.yytext=e(1,2).replace(/\\'/g,"'"),80;case 33:return 85;case 34:return 82;case 35:return 82;case 36:return 83;case 37:return 84;case 38:return 81;case 39:return 75;case 40:return 77;case 41:return 72;case 42:return b.yytext=b.yytext.replace(/\\([\\\]])/g,"$1"),72;case 43:return"INVALID";case 44:return 5}},rules:[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{(?=[^\/]))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]*?(?=(\{\{\{\{)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#>)/,/^(?:\{\{(~)?#\*?)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?\*?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],conditions:{mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}}};return a}();return J.lexer=K,a.prototype=J,J.Parser=a,new a}();b["default"]=c,a.exports=b["default"]},function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(){var a=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];this.options=a}function f(a,b,c){void 0===b&&(b=a.length);var d=a[b-1],e=a[b-2];return d?"ContentStatement"===d.type?(e||!c?/\r?\n\s*?$/:/(^|\r?\n)\s*?$/).test(d.original):void 0:c}function g(a,b,c){void 0===b&&(b=-1);var d=a[b+1],e=a[b+2];return d?"ContentStatement"===d.type?(e||!c?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(d.original):void 0:c}function h(a,b,c){var d=a[null==b?0:b+1];if(d&&"ContentStatement"===d.type&&(c||!d.rightStripped)){var e=d.value;d.value=d.value.replace(c?/^\s+/:/^[ \t]*\r?\n?/,""),d.rightStripped=d.value!==e}}function i(a,b,c){var d=a[null==b?a.length-1:b-1];if(d&&"ContentStatement"===d.type&&(c||!d.leftStripped)){var e=d.value;return d.value=d.value.replace(c?/\s+$/:/[ \t]+$/,""),d.leftStripped=d.value!==e,d.leftStripped}}b.__esModule=!0;var j=c(23),k=d(j);e.prototype=new k["default"],e.prototype.Program=function(a){var b=!this.options.ignoreStandalone,c=!this.isRootSeen;this.isRootSeen=!0;for(var d=a.body,e=0,j=d.length;e<j;e++){var k=d[e],l=this.accept(k);if(l){var m=f(d,e,c),n=g(d,e,c),o=l.openStandalone&&m,p=l.closeStandalone&&n,q=l.inlineStandalone&&m&&n;l.close&&h(d,e,!0),l.open&&i(d,e,!0),b&&q&&(h(d,e),i(d,e)&&"PartialStatement"===k.type&&(k.indent=/([ \t]+$)/.exec(d[e-1].original)[1])),b&&o&&(h((k.program||k.inverse).body),i(d,e)),b&&p&&(h(d,e),i((k.inverse||k.program).body))}}return a},e.prototype.BlockStatement=e.prototype.DecoratorBlock=e.prototype.PartialBlockStatement=function(a){this.accept(a.program),this.accept(a.inverse);var b=a.program||a.inverse,c=a.program&&a.inverse,d=c,e=c;if(c&&c.chained)for(d=c.body[0].program;e.chained;)e=e.body[e.body.length-1].program;var j={open:a.openStrip.open,close:a.closeStrip.close,openStandalone:g(b.body),closeStandalone:f((d||b).body)};if(a.openStrip.close&&h(b.body,null,!0),c){var k=a.inverseStrip;k.open&&i(b.body,null,!0),k.close&&h(d.body,null,!0),a.closeStrip.open&&i(e.body,null,!0),!this.options.ignoreStandalone&&f(b.body)&&g(d.body)&&(i(b.body),h(d.body))}else a.closeStrip.open&&i(b.body,null,!0);return j},e.prototype.Decorator=e.prototype.MustacheStatement=function(a){return a.strip},e.prototype.PartialStatement=e.prototype.CommentStatement=function(a){var b=a.strip||{};return{inlineStandalone:!0,open:b.open,close:b.close}},b["default"]=e,a.exports=b["default"]},function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(){this.parents=[]}function f(a){this.acceptRequired(a,"path"),this.acceptArray(a.params),this.acceptKey(a,"hash")}function g(a){f.call(this,a),this.acceptKey(a,"program"),this.acceptKey(a,"inverse")}function h(a){this.acceptRequired(a,"name"),this.acceptArray(a.params),this.acceptKey(a,"hash")}b.__esModule=!0;var i=c(4),j=d(i);e.prototype={constructor:e,mutating:!1,acceptKey:function(a,b){var c=this.accept(a[b]);if(this.mutating){if(c&&!e.prototype[c.type])throw new j["default"]('Unexpected node type "'+c.type+'" found when accepting '+b+" on "+a.type);a[b]=c}},acceptRequired:function(a,b){if(this.acceptKey(a,b),!a[b])throw new j["default"](a.type+" requires "+b)},acceptArray:function(a){for(var b=0,c=a.length;b<c;b++)this.acceptKey(a,b),a[b]||(a.splice(b,1),b--,c--)},accept:function(a){if(a){if(!this[a.type])throw new j["default"]("Unknown type: "+a.type,a);this.current&&this.parents.unshift(this.current),this.current=a;var b=this[a.type](a);return this.current=this.parents.shift(),!this.mutating||b?b:b!==!1?a:void 0}},Program:function(a){this.acceptArray(a.body)},MustacheStatement:f,Decorator:f,BlockStatement:g,DecoratorBlock:g,PartialStatement:h,PartialBlockStatement:function(a){h.call(this,a),this.acceptKey(a,"program")},ContentStatement:function(){},CommentStatement:function(){},SubExpression:f,PathExpression:function(){},StringLiteral:function(){},NumberLiteral:function(){},BooleanLiteral:function(){},UndefinedLiteral:function(){},NullLiteral:function(){},Hash:function(a){this.acceptArray(a.pairs)},HashPair:function(a){this.acceptRequired(a,"value")}},b["default"]=e,a.exports=b["default"]},function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(b=b.path?b.path.original:b,a.path.original!==b){var c={loc:a.path.loc};throw new q["default"](a.path.original+" doesn't match "+b,c)}}function f(a,b){this.source=a,this.start={line:b.first_line,column:b.first_column},this.end={line:b.last_line,column:b.last_column}}function g(a){return/^\[.*\]$/.test(a)?a.substr(1,a.length-2):a}function h(a,b){return{open:"~"===a.charAt(2),close:"~"===b.charAt(b.length-3)}}function i(a){return a.replace(/^\{\{~?\!-?-?/,"").replace(/-?-?~?\}\}$/,"")}function j(a,b,c){c=this.locInfo(c);for(var d=a?"@":"",e=[],f=0,g=0,h=b.length;g<h;g++){var i=b[g].part,j=b[g].original!==i;if(d+=(b[g].separator||"")+i,j||".."!==i&&"."!==i&&"this"!==i)e.push(i);else{if(e.length>0)throw new q["default"]("Invalid path: "+d,{loc:c});".."===i&&f++}}return{type:"PathExpression",data:a,depth:f,parts:e,original:d,loc:c}}function k(a,b,c,d,e,f){var g=d.charAt(3)||d.charAt(2),h="{"!==g&&"&"!==g,i=/\*/.test(d);return{type:i?"Decorator":"MustacheStatement",path:a,params:b,hash:c,escaped:h,strip:e,loc:this.locInfo(f)}}function l(a,b,c,d){e(a,c),d=this.locInfo(d);var f={type:"Program",body:b,strip:{},loc:d};return{type:"BlockStatement",path:a.path,params:a.params,hash:a.hash,program:f,openStrip:{},inverseStrip:{},closeStrip:{},loc:d}}function m(a,b,c,d,f,g){d&&d.path&&e(a,d);var h=/\*/.test(a.open);b.blockParams=a.blockParams;var i=void 0,j=void 0;if(c){if(h)throw new q["default"]("Unexpected inverse block on decorator",c);c.chain&&(c.program.body[0].closeStrip=d.strip),j=c.strip,i=c.program}return f&&(f=i,i=b,b=f),{type:h?"DecoratorBlock":"BlockStatement",path:a.path,params:a.params,hash:a.hash,program:b,inverse:i,openStrip:a.strip,inverseStrip:j,closeStrip:d&&d.strip,loc:this.locInfo(g)}}function n(a,b){if(!b&&a.length){var c=a[0].loc,d=a[a.length-1].loc;c&&d&&(b={source:c.source,start:{line:c.start.line,column:c.start.column},end:{line:d.end.line,column:d.end.column}})}return{type:"Program",body:a,strip:{},loc:b}}function o(a,b,c,d){return e(a,c),{type:"PartialBlockStatement",name:a.path,params:a.params,hash:a.hash,program:b,openStrip:a.strip,closeStrip:c&&c.strip,loc:this.locInfo(d)}}b.__esModule=!0,b.SourceLocation=f,b.id=g,b.stripFlags=h,b.stripComment=i,b.preparePath=j,b.prepareMustache=k,b.prepareRawBlock=l,b.prepareBlock=m,b.prepareProgram=n,b.preparePartialBlock=o;var p=c(4),q=d(p)},function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(){}function f(a,b,c){void 0===b&&(b={}),h(a,b);var d=i(a,b,c);return(new c.JavaScriptCompiler).compile(d,b)}function g(a,b,c){function d(){var d=i(a,b,c),e=(new c.JavaScriptCompiler).compile(d,b,void 0,!0);return c.template(e)}void 0===b&&(b={}),b=n.extend({},b),h(a,b);var e=void 0;return function(a,b){return e||(e=d()),e.call(this,a,b)}}function h(a,b){if(null==a||"string"!=typeof a&&"Program"!==a.type)throw new m["default"]("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+a);if(b.trackIds||b.stringParams)throw new m["default"]("TrackIds and stringParams are no longer supported. See Github #1145");"data"in b||(b.data=!0),b.compat&&(b.useDepths=!0)}function i(a,b,c){var d=c.parse(a,b);return(new c.Compiler).compile(d,b)}function j(a,b){if(a===b)return!0;if(n.isArray(a)&&n.isArray(b)&&a.length===b.length){for(var c=0;c<a.length;c++)if(!j(a[c],b[c]))return!1;return!0}}function k(a){if(!a.path.parts){var b=a.path;a.path={type:"PathExpression",data:!1,depth:0,parts:[b.original+""],original:b.original+"",loc:b.loc}}}b.__esModule=!0,b.Compiler=e,b.precompile=f,b.compile=g;var l=c(4),m=d(l),n=c(3),o=c(19),p=d(o),q=[].slice;e.prototype={compiler:e,equals:function(a){var b=this.opcodes.length;if(a.opcodes.length!==b)return!1;for(var c=0;c<b;c++){var d=this.opcodes[c],e=a.opcodes[c];if(d.opcode!==e.opcode||!j(d.args,e.args))return!1}b=this.children.length;for(var c=0;c<b;c++)if(!this.children[c].equals(a.children[c]))return!1;return!0},guid:0,compile:function(a,b){this.sourceNode=[],this.opcodes=[],this.children=[],this.options=b,b.blockParams=b.blockParams||[];var c=b.knownHelpers;if(b.knownHelpers={helperMissing:!0,blockHelperMissing:!0,each:!0,"if":!0,unless:!0,"with":!0,log:!0,lookup:!0},c)for(var d in c)d in c&&(this.options.knownHelpers[d]=c[d]);return this.accept(a)},compileProgram:function(a){var b=new this.compiler,c=b.compile(a,this.options),d=this.guid++;return this.usePartial=this.usePartial||c.usePartial,this.children[d]=c,this.useDepths=this.useDepths||c.useDepths,d},accept:function(a){if(!this[a.type])throw new m["default"]("Unknown type: "+a.type,a);this.sourceNode.unshift(a);var b=this[a.type](a);return this.sourceNode.shift(),b},Program:function(a){this.options.blockParams.unshift(a.blockParams);for(var b=a.body,c=b.length,d=0;d<c;d++)this.accept(b[d]);return this.options.blockParams.shift(),this.isSimple=1===c,this.blockParams=a.blockParams?a.blockParams.length:0,this},BlockStatement:function(a){k(a);var b=a.program,c=a.inverse;b=b&&this.compileProgram(b),c=c&&this.compileProgram(c);var d=this.classifySexpr(a);"helper"===d?this.helperSexpr(a,b,c):"simple"===d?(this.simpleSexpr(a),this.opcode("pushProgram",b),this.opcode("pushProgram",c),this.opcode("emptyHash"),this.opcode("blockValue",a.path.original)):(this.ambiguousSexpr(a,b,c),this.opcode("pushProgram",b),this.opcode("pushProgram",c),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue")),this.opcode("append")},DecoratorBlock:function(a){var b=a.program&&this.compileProgram(a.program),c=this.setupFullMustacheParams(a,b,void 0),d=a.path;this.useDecorators=!0,this.opcode("registerDecorator",c.length,d.original)},PartialStatement:function(a){this.usePartial=!0;var b=a.program;b&&(b=this.compileProgram(a.program));var c=a.params;if(c.length>1)throw new m["default"]("Unsupported number of partial arguments: "+c.length,a);c.length||(this.options.explicitPartialContext?this.opcode("pushLiteral","undefined"):c.push({type:"PathExpression",parts:[],depth:0}));var d=a.name.original,e="SubExpression"===a.name.type;e&&this.accept(a.name),this.setupFullMustacheParams(a,b,void 0,!0);var f=a.indent||"";this.options.preventIndent&&f&&(this.opcode("appendContent",f),f=""),this.opcode("invokePartial",e,d,f),this.opcode("append")},PartialBlockStatement:function(a){this.PartialStatement(a)},MustacheStatement:function(a){this.SubExpression(a),a.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},Decorator:function(a){this.DecoratorBlock(a)},ContentStatement:function(a){a.value&&this.opcode("appendContent",a.value)},CommentStatement:function(){},SubExpression:function(a){k(a);var b=this.classifySexpr(a);"simple"===b?this.simpleSexpr(a):"helper"===b?this.helperSexpr(a):this.ambiguousSexpr(a)},ambiguousSexpr:function(a,b,c){var d=a.path,e=d.parts[0],f=null!=b||null!=c;this.opcode("getContext",d.depth),this.opcode("pushProgram",b),this.opcode("pushProgram",c),d.strict=!0,this.accept(d),this.opcode("invokeAmbiguous",e,f)},simpleSexpr:function(a){var b=a.path;b.strict=!0,this.accept(b),this.opcode("resolvePossibleLambda")},helperSexpr:function(a,b,c){var d=this.setupFullMustacheParams(a,b,c),e=a.path,f=e.parts[0];if(this.options.knownHelpers[f])this.opcode("invokeKnownHelper",d.length,f);else{if(this.options.knownHelpersOnly)throw new m["default"]("You specified knownHelpersOnly, but used the unknown helper "+f,a);e.strict=!0,e.falsy=!0,this.accept(e),this.opcode("invokeHelper",d.length,e.original,p["default"].helpers.simpleId(e))}},PathExpression:function(a){this.addDepth(a.depth),this.opcode("getContext",a.depth);var b=a.parts[0],c=p["default"].helpers.scopedId(a),d=!a.depth&&!c&&this.blockParamIndex(b);d?this.opcode("lookupBlockParam",d,a.parts):b?a.data?(this.options.data=!0,this.opcode("lookupData",a.depth,a.parts,a.strict)):this.opcode("lookupOnContext",a.parts,a.falsy,a.strict,c):this.opcode("pushContext")},StringLiteral:function(a){this.opcode("pushString",a.value)},NumberLiteral:function(a){this.opcode("pushLiteral",a.value)},BooleanLiteral:function(a){this.opcode("pushLiteral",a.value)},UndefinedLiteral:function(){this.opcode("pushLiteral","undefined")},NullLiteral:function(){this.opcode("pushLiteral","null")},Hash:function(a){var b=a.pairs,c=0,d=b.length;for(this.opcode("pushHash");c<d;c++)this.pushParam(b[c].value);for(;c--;)this.opcode("assignToHash",b[c].key);this.opcode("popHash")},opcode:function(a){this.opcodes.push({opcode:a,args:q.call(arguments,1),loc:this.sourceNode[0].loc})},addDepth:function(a){a&&(this.useDepths=!0)},classifySexpr:function(a){var b=p["default"].helpers.simpleId(a.path),c=b&&!!this.blockParamIndex(a.path.parts[0]),d=!c&&p["default"].helpers.helperExpression(a),e=!c&&(d||b);if(e&&!d){var f=a.path.parts[0],g=this.options;g.knownHelpers[f]?d=!0:g.knownHelpersOnly&&(e=!1)}return d?"helper":e?"ambiguous":"simple"},pushParams:function(a){for(var b=0,c=a.length;b<c;b++)this.pushParam(a[b])},pushParam:function(a){this.accept(a)},setupFullMustacheParams:function(a,b,c,d){var e=a.params;return this.pushParams(e),this.opcode("pushProgram",b),this.opcode("pushProgram",c),a.hash?this.accept(a.hash):this.opcode("emptyHash",d),e},blockParamIndex:function(a){for(var b=0,c=this.options.blockParams.length;b<c;b++){var d=this.options.blockParams[b],e=d&&n.indexOf(d,a);if(d&&e>=0)return[b,e]}}}},function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){this.value=a}function f(){}function g(a,b,c,d){var e=b.popStack(),f=0,g=c.length;for(a&&g--;f<g;f++)e=b.nameLookup(e,c[f],d);return a?[b.aliasable("container.strict"),"(",e,", ",b.quotedString(c[f]),")"]:e}b.__esModule=!0;var h=c(2),i=c(4),j=d(i),k=c(3),l=c(27),m=d(l);f.prototype={nameLookup:function(a,b){return f.isValidJavaScriptVariableName(b)?[a,".",b]:[a,"[",JSON.stringify(b),"]"]},depthedLookup:function(a){return[this.aliasable("container.lookup"),'(depths, "',a,'")']},compilerInfo:function(){var a=h.COMPILER_REVISION,b=h.REVISION_CHANGES[a];return[a,b]},appendToBuffer:function(a,b,c){return k.isArray(a)||(a=[a]),a=this.source.wrap(a,b),this.environment.isSimple?["return ",a,";"]:c?["buffer += ",a,";"]:(a.appendToBuffer=!0,a)},initializeBuffer:function(){return this.quotedString("")},compile:function(a,b,c,d){this.environment=a,this.options=b,this.precompile=!d,this.name=this.environment.name,this.isChild=!!c,this.context=c||{decorators:[],programs:[],environments:[]},this.preamble(),this.stackSlot=0,this.stackVars=[],this.aliases={},this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.blockParams=[],this.compileChildren(a,b),this.useDepths=this.useDepths||a.useDepths||a.useDecorators||this.options.compat,this.useBlockParams=this.useBlockParams||a.useBlockParams;var e=a.opcodes,f=void 0,g=void 0,h=void 0,i=void 0;for(h=0,i=e.length;h<i;h++)f=e[h],this.source.currentLocation=f.loc,g=g||f.loc,this[f.opcode].apply(this,f.args);if(this.source.currentLocation=g,this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new j["default"]("Compile completed with content left on stack");this.decorators.isEmpty()?this.decorators=void 0:(this.useDecorators=!0,this.decorators.prepend("var decorators = container.decorators;\n"),this.decorators.push("return fn;"),d?this.decorators=Function.apply(this,["fn","props","container","depth0","data","blockParams","depths",this.decorators.merge()]):(this.decorators.prepend("function(fn, props, container, depth0, data, blockParams, depths) {\n"),this.decorators.push("}\n"),this.decorators=this.decorators.merge()));var k=this.createFunctionContext(d);if(this.isChild)return k;var l={compiler:this.compilerInfo(),main:k};this.decorators&&(l.main_d=this.decorators,l.useDecorators=!0);var m=this.context,n=m.programs,o=m.decorators;for(h=0,i=n.length;h<i;h++)n[h]&&(l[h]=n[h],o[h]&&(l[h+"_d"]=o[h],l.useDecorators=!0));return this.environment.usePartial&&(l.usePartial=!0),this.options.data&&(l.useData=!0),this.useDepths&&(l.useDepths=!0),this.useBlockParams&&(l.useBlockParams=!0),this.options.compat&&(l.compat=!0),d?l.compilerOptions=this.options:(l.compiler=JSON.stringify(l.compiler),this.source.currentLocation={start:{line:1,column:0}},l=this.objectLiteral(l),b.srcName?(l=l.toStringWithSourceMap({file:b.destName}),l.map=l.map&&l.map.toString()):l=l.toString()),l},preamble:function(){this.lastContext=0,this.source=new m["default"](this.options.srcName),this.decorators=new m["default"](this.options.srcName)},createFunctionContext:function(a){var b="",c=this.stackVars.concat(this.registers.list);c.length>0&&(b+=", "+c.join(", "));var d=0;for(var e in this.aliases){var f=this.aliases[e];this.aliases.hasOwnProperty(e)&&f.children&&f.referenceCount>1&&(b+=", alias"+ ++d+"="+e,f.children[0]="alias"+d)}var g=["container","depth0","helpers","partials","data"];(this.useBlockParams||this.useDepths)&&g.push("blockParams"),this.useDepths&&g.push("depths");var h=this.mergeSource(b);return a?(g.push(h),Function.apply(this,g)):this.source.wrap(["function(",g.join(","),") {\n ",h,"}"])},mergeSource:function(a){var b=this.environment.isSimple,c=!this.forceBuffer,d=void 0,e=void 0,f=void 0,g=void 0;return this.source.each(function(a){a.appendToBuffer?(f?a.prepend(" + "):f=a,g=a):(f&&(e?f.prepend("buffer += "):d=!0,g.add(";"),f=g=void 0),e=!0,b||(c=!1))}),c?f?(f.prepend("return "),g.add(";")):e||this.source.push('return "";'):(a+=", buffer = "+(d?"":this.initializeBuffer()),f?(f.prepend("return buffer + "),g.add(";")):this.source.push("return buffer;")),a&&this.source.prepend("var "+a.substring(2)+(d?"":";\n")),this.source.merge()},blockValue:function(a){var b=this.aliasable("helpers.blockHelperMissing"),c=[this.contextName(0)];this.setupHelperArgs(a,0,c);var d=this.popStack();c.splice(1,0,d),this.push(this.source.functionCall(b,"call",c))},ambiguousBlockValue:function(){var a=this.aliasable("helpers.blockHelperMissing"),b=[this.contextName(0)];this.setupHelperArgs("",0,b,!0),this.flushInline();var c=this.topStack();b.splice(1,0,c),this.pushSource(["if (!",this.lastHelper,") { ",c," = ",this.source.functionCall(a,"call",b),"}"])},appendContent:function(a){this.pendingContent?a=this.pendingContent+a:this.pendingLocation=this.source.currentLocation,this.pendingContent=a},append:function(){if(this.isInline())this.replaceStack(function(a){return[" != null ? ",a,' : ""']}),this.pushSource(this.appendToBuffer(this.popStack()));else{var a=this.popStack();this.pushSource(["if (",a," != null) { ",this.appendToBuffer(a,void 0,!0)," }"]),this.environment.isSimple&&this.pushSource(["else { ",this.appendToBuffer("''",void 0,!0)," }"])}},appendEscaped:function(){this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"),"(",this.popStack(),")"]))},getContext:function(a){this.lastContext=a},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(a,b,c,d){var e=0;d||!this.options.compat||this.lastContext?this.pushContext():this.push(this.depthedLookup(a[e++])),this.resolvePath("context",a,e,b,c)},lookupBlockParam:function(a,b){this.useBlockParams=!0,this.push(["blockParams[",a[0],"][",a[1],"]"]),this.resolvePath("context",b,1)},lookupData:function(a,b,c){a?this.pushStackLiteral("container.data(data, "+a+")"):this.pushStackLiteral("data"),this.resolvePath("data",b,0,!0,c)},resolvePath:function(a,b,c,d,e){var f=this;if(this.options.strict||this.options.assumeObjects)return void this.push(g(this.options.strict&&e,this,b,a));for(var h=b.length;c<h;c++)this.replaceStack(function(e){var g=f.nameLookup(e,b[c],a);return d?[" && ",g]:[" != null ? ",g," : ",e]})},resolvePossibleLambda:function(){this.push([this.aliasable("container.lambda"),"(",this.popStack(),", ",this.contextName(0),")"])},emptyHash:function(a){this.pushStackLiteral(a?"undefined":"{}")},pushHash:function(){this.hash&&this.hashes.push(this.hash),this.hash={values:{}}},popHash:function(){var a=this.hash;this.hash=this.hashes.pop(),this.push(this.objectLiteral(a.values))},pushString:function(a){this.pushStackLiteral(this.quotedString(a))},pushLiteral:function(a){this.pushStackLiteral(a)},pushProgram:function(a){null!=a?this.pushStackLiteral(this.programExpression(a)):this.pushStackLiteral(null)},registerDecorator:function(a,b){var c=this.nameLookup("decorators",b,"decorator"),d=this.setupHelperArgs(b,a);this.decorators.push(["fn = ",this.decorators.functionCall(c,"",["fn","props","container",d])," || fn;"])},invokeHelper:function(a,b,c){var d=this.popStack(),e=this.setupHelper(a,b),f=c?[e.name," || "]:"",g=["("].concat(f,d);this.options.strict||g.push(" || ",this.aliasable("helpers.helperMissing")),g.push(")"),this.push(this.source.functionCall(g,"call",e.callParams))},invokeKnownHelper:function(a,b){var c=this.setupHelper(a,b);this.push(this.source.functionCall(c.name,"call",c.callParams))},invokeAmbiguous:function(a,b){this.useRegister("helper");var c=this.popStack();this.emptyHash();var d=this.setupHelper(0,a,b),e=this.lastHelper=this.nameLookup("helpers",a,"helper"),f=["(","(helper = ",e," || ",c,")"];this.options.strict||(f[0]="(helper = ",f.push(" != null ? helper : ",this.aliasable("helpers.helperMissing"))),this.push(["(",f,d.paramsInit?["),(",d.paramsInit]:[],"),","(typeof helper === ",this.aliasable('"function"')," ? ",this.source.functionCall("helper","call",d.callParams)," : helper))"])},invokePartial:function(a,b,c){var d=[],e=this.setupParams(b,1,d);a&&(b=this.popStack(),delete e.name),c&&(e.indent=JSON.stringify(c)),e.helpers="helpers",e.partials="partials",e.decorators="container.decorators",a?d.unshift(b):d.unshift(this.nameLookup("partials",b,"partial")),this.options.compat&&(e.depths="depths"),e=this.objectLiteral(e),d.push(e),this.push(this.source.functionCall("container.invokePartial","",d))},assignToHash:function(a){this.hash.values[a]=this.popStack()},compiler:f,compileChildren:function(a,b){for(var c=a.children,d=void 0,e=void 0,f=0,g=c.length;f<g;f++){d=c[f],e=new this.compiler;var h=this.matchExistingProgram(d);if(null==h){this.context.programs.push("");var i=this.context.programs.length;d.index=i,d.name="program"+i,this.context.programs[i]=e.compile(d,b,this.context,!this.precompile),this.context.decorators[i]=e.decorators,this.context.environments[i]=d,this.useDepths=this.useDepths||e.useDepths,this.useBlockParams=this.useBlockParams||e.useBlockParams,d.useDepths=this.useDepths,d.useBlockParams=this.useBlockParams}else d.index=h.index,d.name="program"+h.index,this.useDepths=this.useDepths||h.useDepths,this.useBlockParams=this.useBlockParams||h.useBlockParams}},matchExistingProgram:function(a){for(var b=0,c=this.context.environments.length;b<c;b++){var d=this.context.environments[b];if(d&&d.equals(a))return d}},programExpression:function(a){var b=this.environment.children[a],c=[b.index,"data",b.blockParams];return(this.useBlockParams||this.useDepths)&&c.push("blockParams"),this.useDepths&&c.push("depths"),"container.program("+c.join(", ")+")"},useRegister:function(a){this.registers[a]||(this.registers[a]=!0,this.registers.list.push(a))},push:function(a){return a instanceof e||(a=this.source.wrap(a)),this.inlineStack.push(a),a},pushStackLiteral:function(a){this.push(new e(a))},pushSource:function(a){this.pendingContent&&(this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent),this.pendingLocation)),this.pendingContent=void 0),a&&this.source.push(a)},replaceStack:function(a){var b=["("],c=void 0,d=void 0,f=void 0;if(!this.isInline())throw new j["default"]("replaceStack on non-inline");var g=this.popStack(!0);if(g instanceof e)c=[g.value],b=["(",c],f=!0;else{d=!0;var h=this.incrStack();b=["((",this.push(h)," = ",g,")"],c=this.topStack()}var i=a.call(this,c);f||this.popStack(),d&&this.stackSlot--,this.push(b.concat(i,")"))},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var a=this.inlineStack;this.inlineStack=[];for(var b=0,c=a.length;b<c;b++){var d=a[b];if(d instanceof e)this.compileStack.push(d);else{var f=this.incrStack();this.pushSource([f," = ",d,";"]),this.compileStack.push(f)}}},isInline:function(){return this.inlineStack.length},popStack:function(a){var b=this.isInline(),c=(b?this.inlineStack:this.compileStack).pop();if(!a&&c instanceof e)return c.value;if(!b){if(!this.stackSlot)throw new j["default"]("Invalid stack pop");this.stackSlot--}return c},topStack:function(){var a=this.isInline()?this.inlineStack:this.compileStack,b=a[a.length-1];return b instanceof e?b.value:b},contextName:function(a){return this.useDepths&&a?"depths["+a+"]":"depth"+a},quotedString:function(a){return this.source.quotedString(a)},objectLiteral:function(a){return this.source.objectLiteral(a)},aliasable:function(a){var b=this.aliases[a];return b?(b.referenceCount++,b):(b=this.aliases[a]=this.source.wrap(a),b.aliasable=!0,b.referenceCount=1,b)},setupHelper:function(a,b,c){var d=[],e=this.setupHelperArgs(b,a,d,c),f=this.nameLookup("helpers",b,"helper"),g=this.aliasable(this.contextName(0)+" != null ? "+this.contextName(0)+" : (container.nullContext || {})");return{params:d,paramsInit:e,name:f,callParams:[g].concat(d)}},setupParams:function(a,b,c){var d={},e=!c,f=void 0;e&&(c=[]),d.name=this.quotedString(a),d.hash=this.popStack();var g=this.popStack(),h=this.popStack();(h||g)&&(d.fn=h||"container.noop",d.inverse=g||"container.noop");for(var i=b;i--;)f=this.popStack(),c[i]=f;return e&&(d.args=this.source.generateArray(c)),this.options.data&&(d.data="data"),this.useBlockParams&&(d.blockParams="blockParams"),d},setupHelperArgs:function(a,b,c,d){var e=this.setupParams(a,b,c);return e=this.objectLiteral(e),d?(this.useRegister("options"),c.push("options"),["options=",e]):c?(c.push(e),""):e}},function(){for(var a="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield await null true false".split(" "),b=f.RESERVED_WORDS={},c=0,d=a.length;c<d;c++)b[a[c]]=!0}(),f.isValidJavaScriptVariableName=function(a){return!f.RESERVED_WORDS[a]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(a)},b["default"]=f,a.exports=b["default"]},function(a,b,c){"use strict";function d(a,b,c){if(f.isArray(a)){for(var d=[],e=0,g=a.length;e<g;e++)d.push(b.wrap(a[e],c));return d}return"boolean"==typeof a||"number"==typeof a?a+"":a}function e(a){this.srcFile=a,this.source=[]}b.__esModule=!0;var f=c(3),g=void 0;try{}catch(h){}g||(g=function(a,b,c,d){this.src="",d&&this.add(d)},g.prototype={add:function(a){f.isArray(a)&&(a=a.join("")),this.src+=a},prepend:function(a){f.isArray(a)&&(a=a.join("")),this.src=a+this.src},toStringWithSourceMap:function(){return{code:this.toString()}},toString:function(){return this.src}}),e.prototype={isEmpty:function(){return!this.source.length},prepend:function(a,b){this.source.unshift(this.wrap(a,b))},push:function(a,b){this.source.push(this.wrap(a,b))},merge:function(){var a=this.empty();return this.each(function(b){a.add([" ",b,"\n"])}),a},each:function(a){for(var b=0,c=this.source.length;b<c;b++)a(this.source[b])},empty:function(){var a=this.currentLocation||{start:{}};return new g(a.start.line,a.start.column,this.srcFile)},wrap:function(a){var b=arguments.length<=1||void 0===arguments[1]?this.currentLocation||{start:{}}:arguments[1];return a instanceof g?a:(a=d(a,this,b),new g(b.start.line,b.start.column,this.srcFile,a))},functionCall:function(a,b,c){return c=this.generateList(c),this.wrap([a,b?"."+b+"(":"(",c,")"])},quotedString:function(a){return'"'+(a+"").replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},objectLiteral:function(a){var b=[];for(var c in a)if(a.hasOwnProperty(c)){var e=d(a[c],this);"undefined"!==e&&b.push([this.quotedString(c),":",e])}var f=this.generateList(b);return f.prepend("{"),f.add("}"),f},generateList:function(a){for(var b=this.empty(),c=0,e=a.length;c<e;c++)c&&b.add(","),b.add(d(a[c],this));return b},generateArray:function(a){var b=this.generateList(a);return b.prepend("["),b.add("]"),b}},b["default"]=e,a.exports=b["default"]}])});
-// @license-end
diff --git a/backend/vendor/assets/javascripts/jquery.jstree/jquery.jstree.js b/backend/vendor/assets/javascripts/jquery.jstree/jquery.jstree.js
deleted file mode 100644
index 31a8e93bfd..0000000000
--- a/backend/vendor/assets/javascripts/jquery.jstree/jquery.jstree.js
+++ /dev/null
@@ -1,4564 +0,0 @@
-/*
- * jsTree 1.0-rc3
- * http://jstree.com/
- *
- * Copyright (c) 2010 Ivan Bozhanov (vakata.com)
- *
- * Licensed same as jquery - under the terms of either the MIT License or the GPL Version 2 License
- * http://www.opensource.org/licenses/mit-license.php
- * http://www.gnu.org/licenses/gpl.html
- *
- * $Date: 2011-02-09 01:17:14 +0200 (ср, 09 февр 2011) $
- * $Revision: 236 $
- */
-
-/*jslint browser: true, onevar: true, undef: true, bitwise: true, strict: true */
-/*global window : false, clearInterval: false, clearTimeout: false, document: false, setInterval: false, setTimeout: false, jQuery: false, navigator: false, XSLTProcessor: false, DOMParser: false, XMLSerializer: false, ActiveXObject: false */
-
-"use strict";
-
-// top wrapper to prevent multiple inclusion (is this OK?)
-(function () { if(jQuery && jQuery.jstree) { return; }
- var is_ie6 = false, is_ie7 = false, is_ff2 = false;
-
- /*
- * jsTree core
- */
- (function ($) {
- // Common functions not related to jsTree
- // decided to move them to a `vakata` "namespace"
- $.vakata = {};
- // CSS related functions
- $.vakata.css = {
- get_css : function(rule_name, delete_flag, sheet) {
- rule_name = rule_name.toLowerCase();
- var css_rules = sheet.cssRules || sheet.rules,
- j = 0;
- do {
- if(css_rules.length && j > css_rules.length + 5) { return false; }
- if(css_rules[j].selectorText && css_rules[j].selectorText.toLowerCase() == rule_name) {
- if(delete_flag === true) {
- if(sheet.removeRule) { sheet.removeRule(j); }
- if(sheet.deleteRule) { sheet.deleteRule(j); }
- return true;
- }
- else { return css_rules[j]; }
- }
- }
- while (css_rules[++j]);
- return false;
- },
- add_css : function(rule_name, sheet) {
- if($.jstree.css.get_css(rule_name, false, sheet)) { return false; }
- if(sheet.insertRule) { sheet.insertRule(rule_name + ' { }', 0); } else { sheet.addRule(rule_name, null, 0); }
- return $.vakata.css.get_css(rule_name);
- },
- remove_css : function(rule_name, sheet) {
- return $.vakata.css.get_css(rule_name, true, sheet);
- },
- add_sheet : function(opts) {
- var tmp = false, is_new = true;
- if(opts.str) {
- if(opts.title) { tmp = $("style[id='" + opts.title + "-stylesheet']")[0]; }
- if(tmp) { is_new = false; }
- else {
- tmp = document.createElement("style");
- tmp.setAttribute('type',"text/css");
- if(opts.title) { tmp.setAttribute("id", opts.title + "-stylesheet"); }
- }
- if(tmp.styleSheet) {
- if(is_new) {
- document.getElementsByTagName("head")[0].appendChild(tmp);
- tmp.styleSheet.cssText = opts.str;
- }
- else {
- tmp.styleSheet.cssText = tmp.styleSheet.cssText + " " + opts.str;
- }
- }
- else {
- tmp.appendChild(document.createTextNode(opts.str));
- document.getElementsByTagName("head")[0].appendChild(tmp);
- }
- return tmp.sheet || tmp.styleSheet;
- }
- if(opts.url) {
- if(document.createStyleSheet) {
- try { tmp = document.createStyleSheet(opts.url); } catch (e) { }
- }
- else {
- tmp = document.createElement('link');
- tmp.rel = 'stylesheet';
- tmp.type = 'text/css';
- tmp.media = "all";
- tmp.href = opts.url;
- document.getElementsByTagName("head")[0].appendChild(tmp);
- return tmp.styleSheet;
- }
- }
- }
- };
-
- // private variables
- var instances = [], // instance array (used by $.jstree.reference/create/focused)
- focused_instance = -1, // the index in the instance array of the currently focused instance
- plugins = {}, // list of included plugins
- prepared_move = {}; // for the move_node function
-
- // jQuery plugin wrapper (thanks to jquery UI widget function)
- $.fn.jstree = function (settings) {
- var isMethodCall = (typeof settings == 'string'), // is this a method call like $().jstree("open_node")
- args = Array.prototype.slice.call(arguments, 1),
- returnValue = this;
-
- // if a method call execute the method on all selected instances
- if(isMethodCall) {
- if(settings.substring(0, 1) == '_') { return returnValue; }
- this.each(function() {
- var instance = instances[$.data(this, "jstree_instance_id")],
- methodValue = (instance && $.isFunction(instance[settings])) ? instance[settings].apply(instance, args) : instance;
- if(typeof methodValue !== "undefined" && (settings.indexOf("is_") === 0 || (methodValue !== true && methodValue !== false))) { returnValue = methodValue; return false; }
- });
- }
- else {
- this.each(function() {
- // extend settings and allow for multiple hashes and $.data
- var instance_id = $.data(this, "jstree_instance_id"),
- a = [],
- b = settings ? $.extend({}, true, settings) : {},
- c = $(this),
- s = false,
- t = [];
- a = a.concat(args);
- if(c.data("jstree")) { a.push(c.data("jstree")); }
- b = a.length ? $.extend.apply(null, [true, b].concat(a)) : b;
-
- // if an instance already exists, destroy it first
- if(typeof instance_id !== "undefined" && instances[instance_id]) { instances[instance_id].destroy(); }
- // push a new empty object to the instances array
- instance_id = parseInt(instances.push({}),10) - 1;
- // store the jstree instance id to the container element
- $.data(this, "jstree_instance_id", instance_id);
- // clean up all plugins
- b.plugins = $.isArray(b.plugins) ? b.plugins : $.jstree.defaults.plugins.slice();
- b.plugins.unshift("core");
- // only unique plugins
- b.plugins = b.plugins.sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(",");
-
- // extend defaults with passed data
- s = $.extend(true, {}, $.jstree.defaults, b);
- s.plugins = b.plugins;
- $.each(plugins, function (i, val) {
- if($.inArray(i, s.plugins) === -1) { s[i] = null; delete s[i]; }
- else { t.push(i); }
- });
- s.plugins = t;
-
- // push the new object to the instances array (at the same time set the default classes to the container) and init
- instances[instance_id] = new $.jstree._instance(instance_id, $(this).addClass("jstree jstree-" + instance_id), s);
- // init all activated plugins for this instance
- $.each(instances[instance_id]._get_settings().plugins, function (i, val) { instances[instance_id].data[val] = {}; });
- $.each(instances[instance_id]._get_settings().plugins, function (i, val) { if(plugins[val]) { plugins[val].__init.apply(instances[instance_id]); } });
- // initialize the instance
- setTimeout(function() { if(instances[instance_id]) { instances[instance_id].init(); } }, 0);
- });
- }
- // return the jquery selection (or if it was a method call that returned a value - the returned value)
- return returnValue;
- };
- // object to store exposed functions and objects
- $.jstree = {
- defaults : {
- plugins : []
- },
- _focused : function () { return instances[focused_instance] || null; },
- _reference : function (needle) {
- // get by instance id
- if(instances[needle]) { return instances[needle]; }
- // get by DOM (if still no luck - return null
- var o = $(needle);
- if(!o.length && typeof needle === "string") { o = $("#" + needle); }
- if(!o.length) { return null; }
- return instances[o.closest(".jstree").data("jstree_instance_id")] || null;
- },
- _instance : function (index, container, settings) {
- // for plugins to store data in
- this.data = { core : {} };
- this.get_settings = function () { return $.extend(true, {}, settings); };
- this._get_settings = function () { return settings; };
- this.get_index = function () { return index; };
- this.get_container = function () { return container; };
- this.get_container_ul = function () { return container.children("ul:eq(0)"); };
- this._set_settings = function (s) {
- settings = $.extend(true, {}, settings, s);
- };
- },
- _fn : { },
- plugin : function (pname, pdata) {
- pdata = $.extend({}, {
- __init : $.noop,
- __destroy : $.noop,
- _fn : {},
- defaults : false
- }, pdata);
- plugins[pname] = pdata;
-
- $.jstree.defaults[pname] = pdata.defaults;
- $.each(pdata._fn, function (i, val) {
- val.plugin = pname;
- val.old = $.jstree._fn[i];
- $.jstree._fn[i] = function () {
- var rslt,
- func = val,
- args = Array.prototype.slice.call(arguments),
- evnt = new $.Event("before.jstree"),
- rlbk = false;
-
- if(this.data.core.locked === true && i !== "unlock" && i !== "is_locked") { return; }
-
- // Check if function belongs to the included plugins of this instance
- do {
- if(func && func.plugin && $.inArray(func.plugin, this._get_settings().plugins) !== -1) { break; }
- func = func.old;
- } while(func);
- if(!func) { return; }
-
- // context and function to trigger events, then finally call the function
- if(i.indexOf("_") === 0) {
- rslt = func.apply(this, args);
- }
- else {
- rslt = this.get_container().triggerHandler(evnt, { "func" : i, "inst" : this, "args" : args, "plugin" : func.plugin });
- if(rslt === false) { return; }
- if(typeof rslt !== "undefined") { args = rslt; }
-
- rslt = func.apply(
- $.extend({}, this, {
- __callback : function (data) {
- this.get_container().triggerHandler( i + '.jstree', { "inst" : this, "args" : args, "rslt" : data, "rlbk" : rlbk });
- },
- __rollback : function () {
- rlbk = this.get_rollback();
- return rlbk;
- },
- __call_old : function (replace_arguments) {
- return func.old.apply(this, (replace_arguments ? Array.prototype.slice.call(arguments, 1) : args ) );
- }
- }), args);
- }
-
- // return the result
- return rslt;
- };
- $.jstree._fn[i].old = val.old;
- $.jstree._fn[i].plugin = pname;
- });
- },
- rollback : function (rb) {
- if(rb) {
- if(!$.isArray(rb)) { rb = [ rb ]; }
- $.each(rb, function (i, val) {
- instances[val.i].set_rollback(val.h, val.d);
- });
- }
- }
- };
- // set the prototype for all instances
- $.jstree._fn = $.jstree._instance.prototype = {};
-
- // load the css when DOM is ready
- $(function() {
- // code is copied from jQuery ($.browser is deprecated + there is a bug in IE)
- var u = navigator.userAgent.toLowerCase(),
- v = (u.match( /.+?(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1],
- css_string = '' +
- '.jstree ul, .jstree li { display:block; margin:0 0 0 0; padding:0 0 0 0; list-style-type:none; } ' +
- '.jstree li { display:block; min-height:18px; line-height:18px; white-space:nowrap; margin-left:18px; min-width:18px; } ' +
- '.jstree-rtl li { margin-left:0; margin-right:18px; } ' +
- '.jstree > ul > li { margin-left:0px; } ' +
- '.jstree-rtl > ul > li { margin-right:0px; } ' +
- '.jstree ins { display:inline-block; text-decoration:none; width:18px; height:18px; margin:0 0 0 0; padding:0; } ' +
- '.jstree a { display:inline-block; line-height:16px; height:16px; color:black; white-space:nowrap; text-decoration:none; padding:1px 2px; margin:0; } ' +
- '.jstree a:focus { outline: none; } ' +
- '.jstree a > ins { height:16px; width:16px; } ' +
- '.jstree a > .jstree-icon { margin-right:3px; } ' +
- '.jstree-rtl a > .jstree-icon { margin-left:3px; margin-right:0; } ' +
- 'li.jstree-open > ul { display:block; } ' +
- 'li.jstree-closed > ul { display:none; } ';
- // Correct IE 6 (does not support the > CSS selector)
- if(/msie/.test(u) && parseInt(v, 10) == 6) {
- is_ie6 = true;
-
- // fix image flicker and lack of caching
- try {
- document.execCommand("BackgroundImageCache", false, true);
- } catch (err) { }
-
- css_string += '' +
- '.jstree li { height:18px; margin-left:0; margin-right:0; } ' +
- '.jstree li li { margin-left:18px; } ' +
- '.jstree-rtl li li { margin-left:0px; margin-right:18px; } ' +
- 'li.jstree-open ul { display:block; } ' +
- 'li.jstree-closed ul { display:none !important; } ' +
- '.jstree li a { display:inline; border-width:0 !important; padding:0px 2px !important; } ' +
- '.jstree li a ins { height:16px; width:16px; margin-right:3px; } ' +
- '.jstree-rtl li a ins { margin-right:0px; margin-left:3px; } ';
- }
- // Correct IE 7 (shifts anchor nodes onhover)
- if(/msie/.test(u) && parseInt(v, 10) == 7) {
- is_ie7 = true;
- css_string += '.jstree li a { border-width:0 !important; padding:0px 2px !important; } ';
- }
- // correct ff2 lack of display:inline-block
- if(!/compatible/.test(u) && /mozilla/.test(u) && parseFloat(v, 10) < 1.9) {
- is_ff2 = true;
- css_string += '' +
- '.jstree ins { display:-moz-inline-box; } ' +
- '.jstree li { line-height:12px; } ' + // WHY??
- '.jstree a { display:-moz-inline-box; } ' +
- '.jstree .jstree-no-icons .jstree-checkbox { display:-moz-inline-stack !important; } ';
- /* this shouldn't be here as it is theme specific */
- }
- // the default stylesheet
- $.vakata.css.add_sheet({ str : css_string, title : "jstree" });
- });
-
- // core functions (open, close, create, update, delete)
- $.jstree.plugin("core", {
- __init : function () {
- this.data.core.locked = false;
- this.data.core.to_open = this.get_settings().core.initially_open;
- this.data.core.to_load = this.get_settings().core.initially_load;
- },
- defaults : {
- html_titles : false,
- animation : 500,
- initially_open : [],
- initially_load : [],
- open_parents : true,
- notify_plugins : true,
- rtl : false,
- load_open : false,
- strings : {
- loading : "Loading ...",
- new_node : "New node",
- multiple_selection : "Multiple selection"
- }
- },
- _fn : {
- init : function () {
- this.set_focus();
- if(this._get_settings().core.rtl) {
- this.get_container().addClass("jstree-rtl").css("direction", "rtl");
- }
- this.get_container().html("<ul><li class='jstree-last jstree-leaf'><ins>&#160;</ins><a class='jstree-loading' href='#'><ins class='jstree-icon'>&#160;</ins>" + this._get_string("loading") + "</a></li></ul>");
- this.data.core.li_height = this.get_container_ul().find("li.jstree-closed, li.jstree-leaf").eq(0).height() || 18;
-
- this.get_container()
- .delegate("li > ins", "click.jstree", $.proxy(function (event) {
- var trgt = $(event.target);
- // if(trgt.is("ins") && event.pageY - trgt.offset().top < this.data.core.li_height) { this.toggle_node(trgt); }
- this.toggle_node(trgt);
- }, this))
- .bind("mousedown.jstree", $.proxy(function () {
- this.set_focus(); // This used to be setTimeout(set_focus,0) - why?
- }, this))
- .bind("dblclick.jstree", function (event) {
- var sel;
- if(document.selection && document.selection.empty) { document.selection.empty(); }
- else {
- if(window.getSelection) {
- sel = window.getSelection();
- try {
- sel.removeAllRanges();
- sel.collapse();
- } catch (err) { }
- }
- }
- });
- if(this._get_settings().core.notify_plugins) {
- this.get_container()
- .bind("load_node.jstree", $.proxy(function (e, data) {
- var o = this._get_node(data.rslt.obj),
- t = this;
- if(o === -1) { o = this.get_container_ul(); }
- if(!o.length) { return; }
- o.find("li").each(function () {
- var th = $(this);
- if(th.data("jstree")) {
- $.each(th.data("jstree"), function (plugin, values) {
- if(t.data[plugin] && $.isFunction(t["_" + plugin + "_notify"])) {
- t["_" + plugin + "_notify"].call(t, th, values);
- }
- });
- }
- });
- }, this));
- }
- if(this._get_settings().core.load_open) {
- this.get_container()
- .bind("load_node.jstree", $.proxy(function (e, data) {
- var o = this._get_node(data.rslt.obj),
- t = this;
- if(o === -1) { o = this.get_container_ul(); }
- if(!o.length) { return; }
- o.find("li.jstree-open:not(:has(ul))").each(function () {
- t.load_node(this, $.noop, $.noop);
- });
- }, this));
- }
- this.__callback();
- this.load_node(-1, function () { this.loaded(); this.reload_nodes(); });
- },
- destroy : function () {
- var i,
- n = this.get_index(),
- s = this._get_settings(),
- _this = this;
-
- $.each(s.plugins, function (i, val) {
- try { plugins[val].__destroy.apply(_this); } catch(err) { }
- });
- this.__callback();
- // set focus to another instance if this one is focused
- if(this.is_focused()) {
- for(i in instances) {
- if(instances.hasOwnProperty(i) && i != n) {
- instances[i].set_focus();
- break;
- }
- }
- }
- // if no other instance found
- if(n === focused_instance) { focused_instance = -1; }
- // remove all traces of jstree in the DOM (only the ones set using jstree*) and cleans all events
- this.get_container()
- .unbind(".jstree")
- .undelegate(".jstree")
- .removeData("jstree_instance_id")
- .find("[class^='jstree']")
- .addBack()
- .attr("class", function () { return this.className.replace(/jstree[^ ]*|$/ig,''); });
- $(document)
- .unbind(".jstree-" + n)
- .undelegate(".jstree-" + n);
- // remove the actual data
- instances[n] = null;
- delete instances[n];
- },
-
- _core_notify : function (n, data) {
- if(data.opened) {
- this.open_node(n, false, true);
- }
- },
-
- lock : function () {
- this.data.core.locked = true;
- this.get_container().children("ul").addClass("jstree-locked").css("opacity","0.7");
- this.__callback({});
- },
- unlock : function () {
- this.data.core.locked = false;
- this.get_container().children("ul").removeClass("jstree-locked").css("opacity","1");
- this.__callback({});
- },
- is_locked : function () { return this.data.core.locked; },
- save_opened : function () {
- var _this = this;
- this.data.core.to_open = [];
- this.get_container_ul().find("li.jstree-open").each(function () {
- if(this.id) { _this.data.core.to_open.push("#" + this.id.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")); }
- });
- this.__callback(_this.data.core.to_open);
- },
- save_loaded : function () { },
- reload_nodes : function (is_callback) {
- var _this = this,
- done = true,
- current = [],
- remaining = [];
- if(!is_callback) {
- this.data.core.reopen = false;
- this.data.core.refreshing = true;
- this.data.core.to_open = $.map($.makeArray(this.data.core.to_open), function (n) { return "#" + n.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"); });
- this.data.core.to_load = $.map($.makeArray(this.data.core.to_load), function (n) { return "#" + n.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"); });
- if(this.data.core.to_open.length) {
- this.data.core.to_load = this.data.core.to_load.concat(this.data.core.to_open);
- }
- }
- if(this.data.core.to_load.length) {
- $.each(this.data.core.to_load, function (i, val) {
- if(val == "#") { return true; }
- if($(val).length) { current.push(val); }
- else { remaining.push(val); }
- });
- if(current.length) {
- this.data.core.to_load = remaining;
- $.each(current, function (i, val) {
- if(!_this._is_loaded(val)) {
- _this.load_node(val, function () { _this.reload_nodes(true); }, function () { _this.reload_nodes(true); });
- done = false;
- }
- });
- }
- }
- if(this.data.core.to_open.length) {
- $.each(this.data.core.to_open, function (i, val) {
- _this.open_node(val, false, true);
- });
- }
- if(done) {
- // TODO: find a more elegant approach to syncronizing returning requests
- if(this.data.core.reopen) { clearTimeout(this.data.core.reopen); }
- this.data.core.reopen = setTimeout(function () { _this.__callback({}, _this); }, 50);
- this.data.core.refreshing = false;
- this.reopen();
- }
- },
- reopen : function () {
- var _this = this;
- if(this.data.core.to_open.length) {
- $.each(this.data.core.to_open, function (i, val) {
- _this.open_node(val, false, true);
- });
- }
- this.__callback({});
- },
- refresh : function (obj) {
- var _this = this;
- this.save_opened();
- if(!obj) { obj = -1; }
- obj = this._get_node(obj);
- if(!obj) { obj = -1; }
- if(obj !== -1) { obj.children("UL").remove(); }
- else { this.get_container_ul().empty(); }
- this.load_node(obj, function () { _this.__callback({ "obj" : obj}); _this.reload_nodes(); });
- },
- // Dummy function to fire after the first load (so that there is a jstree.loaded event)
- loaded : function () {
- this.__callback();
- },
- // deal with focus
- set_focus : function () {
- if(this.is_focused()) { return; }
- var f = $.jstree._focused();
- if(f) { f.unset_focus(); }
-
- this.get_container().addClass("jstree-focused");
- focused_instance = this.get_index();
- this.__callback();
- },
- is_focused : function () {
- return focused_instance == this.get_index();
- },
- unset_focus : function () {
- if(this.is_focused()) {
- this.get_container().removeClass("jstree-focused");
- focused_instance = -1;
- }
- this.__callback();
- },
-
- // traverse
- _get_node : function (obj) {
- var $obj = $(obj, this.get_container());
- if($obj.is(".jstree") || obj == -1) { return -1; }
- $obj = $obj.closest("li", this.get_container());
- return $obj.length ? $obj : false;
- },
- _get_next : function (obj, strict) {
- obj = this._get_node(obj);
- if(obj === -1) { return this.get_container().find("> ul > li:first-child"); }
- if(!obj.length) { return false; }
- if(strict) { return (obj.nextAll("li").size() > 0) ? obj.nextAll("li:eq(0)") : false; }
-
- if(obj.hasClass("jstree-open")) { return obj.find("li:eq(0)"); }
- else if(obj.nextAll("li").size() > 0) { return obj.nextAll("li:eq(0)"); }
- else { return obj.parentsUntil(".jstree","li").next("li").eq(0); }
- },
- _get_prev : function (obj, strict) {
- obj = this._get_node(obj);
- if(obj === -1) { return this.get_container().find("> ul > li:last-child"); }
- if(!obj.length) { return false; }
- if(strict) { return (obj.prevAll("li").length > 0) ? obj.prevAll("li:eq(0)") : false; }
-
- if(obj.prev("li").length) {
- obj = obj.prev("li").eq(0);
- while(obj.hasClass("jstree-open")) { obj = obj.children("ul:eq(0)").children("li:last"); }
- return obj;
- }
- else { var o = obj.parentsUntil(".jstree","li:eq(0)"); return o.length ? o : false; }
- },
- _get_parent : function (obj) {
- obj = this._get_node(obj);
- if(obj == -1 || !obj.length) { return false; }
- var o = obj.parentsUntil(".jstree", "li:eq(0)");
- return o.length ? o : -1;
- },
- _get_children : function (obj) {
- obj = this._get_node(obj);
- if(obj === -1) { return this.get_container().children("ul:eq(0)").children("li"); }
- if(!obj.length) { return false; }
- return obj.children("ul:eq(0)").children("li");
- },
- get_path : function (obj, id_mode) {
- var p = [],
- _this = this;
- obj = this._get_node(obj);
- if(obj === -1 || !obj || !obj.length) { return false; }
- obj.parentsUntil(".jstree", "li").each(function () {
- p.push( id_mode ? this.id : _this.get_text(this) );
- });
- p.reverse();
- p.push( id_mode ? obj.attr("id") : this.get_text(obj) );
- return p;
- },
-
- // string functions
- _get_string : function (key) {
- return this._get_settings().core.strings[key] || key;
- },
-
- is_open : function (obj) { obj = this._get_node(obj); return obj && obj !== -1 && obj.hasClass("jstree-open"); },
- is_closed : function (obj) { obj = this._get_node(obj); return obj && obj !== -1 && obj.hasClass("jstree-closed"); },
- is_leaf : function (obj) { obj = this._get_node(obj); return obj && obj !== -1 && obj.hasClass("jstree-leaf"); },
- correct_state : function (obj) {
- obj = this._get_node(obj);
- if(!obj || obj === -1) { return false; }
- obj.removeClass("jstree-closed jstree-open").addClass("jstree-leaf").children("ul").remove();
- this.__callback({ "obj" : obj });
- },
- // open/close
- open_node : function (obj, callback, skip_animation) {
- obj = this._get_node(obj);
- if(!obj.length) { return false; }
- if(!obj.hasClass("jstree-closed")) { if(callback) { callback.call(); } return false; }
- var s = skip_animation || is_ie6 ? 0 : this._get_settings().core.animation,
- t = this;
- if(!this._is_loaded(obj)) {
- obj.children("a").addClass("jstree-loading");
- this.load_node(obj, function () { t.open_node(obj, callback, skip_animation); }, callback);
- }
- else {
- if(this._get_settings().core.open_parents) {
- obj.parentsUntil(".jstree",".jstree-closed").each(function () {
- t.open_node(this, false, true);
- });
- }
- if(s) { obj.children("ul").css("display","none"); }
- obj.removeClass("jstree-closed").addClass("jstree-open").children("a").removeClass("jstree-loading");
- if(s) { obj.children("ul").stop(true, true).slideDown(s, function () { this.style.display = ""; t.after_open(obj); }); }
- else { t.after_open(obj); }
- this.__callback({ "obj" : obj });
- if(callback) { callback.call(); }
- }
- },
- after_open : function (obj) { this.__callback({ "obj" : obj }); },
- close_node : function (obj, skip_animation) {
- obj = this._get_node(obj);
- var s = skip_animation || is_ie6 ? 0 : this._get_settings().core.animation,
- t = this;
- if(!obj.length || !obj.hasClass("jstree-open")) { return false; }
- if(s) { obj.children("ul").attr("style","display:block !important"); }
- obj.removeClass("jstree-open").addClass("jstree-closed");
- if(s) { obj.children("ul").stop(true, true).slideUp(s, function () { this.style.display = ""; t.after_close(obj); }); }
- else { t.after_close(obj); }
- this.__callback({ "obj" : obj });
- },
- after_close : function (obj) { this.__callback({ "obj" : obj }); },
- toggle_node : function (obj) {
- obj = this._get_node(obj);
- if(obj.hasClass("jstree-closed")) { return this.open_node(obj); }
- if(obj.hasClass("jstree-open")) { return this.close_node(obj); }
- },
- open_all : function (obj, do_animation, original_obj) {
- obj = obj ? this._get_node(obj) : -1;
- if(!obj || obj === -1) { obj = this.get_container_ul(); }
- if(original_obj) {
- obj = obj.find("li.jstree-closed");
- }
- else {
- original_obj = obj;
- if(obj.is(".jstree-closed")) { obj = obj.find("li.jstree-closed").addBack(); }
- else { obj = obj.find("li.jstree-closed"); }
- }
- var _this = this;
- obj.each(function () {
- var __this = this;
- if(!_this._is_loaded(this)) { _this.open_node(this, function() { _this.open_all(__this, do_animation, original_obj); }, !do_animation); }
- else { _this.open_node(this, false, !do_animation); }
- });
- // so that callback is fired AFTER all nodes are open
- if(original_obj.find('li.jstree-closed').length === 0) { this.__callback({ "obj" : original_obj }); }
- },
- close_all : function (obj, do_animation) {
- var _this = this;
- obj = obj ? this._get_node(obj) : this.get_container();
- if(!obj || obj === -1) { obj = this.get_container_ul(); }
- obj.find("li.jstree-open").addBack().each(function () { _this.close_node(this, !do_animation); });
- this.__callback({ "obj" : obj });
- },
- clean_node : function (obj) {
- obj = obj && obj != -1 ? $(obj) : this.get_container_ul();
- obj = obj.is("li") ? obj.find("li").addBack() : obj.find("li");
- obj.removeClass("jstree-last")
- .filter("li:last-child").addClass("jstree-last").end()
- .filter(":has(li)")
- .not(".jstree-open").removeClass("jstree-leaf").addClass("jstree-closed");
- obj.not(".jstree-open, .jstree-closed").addClass("jstree-leaf").children("ul").remove();
- this.__callback({ "obj" : obj });
- },
- // rollback
- get_rollback : function () {
- this.__callback();
- return { i : this.get_index(), h : this.get_container().children("ul").clone(true), d : this.data };
- },
- set_rollback : function (html, data) {
- this.get_container().empty().append(html);
- this.data = data;
- this.__callback();
- },
- // Dummy functions to be overwritten by any datastore plugin included
- load_node : function (obj, s_call, e_call) { this.__callback({ "obj" : obj }); },
- _is_loaded : function (obj) { return true; },
-
- // Basic operations: create
- create_node : function (obj, position, js, callback, is_loaded) {
- obj = this._get_node(obj);
- position = typeof position === "undefined" ? "last" : position;
- var d = $("<li />"),
- s = this._get_settings().core,
- tmp;
-
- if(obj !== -1 && !obj.length) { return false; }
- if(!is_loaded && !this._is_loaded(obj)) { this.load_node(obj, function () { this.create_node(obj, position, js, callback, true); }); return false; }
-
- this.__rollback();
-
- if(typeof js === "string") { js = { "data" : js }; }
- if(!js) { js = {}; }
- if(js.attr) { d.attr(js.attr); }
- if(js.metadata) { d.data(js.metadata); }
- if(js.state) { d.addClass("jstree-" + js.state); }
- if(!js.data) { js.data = this._get_string("new_node"); }
- if(!$.isArray(js.data)) { tmp = js.data; js.data = []; js.data.push(tmp); }
- $.each(js.data, function (i, m) {
- tmp = $("<a />");
- if($.isFunction(m)) { m = m.call(this, js); }
- if(typeof m == "string") { tmp.attr('href','#')[ s.html_titles ? "html" : "text" ](m); }
- else {
- if(!m.attr) { m.attr = {}; }
- if(!m.attr.href) { m.attr.href = '#'; }
- tmp.attr(m.attr)[ s.html_titles ? "html" : "text" ](m.title);
- if(m.language) { tmp.addClass(m.language); }
- }
- tmp.prepend("<ins class='jstree-icon'>&#160;</ins>");
- if(!m.icon && js.icon) { m.icon = js.icon; }
- if(m.icon) {
- if(m.icon.indexOf("/") === -1) { tmp.children("ins").addClass(m.icon); }
- else { tmp.children("ins").css("background","url('" + m.icon + "') center center no-repeat"); }
- }
- d.append(tmp);
- });
- d.prepend("<ins class='jstree-icon'>&#160;</ins>");
- if(obj === -1) {
- obj = this.get_container();
- if(position === "before") { position = "first"; }
- if(position === "after") { position = "last"; }
- }
- switch(position) {
- case "before": obj.before(d); tmp = this._get_parent(obj); break;
- case "after" : obj.after(d); tmp = this._get_parent(obj); break;
- case "inside":
- case "first" :
- if(!obj.children("ul").length) { obj.append("<ul />"); }
- obj.children("ul").prepend(d);
- tmp = obj;
- break;
- case "last":
- if(!obj.children("ul").length) { obj.append("<ul />"); }
- obj.children("ul").append(d);
- tmp = obj;
- break;
- default:
- if(!obj.children("ul").length) { obj.append("<ul />"); }
- if(!position) { position = 0; }
- tmp = obj.children("ul").children("li").eq(position);
- if(tmp.length) { tmp.before(d); }
- else { obj.children("ul").append(d); }
- tmp = obj;
- break;
- }
- if(tmp === -1 || tmp.get(0) === this.get_container().get(0)) { tmp = -1; }
- this.clean_node(tmp);
- this.__callback({ "obj" : d, "parent" : tmp });
- if(callback) { callback.call(this, d); }
- return d;
- },
- // Basic operations: rename (deal with text)
- get_text : function (obj) {
- obj = this._get_node(obj);
- if(!obj.length) { return false; }
- var s = this._get_settings().core.html_titles;
- obj = obj.children("a:eq(0)");
- if(s) {
- obj = obj.clone();
- obj.children("INS").remove();
- return obj.html();
- }
- else {
- obj = obj.contents().filter(function() { return this.nodeType == 3; })[0];
- return obj.nodeValue;
- }
- },
- set_text : function (obj, val) {
- obj = this._get_node(obj);
- if(!obj.length) { return false; }
- obj = obj.children("a:eq(0)");
- if(this._get_settings().core.html_titles) {
- var tmp = obj.children("INS").clone();
- obj.html(val).prepend(tmp);
- this.__callback({ "obj" : obj, "name" : val });
- return true;
- }
- else {
- obj = obj.contents().filter(function() { return this.nodeType == 3; })[0];
- this.__callback({ "obj" : obj, "name" : val });
- return (obj.nodeValue = val);
- }
- },
- rename_node : function (obj, val) {
- obj = this._get_node(obj);
- this.__rollback();
- if(obj && obj.length && this.set_text.apply(this, Array.prototype.slice.call(arguments))) { this.__callback({ "obj" : obj, "name" : val }); }
- },
- // Basic operations: deleting nodes
- delete_node : function (obj) {
- obj = this._get_node(obj);
- if(!obj.length) { return false; }
- this.__rollback();
- var p = this._get_parent(obj), prev = $([]), t = this;
- obj.each(function () {
- prev = prev.add(t._get_prev(this));
- });
- obj = obj.detach();
- if(p !== -1 && p.find("> ul > li").length === 0) {
- p.removeClass("jstree-open jstree-closed").addClass("jstree-leaf");
- }
- this.clean_node(p);
- this.__callback({ "obj" : obj, "prev" : prev, "parent" : p });
- return obj;
- },
- prepare_move : function (o, r, pos, cb, is_cb) {
- var p = {};
-
- p.ot = $.jstree._reference(o) || this;
- p.o = p.ot._get_node(o);
- p.r = r === - 1 ? -1 : this._get_node(r);
- p.p = (typeof pos === "undefined" || pos === false) ? "last" : pos; // TODO: move to a setting
- if(!is_cb && prepared_move.o && prepared_move.o[0] === p.o[0] && prepared_move.r[0] === p.r[0] && prepared_move.p === p.p) {
- this.__callback(prepared_move);
- if(cb) { cb.call(this, prepared_move); }
- return;
- }
- p.ot = $.jstree._reference(p.o) || this;
- p.rt = $.jstree._reference(p.r) || this; // r === -1 ? p.ot : $.jstree._reference(p.r) || this
- if(p.r === -1 || !p.r) {
- p.cr = -1;
- switch(p.p) {
- case "first":
- case "before":
- case "inside":
- p.cp = 0;
- break;
- case "after":
- case "last":
- p.cp = p.rt.get_container().find(" > ul > li").length;
- break;
- default:
- p.cp = p.p;
- break;
- }
- }
- else {
- if(!/^(before|after)$/.test(p.p) && !this._is_loaded(p.r)) {
- return this.load_node(p.r, function () { this.prepare_move(o, r, pos, cb, true); });
- }
- switch(p.p) {
- case "before":
- p.cp = p.r.index();
- p.cr = p.rt._get_parent(p.r);
- break;
- case "after":
- p.cp = p.r.index() + 1;
- p.cr = p.rt._get_parent(p.r);
- break;
- case "inside":
- case "first":
- p.cp = 0;
- p.cr = p.r;
- break;
- case "last":
- p.cp = p.r.find(" > ul > li").length;
- p.cr = p.r;
- break;
- default:
- p.cp = p.p;
- p.cr = p.r;
- break;
- }
- }
- p.np = p.cr == -1 ? p.rt.get_container() : p.cr;
- p.op = p.ot._get_parent(p.o);
- p.cop = p.o.index();
- if(p.op === -1) { p.op = p.ot ? p.ot.get_container() : this.get_container(); }
- if(!/^(before|after)$/.test(p.p) && p.op && p.np && p.op[0] === p.np[0] && p.o.index() < p.cp) { p.cp++; }
- //if(p.p === "before" && p.op && p.np && p.op[0] === p.np[0] && p.o.index() < p.cp) { p.cp--; }
- p.or = p.np.find(" > ul > li:nth-child(" + (p.cp + 1) + ")");
- prepared_move = p;
- this.__callback(prepared_move);
- if(cb) { cb.call(this, prepared_move); }
- },
- check_move : function () {
- var obj = prepared_move, ret = true, r = obj.r === -1 ? this.get_container() : obj.r;
- if(!obj || !obj.o || obj.or[0] === obj.o[0]) { return false; }
- if(!obj.cy) {
- if(obj.op && obj.np && obj.op[0] === obj.np[0] && obj.cp - 1 === obj.o.index()) { return false; }
- obj.o.each(function () {
- if(r.parentsUntil(".jstree", "li").addBack().index(this) !== -1) { ret = false; return false; }
- });
- }
- return ret;
- },
- move_node : function (obj, ref, position, is_copy, is_prepared, skip_check) {
- if(!is_prepared) {
- return this.prepare_move(obj, ref, position, function (p) {
- this.move_node(p, false, false, is_copy, true, skip_check);
- });
- }
- if(is_copy) {
- prepared_move.cy = true;
- }
- if(!skip_check && !this.check_move()) { return false; }
-
- this.__rollback();
- var o = false;
- if(is_copy) {
- o = obj.o.clone(true);
- o.find("*[id]").addBack().each(function () {
- if(this.id) { this.id = "copy_" + this.id; }
- });
- }
- else { o = obj.o; }
-
- if(obj.or.length) { obj.or.before(o); }
- else {
- if(!obj.np.children("ul").length) { $("<ul />").appendTo(obj.np); }
- obj.np.children("ul:eq(0)").append(o);
- }
-
- try {
- obj.ot.clean_node(obj.op);
- obj.rt.clean_node(obj.np);
- if(!obj.op.find("> ul > li").length) {
- obj.op.removeClass("jstree-open jstree-closed").addClass("jstree-leaf").children("ul").remove();
- }
- } catch (e) { }
-
- if(is_copy) {
- prepared_move.cy = true;
- prepared_move.oc = o;
- }
- this.__callback(prepared_move);
- return prepared_move;
- },
- _get_move : function () { return prepared_move; }
- }
- });
- })(jQuery);
- //*/
-
- /*
- * jsTree ui plugin
- * This plugins handles selecting/deselecting/hovering/dehovering nodes
- */
- (function ($) {
- var scrollbar_width, e1, e2;
- $(function() {
- if (/msie/.test(navigator.userAgent.toLowerCase())) {
- e1 = $('<textarea cols="10" rows="2"></textarea>').css({ position: 'absolute', top: -1000, left: 0 }).appendTo('body');
- e2 = $('<textarea cols="10" rows="2" style="overflow: hidden;"></textarea>').css({ position: 'absolute', top: -1000, left: 0 }).appendTo('body');
- scrollbar_width = e1.width() - e2.width();
- e1.add(e2).remove();
- }
- else {
- e1 = $('<div />').css({ width: 100, height: 100, overflow: 'auto', position: 'absolute', top: -1000, left: 0 })
- .prependTo('body').append('<div />').find('div').css({ width: '100%', height: 200 });
- scrollbar_width = 100 - e1.width();
- e1.parent().remove();
- }
- });
- $.jstree.plugin("ui", {
- __init : function () {
- this.data.ui.selected = $();
- this.data.ui.last_selected = false;
- this.data.ui.hovered = null;
- this.data.ui.to_select = this.get_settings().ui.initially_select;
-
- this.get_container()
- .delegate("a", "click.jstree", $.proxy(function (event) {
- event.preventDefault();
- event.currentTarget.blur();
- if(!$(event.currentTarget).hasClass("jstree-loading")) {
- this.select_node(event.currentTarget, true, event);
- }
- }, this))
- .delegate("a", "mouseenter.jstree", $.proxy(function (event) {
- if(!$(event.currentTarget).hasClass("jstree-loading")) {
- this.hover_node(event.target);
- }
- }, this))
- .delegate("a", "mouseleave.jstree", $.proxy(function (event) {
- if(!$(event.currentTarget).hasClass("jstree-loading")) {
- this.dehover_node(event.target);
- }
- }, this))
- .bind("reopen.jstree", $.proxy(function () {
- this.reselect();
- }, this))
- .bind("get_rollback.jstree", $.proxy(function () {
- this.dehover_node();
- this.save_selected();
- }, this))
- .bind("set_rollback.jstree", $.proxy(function () {
- this.reselect();
- }, this))
- .bind("close_node.jstree", $.proxy(function (event, data) {
- var s = this._get_settings().ui,
- obj = this._get_node(data.rslt.obj),
- clk = (obj && obj.length) ? obj.children("ul").find("a.jstree-clicked") : $(),
- _this = this;
- if(s.selected_parent_close === false || !clk.length) { return; }
- clk.each(function () {
- _this.deselect_node(this);
- if(s.selected_parent_close === "select_parent") { _this.select_node(obj); }
- });
- }, this))
- .bind("delete_node.jstree", $.proxy(function (event, data) {
- var s = this._get_settings().ui.select_prev_on_delete,
- obj = this._get_node(data.rslt.obj),
- clk = (obj && obj.length) ? obj.find("a.jstree-clicked") : [],
- _this = this;
- clk.each(function () { _this.deselect_node(this); });
- if(s && clk.length) {
- data.rslt.prev.each(function () {
- if(this.parentNode) { _this.select_node(this); return false; /* if return false is removed all prev nodes will be selected */}
- });
- }
- }, this))
- .bind("move_node.jstree", $.proxy(function (event, data) {
- if(data.rslt.cy) {
- data.rslt.oc.find("a.jstree-clicked").removeClass("jstree-clicked");
- }
- }, this));
- },
- defaults : {
- select_limit : -1, // 0, 1, 2 ... or -1 for unlimited
- select_multiple_modifier : "ctrl", // on, or ctrl, shift, alt
- select_range_modifier : "shift",
- selected_parent_close : "select_parent", // false, "deselect", "select_parent"
- selected_parent_open : true,
- select_prev_on_delete : true,
- disable_selecting_children : false,
- initially_select : []
- },
- _fn : {
- _get_node : function (obj, allow_multiple) {
- if(typeof obj === "undefined" || obj === null) { return allow_multiple ? this.data.ui.selected : this.data.ui.last_selected; }
- var $obj = $(obj, this.get_container());
- if($obj.is(".jstree") || obj == -1) { return -1; }
- $obj = $obj.closest("li", this.get_container());
- return $obj.length ? $obj : false;
- },
- _ui_notify : function (n, data) {
- if(data.selected) {
- this.select_node(n, false);
- }
- },
- save_selected : function () {
- var _this = this;
- this.data.ui.to_select = [];
- this.data.ui.selected.each(function () { if(this.id) { _this.data.ui.to_select.push("#" + this.id.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")); } });
- this.__callback(this.data.ui.to_select);
- },
- reselect : function () {
- var _this = this,
- s = this.data.ui.to_select;
- s = $.map($.makeArray(s), function (n) { return "#" + n.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"); });
- // this.deselect_all(); WHY deselect, breaks plugin state notifier?
- $.each(s, function (i, val) { if(val && val !== "#") { _this.select_node(val); } });
- this.data.ui.selected = this.data.ui.selected.filter(function () { return this.parentNode; });
- this.__callback();
- },
- refresh : function (obj) {
- this.save_selected();
- return this.__call_old();
- },
- hover_node : function (obj) {
- obj = this._get_node(obj);
- if(!obj.length) { return false; }
- //if(this.data.ui.hovered && obj.get(0) === this.data.ui.hovered.get(0)) { return; }
- if(!obj.hasClass("jstree-hovered")) { this.dehover_node(); }
- this.data.ui.hovered = obj.children("a").addClass("jstree-hovered").parent();
- this._fix_scroll(obj);
- this.__callback({ "obj" : obj });
- },
- dehover_node : function () {
- var obj = this.data.ui.hovered, p;
- if(!obj || !obj.length) { return false; }
- p = obj.children("a").removeClass("jstree-hovered").parent();
- if(this.data.ui.hovered[0] === p[0]) { this.data.ui.hovered = null; }
- this.__callback({ "obj" : obj });
- },
- select_node : function (obj, check, e) {
- obj = this._get_node(obj);
- if(obj == -1 || !obj || !obj.length) { return false; }
- var s = this._get_settings().ui,
- is_multiple = (s.select_multiple_modifier == "on" || (s.select_multiple_modifier !== false && e && e[s.select_multiple_modifier + "Key"])),
- is_range = (s.select_range_modifier !== false && e && e[s.select_range_modifier + "Key"] && this.data.ui.last_selected && this.data.ui.last_selected[0] !== obj[0] && this.data.ui.last_selected.parent()[0] === obj.parent()[0]),
- is_selected = this.is_selected(obj),
- proceed = true,
- t = this;
- if(check) {
- if(s.disable_selecting_children && is_multiple &&
- (
- (obj.parentsUntil(".jstree","li").children("a.jstree-clicked").length) ||
- (obj.children("ul").find("a.jstree-clicked:eq(0)").length)
- )
- ) {
- return false;
- }
- proceed = false;
- switch(!0) {
- case (is_range):
- this.data.ui.last_selected.addClass("jstree-last-selected");
- obj = obj[ obj.index() < this.data.ui.last_selected.index() ? "nextUntil" : "prevUntil" ](".jstree-last-selected").addBack();
- if(s.select_limit == -1 || obj.length < s.select_limit) {
- this.data.ui.last_selected.removeClass("jstree-last-selected");
- this.data.ui.selected.each(function () {
- if(this !== t.data.ui.last_selected[0]) { t.deselect_node(this); }
- });
- is_selected = false;
- proceed = true;
- }
- else {
- proceed = false;
- }
- break;
- case (is_selected && !is_multiple):
- this.deselect_all();
- is_selected = false;
- proceed = true;
- break;
- case (!is_selected && !is_multiple):
- if(s.select_limit == -1 || s.select_limit > 0) {
- this.deselect_all();
- proceed = true;
- }
- break;
- case (is_selected && is_multiple):
- this.deselect_node(obj);
- break;
- case (!is_selected && is_multiple):
- if(s.select_limit == -1 || this.data.ui.selected.length + 1 <= s.select_limit) {
- proceed = true;
- }
- break;
- }
- }
- if(proceed && !is_selected) {
- if(!is_range) { this.data.ui.last_selected = obj; }
- obj.children("a").addClass("jstree-clicked");
- if(s.selected_parent_open) {
- obj.parents(".jstree-closed").each(function () { t.open_node(this, false, true); });
- }
- this.data.ui.selected = this.data.ui.selected.add(obj);
- this._fix_scroll(obj.eq(0));
- this.__callback({ "obj" : obj, "e" : e });
- }
- },
- _fix_scroll : function (obj) {
- var c = this.get_container()[0], t;
- if(c.scrollHeight > c.offsetHeight) {
- obj = this._get_node(obj);
- if(!obj || obj === -1 || !obj.length || !obj.is(":visible")) { return; }
- t = obj.offset().top - this.get_container().offset().top;
- if(t < 0) {
- c.scrollTop = c.scrollTop + t - 1;
- }
- if(t + this.data.core.li_height + (c.scrollWidth > c.offsetWidth ? scrollbar_width : 0) > c.offsetHeight) {
- c.scrollTop = c.scrollTop + (t - c.offsetHeight + this.data.core.li_height + 1 + (c.scrollWidth > c.offsetWidth ? scrollbar_width : 0));
- }
- }
- },
- deselect_node : function (obj) {
- obj = this._get_node(obj);
- if(!obj.length) { return false; }
- if(this.is_selected(obj)) {
- obj.children("a").removeClass("jstree-clicked");
- this.data.ui.selected = this.data.ui.selected.not(obj);
- if(this.data.ui.last_selected.get(0) === obj.get(0)) { this.data.ui.last_selected = this.data.ui.selected.eq(0); }
- this.__callback({ "obj" : obj });
- }
- },
- toggle_select : function (obj) {
- obj = this._get_node(obj);
- if(!obj.length) { return false; }
- if(this.is_selected(obj)) { this.deselect_node(obj); }
- else { this.select_node(obj); }
- },
- is_selected : function (obj) { return this.data.ui.selected.index(this._get_node(obj)) >= 0; },
- get_selected : function (context) {
- return context ? $(context).find("a.jstree-clicked").parent() : this.data.ui.selected;
- },
- deselect_all : function (context) {
- var ret = context ? $(context).find("a.jstree-clicked").parent() : this.get_container().find("a.jstree-clicked").parent();
- ret.children("a.jstree-clicked").removeClass("jstree-clicked");
- this.data.ui.selected = $([]);
- this.data.ui.last_selected = false;
- this.__callback({ "obj" : ret });
- }
- }
- });
- // include the selection plugin by default
- $.jstree.defaults.plugins.push("ui");
- })(jQuery);
- //*/
-
- /*
- * jsTree CRRM plugin
- * Handles creating/renaming/removing/moving nodes by user interaction.
- */
- (function ($) {
- $.jstree.plugin("crrm", {
- __init : function () {
- this.get_container()
- .bind("move_node.jstree", $.proxy(function (e, data) {
- if(this._get_settings().crrm.move.open_onmove) {
- var t = this;
- data.rslt.np.parentsUntil(".jstree").addBack().filter(".jstree-closed").each(function () {
- t.open_node(this, false, true);
- });
- }
- }, this));
- },
- defaults : {
- input_width_limit : 200,
- move : {
- always_copy : false, // false, true or "multitree"
- open_onmove : true,
- default_position : "last",
- check_move : function (m) { return true; }
- }
- },
- _fn : {
- _show_input : function (obj, callback) {
- obj = this._get_node(obj);
- var rtl = this._get_settings().core.rtl,
- w = this._get_settings().crrm.input_width_limit,
- w1 = obj.children("ins").width(),
- w2 = obj.find("> a:visible > ins").width() * obj.find("> a:visible > ins").length,
- t = this.get_text(obj),
- h1 = $("<div />", { css : { "position" : "absolute", "top" : "-200px", "left" : (rtl ? "0px" : "-1000px"), "visibility" : "hidden" } }).appendTo("body"),
- h2 = obj.css("position","relative").append(
- $("<input />", {
- "value" : t,
- "class" : "jstree-rename-input",
- // "size" : t.length,
- "css" : {
- "padding" : "0",
- "border" : "1px solid silver",
- "position" : "absolute",
- "left" : (rtl ? "auto" : (w1 + w2 + 4) + "px"),
- "right" : (rtl ? (w1 + w2 + 4) + "px" : "auto"),
- "top" : "0px",
- "height" : (this.data.core.li_height - 2) + "px",
- "lineHeight" : (this.data.core.li_height - 2) + "px",
- "width" : "150px" // will be set a bit further down
- },
- "blur" : $.proxy(function () {
- var i = obj.children(".jstree-rename-input"),
- v = i.val();
- if(v === "") { v = t; }
- h1.remove();
- i.remove(); // rollback purposes
- this.set_text(obj,t); // rollback purposes
- this.rename_node(obj, v);
- callback.call(this, obj, v, t);
- obj.css("position","");
- }, this),
- "keyup" : function (event) {
- var key = event.keyCode || event.which;
- if(key == 27) { this.value = t; this.blur(); return; }
- else if(key == 13) { this.blur(); return; }
- else {
- h2.width(Math.min(h1.text("pW" + this.value).width(),w));
- }
- },
- "keypress" : function(event) {
- var key = event.keyCode || event.which;
- if(key == 13) { return false; }
- }
- })
- ).children(".jstree-rename-input");
- this.set_text(obj, "");
- h1.css({
- fontFamily : h2.css('fontFamily') || '',
- fontSize : h2.css('fontSize') || '',
- fontWeight : h2.css('fontWeight') || '',
- fontStyle : h2.css('fontStyle') || '',
- fontStretch : h2.css('fontStretch') || '',
- fontVariant : h2.css('fontVariant') || '',
- letterSpacing : h2.css('letterSpacing') || '',
- wordSpacing : h2.css('wordSpacing') || ''
- });
- h2.width(Math.min(h1.text("pW" + h2[0].value).width(),w))[0].select();
- },
- rename : function (obj) {
- obj = this._get_node(obj);
- this.__rollback();
- var f = this.__callback;
- this._show_input(obj, function (obj, new_name, old_name) {
- f.call(this, { "obj" : obj, "new_name" : new_name, "old_name" : old_name });
- });
- },
- create : function (obj, position, js, callback, skip_rename) {
- var t, _this = this;
- obj = this._get_node(obj);
- if(!obj) { obj = -1; }
- this.__rollback();
- t = this.create_node(obj, position, js, function (t) {
- var p = this._get_parent(t),
- pos = $(t).index();
- if(callback) { callback.call(this, t); }
- if(p.length && p.hasClass("jstree-closed")) { this.open_node(p, false, true); }
- if(!skip_rename) {
- this._show_input(t, function (obj, new_name, old_name) {
- _this.__callback({ "obj" : obj, "name" : new_name, "parent" : p, "position" : pos });
- });
- }
- else { _this.__callback({ "obj" : t, "name" : this.get_text(t), "parent" : p, "position" : pos }); }
- });
- return t;
- },
- remove : function (obj) {
- obj = this._get_node(obj, true);
- var p = this._get_parent(obj), prev = this._get_prev(obj);
- this.__rollback();
- obj = this.delete_node(obj);
- if(obj !== false) { this.__callback({ "obj" : obj, "prev" : prev, "parent" : p }); }
- },
- check_move : function () {
- if(!this.__call_old()) { return false; }
- var s = this._get_settings().crrm.move;
- if(!s.check_move.call(this, this._get_move())) { return false; }
- return true;
- },
- move_node : function (obj, ref, position, is_copy, is_prepared, skip_check) {
- var s = this._get_settings().crrm.move;
- if(!is_prepared) {
- if(typeof position === "undefined") { position = s.default_position; }
- if(position === "inside" && !s.default_position.match(/^(before|after)$/)) { position = s.default_position; }
- return this.__call_old(true, obj, ref, position, is_copy, false, skip_check);
- }
- // if the move is already prepared
- if(s.always_copy === true || (s.always_copy === "multitree" && obj.rt.get_index() !== obj.ot.get_index() )) {
- is_copy = true;
- }
- this.__call_old(true, obj, ref, position, is_copy, true, skip_check);
- },
-
- cut : function (obj) {
- obj = this._get_node(obj, true);
- if(!obj || !obj.length) { return false; }
- this.data.crrm.cp_nodes = false;
- this.data.crrm.ct_nodes = obj;
- this.__callback({ "obj" : obj });
- },
- copy : function (obj) {
- obj = this._get_node(obj, true);
- if(!obj || !obj.length) { return false; }
- this.data.crrm.ct_nodes = false;
- this.data.crrm.cp_nodes = obj;
- this.__callback({ "obj" : obj });
- },
- paste : function (obj) {
- obj = this._get_node(obj);
- if(!obj || !obj.length) { return false; }
- var nodes = this.data.crrm.ct_nodes ? this.data.crrm.ct_nodes : this.data.crrm.cp_nodes;
- if(!this.data.crrm.ct_nodes && !this.data.crrm.cp_nodes) { return false; }
- if(this.data.crrm.ct_nodes) { this.move_node(this.data.crrm.ct_nodes, obj); this.data.crrm.ct_nodes = false; }
- if(this.data.crrm.cp_nodes) { this.move_node(this.data.crrm.cp_nodes, obj, false, true); }
- this.__callback({ "obj" : obj, "nodes" : nodes });
- }
- }
- });
- // include the crr plugin by default
- // $.jstree.defaults.plugins.push("crrm");
- })(jQuery);
- //*/
-
- /*
- * jsTree themes plugin
- * Handles loading and setting themes, as well as detecting path to themes, etc.
- */
- (function ($) {
- var themes_loaded = [];
- // this variable stores the path to the themes folder - if left as false - it will be autodetected
- $.jstree._themes = false;
- $.jstree.plugin("themes", {
- __init : function () {
- this.get_container()
- .bind("init.jstree", $.proxy(function () {
- var s = this._get_settings().themes;
- this.data.themes.dots = s.dots;
- this.data.themes.icons = s.icons;
- this.set_theme(s.theme, s.url);
- }, this))
- .bind("loaded.jstree", $.proxy(function () {
- // bound here too, as simple HTML tree's won't honor dots & icons otherwise
- if(!this.data.themes.dots) { this.hide_dots(); }
- else { this.show_dots(); }
- if(!this.data.themes.icons) { this.hide_icons(); }
- else { this.show_icons(); }
- }, this));
- },
- defaults : {
- theme : "default",
- url : false,
- dots : true,
- icons : true
- },
- _fn : {
- set_theme : function (theme_name, theme_url) {
- if(!theme_name) { return false; }
- if(!theme_url) { theme_url = $.jstree._themes + theme_name + '/style.css'; }
- if($.inArray(theme_url, themes_loaded) == -1) {
- $.vakata.css.add_sheet({ "url" : theme_url });
- themes_loaded.push(theme_url);
- }
- if(this.data.themes.theme != theme_name) {
- this.get_container().removeClass('jstree-' + this.data.themes.theme);
- this.data.themes.theme = theme_name;
- }
- this.get_container().addClass('jstree-' + theme_name);
- if(!this.data.themes.dots) { this.hide_dots(); }
- else { this.show_dots(); }
- if(!this.data.themes.icons) { this.hide_icons(); }
- else { this.show_icons(); }
- this.__callback();
- },
- get_theme : function () { return this.data.themes.theme; },
-
- show_dots : function () { this.data.themes.dots = true; this.get_container().children("ul").removeClass("jstree-no-dots"); },
- hide_dots : function () { this.data.themes.dots = false; this.get_container().children("ul").addClass("jstree-no-dots"); },
- toggle_dots : function () { if(this.data.themes.dots) { this.hide_dots(); } else { this.show_dots(); } },
-
- show_icons : function () { this.data.themes.icons = true; this.get_container().children("ul").removeClass("jstree-no-icons"); },
- hide_icons : function () { this.data.themes.icons = false; this.get_container().children("ul").addClass("jstree-no-icons"); },
- toggle_icons: function () { if(this.data.themes.icons) { this.hide_icons(); } else { this.show_icons(); } }
- }
- });
- // autodetect themes path
- $(function () {
- if($.jstree._themes === false) {
- $("script").each(function () {
- if(this.src.toString().match(/jquery\.jstree[^\/]*?\.js(\?.*)?$/)) {
- $.jstree._themes = this.src.toString().replace(/jquery\.jstree[^\/]*?\.js(\?.*)?$/, "") + 'themes/';
- return false;
- }
- });
- }
- if($.jstree._themes === false) { $.jstree._themes = "themes/"; }
- });
- // include the themes plugin by default
- $.jstree.defaults.plugins.push("themes");
- })(jQuery);
- //*/
-
- /*
- * jsTree hotkeys plugin
- * Enables keyboard navigation for all tree instances
- * Depends on the jstree ui & jquery hotkeys plugins
- */
- (function ($) {
- var bound = [];
- function exec(i, event) {
- var f = $.jstree._focused(), tmp;
- if(f && f.data && f.data.hotkeys && f.data.hotkeys.enabled) {
- tmp = f._get_settings().hotkeys[i];
- if(tmp) { return tmp.call(f, event); }
- }
- }
- $.jstree.plugin("hotkeys", {
- __init : function () {
- if(typeof $.hotkeys === "undefined") { throw "jsTree hotkeys: jQuery hotkeys plugin not included."; }
- if(!this.data.ui) { throw "jsTree hotkeys: jsTree UI plugin not included."; }
- $.each(this._get_settings().hotkeys, function (i, v) {
- if(v !== false && $.inArray(i, bound) == -1) {
- $(document).bind("keydown", i, function (event) { return exec(i, event); });
- bound.push(i);
- }
- });
- this.get_container()
- .bind("lock.jstree", $.proxy(function () {
- if(this.data.hotkeys.enabled) { this.data.hotkeys.enabled = false; this.data.hotkeys.revert = true; }
- }, this))
- .bind("unlock.jstree", $.proxy(function () {
- if(this.data.hotkeys.revert) { this.data.hotkeys.enabled = true; }
- }, this));
- this.enable_hotkeys();
- },
- defaults : {
- "up" : function () {
- var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
- this.hover_node(this._get_prev(o));
- return false;
- },
- "ctrl+up" : function () {
- var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
- this.hover_node(this._get_prev(o));
- return false;
- },
- "shift+up" : function () {
- var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
- this.hover_node(this._get_prev(o));
- return false;
- },
- "down" : function () {
- var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
- this.hover_node(this._get_next(o));
- return false;
- },
- "ctrl+down" : function () {
- var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
- this.hover_node(this._get_next(o));
- return false;
- },
- "shift+down" : function () {
- var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
- this.hover_node(this._get_next(o));
- return false;
- },
- "left" : function () {
- var o = this.data.ui.hovered || this.data.ui.last_selected;
- if(o) {
- if(o.hasClass("jstree-open")) { this.close_node(o); }
- else { this.hover_node(this._get_prev(o)); }
- }
- return false;
- },
- "ctrl+left" : function () {
- var o = this.data.ui.hovered || this.data.ui.last_selected;
- if(o) {
- if(o.hasClass("jstree-open")) { this.close_node(o); }
- else { this.hover_node(this._get_prev(o)); }
- }
- return false;
- },
- "shift+left" : function () {
- var o = this.data.ui.hovered || this.data.ui.last_selected;
- if(o) {
- if(o.hasClass("jstree-open")) { this.close_node(o); }
- else { this.hover_node(this._get_prev(o)); }
- }
- return false;
- },
- "right" : function () {
- var o = this.data.ui.hovered || this.data.ui.last_selected;
- if(o && o.length) {
- if(o.hasClass("jstree-closed")) { this.open_node(o); }
- else { this.hover_node(this._get_next(o)); }
- }
- return false;
- },
- "ctrl+right" : function () {
- var o = this.data.ui.hovered || this.data.ui.last_selected;
- if(o && o.length) {
- if(o.hasClass("jstree-closed")) { this.open_node(o); }
- else { this.hover_node(this._get_next(o)); }
- }
- return false;
- },
- "shift+right" : function () {
- var o = this.data.ui.hovered || this.data.ui.last_selected;
- if(o && o.length) {
- if(o.hasClass("jstree-closed")) { this.open_node(o); }
- else { this.hover_node(this._get_next(o)); }
- }
- return false;
- },
- "space" : function () {
- if(this.data.ui.hovered) { this.data.ui.hovered.children("a:eq(0)").click(); }
- return false;
- },
- "ctrl+space" : function (event) {
- event.type = "click";
- if(this.data.ui.hovered) { this.data.ui.hovered.children("a:eq(0)").trigger(event); }
- return false;
- },
- "shift+space" : function (event) {
- event.type = "click";
- if(this.data.ui.hovered) { this.data.ui.hovered.children("a:eq(0)").trigger(event); }
- return false;
- },
- "f2" : function () { this.rename(this.data.ui.hovered || this.data.ui.last_selected); },
- "del" : function () { this.remove(this.data.ui.hovered || this._get_node(null)); }
- },
- _fn : {
- enable_hotkeys : function () {
- this.data.hotkeys.enabled = true;
- },
- disable_hotkeys : function () {
- this.data.hotkeys.enabled = false;
- }
- }
- });
- })(jQuery);
- //*/
-
- /*
- * jsTree JSON plugin
- * The JSON data store. Datastores are build by overriding the `load_node` and `_is_loaded` functions.
- */
- (function ($) {
- $.jstree.plugin("json_data", {
- __init : function() {
- var s = this._get_settings().json_data;
- if(s.progressive_unload) {
- this.get_container().bind("after_close.jstree", function (e, data) {
- data.rslt.obj.children("ul").remove();
- });
- }
- },
- defaults : {
- // `data` can be a function:
- // * accepts two arguments - node being loaded and a callback to pass the result to
- // * will be executed in the current tree's scope & ajax won't be supported
- data : false,
- ajax : false,
- correct_state : true,
- progressive_render : false,
- progressive_unload : false
- },
- _fn : {
- load_node : function (obj, s_call, e_call) { var _this = this; this.load_node_json(obj, function () { _this.__callback({ "obj" : _this._get_node(obj) }); s_call.call(this); }, e_call); },
- _is_loaded : function (obj) {
- var s = this._get_settings().json_data;
- obj = this._get_node(obj);
- return obj == -1 || !obj || (!s.ajax && !s.progressive_render && !$.isFunction(s.data)) || obj.is(".jstree-open, .jstree-leaf") || obj.children("ul").children("li").length > 0;
- },
- refresh : function (obj) {
- obj = this._get_node(obj);
- var s = this._get_settings().json_data;
- if(obj && obj !== -1 && s.progressive_unload && ($.isFunction(s.data) || !!s.ajax)) {
- obj.removeData("jstree_children");
- }
- return this.__call_old();
- },
- load_node_json : function (obj, s_call, e_call) {
- var s = this.get_settings().json_data, d,
- error_func = function () {},
- success_func = function () {};
- obj = this._get_node(obj);
-
- if(obj && obj !== -1 && (s.progressive_render || s.progressive_unload) && !obj.is(".jstree-open, .jstree-leaf") && obj.children("ul").children("li").length === 0 && obj.data("jstree_children")) {
- d = this._parse_json(obj.data("jstree_children"), obj);
- if(d) {
- obj.append(d);
- if(!s.progressive_unload) { obj.removeData("jstree_children"); }
- }
- this.clean_node(obj);
- if(s_call) { s_call.call(this); }
- return;
- }
-
- if(obj && obj !== -1) {
- if(obj.data("jstree_is_loading")) { return; }
- else { obj.data("jstree_is_loading",true); }
- }
- switch(!0) {
- case (!s.data && !s.ajax): throw "Neither data nor ajax settings supplied.";
- // function option added here for easier model integration (also supporting async - see callback)
- case ($.isFunction(s.data)):
- s.data.call(this, obj, $.proxy(function (d) {
- d = this._parse_json(d, obj);
- if(!d) {
- if(obj === -1 || !obj) {
- if(s.correct_state) { this.get_container().children("ul").empty(); }
- }
- else {
- obj.children("a.jstree-loading").removeClass("jstree-loading");
- obj.removeData("jstree_is_loading");
- if(s.correct_state) { this.correct_state(obj); }
- }
- if(e_call) { e_call.call(this); }
- }
- else {
- if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
- else { obj.append(d).children("a.jstree-loading").removeClass("jstree-loading"); obj.removeData("jstree_is_loading"); }
- this.clean_node(obj);
- if(s_call) { s_call.call(this); }
- }
- }, this));
- break;
- case (!!s.data && !s.ajax) || (!!s.data && !!s.ajax && (!obj || obj === -1)):
- if(!obj || obj == -1) {
- d = this._parse_json(s.data, obj);
- if(d) {
- this.get_container().children("ul").empty().append(d.children());
- this.clean_node();
- }
- else {
- if(s.correct_state) { this.get_container().children("ul").empty(); }
- }
- }
- if(s_call) { s_call.call(this); }
- break;
- case (!s.data && !!s.ajax) || (!!s.data && !!s.ajax && obj && obj !== -1):
- error_func = function (x, t, e) {
- var ef = this.get_settings().json_data.ajax.error;
- if(ef) { ef.call(this, x, t, e); }
- if(obj != -1 && obj.length) {
- obj.children("a.jstree-loading").removeClass("jstree-loading");
- obj.removeData("jstree_is_loading");
- if(t === "success" && s.correct_state) { this.correct_state(obj); }
- }
- else {
- if(t === "success" && s.correct_state) { this.get_container().children("ul").empty(); }
- }
- if(e_call) { e_call.call(this); }
- };
- success_func = function (d, t, x) {
- var sf = this.get_settings().json_data.ajax.success;
- if(sf) { d = sf.call(this,d,t,x) || d; }
- if(d === "" || (d && d.toString && d.toString().replace(/^[\s\n]+$/,"") === "") || (!$.isArray(d) && !$.isPlainObject(d))) {
- return error_func.call(this, x, t, "");
- }
- d = this._parse_json(d, obj);
- if(d) {
- if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
- else { obj.append(d).children("a.jstree-loading").removeClass("jstree-loading"); obj.removeData("jstree_is_loading"); }
- this.clean_node(obj);
- if(s_call) { s_call.call(this); }
- }
- else {
- if(obj === -1 || !obj) {
- if(s.correct_state) {
- this.get_container().children("ul").empty();
- if(s_call) { s_call.call(this); }
- }
- }
- else {
- obj.children("a.jstree-loading").removeClass("jstree-loading");
- obj.removeData("jstree_is_loading");
- if(s.correct_state) {
- this.correct_state(obj);
- if(s_call) { s_call.call(this); }
- }
- }
- }
- };
- s.ajax.context = this;
- s.ajax.error = error_func;
- s.ajax.success = success_func;
- if(!s.ajax.dataType) { s.ajax.dataType = "json"; }
- if($.isFunction(s.ajax.url)) { s.ajax.url = s.ajax.url.call(this, obj); }
- if($.isFunction(s.ajax.data)) { s.ajax.data = s.ajax.data.call(this, obj); }
- $.ajax(s.ajax);
- break;
- }
- },
- _parse_json : function (js, obj, is_callback) {
- var d = false,
- p = this._get_settings(),
- s = p.json_data,
- t = p.core.html_titles,
- tmp, i, j, ul1, ul2;
-
- if(!js) { return d; }
- if(s.progressive_unload && obj && obj !== -1) {
- obj.data("jstree_children", d);
- }
- if($.isArray(js)) {
- d = $('<ul>');
- if(!js.length) { return false; }
- for(i = 0, j = js.length; i < j; i++) {
- tmp = this._parse_json(js[i], obj, true);
- if(tmp.length) {
- d = d.append(tmp);
- }
- }
- d = d.children();
- }
- else {
- if(typeof js == "string") { js = { data : js }; }
- if(!js.data && js.data !== "") { return d; }
- d = $("<li />");
- if(js.attr) { d.attr(js.attr); }
- if(js.metadata) { d.data(js.metadata); }
- if(js.state) { d.addClass("jstree-" + js.state); }
- if(!$.isArray(js.data)) { tmp = js.data; js.data = []; js.data.push(tmp); }
- $.each(js.data, function (i, m) {
- tmp = $("<a />");
- if($.isFunction(m)) { m = m.call(this, js); }
- if(typeof m == "string") { tmp.attr('href','#')[ t ? "html" : "text" ](m); }
- else {
- if(!m.attr) { m.attr = {}; }
- if(!m.attr.href) { m.attr.href = '#'; }
- tmp.attr(m.attr)[ t ? "html" : "text" ](m.title);
- if(m.language) { tmp.addClass(m.language); }
- }
- tmp.prepend("<ins class='jstree-icon'>&#160;</ins>");
- if(!m.icon && js.icon) { m.icon = js.icon; }
- if(m.icon) {
- if(m.icon.indexOf("/") === -1) { tmp.children("ins").addClass(m.icon); }
- else { tmp.children("ins").css("background","url('" + m.icon + "') center center no-repeat"); }
- }
- d.append(tmp);
- });
- d.prepend("<ins class='jstree-icon'>&#160;</ins>");
- if(js.children) {
- if(s.progressive_render && js.state !== "open") {
- d.addClass("jstree-closed").data("jstree_children", js.children);
- }
- else {
- if(s.progressive_unload) { d.data("jstree_children", js.children); }
- if($.isArray(js.children) && js.children.length) {
- tmp = this._parse_json(js.children, obj, true);
- if(tmp.length) {
- ul2 = $("<ul />");
- ul2.append(tmp);
- d.append(ul2);
- }
- }
- }
- }
- }
- if(!is_callback) {
- ul1 = $("<ul />");
- ul1.append(d);
- d = ul1;
- }
- return d;
- },
- get_json : function (obj, li_attr, a_attr, is_callback) {
- var result = [],
- s = this._get_settings(),
- _this = this,
- tmp1, tmp2, li, a, t, lang;
- obj = this._get_node(obj);
- if(!obj || obj === -1) { obj = this.get_container().find("> ul > li"); }
- li_attr = $.isArray(li_attr) ? li_attr : [ "id", "class" ];
- if(!is_callback && this.data.types) { li_attr.push(s.types.type_attr); }
- a_attr = $.isArray(a_attr) ? a_attr : [ ];
-
- obj.each(function () {
- li = $(this);
- tmp1 = { data : [] };
- if(li_attr.length) { tmp1.attr = { }; }
- $.each(li_attr, function (i, v) {
- tmp2 = li.attr(v);
- if(tmp2 && tmp2.length && tmp2.replace(/jstree[^ ]*/ig,'').length) {
- tmp1.attr[v] = (" " + tmp2).replace(/ jstree[^ ]*/ig,'').replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"");
- }
- });
- if(li.hasClass("jstree-open")) { tmp1.state = "open"; }
- if(li.hasClass("jstree-closed")) { tmp1.state = "closed"; }
- if(li.data()) { tmp1.metadata = li.data(); }
- a = li.children("a");
- a.each(function () {
- t = $(this);
- if(
- a_attr.length ||
- $.inArray("languages", s.plugins) !== -1 ||
- t.children("ins").get(0).style.backgroundImage.length ||
- (t.children("ins").get(0).className && t.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,'').length)
- ) {
- lang = false;
- if($.inArray("languages", s.plugins) !== -1 && $.isArray(s.languages) && s.languages.length) {
- $.each(s.languages, function (l, lv) {
- if(t.hasClass(lv)) {
- lang = lv;
- return false;
- }
- });
- }
- tmp2 = { attr : { }, title : _this.get_text(t, lang) };
- $.each(a_attr, function (k, z) {
- tmp2.attr[z] = (" " + (t.attr(z) || "")).replace(/ jstree[^ ]*/ig,'').replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"");
- });
- if($.inArray("languages", s.plugins) !== -1 && $.isArray(s.languages) && s.languages.length) {
- $.each(s.languages, function (k, z) {
- if(t.hasClass(z)) { tmp2.language = z; return true; }
- });
- }
- if(t.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,'').replace(/^\s+$/ig,"").length) {
- tmp2.icon = t.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,'').replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"");
- }
- if(t.children("ins").get(0).style.backgroundImage.length) {
- tmp2.icon = t.children("ins").get(0).style.backgroundImage.replace("url(","").replace(")","");
- }
- }
- else {
- tmp2 = _this.get_text(t);
- }
- if(a.length > 1) { tmp1.data.push(tmp2); }
- else { tmp1.data = tmp2; }
- });
- li = li.find("> ul > li");
- if(li.length) { tmp1.children = _this.get_json(li, li_attr, a_attr, true); }
- result.push(tmp1);
- });
- return result;
- }
- }
- });
- })(jQuery);
- //*/
-
- /*
- * jsTree languages plugin
- * Adds support for multiple language versions in one tree
- * This basically allows for many titles coexisting in one node, but only one of them being visible at any given time
- * This is useful for maintaining the same structure in many languages (hence the name of the plugin)
- */
- (function ($) {
- var sh = false;
- $.jstree.plugin("languages", {
- __init : function () { this._load_css(); },
- defaults : [],
- _fn : {
- set_lang : function (i) {
- var langs = this._get_settings().languages,
- st = false,
- selector = ".jstree-" + this.get_index() + ' a';
- if(!$.isArray(langs) || langs.length === 0) { return false; }
- if($.inArray(i,langs) == -1) {
- if(!!langs[i]) { i = langs[i]; }
- else { return false; }
- }
- if(i == this.data.languages.current_language) { return true; }
- st = $.vakata.css.get_css(selector + "." + this.data.languages.current_language, false, sh);
- if(st !== false) { st.style.display = "none"; }
- st = $.vakata.css.get_css(selector + "." + i, false, sh);
- if(st !== false) { st.style.display = ""; }
- this.data.languages.current_language = i;
- this.__callback(i);
- return true;
- },
- get_lang : function () {
- return this.data.languages.current_language;
- },
- _get_string : function (key, lang) {
- var langs = this._get_settings().languages,
- s = this._get_settings().core.strings;
- if($.isArray(langs) && langs.length) {
- lang = (lang && $.inArray(lang,langs) != -1) ? lang : this.data.languages.current_language;
- }
- if(s[lang] && s[lang][key]) { return s[lang][key]; }
- if(s[key]) { return s[key]; }
- return key;
- },
- get_text : function (obj, lang) {
- obj = this._get_node(obj) || this.data.ui.last_selected;
- if(!obj.size()) { return false; }
- var langs = this._get_settings().languages,
- s = this._get_settings().core.html_titles;
- if($.isArray(langs) && langs.length) {
- lang = (lang && $.inArray(lang,langs) != -1) ? lang : this.data.languages.current_language;
- obj = obj.children("a." + lang);
- }
- else { obj = obj.children("a:eq(0)"); }
- if(s) {
- obj = obj.clone();
- obj.children("INS").remove();
- return obj.html();
- }
- else {
- obj = obj.contents().filter(function() { return this.nodeType == 3; })[0];
- return obj.nodeValue;
- }
- },
- set_text : function (obj, val, lang) {
- obj = this._get_node(obj) || this.data.ui.last_selected;
- if(!obj.size()) { return false; }
- var langs = this._get_settings().languages,
- s = this._get_settings().core.html_titles,
- tmp;
- if($.isArray(langs) && langs.length) {
- lang = (lang && $.inArray(lang,langs) != -1) ? lang : this.data.languages.current_language;
- obj = obj.children("a." + lang);
- }
- else { obj = obj.children("a:eq(0)"); }
- if(s) {
- tmp = obj.children("INS").clone();
- obj.html(val).prepend(tmp);
- this.__callback({ "obj" : obj, "name" : val, "lang" : lang });
- return true;
- }
- else {
- obj = obj.contents().filter(function() { return this.nodeType == 3; })[0];
- this.__callback({ "obj" : obj, "name" : val, "lang" : lang });
- return (obj.nodeValue = val);
- }
- },
- _load_css : function () {
- var langs = this._get_settings().languages,
- str = "/* languages css */",
- selector = ".jstree-" + this.get_index() + ' a',
- ln;
- if($.isArray(langs) && langs.length) {
- this.data.languages.current_language = langs[0];
- for(ln = 0; ln < langs.length; ln++) {
- str += selector + "." + langs[ln] + " {";
- if(langs[ln] != this.data.languages.current_language) { str += " display:none; "; }
- str += " } ";
- }
- sh = $.vakata.css.add_sheet({ 'str' : str, 'title' : "jstree-languages" });
- }
- },
- create_node : function (obj, position, js, callback) {
- var t = this.__call_old(true, obj, position, js, function (t) {
- var langs = this._get_settings().languages,
- a = t.children("a"),
- ln;
- if($.isArray(langs) && langs.length) {
- for(ln = 0; ln < langs.length; ln++) {
- if(!a.is("." + langs[ln])) {
- t.append(a.eq(0).clone().removeClass(langs.join(" ")).addClass(langs[ln]));
- }
- }
- a.not("." + langs.join(", .")).remove();
- }
- if(callback) { callback.call(this, t); }
- });
- return t;
- }
- }
- });
- })(jQuery);
-//*/
-
-/*
- * jsTree cookies plugin
- * Stores the currently opened/selected nodes in a cookie and then restores them
- * Depends on the js.cookie plugin
- */
-(function ($) {
- $.jstree.plugin("cookies", {
- __init : function () {
- if(typeof Cookies === "undefined") { throw "jsTree cookie: jQuery cookie plugin not included."; }
-
- var s = this._get_settings().cookies,
- tmp;
- if(!!s.save_loaded) {
- tmp = Cookies.get(s.save_loaded);
- if(tmp && tmp.length) { this.data.core.to_load = tmp.split(","); }
- }
- if(!!s.save_opened) {
- tmp = Cookies.get(s.save_opened);
- if(tmp && tmp.length) { this.data.core.to_open = tmp.split(","); }
- }
- if(!!s.save_selected) {
- tmp = Cookies.get(s.save_selected);
- if(tmp && tmp.length && this.data.ui) { this.data.ui.to_select = tmp.split(","); }
- }
- this.get_container()
- .one( ( this.data.ui ? "reselect" : "reopen" ) + ".jstree", $.proxy(function () {
- this.get_container()
- .bind("open_node.jstree close_node.jstree select_node.jstree deselect_node.jstree", $.proxy(function (e) {
- if(this._get_settings().cookies.auto_save) { this.save_cookie((e.handleObj.namespace + e.handleObj.type).replace("jstree","")); }
- }, this));
- }, this));
- },
- defaults : {
- save_loaded : "jstree_load",
- save_opened : "jstree_open",
- save_selected : "jstree_select",
- auto_save : true,
- cookie_options : {}
- },
- _fn : {
- save_cookie : function (c) {
- if(this.data.core.refreshing) { return; }
- var s = this._get_settings().cookies;
- if(!c) { // if called manually and not by event
- if(s.save_loaded) {
- this.save_loaded();
- Cookies.set(s.save_loaded, this.data.core.to_load.join(","), s.cookie_options);
- }
- if(s.save_opened) {
- this.save_opened();
- Cookies.set(s.save_opened, this.data.core.to_open.join(","), s.cookie_options);
- }
- if(s.save_selected && this.data.ui) {
- this.save_selected();
- Cookies.set(s.save_selected, this.data.ui.to_select.join(","), s.cookie_options);
- }
- return;
- }
- switch(c) {
- case "open_node":
- case "close_node":
- if(!!s.save_opened) {
- this.save_opened();
- Cookies.set(s.save_opened, this.data.core.to_open.join(","), s.cookie_options);
- }
- if(!!s.save_loaded) {
- this.save_loaded();
- Cookies.set(s.save_loaded, this.data.core.to_load.join(","), s.cookie_options);
- }
- break;
- case "select_node":
- case "deselect_node":
- if(!!s.save_selected && this.data.ui) {
- this.save_selected();
- Cookies.set(s.save_selected, this.data.ui.to_select.join(","), s.cookie_options);
- }
- break;
- }
- }
- }
- });
- // include cookies by default
- // $.jstree.defaults.plugins.push("cookies");
-})(jQuery);
-//*/
-
-/*
- * jsTree sort plugin
- * Sorts items alphabetically (or using any other function)
- */
-(function ($) {
- $.jstree.plugin("sort", {
- __init : function () {
- this.get_container()
- .bind("load_node.jstree", $.proxy(function (e, data) {
- var obj = this._get_node(data.rslt.obj);
- obj = obj === -1 ? this.get_container().children("ul") : obj.children("ul");
- this.sort(obj);
- }, this))
- .bind("rename_node.jstree create_node.jstree create.jstree", $.proxy(function (e, data) {
- this.sort(data.rslt.obj.parent());
- }, this))
- .bind("move_node.jstree", $.proxy(function (e, data) {
- var m = data.rslt.np == -1 ? this.get_container() : data.rslt.np;
- this.sort(m.children("ul"));
- }, this));
- },
- defaults : function (a, b) { return this.get_text(a) > this.get_text(b) ? 1 : -1; },
- _fn : {
- sort : function (obj) {
- var s = this._get_settings().sort,
- t = this;
- obj.append($.makeArray(obj.children("li")).sort($.proxy(s, t)));
- obj.find("> li > ul").each(function() { t.sort($(this)); });
- this.clean_node(obj);
- }
- }
- });
-})(jQuery);
-//*/
-
-/*
- * jsTree DND plugin
- * Drag and drop plugin for moving/copying nodes
- */
-(function ($) {
- var o = false,
- r = false,
- m = false,
- ml = false,
- sli = false,
- sti = false,
- dir1 = false,
- dir2 = false,
- last_pos = false;
- $.vakata.dnd = {
- is_down : false,
- is_drag : false,
- helper : false,
- scroll_spd : 10,
- init_x : 0,
- init_y : 0,
- threshold : 5,
- helper_left : 5,
- helper_top : 10,
- user_data : {},
-
- drag_start : function (e, data, html) {
- if($.vakata.dnd.is_drag) { $.vakata.drag_stop({}); }
- try {
- e.currentTarget.unselectable = "on";
- e.currentTarget.onselectstart = function() { return false; };
- if(e.currentTarget.style) { e.currentTarget.style.MozUserSelect = "none"; }
- } catch(err) { }
- $.vakata.dnd.init_x = e.pageX;
- $.vakata.dnd.init_y = e.pageY;
- $.vakata.dnd.user_data = data;
- $.vakata.dnd.is_down = true;
- $.vakata.dnd.helper = $("<div id='vakata-dragged' />").html(html); //.fadeTo(10,0.25);
- $(document).bind("mousemove", $.vakata.dnd.drag);
- $(document).bind("mouseup", $.vakata.dnd.drag_stop);
- return false;
- },
- drag : function (e) {
- if(!$.vakata.dnd.is_down) { return; }
- if(!$.vakata.dnd.is_drag) {
- if(Math.abs(e.pageX - $.vakata.dnd.init_x) > 5 || Math.abs(e.pageY - $.vakata.dnd.init_y) > 5) {
- $.vakata.dnd.helper.appendTo("body");
- $.vakata.dnd.is_drag = true;
- $(document).triggerHandler("drag_start.vakata", { "event" : e, "data" : $.vakata.dnd.user_data });
- }
- else { return; }
- }
-
- // maybe use a scrolling parent element instead of document?
- if(e.type === "mousemove") { // thought of adding scroll in order to move the helper, but mouse poisition is n/a
- var d = $(document), t = d.scrollTop(), l = d.scrollLeft();
- if(e.pageY - t < 20) {
- if(sti && dir1 === "down") { clearInterval(sti); sti = false; }
- if(!sti) { dir1 = "up"; sti = setInterval(function () { $(document).scrollTop($(document).scrollTop() - $.vakata.dnd.scroll_spd); }, 150); }
- }
- else {
- if(sti && dir1 === "up") { clearInterval(sti); sti = false; }
- }
- if($(window).height() - (e.pageY - t) < 20) {
- if(sti && dir1 === "up") { clearInterval(sti); sti = false; }
- if(!sti) { dir1 = "down"; sti = setInterval(function () { $(document).scrollTop($(document).scrollTop() + $.vakata.dnd.scroll_spd); }, 150); }
- }
- else {
- if(sti && dir1 === "down") { clearInterval(sti); sti = false; }
- }
-
- if(e.pageX - l < 20) {
- if(sli && dir2 === "right") { clearInterval(sli); sli = false; }
- if(!sli) { dir2 = "left"; sli = setInterval(function () { $(document).scrollLeft($(document).scrollLeft() - $.vakata.dnd.scroll_spd); }, 150); }
- }
- else {
- if(sli && dir2 === "left") { clearInterval(sli); sli = false; }
- }
- if($(window).width() - (e.pageX - l) < 20) {
- if(sli && dir2 === "left") { clearInterval(sli); sli = false; }
- if(!sli) { dir2 = "right"; sli = setInterval(function () { $(document).scrollLeft($(document).scrollLeft() + $.vakata.dnd.scroll_spd); }, 150); }
- }
- else {
- if(sli && dir2 === "right") { clearInterval(sli); sli = false; }
- }
- }
-
- $.vakata.dnd.helper.css({ left : (e.pageX + $.vakata.dnd.helper_left) + "px", top : (e.pageY + $.vakata.dnd.helper_top) + "px" });
- $(document).triggerHandler("drag.vakata", { "event" : e, "data" : $.vakata.dnd.user_data });
- },
- drag_stop : function (e) {
- if(sli) { clearInterval(sli); }
- if(sti) { clearInterval(sti); }
- $(document).unbind("mousemove", $.vakata.dnd.drag);
- $(document).unbind("mouseup", $.vakata.dnd.drag_stop);
- $(document).triggerHandler("drag_stop.vakata", { "event" : e, "data" : $.vakata.dnd.user_data });
- $.vakata.dnd.helper.remove();
- $.vakata.dnd.init_x = 0;
- $.vakata.dnd.init_y = 0;
- $.vakata.dnd.user_data = {};
- $.vakata.dnd.is_down = false;
- $.vakata.dnd.is_drag = false;
- }
- };
- $(function() {
- var css_string = '#vakata-dragged { display:block; margin:0 0 0 0; padding:4px 4px 4px 24px; position:absolute; top:-2000px; line-height:16px; z-index:10000; } ';
- $.vakata.css.add_sheet({ str : css_string, title : "vakata" });
- });
-
- $.jstree.plugin("dnd", {
- __init : function () {
- this.data.dnd = {
- active : false,
- after : false,
- inside : false,
- before : false,
- off : false,
- prepared : false,
- w : 0,
- to1 : false,
- to2 : false,
- cof : false,
- cw : false,
- ch : false,
- i1 : false,
- i2 : false,
- mto : false
- };
- this.get_container()
- .bind("mouseenter.jstree", $.proxy(function (e) {
- if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
- if(this.data.themes) {
- m.attr("class", "jstree-" + this.data.themes.theme);
- if(ml) { ml.attr("class", "jstree-" + this.data.themes.theme); }
- $.vakata.dnd.helper.attr("class", "jstree-dnd-helper jstree-" + this.data.themes.theme);
- }
- //if($(e.currentTarget).find("> ul > li").length === 0) {
- if(e.currentTarget === e.target && $.vakata.dnd.user_data.obj && $($.vakata.dnd.user_data.obj).length && $($.vakata.dnd.user_data.obj).parents(".jstree:eq(0)")[0] !== e.target) { // node should not be from the same tree
- var tr = $.jstree._reference(e.target), dc;
- if(tr.data.dnd.foreign) {
- dc = tr._get_settings().dnd.drag_check.call(this, { "o" : o, "r" : tr.get_container(), is_root : true });
- if(dc === true || dc.inside === true || dc.before === true || dc.after === true) {
- $.vakata.dnd.helper.children("ins").attr("class","jstree-ok");
- }
- }
- else {
- tr.prepare_move(o, tr.get_container(), "last");
- if(tr.check_move()) {
- $.vakata.dnd.helper.children("ins").attr("class","jstree-ok");
- }
- }
- }
- }
- }, this))
- .bind("mouseup.jstree", $.proxy(function (e) {
- //if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree && $(e.currentTarget).find("> ul > li").length === 0) {
- if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree && e.currentTarget === e.target && $.vakata.dnd.user_data.obj && $($.vakata.dnd.user_data.obj).length && $($.vakata.dnd.user_data.obj).parents(".jstree:eq(0)")[0] !== e.target) { // node should not be from the same tree
- var tr = $.jstree._reference(e.currentTarget), dc;
- if(tr.data.dnd.foreign) {
- dc = tr._get_settings().dnd.drag_check.call(this, { "o" : o, "r" : tr.get_container(), is_root : true });
- if(dc === true || dc.inside === true || dc.before === true || dc.after === true) {
- tr._get_settings().dnd.drag_finish.call(this, { "o" : o, "r" : tr.get_container(), is_root : true });
- }
- }
- else {
- tr.move_node(o, tr.get_container(), "last", e[tr._get_settings().dnd.copy_modifier + "Key"]);
- }
- }
- }, this))
- .bind("mouseleave.jstree", $.proxy(function (e) {
- if(e.relatedTarget && e.relatedTarget.id && e.relatedTarget.id === "jstree-marker-line") {
- return false;
- }
- if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
- if(this.data.dnd.i1) { clearInterval(this.data.dnd.i1); }
- if(this.data.dnd.i2) { clearInterval(this.data.dnd.i2); }
- if(this.data.dnd.to1) { clearTimeout(this.data.dnd.to1); }
- if(this.data.dnd.to2) { clearTimeout(this.data.dnd.to2); }
- if($.vakata.dnd.helper.children("ins").hasClass("jstree-ok")) {
- $.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");
- }
- }
- }, this))
- .bind("mousemove.jstree", $.proxy(function (e) {
- if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
- var cnt = this.get_container()[0];
-
- // Horizontal scroll
- if(e.pageX + 24 > this.data.dnd.cof.left + this.data.dnd.cw) {
- if(this.data.dnd.i1) { clearInterval(this.data.dnd.i1); }
- this.data.dnd.i1 = setInterval($.proxy(function () { this.scrollLeft += $.vakata.dnd.scroll_spd; }, cnt), 100);
- }
- else if(e.pageX - 24 < this.data.dnd.cof.left) {
- if(this.data.dnd.i1) { clearInterval(this.data.dnd.i1); }
- this.data.dnd.i1 = setInterval($.proxy(function () { this.scrollLeft -= $.vakata.dnd.scroll_spd; }, cnt), 100);
- }
- else {
- if(this.data.dnd.i1) { clearInterval(this.data.dnd.i1); }
- }
-
- // Vertical scroll
- if(e.pageY + 24 > this.data.dnd.cof.top + this.data.dnd.ch) {
- if(this.data.dnd.i2) { clearInterval(this.data.dnd.i2); }
- this.data.dnd.i2 = setInterval($.proxy(function () { this.scrollTop += $.vakata.dnd.scroll_spd; }, cnt), 100);
- }
- else if(e.pageY - 24 < this.data.dnd.cof.top) {
- if(this.data.dnd.i2) { clearInterval(this.data.dnd.i2); }
- this.data.dnd.i2 = setInterval($.proxy(function () { this.scrollTop -= $.vakata.dnd.scroll_spd; }, cnt), 100);
- }
- else {
- if(this.data.dnd.i2) { clearInterval(this.data.dnd.i2); }
- }
-
- }
- }, this))
- .bind("scroll.jstree", $.proxy(function (e) {
- if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree && m && ml) {
- m.hide();
- ml.hide();
- }
- }, this))
- .delegate("a", "mousedown.jstree", $.proxy(function (e) {
- if(e.which === 1) {
- this.start_drag(e.currentTarget, e);
- return false;
- }
- }, this))
- .delegate("a", "mouseenter.jstree", $.proxy(function (e) {
- if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
- this.dnd_enter(e.currentTarget);
- }
- }, this))
- .delegate("a", "mousemove.jstree", $.proxy(function (e) {
- if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
- if(!r || !r.length || r.children("a")[0] !== e.currentTarget) {
- this.dnd_enter(e.currentTarget);
- }
- if(typeof this.data.dnd.off.top === "undefined") { this.data.dnd.off = $(e.target).offset(); }
- this.data.dnd.w = (e.pageY - (this.data.dnd.off.top || 0)) % this.data.core.li_height;
- if(this.data.dnd.w < 0) { this.data.dnd.w += this.data.core.li_height; }
- this.dnd_show();
- }
- }, this))
- .delegate("a", "mouseleave.jstree", $.proxy(function (e) {
- if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
- if(e.relatedTarget && e.relatedTarget.id && e.relatedTarget.id === "jstree-marker-line") {
- return false;
- }
- if(m) { m.hide(); }
- if(ml) { ml.hide(); }
- /*
- var ec = $(e.currentTarget).closest("li"),
- er = $(e.relatedTarget).closest("li");
- if(er[0] !== ec.prev()[0] && er[0] !== ec.next()[0]) {
- if(m) { m.hide(); }
- if(ml) { ml.hide(); }
- }
- */
- this.data.dnd.mto = setTimeout(
- (function (t) { return function () { t.dnd_leave(e); }; })(this),
- 0);
- }
- }, this))
- .delegate("a", "mouseup.jstree", $.proxy(function (e) {
- if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
- this.dnd_finish(e);
- }
- }, this));
-
- $(document)
- .bind("drag_stop.vakata", $.proxy(function () {
- if(this.data.dnd.to1) { clearTimeout(this.data.dnd.to1); }
- if(this.data.dnd.to2) { clearTimeout(this.data.dnd.to2); }
- if(this.data.dnd.i1) { clearInterval(this.data.dnd.i1); }
- if(this.data.dnd.i2) { clearInterval(this.data.dnd.i2); }
- this.data.dnd.after = false;
- this.data.dnd.before = false;
- this.data.dnd.inside = false;
- this.data.dnd.off = false;
- this.data.dnd.prepared = false;
- this.data.dnd.w = false;
- this.data.dnd.to1 = false;
- this.data.dnd.to2 = false;
- this.data.dnd.i1 = false;
- this.data.dnd.i2 = false;
- this.data.dnd.active = false;
- this.data.dnd.foreign = false;
- if(m) { m.css({ "top" : "-2000px" }); }
- if(ml) { ml.css({ "top" : "-2000px" }); }
- }, this))
- .bind("drag_start.vakata", $.proxy(function (e, data) {
- if(data.data.jstree) {
- var et = $(data.event.target);
- if(et.closest(".jstree").hasClass("jstree-" + this.get_index())) {
- this.dnd_enter(et);
- }
- }
- }, this));
- /*
- .bind("keydown.jstree-" + this.get_index() + " keyup.jstree-" + this.get_index(), $.proxy(function(e) {
- if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree && !this.data.dnd.foreign) {
- var h = $.vakata.dnd.helper.children("ins");
- if(e[this._get_settings().dnd.copy_modifier + "Key"] && h.hasClass("jstree-ok")) {
- h.parent().html(h.parent().html().replace(/ \(Copy\)$/, "") + " (Copy)");
- }
- else {
- h.parent().html(h.parent().html().replace(/ \(Copy\)$/, ""));
- }
- }
- }, this)); */
-
-
-
- var s = this._get_settings().dnd;
- if(s.drag_target) {
- $(document)
- .delegate(s.drag_target, "mousedown.jstree-" + this.get_index(), $.proxy(function (e) {
- o = e.target;
- $.vakata.dnd.drag_start(e, { jstree : true, obj : e.target }, "<ins class='jstree-icon'></ins>" + $(e.target).text() );
- if(this.data.themes) {
- if(m) { m.attr("class", "jstree-" + this.data.themes.theme); }
- if(ml) { ml.attr("class", "jstree-" + this.data.themes.theme); }
- $.vakata.dnd.helper.attr("class", "jstree-dnd-helper jstree-" + this.data.themes.theme);
- }
- $.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");
- var cnt = this.get_container();
- this.data.dnd.cof = cnt.offset();
- this.data.dnd.cw = parseInt(cnt.width(),10);
- this.data.dnd.ch = parseInt(cnt.height(),10);
- this.data.dnd.foreign = true;
- e.preventDefault();
- }, this));
- }
- if(s.drop_target) {
- $(document)
- .delegate(s.drop_target, "mouseenter.jstree-" + this.get_index(), $.proxy(function (e) {
- if(this.data.dnd.active && this._get_settings().dnd.drop_check.call(this, { "o" : o, "r" : $(e.target), "e" : e })) {
- $.vakata.dnd.helper.children("ins").attr("class","jstree-ok");
- }
- }, this))
- .delegate(s.drop_target, "mouseleave.jstree-" + this.get_index(), $.proxy(function (e) {
- if(this.data.dnd.active) {
- $.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");
- }
- }, this))
- .delegate(s.drop_target, "mouseup.jstree-" + this.get_index(), $.proxy(function (e) {
- if(this.data.dnd.active && $.vakata.dnd.helper.children("ins").hasClass("jstree-ok")) {
- this._get_settings().dnd.drop_finish.call(this, { "o" : o, "r" : $(e.target), "e" : e });
- }
- }, this));
- }
- },
- defaults : {
- copy_modifier : "ctrl",
- check_timeout : 100,
- open_timeout : 500,
- drop_target : ".jstree-drop",
- drop_check : function (data) { return true; },
- drop_finish : $.noop,
- drag_target : ".jstree-draggable",
- drag_finish : $.noop,
- drag_check : function (data) { return { after : false, before : false, inside : true }; }
- },
- _fn : {
- dnd_prepare : function () {
- if(!r || !r.length) { return; }
- this.data.dnd.off = r.offset();
- if(this._get_settings().core.rtl) {
- this.data.dnd.off.right = this.data.dnd.off.left + r.width();
- }
- if(this.data.dnd.foreign) {
- var a = this._get_settings().dnd.drag_check.call(this, { "o" : o, "r" : r });
- this.data.dnd.after = a.after;
- this.data.dnd.before = a.before;
- this.data.dnd.inside = a.inside;
- this.data.dnd.prepared = true;
- return this.dnd_show();
- }
- this.prepare_move(o, r, "before");
- this.data.dnd.before = this.check_move();
- this.prepare_move(o, r, "after");
- this.data.dnd.after = this.check_move();
- if(this._is_loaded(r)) {
- this.prepare_move(o, r, "inside");
- this.data.dnd.inside = this.check_move();
- }
- else {
- this.data.dnd.inside = false;
- }
- this.data.dnd.prepared = true;
- return this.dnd_show();
- },
- dnd_show : function () {
- if(!this.data.dnd.prepared) { return; }
- var o = ["before","inside","after"],
- r = false,
- rtl = this._get_settings().core.rtl,
- pos;
- if(this.data.dnd.w < this.data.core.li_height/3) { o = ["before","inside","after"]; }
- else if(this.data.dnd.w <= this.data.core.li_height*2/3) {
- o = this.data.dnd.w < this.data.core.li_height/2 ? ["inside","before","after"] : ["inside","after","before"];
- }
- else { o = ["after","inside","before"]; }
- $.each(o, $.proxy(function (i, val) {
- if(this.data.dnd[val]) {
- $.vakata.dnd.helper.children("ins").attr("class","jstree-ok");
- r = val;
- return false;
- }
- }, this));
- if(r === false) { $.vakata.dnd.helper.children("ins").attr("class","jstree-invalid"); }
-
- pos = rtl ? (this.data.dnd.off.right - 18) : (this.data.dnd.off.left + 10);
- switch(r) {
- case "before":
- m.css({ "left" : pos + "px", "top" : (this.data.dnd.off.top - 6) + "px" }).show();
- if(ml) { ml.css({ "left" : (pos + 8) + "px", "top" : (this.data.dnd.off.top - 1) + "px" }).show(); }
- break;
- case "after":
- m.css({ "left" : pos + "px", "top" : (this.data.dnd.off.top + this.data.core.li_height - 6) + "px" }).show();
- if(ml) { ml.css({ "left" : (pos + 8) + "px", "top" : (this.data.dnd.off.top + this.data.core.li_height - 1) + "px" }).show(); }
- break;
- case "inside":
- m.css({ "left" : pos + ( rtl ? -4 : 4) + "px", "top" : (this.data.dnd.off.top + this.data.core.li_height/2 - 5) + "px" }).show();
- if(ml) { ml.hide(); }
- break;
- default:
- m.hide();
- if(ml) { ml.hide(); }
- break;
- }
- last_pos = r;
- return r;
- },
- dnd_open : function () {
- this.data.dnd.to2 = false;
- this.open_node(r, $.proxy(this.dnd_prepare,this), true);
- },
- dnd_finish : function (e) {
- if(this.data.dnd.foreign) {
- if(this.data.dnd.after || this.data.dnd.before || this.data.dnd.inside) {
- this._get_settings().dnd.drag_finish.call(this, { "o" : o, "r" : r, "p" : last_pos });
- }
- }
- else {
- this.dnd_prepare();
- this.move_node(o, r, last_pos, e[this._get_settings().dnd.copy_modifier + "Key"]);
- }
- o = false;
- r = false;
- m.hide();
- if(ml) { ml.hide(); }
- },
- dnd_enter : function (obj) {
- if(this.data.dnd.mto) {
- clearTimeout(this.data.dnd.mto);
- this.data.dnd.mto = false;
- }
- var s = this._get_settings().dnd;
- this.data.dnd.prepared = false;
- r = this._get_node(obj);
- if(s.check_timeout) {
- // do the calculations after a minimal timeout (users tend to drag quickly to the desired location)
- if(this.data.dnd.to1) { clearTimeout(this.data.dnd.to1); }
- this.data.dnd.to1 = setTimeout($.proxy(this.dnd_prepare, this), s.check_timeout);
- }
- else {
- this.dnd_prepare();
- }
- if(s.open_timeout) {
- if(this.data.dnd.to2) { clearTimeout(this.data.dnd.to2); }
- if(r && r.length && r.hasClass("jstree-closed")) {
- // if the node is closed - open it, then recalculate
- this.data.dnd.to2 = setTimeout($.proxy(this.dnd_open, this), s.open_timeout);
- }
- }
- else {
- if(r && r.length && r.hasClass("jstree-closed")) {
- this.dnd_open();
- }
- }
- },
- dnd_leave : function (e) {
- this.data.dnd.after = false;
- this.data.dnd.before = false;
- this.data.dnd.inside = false;
- $.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");
- m.hide();
- if(ml) { ml.hide(); }
- if(r && r[0] === e.target.parentNode) {
- if(this.data.dnd.to1) {
- clearTimeout(this.data.dnd.to1);
- this.data.dnd.to1 = false;
- }
- if(this.data.dnd.to2) {
- clearTimeout(this.data.dnd.to2);
- this.data.dnd.to2 = false;
- }
- }
- },
- start_drag : function (obj, e) {
- o = this._get_node(obj);
- if(this.data.ui && this.is_selected(o)) { o = this._get_node(null, true); }
- var dt = o.length > 1 ? this._get_string("multiple_selection") : this.get_text(o),
- cnt = this.get_container();
- if(!this._get_settings().core.html_titles) { dt = dt.replace(/</ig,"&lt;").replace(/>/ig,"&gt;"); }
- $.vakata.dnd.drag_start(e, { jstree : true, obj : o }, "<ins class='jstree-icon'></ins>" + dt );
- if(this.data.themes) {
- if(m) { m.attr("class", "jstree-" + this.data.themes.theme); }
- if(ml) { ml.attr("class", "jstree-" + this.data.themes.theme); }
- $.vakata.dnd.helper.attr("class", "jstree-dnd-helper jstree-" + this.data.themes.theme);
- }
- this.data.dnd.cof = cnt.offset();
- this.data.dnd.cw = parseInt(cnt.width(),10);
- this.data.dnd.ch = parseInt(cnt.height(),10);
- this.data.dnd.active = true;
- }
- }
- });
- $(function() {
- var css_string = '' +
- '#vakata-dragged ins { display:block; text-decoration:none; width:16px; height:16px; margin:0 0 0 0; padding:0; position:absolute; top:4px; left:4px; ' +
- ' -moz-border-radius:4px; border-radius:4px; -webkit-border-radius:4px; ' +
- '} ' +
- '#vakata-dragged .jstree-ok { background:green; } ' +
- '#vakata-dragged .jstree-invalid { background:red; } ' +
- '#jstree-marker { padding:0; margin:0; font-size:12px; overflow:hidden; height:12px; width:8px; position:absolute; top:-30px; z-index:10001; background-repeat:no-repeat; display:none; background-color:transparent; text-shadow:1px 1px 1px white; color:black; line-height:10px; } ' +
- '#jstree-marker-line { padding:0; margin:0; line-height:0%; font-size:1px; overflow:hidden; height:1px; width:100px; position:absolute; top:-30px; z-index:10000; background-repeat:no-repeat; display:none; background-color:#456c43; ' +
- ' cursor:pointer; border:1px solid #eeeeee; border-left:0; -moz-box-shadow: 0px 0px 2px #666; -webkit-box-shadow: 0px 0px 2px #666; box-shadow: 0px 0px 2px #666; ' +
- ' -moz-border-radius:1px; border-radius:1px; -webkit-border-radius:1px; ' +
- '}' +
- '';
- $.vakata.css.add_sheet({ str : css_string, title : "jstree" });
- m = $("<div />").attr({ id : "jstree-marker" }).hide().html("&raquo;")
- .bind("mouseleave mouseenter", function (e) {
- m.hide();
- ml.hide();
- e.preventDefault();
- e.stopImmediatePropagation();
- return false;
- })
- .appendTo("body");
- ml = $("<div />").attr({ id : "jstree-marker-line" }).hide()
- .bind("mouseup", function (e) {
- if(r && r.length) {
- r.children("a").trigger(e);
- e.preventDefault();
- e.stopImmediatePropagation();
- return false;
- }
- })
- .bind("mouseleave", function (e) {
- var rt = $(e.relatedTarget);
- if(rt.is(".jstree") || rt.closest(".jstree").length === 0) {
- if(r && r.length) {
- r.children("a").trigger(e);
- m.hide();
- ml.hide();
- e.preventDefault();
- e.stopImmediatePropagation();
- return false;
- }
- }
- })
- .appendTo("body");
- $(document).bind("drag_start.vakata", function (e, data) {
- if(data.data.jstree) { m.show(); if(ml) { ml.show(); } }
- });
- $(document).bind("drag_stop.vakata", function (e, data) {
- if(data.data.jstree) { m.hide(); if(ml) { ml.hide(); } }
- });
- });
-})(jQuery);
-//*/
-
-/*
- * jsTree checkbox plugin
- * Inserts checkboxes in front of every node
- * Depends on the ui plugin
- * DOES NOT WORK NICELY WITH MULTITREE DRAG'N'DROP
- */
-(function ($) {
- $.jstree.plugin("checkbox", {
- __init : function () {
- this.data.checkbox.noui = this._get_settings().checkbox.override_ui;
- if(this.data.ui && this.data.checkbox.noui) {
- this.select_node = this.deselect_node = this.deselect_all = $.noop;
- this.get_selected = this.get_checked;
- }
-
- this.get_container()
- .bind("open_node.jstree create_node.jstree clean_node.jstree refresh.jstree", $.proxy(function (e, data) {
- this._prepare_checkboxes(data.rslt.obj);
- }, this))
- .bind("loaded.jstree", $.proxy(function (e) {
- this._prepare_checkboxes();
- }, this))
- .delegate( (this.data.ui && this.data.checkbox.noui ? "a" : "ins.jstree-checkbox") , "click.jstree", $.proxy(function (e) {
- e.preventDefault();
- if(this._get_node(e.target).hasClass("jstree-checked")) { this.uncheck_node(e.target); }
- else { this.check_node(e.target); }
- if(this.data.ui && this.data.checkbox.noui) {
- this.save_selected();
- if(this.data.cookies) { this.save_cookie("select_node"); }
- }
- else {
- e.stopImmediatePropagation();
- return false;
- }
- }, this));
- },
- defaults : {
- override_ui : false,
- two_state : false,
- real_checkboxes : false,
- checked_parent_open : true,
- real_checkboxes_names : function (n) { return [ ("check_" + (n[0].id || Math.ceil(Math.random() * 10000))) , 1]; }
- },
- __destroy : function () {
- this.get_container()
- .find("input.jstree-real-checkbox").removeClass("jstree-real-checkbox").end()
- .find("ins.jstree-checkbox").remove();
- },
- _fn : {
- _checkbox_notify : function (n, data) {
- if(data.checked) {
- this.check_node(n, false);
- }
- },
- _prepare_checkboxes : function (obj) {
- obj = !obj || obj == -1 ? this.get_container().find("> ul > li") : this._get_node(obj);
- if(obj === false) { return; } // added for removing root nodes
- var c, _this = this, t, ts = this._get_settings().checkbox.two_state, rc = this._get_settings().checkbox.real_checkboxes, rcn = this._get_settings().checkbox.real_checkboxes_names;
- obj.each(function () {
- t = $(this);
- c = t.is("li") && (t.hasClass("jstree-checked") || (rc && t.children(":checked").length)) ? "jstree-checked" : "jstree-unchecked";
- t.find("li").addBack().each(function () {
- var $t = $(this), nm;
- $t.children("a" + (_this.data.languages ? "" : ":eq(0)") ).not(":has(.jstree-checkbox)").prepend("<ins class='jstree-checkbox'>&#160;</ins>").parent().not(".jstree-checked, .jstree-unchecked").addClass( ts ? "jstree-unchecked" : c );
- if(rc) {
- if(!$t.children(":checkbox").length) {
- nm = rcn.call(_this, $t);
- $t.prepend("<input type='checkbox' class='jstree-real-checkbox' id='" + nm[0] + "' name='" + nm[0] + "' value='" + nm[1] + "' />");
- }
- else {
- $t.children(":checkbox").addClass("jstree-real-checkbox");
- }
- }
- if(!ts) {
- if(c === "jstree-checked" || $t.hasClass("jstree-checked") || $t.children(':checked').length) {
- $t.find("li").addBack().addClass("jstree-checked").children(":checkbox").prop("checked", true);
- }
- }
- else {
- if($t.hasClass("jstree-checked") || $t.children(':checked').length) {
- $t.addClass("jstree-checked").children(":checkbox").prop("checked", true);
- }
- }
- });
- });
- if(!ts) {
- obj.find(".jstree-checked").parent().parent().each(function () { _this._repair_state(this); });
- }
- },
- change_state : function (obj, state) {
- obj = this._get_node(obj);
- var coll = false, rc = this._get_settings().checkbox.real_checkboxes;
- if(!obj || obj === -1) { return false; }
- state = (state === false || state === true) ? state : obj.hasClass("jstree-checked");
- if(this._get_settings().checkbox.two_state) {
- if(state) {
- obj.removeClass("jstree-checked").addClass("jstree-unchecked");
- if(rc) { obj.children(":checkbox").prop("checked", false); }
- }
- else {
- obj.removeClass("jstree-unchecked").addClass("jstree-checked");
- if(rc) { obj.children(":checkbox").prop("checked", true); }
- }
- }
- else {
- if(state) {
- coll = obj.find("li").addBack();
- if(!coll.filter(".jstree-checked, .jstree-undetermined").length) { return false; }
- coll.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");
- if(rc) { coll.children(":checkbox").prop("checked", false); }
- }
- else {
- coll = obj.find("li").addBack();
- if(!coll.filter(".jstree-unchecked, .jstree-undetermined").length) { return false; }
- coll.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");
- if(rc) { coll.children(":checkbox").prop("checked", true); }
- if(this.data.ui) { this.data.ui.last_selected = obj; }
- this.data.checkbox.last_selected = obj;
- }
- obj.parentsUntil(".jstree", "li").each(function () {
- var $this = $(this);
- if(state) {
- if($this.children("ul").children("li.jstree-checked, li.jstree-undetermined").length) {
- $this.parentsUntil(".jstree", "li").addBack().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
- if(rc) { $this.parentsUntil(".jstree", "li").addBack().children(":checkbox").prop("checked", false); }
- return false;
- }
- else {
- $this.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");
- if(rc) { $this.children(":checkbox").prop("checked", false); }
- }
- }
- else {
- if($this.children("ul").children("li.jstree-unchecked, li.jstree-undetermined").length) {
- $this.parentsUntil(".jstree", "li").addBack().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
- if(rc) { $this.parentsUntil(".jstree", "li").addBack().children(":checkbox").prop("checked", false); }
- return false;
- }
- else {
- $this.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");
- if(rc) { $this.children(":checkbox").prop("checked", true); }
- }
- }
- });
- }
- if(this.data.ui && this.data.checkbox.noui) { this.data.ui.selected = this.get_checked(); }
- this.__callback(obj);
- return true;
- },
- check_node : function (obj) {
- if(this.change_state(obj, false)) {
- obj = this._get_node(obj);
- if(this._get_settings().checkbox.checked_parent_open) {
- var t = this;
- obj.parents(".jstree-closed").each(function () { t.open_node(this, false, true); });
- }
- this.__callback({ "obj" : obj });
- }
- },
- uncheck_node : function (obj) {
- if(this.change_state(obj, true)) { this.__callback({ "obj" : this._get_node(obj) }); }
- },
- check_all : function () {
- var _this = this,
- coll = this._get_settings().checkbox.two_state ? this.get_container_ul().find("li") : this.get_container_ul().children("li");
- coll.each(function () {
- _this.change_state(this, false);
- });
- this.__callback();
- },
- uncheck_all : function () {
- var _this = this,
- coll = this._get_settings().checkbox.two_state ? this.get_container_ul().find("li") : this.get_container_ul().children("li");
- coll.each(function () {
- _this.change_state(this, true);
- });
- this.__callback();
- },
-
- is_checked : function(obj) {
- obj = this._get_node(obj);
- return obj.length ? obj.is(".jstree-checked") : false;
- },
- get_checked : function (obj, get_all) {
- obj = !obj || obj === -1 ? this.get_container() : this._get_node(obj);
- return get_all || this._get_settings().checkbox.two_state ? obj.find(".jstree-checked") : obj.find("> ul > .jstree-checked, .jstree-undetermined > ul > .jstree-checked");
- },
- get_unchecked : function (obj, get_all) {
- obj = !obj || obj === -1 ? this.get_container() : this._get_node(obj);
- return get_all || this._get_settings().checkbox.two_state ? obj.find(".jstree-unchecked") : obj.find("> ul > .jstree-unchecked, .jstree-undetermined > ul > .jstree-unchecked");
- },
-
- show_checkboxes : function () { this.get_container().children("ul").removeClass("jstree-no-checkboxes"); },
- hide_checkboxes : function () { this.get_container().children("ul").addClass("jstree-no-checkboxes"); },
-
- _repair_state : function (obj) {
- obj = this._get_node(obj);
- if(!obj.length) { return; }
- if(this._get_settings().checkbox.two_state) {
- obj.find('li').addBack().not('.jstree-checked').removeClass('jstree-undetermined').addClass('jstree-unchecked').children(':checkbox').prop('checked', true);
- return;
- }
- var rc = this._get_settings().checkbox.real_checkboxes,
- a = obj.find("> ul > .jstree-checked").length,
- b = obj.find("> ul > .jstree-undetermined").length,
- c = obj.find("> ul > li").length;
- if(c === 0) { if(obj.hasClass("jstree-undetermined")) { this.change_state(obj, false); } }
- else if(a === 0 && b === 0) { this.change_state(obj, true); }
- else if(a === c) { this.change_state(obj, false); }
- else {
- obj.parentsUntil(".jstree","li").addBack().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
- if(rc) { obj.parentsUntil(".jstree", "li").addBack().children(":checkbox").prop("checked", false); }
- }
- },
- reselect : function () {
- if(this.data.ui && this.data.checkbox.noui) {
- var _this = this,
- s = this.data.ui.to_select;
- s = $.map($.makeArray(s), function (n) { return "#" + n.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"); });
- this.deselect_all();
- $.each(s, function (i, val) { _this.check_node(val); });
- this.__callback();
- }
- else {
- this.__call_old();
- }
- },
- save_loaded : function () {
- var _this = this;
- this.data.core.to_load = [];
- this.get_container_ul().find("li.jstree-closed.jstree-undetermined").each(function () {
- if(this.id) { _this.data.core.to_load.push("#" + this.id); }
- });
- }
- }
- });
- $(function() {
- var css_string = '.jstree .jstree-real-checkbox { display:none; } ';
- $.vakata.css.add_sheet({ str : css_string, title : "jstree" });
- });
-})(jQuery);
-//*/
-
-/*
- * jsTree XML plugin
- * The XML data store. Datastores are build by overriding the `load_node` and `_is_loaded` functions.
- */
-(function ($) {
- $.vakata.xslt = function (xml, xsl, callback) {
- var r = false, p, q, s;
- // IE9
- if(r === false && (window.ActiveXObject || "ActiveXObject" in window)) {
- try {
- r = new ActiveXObject("Msxml2.XSLTemplate");
- q = new ActiveXObject("Msxml2.DOMDocument");
- q.loadXML(xml);
- s = new ActiveXObject("Msxml2.FreeThreadedDOMDocument");
- s.loadXML(xsl);
- r.stylesheet = s;
- p = r.createProcessor();
- p.input = q;
- p.transform();
- r = p.output;
- }
- catch (e) { }
- }
- xml = $.parseXML(xml);
- xsl = $.parseXML(xsl);
- // FF, Chrome
- if(r === false && typeof (XSLTProcessor) !== "undefined") {
- p = new XSLTProcessor();
- p.importStylesheet(xsl);
- r = p.transformToFragment(xml, document);
- r = $('<div />').append(r).html();
- }
- // OLD IE
- if(r === false && typeof (xml.transformNode) !== "undefined") {
- r = xml.transformNode(xsl);
- }
- callback.call(null, r);
- };
- var xsl = {
- 'nest' : '<' + '?xml version="1.0" encoding="utf-8" ?>' +
- '<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >' +
- '<xsl:output method="html" encoding="utf-8" omit-xml-declaration="yes" standalone="no" indent="no" media-type="text/html" />' +
- '<xsl:template match="/">' +
- ' <xsl:call-template name="nodes">' +
- ' <xsl:with-param name="node" select="/root" />' +
- ' </xsl:call-template>' +
- '</xsl:template>' +
- '<xsl:template name="nodes">' +
- ' <xsl:param name="node" />' +
- ' <ul>' +
- ' <xsl:for-each select="$node/item">' +
- ' <xsl:variable name="children" select="count(./item) &gt; 0" />' +
- ' <li>' +
- ' <xsl:attribute name="class">' +
- ' <xsl:if test="position() = last()">jstree-last </xsl:if>' +
- ' <xsl:choose>' +
- ' <xsl:when test="@state = \'open\'">jstree-open </xsl:when>' +
- ' <xsl:when test="$children or @hasChildren or @state = \'closed\'">jstree-closed </xsl:when>' +
- ' <xsl:otherwise>jstree-leaf </xsl:otherwise>' +
- ' </xsl:choose>' +
- ' <xsl:value-of select="@class" />' +
- ' </xsl:attribute>' +
- ' <xsl:for-each select="@*">' +
- ' <xsl:if test="name() != \'class\' and name() != \'state\' and name() != \'hasChildren\'">' +
- ' <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>' +
- ' </xsl:if>' +
- ' </xsl:for-each>' +
- ' <ins class="jstree-icon"><xsl:text>&#xa0;</xsl:text></ins>' +
- ' <xsl:for-each select="content/name">' +
- ' <a>' +
- ' <xsl:attribute name="href">' +
- ' <xsl:choose>' +
- ' <xsl:when test="@href"><xsl:value-of select="@href" /></xsl:when>' +
- ' <xsl:otherwise>#</xsl:otherwise>' +
- ' </xsl:choose>' +
- ' </xsl:attribute>' +
- ' <xsl:attribute name="class"><xsl:value-of select="@lang" /> <xsl:value-of select="@class" /></xsl:attribute>' +
- ' <xsl:attribute name="style"><xsl:value-of select="@style" /></xsl:attribute>' +
- ' <xsl:for-each select="@*">' +
- ' <xsl:if test="name() != \'style\' and name() != \'class\' and name() != \'href\'">' +
- ' <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>' +
- ' </xsl:if>' +
- ' </xsl:for-each>' +
- ' <ins>' +
- ' <xsl:attribute name="class">jstree-icon ' +
- ' <xsl:if test="string-length(attribute::icon) > 0 and not(contains(@icon,\'/\'))"><xsl:value-of select="@icon" /></xsl:if>' +
- ' </xsl:attribute>' +
- ' <xsl:if test="string-length(attribute::icon) > 0 and contains(@icon,\'/\')"><xsl:attribute name="style">background:url(<xsl:value-of select="@icon" />) center center no-repeat;</xsl:attribute></xsl:if>' +
- ' <xsl:text>&#xa0;</xsl:text>' +
- ' </ins>' +
- ' <xsl:copy-of select="./child::node()" />' +
- ' </a>' +
- ' </xsl:for-each>' +
- ' <xsl:if test="$children or @hasChildren"><xsl:call-template name="nodes"><xsl:with-param name="node" select="current()" /></xsl:call-template></xsl:if>' +
- ' </li>' +
- ' </xsl:for-each>' +
- ' </ul>' +
- '</xsl:template>' +
- '</xsl:stylesheet>',
-
- 'flat' : '<' + '?xml version="1.0" encoding="utf-8" ?>' +
- '<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >' +
- '<xsl:output method="html" encoding="utf-8" omit-xml-declaration="yes" standalone="no" indent="no" media-type="text/xml" />' +
- '<xsl:template match="/">' +
- ' <ul>' +
- ' <xsl:for-each select="//item[not(@parent_id) or @parent_id=0 or not(@parent_id = //item/@id)]">' + /* the last `or` may be removed */
- ' <xsl:call-template name="nodes">' +
- ' <xsl:with-param name="node" select="." />' +
- ' <xsl:with-param name="is_last" select="number(position() = last())" />' +
- ' </xsl:call-template>' +
- ' </xsl:for-each>' +
- ' </ul>' +
- '</xsl:template>' +
- '<xsl:template name="nodes">' +
- ' <xsl:param name="node" />' +
- ' <xsl:param name="is_last" />' +
- ' <xsl:variable name="children" select="count(//item[@parent_id=$node/attribute::id]) &gt; 0" />' +
- ' <li>' +
- ' <xsl:attribute name="class">' +
- ' <xsl:if test="$is_last = true()">jstree-last </xsl:if>' +
- ' <xsl:choose>' +
- ' <xsl:when test="@state = \'open\'">jstree-open </xsl:when>' +
- ' <xsl:when test="$children or @hasChildren or @state = \'closed\'">jstree-closed </xsl:when>' +
- ' <xsl:otherwise>jstree-leaf </xsl:otherwise>' +
- ' </xsl:choose>' +
- ' <xsl:value-of select="@class" />' +
- ' </xsl:attribute>' +
- ' <xsl:for-each select="@*">' +
- ' <xsl:if test="name() != \'parent_id\' and name() != \'hasChildren\' and name() != \'class\' and name() != \'state\'">' +
- ' <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>' +
- ' </xsl:if>' +
- ' </xsl:for-each>' +
- ' <ins class="jstree-icon"><xsl:text>&#xa0;</xsl:text></ins>' +
- ' <xsl:for-each select="content/name">' +
- ' <a>' +
- ' <xsl:attribute name="href">' +
- ' <xsl:choose>' +
- ' <xsl:when test="@href"><xsl:value-of select="@href" /></xsl:when>' +
- ' <xsl:otherwise>#</xsl:otherwise>' +
- ' </xsl:choose>' +
- ' </xsl:attribute>' +
- ' <xsl:attribute name="class"><xsl:value-of select="@lang" /> <xsl:value-of select="@class" /></xsl:attribute>' +
- ' <xsl:attribute name="style"><xsl:value-of select="@style" /></xsl:attribute>' +
- ' <xsl:for-each select="@*">' +
- ' <xsl:if test="name() != \'style\' and name() != \'class\' and name() != \'href\'">' +
- ' <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>' +
- ' </xsl:if>' +
- ' </xsl:for-each>' +
- ' <ins>' +
- ' <xsl:attribute name="class">jstree-icon ' +
- ' <xsl:if test="string-length(attribute::icon) > 0 and not(contains(@icon,\'/\'))"><xsl:value-of select="@icon" /></xsl:if>' +
- ' </xsl:attribute>' +
- ' <xsl:if test="string-length(attribute::icon) > 0 and contains(@icon,\'/\')"><xsl:attribute name="style">background:url(<xsl:value-of select="@icon" />) center center no-repeat;</xsl:attribute></xsl:if>' +
- ' <xsl:text>&#xa0;</xsl:text>' +
- ' </ins>' +
- ' <xsl:copy-of select="./child::node()" />' +
- ' </a>' +
- ' </xsl:for-each>' +
- ' <xsl:if test="$children">' +
- ' <ul>' +
- ' <xsl:for-each select="//item[@parent_id=$node/attribute::id]">' +
- ' <xsl:call-template name="nodes">' +
- ' <xsl:with-param name="node" select="." />' +
- ' <xsl:with-param name="is_last" select="number(position() = last())" />' +
- ' </xsl:call-template>' +
- ' </xsl:for-each>' +
- ' </ul>' +
- ' </xsl:if>' +
- ' </li>' +
- '</xsl:template>' +
- '</xsl:stylesheet>'
- },
- escape_xml = function(string) {
- return string
- .toString()
- .replace(/&/g, '&amp;')
- .replace(/</g, '&lt;')
- .replace(/>/g, '&gt;')
- .replace(/"/g, '&quot;')
- .replace(/'/g, '&apos;');
- };
- $.jstree.plugin("xml_data", {
- defaults : {
- data : false,
- ajax : false,
- xsl : "flat",
- clean_node : false,
- correct_state : true,
- get_skip_empty : false,
- get_include_preamble : true
- },
- _fn : {
- load_node : function (obj, s_call, e_call) { var _this = this; this.load_node_xml(obj, function () { _this.__callback({ "obj" : _this._get_node(obj) }); s_call.call(this); }, e_call); },
- _is_loaded : function (obj) {
- var s = this._get_settings().xml_data;
- obj = this._get_node(obj);
- return obj == -1 || !obj || (!s.ajax && !$.isFunction(s.data)) || obj.is(".jstree-open, .jstree-leaf") || obj.children("ul").children("li").size() > 0;
- },
- load_node_xml : function (obj, s_call, e_call) {
- var s = this.get_settings().xml_data,
- error_func = function () {},
- success_func = function () {};
-
- obj = this._get_node(obj);
- if(obj && obj !== -1) {
- if(obj.data("jstree_is_loading")) { return; }
- else { obj.data("jstree_is_loading",true); }
- }
- switch(!0) {
- case (!s.data && !s.ajax): throw "Neither data nor ajax settings supplied.";
- case ($.isFunction(s.data)):
- s.data.call(this, obj, $.proxy(function (d) {
- this.parse_xml(d, $.proxy(function (d) {
- if(d) {
- d = d.replace(/ ?xmlns="[^"]*"/ig, "");
- if(d.length > 10) {
- d = $(d);
- if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
- else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d); obj.removeData("jstree_is_loading"); }
- if(s.clean_node) { this.clean_node(obj); }
- if(s_call) { s_call.call(this); }
- }
- else {
- if(obj && obj !== -1) {
- obj.children("a.jstree-loading").removeClass("jstree-loading");
- obj.removeData("jstree_is_loading");
- if(s.correct_state) {
- this.correct_state(obj);
- if(s_call) { s_call.call(this); }
- }
- }
- else {
- if(s.correct_state) {
- this.get_container().children("ul").empty();
- if(s_call) { s_call.call(this); }
- }
- }
- }
- }
- }, this));
- }, this));
- break;
- case (!!s.data && !s.ajax) || (!!s.data && !!s.ajax && (!obj || obj === -1)):
- if(!obj || obj == -1) {
- this.parse_xml(s.data, $.proxy(function (d) {
- if(d) {
- d = d.replace(/ ?xmlns="[^"]*"/ig, "");
- if(d.length > 10) {
- d = $(d);
- this.get_container().children("ul").empty().append(d.children());
- if(s.clean_node) { this.clean_node(obj); }
- if(s_call) { s_call.call(this); }
- }
- }
- else {
- if(s.correct_state) {
- this.get_container().children("ul").empty();
- if(s_call) { s_call.call(this); }
- }
- }
- }, this));
- }
- break;
- case (!s.data && !!s.ajax) || (!!s.data && !!s.ajax && obj && obj !== -1):
- error_func = function (x, t, e) {
- var ef = this.get_settings().xml_data.ajax.error;
- if(ef) { ef.call(this, x, t, e); }
- if(obj !== -1 && obj.length) {
- obj.children("a.jstree-loading").removeClass("jstree-loading");
- obj.removeData("jstree_is_loading");
- if(t === "success" && s.correct_state) { this.correct_state(obj); }
- }
- else {
- if(t === "success" && s.correct_state) { this.get_container().children("ul").empty(); }
- }
- if(e_call) { e_call.call(this); }
- };
- success_func = function (d, t, x) {
- d = x.responseText;
- var sf = this.get_settings().xml_data.ajax.success;
- if(sf) { d = sf.call(this,d,t,x) || d; }
- if(d === "" || (d && d.toString && d.toString().replace(/^[\s\n]+$/,"") === "")) {
- return error_func.call(this, x, t, "");
- }
- this.parse_xml(d, $.proxy(function (d) {
- if(d) {
- d = d.replace(/ ?xmlns="[^"]*"/ig, "");
- if(d.length > 10) {
- d = $(d);
- if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
- else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d); obj.removeData("jstree_is_loading"); }
- if(s.clean_node) { this.clean_node(obj); }
- if(s_call) { s_call.call(this); }
- }
- else {
- if(obj && obj !== -1) {
- obj.children("a.jstree-loading").removeClass("jstree-loading");
- obj.removeData("jstree_is_loading");
- if(s.correct_state) {
- this.correct_state(obj);
- if(s_call) { s_call.call(this); }
- }
- }
- else {
- if(s.correct_state) {
- this.get_container().children("ul").empty();
- if(s_call) { s_call.call(this); }
- }
- }
- }
- }
- }, this));
- };
- s.ajax.context = this;
- s.ajax.error = error_func;
- s.ajax.success = success_func;
- if(!s.ajax.dataType) { s.ajax.dataType = "xml"; }
- if($.isFunction(s.ajax.url)) { s.ajax.url = s.ajax.url.call(this, obj); }
- if($.isFunction(s.ajax.data)) { s.ajax.data = s.ajax.data.call(this, obj); }
- $.ajax(s.ajax);
- break;
- }
- },
- parse_xml : function (xml, callback) {
- var s = this._get_settings().xml_data;
- $.vakata.xslt(xml, xsl[s.xsl], callback);
- },
- get_xml : function (tp, obj, li_attr, a_attr, is_callback) {
- var result = "",
- s = this._get_settings(),
- _this = this,
- tmp1, tmp2, li, a, lang;
- if(!tp) { tp = "flat"; }
- if(!is_callback) { is_callback = 0; }
- obj = this._get_node(obj);
- if(!obj || obj === -1) { obj = this.get_container().find("> ul > li"); }
- li_attr = $.isArray(li_attr) ? li_attr : [ "id", "class" ];
- if(!is_callback && this.data.types && $.inArray(s.types.type_attr, li_attr) === -1) { li_attr.push(s.types.type_attr); }
-
- a_attr = $.isArray(a_attr) ? a_attr : [ ];
-
- if(!is_callback) {
- if(s.xml_data.get_include_preamble) {
- result += '<' + '?xml version="1.0" encoding="UTF-8"?' + '>';
- }
- result += "<root>";
- }
- obj.each(function () {
- result += "<item";
- li = $(this);
- $.each(li_attr, function (i, v) {
- var t = li.attr(v);
- if(!s.xml_data.get_skip_empty || typeof t !== "undefined") {
- result += " " + v + "=\"" + escape_xml((" " + (t || "")).replace(/ jstree[^ ]*/ig,'').replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"")) + "\"";
- }
- });
- if(li.hasClass("jstree-open")) { result += " state=\"open\""; }
- if(li.hasClass("jstree-closed")) { result += " state=\"closed\""; }
- if(tp === "flat") { result += " parent_id=\"" + escape_xml(is_callback) + "\""; }
- result += ">";
- result += "<content>";
- a = li.children("a");
- a.each(function () {
- tmp1 = $(this);
- lang = false;
- result += "<name";
- if($.inArray("languages", s.plugins) !== -1) {
- $.each(s.languages, function (k, z) {
- if(tmp1.hasClass(z)) { result += " lang=\"" + escape_xml(z) + "\""; lang = z; return false; }
- });
- }
- if(a_attr.length) {
- $.each(a_attr, function (k, z) {
- var t = tmp1.attr(z);
- if(!s.xml_data.get_skip_empty || typeof t !== "undefined") {
- result += " " + z + "=\"" + escape_xml((" " + t || "").replace(/ jstree[^ ]*/ig,'').replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"")) + "\"";
- }
- });
- }
- if(tmp1.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,'').replace(/^\s+$/ig,"").length) {
- result += ' icon="' + escape_xml(tmp1.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,'').replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"")) + '"';
- }
- if(tmp1.children("ins").get(0).style.backgroundImage.length) {
- result += ' icon="' + escape_xml(tmp1.children("ins").get(0).style.backgroundImage.replace("url(","").replace(")","").replace(/'/ig,"").replace(/"/ig,"")) + '"';
- }
- result += ">";
- result += "<![CDATA[" + _this.get_text(tmp1, lang) + "]]>";
- result += "</name>";
- });
- result += "</content>";
- tmp2 = li[0].id || true;
- li = li.find("> ul > li");
- if(li.length) { tmp2 = _this.get_xml(tp, li, li_attr, a_attr, tmp2); }
- else { tmp2 = ""; }
- if(tp == "nest") { result += tmp2; }
- result += "</item>";
- if(tp == "flat") { result += tmp2; }
- });
- if(!is_callback) { result += "</root>"; }
- return result;
- }
- }
- });
-})(jQuery);
-//*/
-
-/*
- * jsTree search plugin
- * Enables both sync and async search on the tree
- * DOES NOT WORK WITH JSON PROGRESSIVE RENDER
- */
-(function ($) {
- if($().jquery.split('.')[1] >= 8) {
- $.expr[':'].jstree_contains = $.expr.createPseudo(function(search) {
- return function(a) {
- return (a.textContent || a.innerText || "").toLowerCase().indexOf(search.toLowerCase())>=0;
- };
- });
- $.expr[':'].jstree_title_contains = $.expr.createPseudo(function(search) {
- return function(a) {
- return (a.getAttribute("title") || "").toLowerCase().indexOf(search.toLowerCase())>=0;
- };
- });
- }
- else {
- $.expr[':'].jstree_contains = function(a,i,m){
- return (a.textContent || a.innerText || "").toLowerCase().indexOf(m[3].toLowerCase())>=0;
- };
- $.expr[':'].jstree_title_contains = function(a,i,m) {
- return (a.getAttribute("title") || "").toLowerCase().indexOf(m[3].toLowerCase())>=0;
- };
- }
- $.jstree.plugin("search", {
- __init : function () {
- this.data.search.str = "";
- this.data.search.result = $();
- if(this._get_settings().search.show_only_matches) {
- this.get_container()
- .bind("search.jstree", function (e, data) {
- $(this).children("ul").find("li").hide().removeClass("jstree-last");
- data.rslt.nodes.parentsUntil(".jstree").addBack().show()
- .filter("ul").each(function () { $(this).children("li:visible").eq(-1).addClass("jstree-last"); });
- })
- .bind("clear_search.jstree", function () {
- $(this).children("ul").find("li").css("display","").end().end().jstree("clean_node", -1);
- });
- }
- },
- defaults : {
- ajax : false,
- search_method : "jstree_contains", // for case insensitive - jstree_contains
- show_only_matches : false
- },
- _fn : {
- search : function (str, skip_async) {
- if($.trim(str) === "") { this.clear_search(); return; }
- var s = this.get_settings().search,
- t = this,
- error_func = function () { },
- success_func = function () { };
- this.data.search.str = str;
-
- if(!skip_async && s.ajax !== false && this.get_container_ul().find("li.jstree-closed:not(:has(ul)):eq(0)").length > 0) {
- this.search.supress_callback = true;
- error_func = function () { };
- success_func = function (d, t, x) {
- var sf = this.get_settings().search.ajax.success;
- if(sf) { d = sf.call(this,d,t,x) || d; }
- this.data.search.to_open = d;
- this._search_open();
- };
- s.ajax.context = this;
- s.ajax.error = error_func;
- s.ajax.success = success_func;
- if($.isFunction(s.ajax.url)) { s.ajax.url = s.ajax.url.call(this, str); }
- if($.isFunction(s.ajax.data)) { s.ajax.data = s.ajax.data.call(this, str); }
- if(!s.ajax.data) { s.ajax.data = { "search_string" : str }; }
- if(!s.ajax.dataType || /^json/.exec(s.ajax.dataType)) { s.ajax.dataType = "json"; }
- $.ajax(s.ajax);
- return;
- }
- if(this.data.search.result.length) { this.clear_search(); }
- this.data.search.result = this.get_container().find("a" + (this.data.languages ? "." + this.get_lang() : "" ) + ":" + (s.search_method) + "(" + this.data.search.str + ")");
- this.data.search.result.addClass("jstree-search").parent().parents(".jstree-closed").each(function () {
- t.open_node(this, false, true);
- });
- this.__callback({ nodes : this.data.search.result, str : str });
- },
- clear_search : function (str) {
- this.data.search.result.removeClass("jstree-search");
- this.__callback(this.data.search.result);
- this.data.search.result = $();
- },
- _search_open : function (is_callback) {
- var _this = this,
- done = true,
- current = [],
- remaining = [];
- if(this.data.search.to_open.length) {
- $.each(this.data.search.to_open, function (i, val) {
- if(val == "#") { return true; }
- if($(val).length && $(val).is(".jstree-closed")) { current.push(val); }
- else { remaining.push(val); }
- });
- if(current.length) {
- this.data.search.to_open = remaining;
- $.each(current, function (i, val) {
- _this.open_node(val, function () { _this._search_open(true); });
- });
- done = false;
- }
- }
- if(done) { this.search(this.data.search.str, true); }
- }
- }
- });
-})(jQuery);
-//*/
-
-/*
- * jsTree contextmenu plugin
- */
-(function ($) {
- $.vakata.context = {
- hide_on_mouseleave : false,
-
- cnt : $("<div id='vakata-contextmenu' />"),
- vis : false,
- tgt : false,
- par : false,
- func : false,
- data : false,
- rtl : false,
- show : function (s, t, x, y, d, p, rtl) {
- $.vakata.context.rtl = !!rtl;
- var html = $.vakata.context.parse(s), h, w;
- if(!html) { return; }
- $.vakata.context.vis = true;
- $.vakata.context.tgt = t;
- $.vakata.context.par = p || t || null;
- $.vakata.context.data = d || null;
- $.vakata.context.cnt
- .html(html)
- .css({ "visibility" : "hidden", "display" : "block", "left" : 0, "top" : 0 });
-
- if($.vakata.context.hide_on_mouseleave) {
- $.vakata.context.cnt
- .one("mouseleave", function(e) { $.vakata.context.hide(); });
- }
-
- h = $.vakata.context.cnt.height();
- w = $.vakata.context.cnt.width();
- if(x + w > $(document).width()) {
- x = $(document).width() - (w + 5);
- $.vakata.context.cnt.find("li > ul").addClass("right");
- }
- if(y + h > $(document).height()) {
- y = y - (h + t[0].offsetHeight);
- $.vakata.context.cnt.find("li > ul").addClass("bottom");
- }
-
- $.vakata.context.cnt
- .css({ "left" : x, "top" : y })
- .find("li:has(ul)")
- .bind("mouseenter", function (e) {
- var w = $(document).width(),
- h = $(document).height(),
- ul = $(this).children("ul").show();
- if(w !== $(document).width()) { ul.toggleClass("right"); }
- if(h !== $(document).height()) { ul.toggleClass("bottom"); }
- })
- .bind("mouseleave", function (e) {
- $(this).children("ul").hide();
- })
- .end()
- .css({ "visibility" : "visible" })
- .show();
- $(document).triggerHandler("context_show.vakata");
- },
- hide : function () {
- $.vakata.context.vis = false;
- $.vakata.context.cnt.attr("class","").css({ "visibility" : "hidden" });
- $(document).triggerHandler("context_hide.vakata");
- },
- parse : function (s, is_callback) {
- if(!s) { return false; }
- var str = "",
- tmp = false,
- was_sep = true;
- if(!is_callback) { $.vakata.context.func = {}; }
- str += "<ul>";
- $.each(s, function (i, val) {
- if(!val) { return true; }
- $.vakata.context.func[i] = val.action;
- if(!was_sep && val.separator_before) {
- str += "<li class='vakata-separator vakata-separator-before'></li>";
- }
- was_sep = false;
- str += "<li class='" + (val._class || "") + (val._disabled ? " jstree-contextmenu-disabled " : "") + "'><ins ";
- if(val.icon && val.icon.indexOf("/") === -1) { str += " class='" + val.icon + "' "; }
- if(val.icon && val.icon.indexOf("/") !== -1) { str += " style='background:url(" + val.icon + ") center center no-repeat;' "; }
- str += ">&#160;</ins><a href='#' rel='" + i + "'>";
- if(val.submenu) {
- str += "<span style='float:" + ($.vakata.context.rtl ? "left" : "right") + ";'>&raquo;</span>";
- }
- str += val.label + "</a>";
- if(val.submenu) {
- tmp = $.vakata.context.parse(val.submenu, true);
- if(tmp) { str += tmp; }
- }
- str += "</li>";
- if(val.separator_after) {
- str += "<li class='vakata-separator vakata-separator-after'></li>";
- was_sep = true;
- }
- });
- str = str.replace(/<li class\='vakata-separator vakata-separator-after'\><\/li\>$/,"");
- str += "</ul>";
- $(document).triggerHandler("context_parse.vakata");
- return str.length > 10 ? str : false;
- },
- exec : function (i) {
- if($.isFunction($.vakata.context.func[i])) {
- // if is string - eval and call it!
- $.vakata.context.func[i].call($.vakata.context.data, $.vakata.context.par);
- return true;
- }
- else { return false; }
- }
- };
- $(function () {
- var css_string = '' +
- '#vakata-contextmenu { display:block; visibility:hidden; left:0; top:-200px; position:absolute; margin:0; padding:0; min-width:180px; background:#ebebeb; border:1px solid silver; z-index:10000; *width:180px; } ' +
- '#vakata-contextmenu ul { min-width:180px; *width:180px; } ' +
- '#vakata-contextmenu ul, #vakata-contextmenu li { margin:0; padding:0; list-style-type:none; display:block; } ' +
- '#vakata-contextmenu li { line-height:20px; min-height:20px; position:relative; padding:0px; } ' +
- '#vakata-contextmenu li a { padding:1px 6px; line-height:17px; display:block; text-decoration:none; margin:1px 1px 0 1px; } ' +
- '#vakata-contextmenu li ins { float:left; width:16px; height:16px; text-decoration:none; margin-right:2px; } ' +
- '#vakata-contextmenu li a:hover, #vakata-contextmenu li.vakata-hover > a { background:gray; color:white; } ' +
- '#vakata-contextmenu li ul { display:none; position:absolute; top:-2px; left:100%; background:#ebebeb; border:1px solid gray; } ' +
- '#vakata-contextmenu .right { right:100%; left:auto; } ' +
- '#vakata-contextmenu .bottom { bottom:-1px; top:auto; } ' +
- '#vakata-contextmenu li.vakata-separator { min-height:0; height:1px; line-height:1px; font-size:1px; overflow:hidden; margin:0 2px; background:silver; /* border-top:1px solid #fefefe; */ padding:0; } ';
- $.vakata.css.add_sheet({ str : css_string, title : "vakata" });
- $.vakata.context.cnt
- .delegate("a","click", function (e) { e.preventDefault(); })
- .delegate("a","mouseup", function (e) {
- if(!$(this).parent().hasClass("jstree-contextmenu-disabled") && $.vakata.context.exec($(this).attr("rel"))) {
- $.vakata.context.hide();
- }
- else { $(this).blur(); }
- })
- .delegate("a","mouseover", function () {
- $.vakata.context.cnt.find(".vakata-hover").removeClass("vakata-hover");
- })
- .appendTo("body");
- $(document).bind("mousedown", function (e) { if($.vakata.context.vis && !$.contains($.vakata.context.cnt[0], e.target)) { $.vakata.context.hide(); } });
- if(typeof $.hotkeys !== "undefined") {
- $(document)
- .bind("keydown", "up", function (e) {
- if($.vakata.context.vis) {
- var o = $.vakata.context.cnt.find("ul:visible").last().children(".vakata-hover").removeClass("vakata-hover").prevAll("li:not(.vakata-separator)").first();
- if(!o.length) { o = $.vakata.context.cnt.find("ul:visible").last().children("li:not(.vakata-separator)").last(); }
- o.addClass("vakata-hover");
- e.stopImmediatePropagation();
- e.preventDefault();
- }
- })
- .bind("keydown", "down", function (e) {
- if($.vakata.context.vis) {
- var o = $.vakata.context.cnt.find("ul:visible").last().children(".vakata-hover").removeClass("vakata-hover").nextAll("li:not(.vakata-separator)").first();
- if(!o.length) { o = $.vakata.context.cnt.find("ul:visible").last().children("li:not(.vakata-separator)").first(); }
- o.addClass("vakata-hover");
- e.stopImmediatePropagation();
- e.preventDefault();
- }
- })
- .bind("keydown", "right", function (e) {
- if($.vakata.context.vis) {
- $.vakata.context.cnt.find(".vakata-hover").children("ul").show().children("li:not(.vakata-separator)").removeClass("vakata-hover").first().addClass("vakata-hover");
- e.stopImmediatePropagation();
- e.preventDefault();
- }
- })
- .bind("keydown", "left", function (e) {
- if($.vakata.context.vis) {
- $.vakata.context.cnt.find(".vakata-hover").children("ul").hide().children(".vakata-separator").removeClass("vakata-hover");
- e.stopImmediatePropagation();
- e.preventDefault();
- }
- })
- .bind("keydown", "esc", function (e) {
- $.vakata.context.hide();
- e.preventDefault();
- })
- .bind("keydown", "space", function (e) {
- $.vakata.context.cnt.find(".vakata-hover").last().children("a").click();
- e.preventDefault();
- });
- }
- });
-
- $.jstree.plugin("contextmenu", {
- __init : function () {
- this.get_container()
- .delegate("a", "contextmenu.jstree", $.proxy(function (e) {
- e.preventDefault();
- if(!$(e.currentTarget).hasClass("jstree-loading")) {
- this.show_contextmenu(e.currentTarget, e.pageX, e.pageY);
- }
- }, this))
- .delegate("a", "click.jstree", $.proxy(function (e) {
- if(this.data.contextmenu) {
- $.vakata.context.hide();
- }
- }, this))
- .bind("destroy.jstree", $.proxy(function () {
- // TODO: move this to descruct method
- if(this.data.contextmenu) {
- $.vakata.context.hide();
- }
- }, this));
- $(document).bind("context_hide.vakata", $.proxy(function () { this.data.contextmenu = false; }, this));
- },
- defaults : {
- select_node : false, // requires UI plugin
- show_at_node : true,
- items : { // Could be a function that should return an object like this one
- "create" : {
- "separator_before" : false,
- "separator_after" : true,
- "label" : "Create",
- "action" : function (obj) { this.create(obj); }
- },
- "rename" : {
- "separator_before" : false,
- "separator_after" : false,
- "label" : "Rename",
- "action" : function (obj) { this.rename(obj); }
- },
- "remove" : {
- "separator_before" : false,
- "icon" : false,
- "separator_after" : false,
- "label" : "Delete",
- "action" : function (obj) { if(this.is_selected(obj)) { this.remove(); } else { this.remove(obj); } }
- },
- "ccp" : {
- "separator_before" : true,
- "icon" : false,
- "separator_after" : false,
- "label" : "Edit",
- "action" : false,
- "submenu" : {
- "cut" : {
- "separator_before" : false,
- "separator_after" : false,
- "label" : "Cut",
- "action" : function (obj) { this.cut(obj); }
- },
- "copy" : {
- "separator_before" : false,
- "icon" : false,
- "separator_after" : false,
- "label" : "Copy",
- "action" : function (obj) { this.copy(obj); }
- },
- "paste" : {
- "separator_before" : false,
- "icon" : false,
- "separator_after" : false,
- "label" : "Paste",
- "action" : function (obj) { this.paste(obj); }
- }
- }
- }
- }
- },
- _fn : {
- show_contextmenu : function (obj, x, y) {
- obj = this._get_node(obj);
- var s = this.get_settings().contextmenu,
- a = obj.children("a:visible:eq(0)"),
- o = false,
- i = false;
- if(s.select_node && this.data.ui && !this.is_selected(obj)) {
- this.deselect_all();
- this.select_node(obj, true);
- }
- if(s.show_at_node || typeof x === "undefined" || typeof y === "undefined") {
- o = a.offset();
- x = o.left;
- y = o.top + this.data.core.li_height;
- }
- i = obj.data("jstree") && obj.data("jstree").contextmenu ? obj.data("jstree").contextmenu : s.items;
- if($.isFunction(i)) { i = i.call(this, obj); }
- this.data.contextmenu = true;
- $.vakata.context.show(i, a, x, y, this, obj, this._get_settings().core.rtl);
- if(this.data.themes) { $.vakata.context.cnt.attr("class", "jstree-" + this.data.themes.theme + "-context"); }
- }
- }
- });
-})(jQuery);
-//*/
-
-/*
- * jsTree types plugin
- * Adds support types of nodes
- * You can set an attribute on each li node, that represents its type.
- * According to the type setting the node may get custom icon/validation rules
- */
-(function ($) {
- $.jstree.plugin("types", {
- __init : function () {
- var s = this._get_settings().types;
- this.data.types.attach_to = [];
- this.get_container()
- .bind("init.jstree", $.proxy(function () {
- var types = s.types,
- attr = s.type_attr,
- icons_css = "",
- _this = this;
-
- $.each(types, function (i, tp) {
- $.each(tp, function (k, v) {
- if(!/^(max_depth|max_children|icon|valid_children)$/.test(k)) { _this.data.types.attach_to.push(k); }
- });
- if(!tp.icon) { return true; }
- if( tp.icon.image || tp.icon.position) {
- if(i == "default") { icons_css += '.jstree-' + _this.get_index() + ' a > .jstree-icon { '; }
- else { icons_css += '.jstree-' + _this.get_index() + ' li[' + attr + '="' + i + '"] > a > .jstree-icon { '; }
- if(tp.icon.image) { icons_css += ' background-image:url(' + tp.icon.image + '); '; }
- if(tp.icon.position){ icons_css += ' background-position:' + tp.icon.position + '; '; }
- else { icons_css += ' background-position:0 0; '; }
- icons_css += '} ';
- }
- });
- if(icons_css !== "") { $.vakata.css.add_sheet({ 'str' : icons_css, title : "jstree-types" }); }
- }, this))
- .bind("before.jstree", $.proxy(function (e, data) {
- var s, t,
- o = this._get_settings().types.use_data ? this._get_node(data.args[0]) : false,
- d = o && o !== -1 && o.length ? o.data("jstree") : false;
- if(d && d.types && d.types[data.func] === false) { e.stopImmediatePropagation(); return false; }
- if($.inArray(data.func, this.data.types.attach_to) !== -1) {
- if(!data.args[0] || (!data.args[0].tagName && !data.args[0].jquery)) { return; }
- s = this._get_settings().types.types;
- t = this._get_type(data.args[0]);
- if(
- (
- (s[t] && typeof s[t][data.func] !== "undefined") ||
- (s["default"] && typeof s["default"][data.func] !== "undefined")
- ) && this._check(data.func, data.args[0]) === false
- ) {
- e.stopImmediatePropagation();
- return false;
- }
- }
- }, this));
- if(is_ie6) {
- this.get_container()
- .bind("load_node.jstree set_type.jstree", $.proxy(function (e, data) {
- var r = data && data.rslt && data.rslt.obj && data.rslt.obj !== -1 ? this._get_node(data.rslt.obj).parent() : this.get_container_ul(),
- c = false,
- s = this._get_settings().types;
- $.each(s.types, function (i, tp) {
- if(tp.icon && (tp.icon.image || tp.icon.position)) {
- c = i === "default" ? r.find("li > a > .jstree-icon") : r.find("li[" + s.type_attr + "='" + i + "'] > a > .jstree-icon");
- if(tp.icon.image) { c.css("backgroundImage","url(" + tp.icon.image + ")"); }
- c.css("backgroundPosition", tp.icon.position || "0 0");
- }
- });
- }, this));
- }
- },
- defaults : {
- // defines maximum number of root nodes (-1 means unlimited, -2 means disable max_children checking)
- max_children : -1,
- // defines the maximum depth of the tree (-1 means unlimited, -2 means disable max_depth checking)
- max_depth : -1,
- // defines valid node types for the root nodes
- valid_children : "all",
-
- // whether to use $.data
- use_data : false,
- // where is the type stores (the rel attribute of the LI element)
- type_attr : "rel",
- // a list of types
- types : {
- // the default type
- "default" : {
- "max_children" : -1,
- "max_depth" : -1,
- "valid_children": "all"
-
- // Bound functions - you can bind any other function here (using boolean or function)
- //"select_node" : true
- }
- }
- },
- _fn : {
- _types_notify : function (n, data) {
- if(data.type && this._get_settings().types.use_data) {
- this.set_type(data.type, n);
- }
- },
- _get_type : function (obj) {
- obj = this._get_node(obj);
- return (!obj || !obj.length) ? false : obj.attr(this._get_settings().types.type_attr) || "default";
- },
- set_type : function (str, obj) {
- obj = this._get_node(obj);
- var ret = (!obj.length || !str) ? false : obj.attr(this._get_settings().types.type_attr, str);
- if(ret) { this.__callback({ obj : obj, type : str}); }
- return ret;
- },
- _check : function (rule, obj, opts) {
- obj = this._get_node(obj);
- var v = false, t = this._get_type(obj), d = 0, _this = this, s = this._get_settings().types, data = false;
- if(obj === -1) {
- if(!!s[rule]) { v = s[rule]; }
- else { return; }
- }
- else {
- if(t === false) { return; }
- data = s.use_data ? obj.data("jstree") : false;
- if(data && data.types && typeof data.types[rule] !== "undefined") { v = data.types[rule]; }
- else if(!!s.types[t] && typeof s.types[t][rule] !== "undefined") { v = s.types[t][rule]; }
- else if(!!s.types["default"] && typeof s.types["default"][rule] !== "undefined") { v = s.types["default"][rule]; }
- }
- if($.isFunction(v)) { v = v.call(this, obj); }
- if(rule === "max_depth" && obj !== -1 && opts !== false && s.max_depth !== -2 && v !== 0) {
- // also include the node itself - otherwise if root node it is not checked
- obj.children("a:eq(0)").parentsUntil(".jstree","li").each(function (i) {
- // check if current depth already exceeds global tree depth
- if(s.max_depth !== -1 && s.max_depth - (i + 1) <= 0) { v = 0; return false; }
- d = (i === 0) ? v : _this._check(rule, this, false);
- // check if current node max depth is already matched or exceeded
- if(d !== -1 && d - (i + 1) <= 0) { v = 0; return false; }
- // otherwise - set the max depth to the current value minus current depth
- if(d >= 0 && (d - (i + 1) < v || v < 0) ) { v = d - (i + 1); }
- // if the global tree depth exists and it minus the nodes calculated so far is less than `v` or `v` is unlimited
- if(s.max_depth >= 0 && (s.max_depth - (i + 1) < v || v < 0) ) { v = s.max_depth - (i + 1); }
- });
- }
- return v;
- },
- check_move : function () {
- if(!this.__call_old()) { return false; }
- var m = this._get_move(),
- s = m.rt._get_settings().types,
- mc = m.rt._check("max_children", m.cr),
- md = m.rt._check("max_depth", m.cr),
- vc = m.rt._check("valid_children", m.cr),
- ch = 0, d = 1, t;
-
- if(vc === "none") { return false; }
- if($.isArray(vc) && m.ot && m.ot._get_type) {
- m.o.each(function () {
- if($.inArray(m.ot._get_type(this), vc) === -1) { d = false; return false; }
- });
- if(d === false) { return false; }
- }
- if(s.max_children !== -2 && mc !== -1) {
- ch = m.cr === -1 ? this.get_container().find("> ul > li").not(m.o).length : m.cr.find("> ul > li").not(m.o).length;
- if(ch + m.o.length > mc) { return false; }
- }
- if(s.max_depth !== -2 && md !== -1) {
- d = 0;
- if(md === 0) { return false; }
- if(typeof m.o.d === "undefined") {
- // TODO: deal with progressive rendering and async when checking max_depth (how to know the depth of the moved node)
- t = m.o;
- while(t.length > 0) {
- t = t.find("> ul > li");
- d ++;
- }
- m.o.d = d;
- }
- if(md - m.o.d < 0) { return false; }
- }
- return true;
- },
- create_node : function (obj, position, js, callback, is_loaded, skip_check) {
- if(!skip_check && (is_loaded || this._is_loaded(obj))) {
- var p = (typeof position == "string" && position.match(/^before|after$/i) && obj !== -1) ? this._get_parent(obj) : this._get_node(obj),
- s = this._get_settings().types,
- mc = this._check("max_children", p),
- md = this._check("max_depth", p),
- vc = this._check("valid_children", p),
- ch;
- if(typeof js === "string") { js = { data : js }; }
- if(!js) { js = {}; }
- if(vc === "none") { return false; }
- if($.isArray(vc)) {
- if(!js.attr || !js.attr[s.type_attr]) {
- if(!js.attr) { js.attr = {}; }
- js.attr[s.type_attr] = vc[0];
- }
- else {
- if($.inArray(js.attr[s.type_attr], vc) === -1) { return false; }
- }
- }
- if(s.max_children !== -2 && mc !== -1) {
- ch = p === -1 ? this.get_container().find("> ul > li").length : p.find("> ul > li").length;
- if(ch + 1 > mc) { return false; }
- }
- if(s.max_depth !== -2 && md !== -1 && (md - 1) < 0) { return false; }
- }
- return this.__call_old(true, obj, position, js, callback, is_loaded, skip_check);
- }
- }
- });
-})(jQuery);
-//*/
-
-/*
- * jsTree HTML plugin
- * The HTML data store. Datastores are build by replacing the `load_node` and `_is_loaded` functions.
- */
-(function ($) {
- $.jstree.plugin("html_data", {
- __init : function () {
- // this used to use html() and clean the whitespace, but this way any attached data was lost
- this.data.html_data.original_container_html = this.get_container().find(" > ul > li").clone(true);
- // remove white space from LI node - otherwise nodes appear a bit to the right
- this.data.html_data.original_container_html.find("li").addBack().contents().filter(function() { return this.nodeType == 3; }).remove();
- },
- defaults : {
- data : false,
- ajax : false,
- correct_state : true
- },
- _fn : {
- load_node : function (obj, s_call, e_call) { var _this = this; this.load_node_html(obj, function () { _this.__callback({ "obj" : _this._get_node(obj) }); s_call.call(this); }, e_call); },
- _is_loaded : function (obj) {
- obj = this._get_node(obj);
- return obj == -1 || !obj || (!this._get_settings().html_data.ajax && !$.isFunction(this._get_settings().html_data.data)) || obj.is(".jstree-open, .jstree-leaf") || obj.children("ul").children("li").size() > 0;
- },
- load_node_html : function (obj, s_call, e_call) {
- var d,
- s = this.get_settings().html_data,
- error_func = function () {},
- success_func = function () {};
- obj = this._get_node(obj);
- if(obj && obj !== -1) {
- if(obj.data("jstree_is_loading")) { return; }
- else { obj.data("jstree_is_loading",true); }
- }
- switch(!0) {
- case ($.isFunction(s.data)):
- s.data.call(this, obj, $.proxy(function (d) {
- if(d && d !== "" && d.toString && d.toString().replace(/^[\s\n]+$/,"") !== "") {
- d = $(d);
- if(!d.is("ul")) { d = $("<ul />").append(d); }
- if(obj == -1 || !obj) { this.get_container().children("ul").empty().append(d.children()).find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); }
- else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d).children("ul").find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); obj.removeData("jstree_is_loading"); }
- this.clean_node(obj);
- if(s_call) { s_call.call(this); }
- }
- else {
- if(obj && obj !== -1) {
- obj.children("a.jstree-loading").removeClass("jstree-loading");
- obj.removeData("jstree_is_loading");
- if(s.correct_state) {
- this.correct_state(obj);
- if(s_call) { s_call.call(this); }
- }
- }
- else {
- if(s.correct_state) {
- this.get_container().children("ul").empty();
- if(s_call) { s_call.call(this); }
- }
- }
- }
- }, this));
- break;
- case (!s.data && !s.ajax):
- if(!obj || obj == -1) {
- this.get_container()
- .children("ul").empty()
- .append(this.data.html_data.original_container_html)
- .find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'>&#160;</ins>").end()
- .filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon");
- this.clean_node();
- }
- if(s_call) { s_call.call(this); }
- break;
- case (!!s.data && !s.ajax) || (!!s.data && !!s.ajax && (!obj || obj === -1)):
- if(!obj || obj == -1) {
- d = $(s.data);
- if(!d.is("ul")) { d = $("<ul />").append(d); }
- this.get_container()
- .children("ul").empty().append(d.children())
- .find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'>&#160;</ins>").end()
- .filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon");
- this.clean_node();
- }
- if(s_call) { s_call.call(this); }
- break;
- case (!s.data && !!s.ajax) || (!!s.data && !!s.ajax && obj && obj !== -1):
- obj = this._get_node(obj);
- error_func = function (x, t, e) {
- var ef = this.get_settings().html_data.ajax.error;
- if(ef) { ef.call(this, x, t, e); }
- if(obj != -1 && obj.length) {
- obj.children("a.jstree-loading").removeClass("jstree-loading");
- obj.removeData("jstree_is_loading");
- if(t === "success" && s.correct_state) { this.correct_state(obj); }
- }
- else {
- if(t === "success" && s.correct_state) { this.get_container().children("ul").empty(); }
- }
- if(e_call) { e_call.call(this); }
- };
- success_func = function (d, t, x) {
- var sf = this.get_settings().html_data.ajax.success;
- if(sf) { d = sf.call(this,d,t,x) || d; }
- if(d === "" || (d && d.toString && d.toString().replace(/^[\s\n]+$/,"") === "")) {
- return error_func.call(this, x, t, "");
- }
- if(d) {
- d = $(d);
- if(!d.is("ul")) { d = $("<ul />").append(d); }
- if(obj == -1 || !obj) { this.get_container().children("ul").empty().append(d.children()).find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); }
- else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d).children("ul").find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); obj.removeData("jstree_is_loading"); }
- this.clean_node(obj);
- if(s_call) { s_call.call(this); }
- }
- else {
- if(obj && obj !== -1) {
- obj.children("a.jstree-loading").removeClass("jstree-loading");
- obj.removeData("jstree_is_loading");
- if(s.correct_state) {
- this.correct_state(obj);
- if(s_call) { s_call.call(this); }
- }
- }
- else {
- if(s.correct_state) {
- this.get_container().children("ul").empty();
- if(s_call) { s_call.call(this); }
- }
- }
- }
- };
- s.ajax.context = this;
- s.ajax.error = error_func;
- s.ajax.success = success_func;
- if(!s.ajax.dataType) { s.ajax.dataType = "html"; }
- if($.isFunction(s.ajax.url)) { s.ajax.url = s.ajax.url.call(this, obj); }
- if($.isFunction(s.ajax.data)) { s.ajax.data = s.ajax.data.call(this, obj); }
- $.ajax(s.ajax);
- break;
- }
- }
- }
- });
- // include the HTML data plugin by default
- $.jstree.defaults.plugins.push("html_data");
-})(jQuery);
-//*/
-
-/*
- * jsTree themeroller plugin
- * Adds support for jQuery UI themes. Include this at the end of your plugins list, also make sure "themes" is not included.
- */
-(function ($) {
- $.jstree.plugin("themeroller", {
- __init : function () {
- var s = this._get_settings().themeroller;
- this.get_container()
- .addClass("ui-widget-content")
- .addClass("jstree-themeroller")
- .delegate("a","mouseenter.jstree", function (e) {
- if(!$(e.currentTarget).hasClass("jstree-loading")) {
- $(this).addClass(s.item_h);
- }
- })
- .delegate("a","mouseleave.jstree", function () {
- $(this).removeClass(s.item_h);
- })
- .bind("init.jstree", $.proxy(function (e, data) {
- data.inst.get_container().find("> ul > li > .jstree-loading > ins").addClass("ui-icon-refresh");
- this._themeroller(data.inst.get_container().find("> ul > li"));
- }, this))
- .bind("open_node.jstree create_node.jstree", $.proxy(function (e, data) {
- this._themeroller(data.rslt.obj);
- }, this))
- .bind("loaded.jstree refresh.jstree", $.proxy(function (e) {
- this._themeroller();
- }, this))
- .bind("close_node.jstree", $.proxy(function (e, data) {
- this._themeroller(data.rslt.obj);
- }, this))
- .bind("delete_node.jstree", $.proxy(function (e, data) {
- this._themeroller(data.rslt.parent);
- }, this))
- .bind("correct_state.jstree", $.proxy(function (e, data) {
- data.rslt.obj
- .children("ins.jstree-icon").removeClass(s.opened + " " + s.closed + " ui-icon").end()
- .find("> a > ins.ui-icon")
- .filter(function() {
- return this.className.toString()
- .replace(s.item_clsd,"").replace(s.item_open,"").replace(s.item_leaf,"")
- .indexOf("ui-icon-") === -1;
- }).removeClass(s.item_open + " " + s.item_clsd).addClass(s.item_leaf || "jstree-no-icon");
- }, this))
- .bind("select_node.jstree", $.proxy(function (e, data) {
- data.rslt.obj.children("a").addClass(s.item_a);
- }, this))
- .bind("deselect_node.jstree deselect_all.jstree", $.proxy(function (e, data) {
- this.get_container()
- .find("a." + s.item_a).removeClass(s.item_a).end()
- .find("a.jstree-clicked").addClass(s.item_a);
- }, this))
- .bind("dehover_node.jstree", $.proxy(function (e, data) {
- data.rslt.obj.children("a").removeClass(s.item_h);
- }, this))
- .bind("hover_node.jstree", $.proxy(function (e, data) {
- this.get_container()
- .find("a." + s.item_h).not(data.rslt.obj).removeClass(s.item_h);
- data.rslt.obj.children("a").addClass(s.item_h);
- }, this))
- .bind("move_node.jstree", $.proxy(function (e, data) {
- this._themeroller(data.rslt.o);
- this._themeroller(data.rslt.op);
- }, this));
- },
- __destroy : function () {
- var s = this._get_settings().themeroller,
- c = [ "ui-icon" ];
- $.each(s, function (i, v) {
- v = v.split(" ");
- if(v.length) { c = c.concat(v); }
- });
- this.get_container()
- .removeClass("ui-widget-content")
- .find("." + c.join(", .")).removeClass(c.join(" "));
- },
- _fn : {
- _themeroller : function (obj) {
- var s = this._get_settings().themeroller;
- obj = (!obj || obj == -1) ? this.get_container_ul() : this._get_node(obj);
- obj = (!obj || obj == -1) ? this.get_container_ul() : obj.parent();
- obj
- .find("li.jstree-closed")
- .children("ins.jstree-icon").removeClass(s.opened).addClass("ui-icon " + s.closed).end()
- .children("a").addClass(s.item)
- .children("ins.jstree-icon").addClass("ui-icon")
- .filter(function() {
- return this.className.toString()
- .replace(s.item_clsd,"").replace(s.item_open,"").replace(s.item_leaf,"")
- .indexOf("ui-icon-") === -1;
- }).removeClass(s.item_leaf + " " + s.item_open).addClass(s.item_clsd || "jstree-no-icon")
- .end()
- .end()
- .end()
- .end()
- .find("li.jstree-open")
- .children("ins.jstree-icon").removeClass(s.closed).addClass("ui-icon " + s.opened).end()
- .children("a").addClass(s.item)
- .children("ins.jstree-icon").addClass("ui-icon")
- .filter(function() {
- return this.className.toString()
- .replace(s.item_clsd,"").replace(s.item_open,"").replace(s.item_leaf,"")
- .indexOf("ui-icon-") === -1;
- }).removeClass(s.item_leaf + " " + s.item_clsd).addClass(s.item_open || "jstree-no-icon")
- .end()
- .end()
- .end()
- .end()
- .find("li.jstree-leaf")
- .children("ins.jstree-icon").removeClass(s.closed + " ui-icon " + s.opened).end()
- .children("a").addClass(s.item)
- .children("ins.jstree-icon").addClass("ui-icon")
- .filter(function() {
- return this.className.toString()
- .replace(s.item_clsd,"").replace(s.item_open,"").replace(s.item_leaf,"")
- .indexOf("ui-icon-") === -1;
- }).removeClass(s.item_clsd + " " + s.item_open).addClass(s.item_leaf || "jstree-no-icon");
- }
- },
- defaults : {
- "opened" : "ui-icon-triangle-1-se",
- "closed" : "ui-icon-triangle-1-e",
- "item" : "ui-state-default",
- "item_h" : "ui-state-hover",
- "item_a" : "ui-state-active",
- "item_open" : "ui-icon-folder-open",
- "item_clsd" : "ui-icon-folder-collapsed",
- "item_leaf" : "ui-icon-document"
- }
- });
- $(function() {
- var css_string = '' +
- '.jstree-themeroller .ui-icon { overflow:visible; } ' +
- '.jstree-themeroller a { padding:0 2px; } ' +
- '.jstree-themeroller .jstree-no-icon { display:none; }';
- $.vakata.css.add_sheet({ str : css_string, title : "jstree" });
- });
-})(jQuery);
-//*/
-
-/*
- * jsTree unique plugin
- * Forces different names amongst siblings (still a bit experimental)
- * NOTE: does not check language versions (it will not be possible to have nodes with the same title, even in different languages)
- */
-(function ($) {
- $.jstree.plugin("unique", {
- __init : function () {
- this.get_container()
- .bind("before.jstree", $.proxy(function (e, data) {
- var nms = [], res = true, p, t;
- if(data.func == "move_node") {
- // obj, ref, position, is_copy, is_prepared, skip_check
- if(data.args[4] === true) {
- if(data.args[0].o && data.args[0].o.length) {
- data.args[0].o.children("a").each(function () { nms.push($(this).text().replace(/^\s+/g,"")); });
- res = this._check_unique(nms, data.args[0].np.find("> ul > li").not(data.args[0].o), "move_node");
- }
- }
- }
- if(data.func == "create_node") {
- // obj, position, js, callback, is_loaded
- if(data.args[4] || this._is_loaded(data.args[0])) {
- p = this._get_node(data.args[0]);
- if(data.args[1] && (data.args[1] === "before" || data.args[1] === "after")) {
- p = this._get_parent(data.args[0]);
- if(!p || p === -1) { p = this.get_container(); }
- }
- if(typeof data.args[2] === "string") { nms.push(data.args[2]); }
- else if(!data.args[2] || !data.args[2].data) { nms.push(this._get_string("new_node")); }
- else { nms.push(data.args[2].data); }
- res = this._check_unique(nms, p.find("> ul > li"), "create_node");
- }
- }
- if(data.func == "rename_node") {
- // obj, val
- nms.push(data.args[1]);
- t = this._get_node(data.args[0]);
- p = this._get_parent(t);
- if(!p || p === -1) { p = this.get_container(); }
- res = this._check_unique(nms, p.find("> ul > li").not(t), "rename_node");
- }
- if(!res) {
- e.stopPropagation();
- return false;
- }
- }, this));
- },
- defaults : {
- error_callback : $.noop
- },
- _fn : {
- _check_unique : function (nms, p, func) {
- var cnms = [], ok = true;
- p.children("a").each(function () { cnms.push($(this).text().replace(/^\s+/g,"")); });
- if(!cnms.length || !nms.length) { return true; }
- $.each(nms, function (i, v) {
- if($.inArray(v, cnms) !== -1) {
- ok = false;
- return false;
- }
- });
- if(!ok) {
- this._get_settings().unique.error_callback.call(null, nms, p, func);
- }
- return ok;
- },
- check_move : function () {
- if(!this.__call_old()) { return false; }
- var p = this._get_move(), nms = [];
- if(p.o && p.o.length) {
- p.o.children("a").each(function () { nms.push($(this).text().replace(/^\s+/g,"")); });
- return this._check_unique(nms, p.np.find("> ul > li").not(p.o), "check_move");
- }
- return true;
- }
- }
- });
-})(jQuery);
-//*/
-
-/*
- * jsTree wholerow plugin
- * Makes select and hover work on the entire width of the node
- * MAY BE HEAVY IN LARGE DOM
- */
-(function ($) {
- $.jstree.plugin("wholerow", {
- __init : function () {
- if(!this.data.ui) { throw "jsTree wholerow: jsTree UI plugin not included."; }
- this.data.wholerow.html = false;
- this.data.wholerow.to = false;
- this.get_container()
- .bind("init.jstree", $.proxy(function (e, data) {
- this._get_settings().core.animation = 0;
- }, this))
- .bind("open_node.jstree create_node.jstree clean_node.jstree loaded.jstree", $.proxy(function (e, data) {
- this._prepare_wholerow_span( data && data.rslt && data.rslt.obj ? data.rslt.obj : -1 );
- }, this))
- .bind("search.jstree clear_search.jstree reopen.jstree after_open.jstree after_close.jstree create_node.jstree delete_node.jstree clean_node.jstree", $.proxy(function (e, data) {
- if(this.data.to) { clearTimeout(this.data.to); }
- this.data.to = setTimeout( (function (t, o) { return function() { t._prepare_wholerow_ul(o); }; })(this, data && data.rslt && data.rslt.obj ? data.rslt.obj : -1), 0);
- }, this))
- .bind("deselect_all.jstree", $.proxy(function (e, data) {
- this.get_container().find(" > .jstree-wholerow .jstree-clicked").removeClass("jstree-clicked " + (this.data.themeroller ? this._get_settings().themeroller.item_a : "" ));
- }, this))
- .bind("select_node.jstree deselect_node.jstree ", $.proxy(function (e, data) {
- data.rslt.obj.each(function () {
- var ref = data.inst.get_container().find(" > .jstree-wholerow li:visible:eq(" + ( parseInt((($(this).offset().top - data.inst.get_container().offset().top + data.inst.get_container()[0].scrollTop) / data.inst.data.core.li_height),10)) + ")");
- // ref.children("a")[e.type === "select_node" ? "addClass" : "removeClass"]("jstree-clicked");
- ref.children("a").attr("class",data.rslt.obj.children("a").attr("class"));
- });
- }, this))
- .bind("hover_node.jstree dehover_node.jstree", $.proxy(function (e, data) {
- this.get_container().find(" > .jstree-wholerow .jstree-hovered").removeClass("jstree-hovered " + (this.data.themeroller ? this._get_settings().themeroller.item_h : "" ));
- if(e.type === "hover_node") {
- var ref = this.get_container().find(" > .jstree-wholerow li:visible:eq(" + ( parseInt(((data.rslt.obj.offset().top - this.get_container().offset().top + this.get_container()[0].scrollTop) / this.data.core.li_height),10)) + ")");
- // ref.children("a").addClass("jstree-hovered");
- ref.children("a").attr("class",data.rslt.obj.children(".jstree-hovered").attr("class"));
- }
- }, this))
- .delegate(".jstree-wholerow-span, ins.jstree-icon, li", "click.jstree", function (e) {
- var n = $(e.currentTarget);
- if(e.target.tagName === "A" || (e.target.tagName === "INS" && n.closest("li").is(".jstree-open, .jstree-closed"))) { return; }
- n.closest("li").children("a:visible:eq(0)").click();
- e.stopImmediatePropagation();
- })
- .delegate("li", "mouseover.jstree", $.proxy(function (e) {
- e.stopImmediatePropagation();
- if($(e.currentTarget).children(".jstree-hovered, .jstree-clicked").length) { return false; }
- this.hover_node(e.currentTarget);
- return false;
- }, this))
- .delegate("li", "mouseleave.jstree", $.proxy(function (e) {
- if($(e.currentTarget).children("a").hasClass("jstree-hovered").length) { return; }
- this.dehover_node(e.currentTarget);
- }, this));
- if(is_ie7 || is_ie6) {
- $.vakata.css.add_sheet({ str : ".jstree-" + this.get_index() + " { position:relative; } ", title : "jstree" });
- }
- },
- defaults : {
- },
- __destroy : function () {
- this.get_container().children(".jstree-wholerow").remove();
- this.get_container().find(".jstree-wholerow-span").remove();
- },
- _fn : {
- _prepare_wholerow_span : function (obj) {
- obj = !obj || obj == -1 ? this.get_container().find("> ul > li") : this._get_node(obj);
- if(obj === false) { return; } // added for removing root nodes
- obj.each(function () {
- $(this).find("li").addBack().each(function () {
- var $t = $(this);
- if($t.children(".jstree-wholerow-span").length) { return true; }
- $t.prepend("<span class='jstree-wholerow-span' style='width:" + ($t.parentsUntil(".jstree","li").length * 18) + "px;'>&#160;</span>");
- });
- });
- },
- _prepare_wholerow_ul : function () {
- var o = this.get_container().children("ul").eq(0), h = o.html();
- o.addClass("jstree-wholerow-real");
- if(this.data.wholerow.last_html !== h) {
- this.data.wholerow.last_html = h;
- this.get_container().children(".jstree-wholerow").remove();
- this.get_container().append(
- o.clone().removeClass("jstree-wholerow-real")
- .wrapAll("<div class='jstree-wholerow' />").parent()
- .width(o.parent()[0].scrollWidth)
- .css("top", (o.height() + ( is_ie7 ? 5 : 0)) * -1 )
- .find("li[id]").each(function () { this.removeAttribute("id"); }).end()
- );
- }
- }
- }
- });
- $(function() {
- var css_string = '' +
- '.jstree .jstree-wholerow-real { position:relative; z-index:1; } ' +
- '.jstree .jstree-wholerow-real li { cursor:pointer; } ' +
- '.jstree .jstree-wholerow-real a { border-left-color:transparent !important; border-right-color:transparent !important; } ' +
- '.jstree .jstree-wholerow { position:relative; z-index:0; height:0; } ' +
- '.jstree .jstree-wholerow ul, .jstree .jstree-wholerow li { width:100%; } ' +
- '.jstree .jstree-wholerow, .jstree .jstree-wholerow ul, .jstree .jstree-wholerow li, .jstree .jstree-wholerow a { margin:0 !important; padding:0 !important; } ' +
- '.jstree .jstree-wholerow, .jstree .jstree-wholerow ul, .jstree .jstree-wholerow li { background:transparent !important; }' +
- '.jstree .jstree-wholerow ins, .jstree .jstree-wholerow span, .jstree .jstree-wholerow input { display:none !important; }' +
- '.jstree .jstree-wholerow a, .jstree .jstree-wholerow a:hover { text-indent:-9999px; !important; width:100%; padding:0 !important; border-right-width:0px !important; border-left-width:0px !important; } ' +
- '.jstree .jstree-wholerow-span { position:absolute; left:0; margin:0px; padding:0; height:18px; border-width:0; padding:0; z-index:0; }';
- if(is_ff2) {
- css_string += '' +
- '.jstree .jstree-wholerow a { display:block; height:18px; margin:0; padding:0; border:0; } ' +
- '.jstree .jstree-wholerow-real a { border-color:transparent !important; } ';
- }
- if(is_ie7 || is_ie6) {
- css_string += '' +
- '.jstree .jstree-wholerow, .jstree .jstree-wholerow li, .jstree .jstree-wholerow ul, .jstree .jstree-wholerow a { margin:0; padding:0; line-height:18px; } ' +
- '.jstree .jstree-wholerow a { display:block; height:18px; line-height:18px; overflow:hidden; } ';
- }
- $.vakata.css.add_sheet({ str : css_string, title : "jstree" });
- });
-})(jQuery);
-//*/
-
-/*
- * jsTree model plugin
- * This plugin gets jstree to use a class model to retrieve data, creating great dynamism
- */
-(function ($) {
- var nodeInterface = ["getChildren","getChildrenCount","getAttr","getName","getProps"],
- validateInterface = function(obj, inter) {
- var valid = true;
- obj = obj || {};
- inter = [].concat(inter);
- $.each(inter, function (i, v) {
- if(!$.isFunction(obj[v])) { valid = false; return false; }
- });
- return valid;
- };
- $.jstree.plugin("model", {
- __init : function () {
- if(!this.data.json_data) { throw "jsTree model: jsTree json_data plugin not included."; }
- this._get_settings().json_data.data = function (n, b) {
- var obj = (n == -1) ? this._get_settings().model.object : n.data("jstree_model");
- if(!validateInterface(obj, nodeInterface)) { return b.call(null, false); }
- if(this._get_settings().model.async) {
- obj.getChildren($.proxy(function (data) {
- this.model_done(data, b);
- }, this));
- }
- else {
- this.model_done(obj.getChildren(), b);
- }
- };
- },
- defaults : {
- object : false,
- id_prefix : false,
- async : false
- },
- _fn : {
- model_done : function (data, callback) {
- var ret = [],
- s = this._get_settings(),
- _this = this;
-
- if(!$.isArray(data)) { data = [data]; }
- $.each(data, function (i, nd) {
- var r = nd.getProps() || {};
- r.attr = nd.getAttr() || {};
- if(nd.getChildrenCount()) { r.state = "closed"; }
- r.data = nd.getName();
- if(!$.isArray(r.data)) { r.data = [r.data]; }
- if(_this.data.types && $.isFunction(nd.getType)) {
- r.attr[s.types.type_attr] = nd.getType();
- }
- if(r.attr.id && s.model.id_prefix) { r.attr.id = s.model.id_prefix + r.attr.id; }
- if(!r.metadata) { r.metadata = { }; }
- r.metadata.jstree_model = nd;
- ret.push(r);
- });
- callback.call(null, ret);
- }
- }
- });
-})(jQuery);
-//*/
-
-})();
diff --git a/backend/vendor/assets/javascripts/js.cookie.js b/backend/vendor/assets/javascripts/js.cookie.js
deleted file mode 100644
index 80a755124a..0000000000
--- a/backend/vendor/assets/javascripts/js.cookie.js
+++ /dev/null
@@ -1,163 +0,0 @@
-/*!
- * JavaScript Cookie v2.2.1
- * https://github.com/js-cookie/js-cookie
- *
- * Copyright 2006, 2015 Klaus Hartl & Fagner Brack
- * Released under the MIT license
- */
-;(function (factory) {
- var registeredInModuleLoader;
- if (typeof define === 'function' && define.amd) {
- define(factory);
- registeredInModuleLoader = true;
- }
- if (typeof exports === 'object') {
- module.exports = factory();
- registeredInModuleLoader = true;
- }
- if (!registeredInModuleLoader) {
- var OldCookies = window.Cookies;
- var api = window.Cookies = factory();
- api.noConflict = function () {
- window.Cookies = OldCookies;
- return api;
- };
- }
-}(function () {
- function extend () {
- var i = 0;
- var result = {};
- for (; i < arguments.length; i++) {
- var attributes = arguments[ i ];
- for (var key in attributes) {
- result[key] = attributes[key];
- }
- }
- return result;
- }
-
- function decode (s) {
- return s.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent);
- }
-
- function init (converter) {
- function api() {}
-
- function set (key, value, attributes) {
- if (typeof document === 'undefined') {
- return;
- }
-
- attributes = extend({
- path: '/'
- }, api.defaults, attributes);
-
- if (typeof attributes.expires === 'number') {
- attributes.expires = new Date(new Date() * 1 + attributes.expires * 864e+5);
- }
-
- // We're using "expires" because "max-age" is not supported by IE
- attributes.expires = attributes.expires ? attributes.expires.toUTCString() : '';
-
- try {
- var result = JSON.stringify(value);
- if (/^[\{\[]/.test(result)) {
- value = result;
- }
- } catch (e) {}
-
- value = converter.write ?
- converter.write(value, key) :
- encodeURIComponent(String(value))
- .replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);
-
- key = encodeURIComponent(String(key))
- .replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent)
- .replace(/[\(\)]/g, escape);
-
- var stringifiedAttributes = '';
- for (var attributeName in attributes) {
- if (!attributes[attributeName]) {
- continue;
- }
- stringifiedAttributes += '; ' + attributeName;
- if (attributes[attributeName] === true) {
- continue;
- }
-
- // Considers RFC 6265 section 5.2:
- // ...
- // 3. If the remaining unparsed-attributes contains a %x3B (";")
- // character:
- // Consume the characters of the unparsed-attributes up to,
- // not including, the first %x3B (";") character.
- // ...
- stringifiedAttributes += '=' + attributes[attributeName].split(';')[0];
- }
-
- return (document.cookie = key + '=' + value + stringifiedAttributes);
- }
-
- function get (key, json) {
- if (typeof document === 'undefined') {
- return;
- }
-
- var jar = {};
- // To prevent the for loop in the first place assign an empty array
- // in case there are no cookies at all.
- var cookies = document.cookie ? document.cookie.split('; ') : [];
- var i = 0;
-
- for (; i < cookies.length; i++) {
- var parts = cookies[i].split('=');
- var cookie = parts.slice(1).join('=');
-
- if (!json && cookie.charAt(0) === '"') {
- cookie = cookie.slice(1, -1);
- }
-
- try {
- var name = decode(parts[0]);
- cookie = (converter.read || converter)(cookie, name) ||
- decode(cookie);
-
- if (json) {
- try {
- cookie = JSON.parse(cookie);
- } catch (e) {}
- }
-
- jar[name] = cookie;
-
- if (key === name) {
- break;
- }
- } catch (e) {}
- }
-
- return key ? jar[key] : jar;
- }
-
- api.set = set;
- api.get = function (key) {
- return get(key, false /* read as raw */);
- };
- api.getJSON = function (key) {
- return get(key, true /* read as json */);
- };
- api.remove = function (key, attributes) {
- set(key, '', extend(attributes, {
- expires: -1
- }));
- };
-
- api.defaults = {};
-
- api.withConverter = init;
-
- return api;
- }
-
- return init(function () {});
-}));
diff --git a/backend/vendor/assets/javascripts/jsonapi-serializer.min.js b/backend/vendor/assets/javascripts/jsonapi-serializer.min.js
deleted file mode 100644
index 7ffcbd64cd..0000000000
--- a/backend/vendor/assets/javascripts/jsonapi-serializer.min.js
+++ /dev/null
@@ -1,8 +0,0 @@
-/*!
- * JSON API Serializer 3.6.7
- * https://github.com/SeyZ/jsonapi-serializer
- *
- * Copyright (c) 2015 Sandro Munda
- * Released under the MIT license
- */
-require=function(){return function e(t,r,n){function i(o,s){if(!r[o]){if(!t[o]){var u="function"==typeof require&&require;if(!s&&u)return u(o,!0);if(a)return a(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var l=r[o]={exports:{}};t[o][0].call(l.exports,function(e){return i(t[o][1][e]||e)},l,l.exports,e,t,r,n)}return r[o].exports}for(var a="function"==typeof require&&require,o=0;o<n.length;o++)i(n[o]);return i}}()({1:[function(e,t,r){"use strict";var n=e("lodash/isPlainObject"),i=e("lodash/isFunction"),a=e("lodash/find"),o=e("lodash/extend"),s=e("lodash/transform"),u=e("./inflector");t.exports=function(e,t,r){function c(e){return Array.isArray(e)||n(e)}function l(e){return n(e)?s(e,function(e,t,r){c(t)?e[l(r)]=l(t):e[l(r)]=t}):Array.isArray(e)?e.map(function(e){return c(e)?l(e):e}):i(r.keyForAttribute)?r.keyForAttribute(e):u.caserize(e,r)}function f(e){var t=l(e.attributes||{});return"id"in e&&(t[r.id||"id"]=e.id),r.typeAsAttribute&&"type"in e&&(t.type=e.type),"meta"in e&&(t.meta=l(e.meta||{})),t}function p(e,t){if(e.relationships){var r={};return Promise.all(Object.keys(e.relationships).map(function(n){var i=e.relationships[n];if(null!==i.data)return Array.isArray(i.data)?Promise.all(i.data.map(function(e){return _(e,t)})).then(function(e){e&&(r[l(n)]=e)}):_(i.data,t).then(function(e){e&&(r[l(n)]=e)});r[l(n)]=null})).then(function(){return r})}}function _(t,n){return function(t,r){return new Promise(function(n){e.included&&t||n(null);var i=a(e.included,{id:t.id,type:t.type});return i?r.indexOf(i.type)>-1?Promise.all([f(i)]).then(function(e){var t=e[0],r=e[1];n(o(t,r))}):Promise.all([f(i),p(i,r+":"+i.type+i.id)]).then(function(e){var t=e[0],r=e[1];n(o(t,r))}):n(null)})}(t,n).then(function(e){var n=function(e,t){return r&&e&&r[e.type]?(0,r[e.type].valueForRelationship)(e,t):t}(t,e);return n&&i(n.then)?n.then(function(e){return e}):n})}this.perform=function(){return Promise.all([f(t),p(t,t.type+t.id)]).then(function(t){var n=t[0],i=t[1],a=o(n,i);return e.links&&(a.links=e.links),r&&r.transform&&(a=r.transform(a)),a})}}},{"./inflector":5,"lodash/extend":158,"lodash/find":159,"lodash/isFunction":171,"lodash/isPlainObject":176,"lodash/transform":195}],2:[function(e,t,r){"use strict";var n=e("lodash/isFunction"),i=e("./deserializer-utils");t.exports=function(e){e||(e={}),this.deserialize=function(t,r){return Array.isArray(t.data)?Promise.all(t.data.map(function(r){return new i(t,r,e).perform()})).then(function(e){return n(r)&&r(null,e),e}):new i(t,t.data,e).perform().then(function(e){return n(r)&&r(null,e),e})}}},{"./deserializer-utils":1,"lodash/isFunction":171}],3:[function(e,t,r){"use strict";t.exports=function(e){var t={errors:[]};return e.forEach(function(e){var r={};e.id&&(r.id=e.id),e.status&&(r.status=e.status),e.code&&(r.code=e.code),e.title&&(r.title=e.title),e.detail&&(r.detail=e.detail),e.source&&(r.source={},e.source.pointer&&(r.source.pointer=e.source.pointer),e.source.parameter&&(r.source.parameter=e.source.parameter)),e.links&&(r.links={about:e.links.about}),e.meta&&(r.meta=e.meta),t.errors.push(r)}),t}},{}],4:[function(e,t,r){"use strict";var n=e("./error-utils");t.exports=function(e){return e||(e=[]),Array.isArray(e)?new n(e):new n([e])}},{"./error-utils":3}],5:[function(e,t,r){"use strict";var n=e("inflected");t.exports={caserize:function(e,t){switch(e=n.underscore(e),t.keyForAttribute){case"dash-case":case"lisp-case":case"spinal-case":case"kebab-case":return n.dasherize(e);case"underscore_case":case"snake_case":return e;case"CamelCase":return n.camelize(e);case"camelCase":return n.camelize(e,!1);default:return n.dasherize(e)}},pluralize:function(e){return n.pluralize(e)}}},{inflected:8}],6:[function(e,t,r){"use strict";var n=e("lodash/isPlainObject"),i=e("lodash/isFunction"),a=e("lodash/find"),o=e("lodash/merge"),s=e("lodash/identity"),u=e("lodash/transform"),c=e("lodash/mapValues"),l=e("lodash/mapKeys"),f=e("lodash/pick"),p=e("lodash/pickBy"),_=(e("lodash/keys"),e("lodash/each")),h=e("lodash/isNil"),y=e("./inflector");t.exports=function(e,t,r,v){function b(e){return Array.isArray(e)||n(e)}function d(e){return n(e)?u(e,function(e,t,r){b(t)?e[d(r)]=d(t):e[d(r)]=t}):Array.isArray(e)?e.map(function(e){return b(e)?d(e):e}):i(v.keyForAttribute)?v.keyForAttribute(e):y.caserize(e,v)}function g(){return v.id||"id"}function x(e,t){var r;return t=t||{},i(v.typeForAttribute)&&(r=v.typeForAttribute(e,t)),void 0!==v.pluralizeType&&!v.pluralizeType||void 0!==r||(r=y.pluralize(e)),void 0===r&&(r=e),r}function m(e,r,n){return c(r,function(r){return i(r)?r(t,e,n):r})}function A(e,r){return i(r)?r(t):c(r,function(r){return i(r)?r(t,e):r})}function j(e,t){return l(f(e,t),function(e,t){return d(t)})}function O(e,t){var n,i=(n=t,a(r.included,{id:n.id,type:n.type}));i?(i.relationships=o(i.relationships,p(t.relationships,s)),i.attributes=o(i.attributes,p(t.attributes,s))):(e.included||(e.included=[]),e.included.push(t))}this.serialize=function(e,t,r,i){var a=this,o=null;if(i&&i.ref){if(e.relationships||(e.relationships={}),o=Array.isArray(t[r])?t[r].map(function(e){return a.serializeRef(e,t,r,i)}):a.serializeRef(t[r],t,r,i),e.relationships[d(r)]={},i.ignoreRelationshipData||(e.relationships[d(r)].data=o),i.relationshipLinks){var s=m(t[r],i.relationshipLinks,e);s.related&&(e.relationships[d(r)].links=s)}i.relationshipMeta&&(e.relationships[d(r)].meta=A(t[r],i.relationshipMeta))}else Array.isArray(t[r])?(o=t[r].length&&n(t[r][0])?t[r].map(function(e){return a.serializeNested(e,t,r,i)}):t[r],e.attributes[d(r)]=o):n(t[r])?(o=a.serializeNested(t[r],t,r,i),e.attributes[d(r)]=o):e.attributes[d(r)]=t[r]},this.serializeRef=function(e,t,n,a){var o=this,s=function(e,t,r){if(i(r.ref))return r.ref(e,t);if(!0===r.ref){if(Array.isArray(t))return t.map(function(e){return String(e)});if(t)return String(t)}else if(t&&t[r.ref])return String(t[r.ref])}(t,e,a),u=x(n,e),c=[],l=[];a.attributes&&(e&&a.attributes.forEach(function(t){a[t]&&!e[t]&&a[t].nullIfMissing&&(e[t]=null)}),c=a.attributes.filter(function(e){return a[e]}),l=a.attributes.filter(function(e){return!a[e]}));var f={type:u,id:s};return l&&(f.attributes=j(e,l)),c.forEach(function(t){e&&(b(e[t])||null===e[t])&&o.serialize(f,e,t,a[t])}),l.length&&(void 0===a.included||a.included)&&(a.includedLinks&&(f.links=m(e,a.includedLinks)),void 0!==s&&O(r,f)),void 0!==s?{type:u,id:s}:null},this.serializeNested=function(e,t,r,n){var i=this,a=[],o=[],s={};return n&&n.attributes?(a=n.attributes.filter(function(e){return n[e]}),(o=n.attributes.filter(function(e){return!n[e]}))&&(s.attributes=j(e,o)),a.forEach(function(t){b(e[t])&&i.serialize(s,e,t,n[t])})):s.attributes=e,s.attributes},this.perform=function(){var r=this;if(null===t)return null;v&&v.transform&&(t=v.transform(t));var n={type:x(e,t)};return h(t[g()])||(n.id=String(t[g()])),v.dataLinks&&(n.links=m(t,v.dataLinks)),v.dataMeta&&(n.meta=A(t,v.dataMeta)),_(v.attributes,function(e){var i=e.split(":");if(v[e]&&!t[e]&&v[e].nullIfMissing&&(t[e]=null),i[0]in t){n.attributes||(n.attributes={});var a=e;i.length>1&&(e=i[0],a=i[1]),r.serialize(n,t,e,v[a])}}),n}}},{"./inflector":5,"lodash/each":156,"lodash/find":159,"lodash/identity":165,"lodash/isFunction":171,"lodash/isNil":173,"lodash/isPlainObject":176,"lodash/keys":179,"lodash/mapKeys":181,"lodash/mapValues":182,"lodash/merge":184,"lodash/pick":185,"lodash/pickBy":186,"lodash/transform":195}],7:[function(e,t,r){"use strict";var n=e("lodash/isFunction"),i=e("lodash/mapValues"),a=e("./serializer-utils");t.exports=function(e,t,r){if(this.serialize=function(e){var t,r=this,o={};return r.opts.topLevelLinks&&(o.links=(t=r.opts.topLevelLinks,i(t,function(t){return n(t)?t(e):t}))),r.opts.meta&&(o.meta=i(r.opts.meta,function(t){return n(t)?t(e):t})),Array.isArray(e)?(o.data=[],e.forEach(function(e){var t=new a(r.collectionName,e,o,r.opts);o.data.push(t.perform())}),o):(o.data=new a(r.collectionName,e,o,r.opts).perform(e),o)},3===arguments.length)return this.collectionName=e,this.opts=r,this.serialize(t);this.collectionName=e,this.opts=t}},{"./serializer-utils":6,"lodash/isFunction":171,"lodash/mapValues":182}],8:[function(e,t,r){"use strict";t.exports=e("./lib/Inflector")},{"./lib/Inflector":10}],9:[function(e,t,r){(function(r,n){"use strict";var i=e("./hasProp"),a=e("./remove"),o=e("./icPart");function s(){this.plurals=[],this.singulars=[],this.uncountables=[],this.humans=[],this.acronyms={},this.acronymRegex=/(?=a)b/}s.getInstance=function(e){var t=void 0!==r?r:n;return t.__Inflector_Inflections=t.__Inflector_Inflections||{},t.__Inflector_Inflections[e]=t.__Inflector_Inflections[e]||new s,t.__Inflector_Inflections[e]},s.prototype.acronym=function(e){this.acronyms[e.toLowerCase()]=e;var t=[];for(var r in this.acronyms)i(this.acronyms,r)&&t.push(this.acronyms[r]);this.acronymRegex=new RegExp(t.join("|"))},s.prototype.plural=function(e,t){"string"==typeof e&&a(this.uncountables,e),a(this.uncountables,t),this.plurals.unshift([e,t])},s.prototype.singular=function(e,t){"string"==typeof e&&a(this.uncountables,e),a(this.uncountables,t),this.singulars.unshift([e,t])},s.prototype.irregular=function(e,t){a(this.uncountables,e),a(this.uncountables,t);var r=e[0],n=e.substr(1),i=t[0],s=t.substr(1);if(r.toUpperCase()===i.toUpperCase())this.plural(new RegExp("("+r+")"+n+"$","i"),"$1"+s),this.plural(new RegExp("("+i+")"+s+"$","i"),"$1"+s),this.singular(new RegExp("("+r+")"+n+"$","i"),"$1"+n),this.singular(new RegExp("("+i+")"+s+"$","i"),"$1"+n);else{var u=o(n),c=o(s);this.plural(new RegExp(r.toUpperCase()+u+"$"),i.toUpperCase()+s),this.plural(new RegExp(r.toLowerCase()+u+"$"),i.toLowerCase()+s),this.plural(new RegExp(i.toUpperCase()+c+"$"),i.toUpperCase()+s),this.plural(new RegExp(i.toLowerCase()+c+"$"),i.toLowerCase()+s),this.singular(new RegExp(r.toUpperCase()+u+"$"),r.toUpperCase()+n),this.singular(new RegExp(r.toLowerCase()+u+"$"),r.toLowerCase()+n),this.singular(new RegExp(i.toUpperCase()+c+"$"),r.toUpperCase()+n),this.singular(new RegExp(i.toLowerCase()+c+"$"),r.toLowerCase()+n)}},s.prototype.uncountable=function(){var e=Array.prototype.slice.call(arguments,0);this.uncountables=this.uncountables.concat(e)},s.prototype.human=function(e,t){this.humans.unshift([e,t])},s.prototype.clear=function(e){"all"===(e=e||"all")?(this.plurals=[],this.singulars=[],this.uncountables=[],this.humans=[]):this[e]=[]},t.exports=s}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./hasProp":14,"./icPart":15,"./remove":17,_process:196}],10:[function(e,t,r){"use strict";var n=e("./Inflections"),i=e("./Transliterator"),a=e("./Methods"),o=e("./defaults"),s=e("./isFunc"),u=a;for(var c in u.inflections=function(e,t){if(s(e)&&(t=e,e=null),e=e||"en",!t)return n.getInstance(e);t(n.getInstance(e))},u.transliterations=function(e,t){if(s(e)&&(t=e,e=null),e=e||"en",!t)return i.getInstance(e);t(i.getInstance(e))},o)u.inflections(c,o[c]);t.exports=u},{"./Inflections":9,"./Methods":11,"./Transliterator":12,"./defaults":13,"./isFunc":16}],11:[function(e,t,r){"use strict";var n={pluralize:function(e,t){return t=t||"en",this._applyInflections(e,this.inflections(t).plurals)},singularize:function(e,t){return t=t||"en",this._applyInflections(e,this.inflections(t).singulars)},camelize:function(e,t){null==t&&(t=!0);var r=""+e,n=this;return r=(r=t?r.replace(/^[a-z\d]*/,function(e){return n.inflections().acronyms[e]||n.capitalize(e)}):r.replace(new RegExp("^(?:"+this.inflections().acronymRegex.source+"(?=\\b|[A-Z_])|\\w)"),function(e){return e.toLowerCase()})).replace(/(?:_|(\/))([a-z\d]*)/gi,function(e,t,r,i,a){return t||(t=""),""+t+(n.inflections().acronyms[r]||n.capitalize(r))})},underscore:function(e){var t=""+e;return(t=(t=(t=(t=t.replace(new RegExp("(?:([A-Za-z\\d])|^)("+this.inflections().acronymRegex.source+")(?=\\b|[^a-z])","g"),function(e,t,r){return(t||"")+(t?"_":"")+r.toLowerCase()})).replace(/([A-Z\d]+)([A-Z][a-z])/g,"$1_$2")).replace(/([a-z\d])([A-Z])/g,"$1_$2")).replace(/-/g,"_")).toLowerCase()},humanize:function(e,t){var r,n,i,a=""+e,o=this.inflections().humans,s=this;null!==(t=t||{}).capitalize&&void 0!==t.capitalize||(t.capitalize=!0);for(var u=0,c=o.length;u<c;u++)if(n=(r=o[u])[0],i=r[1],n.test&&n.test(a)||a.indexOf(n)>-1){a=a.replace(n,i);break}return a=(a=(a=a.replace(/_id$/,"")).replace(/_/g," ")).replace(/([a-z\d]*)/gi,function(e){return s.inflections().acronyms[e]||e.toLowerCase()}),t.capitalize&&(a=a.replace(/^\w/,function(e){return e.toUpperCase()})),a},capitalize:function(e){var t=null==e?"":String(e);return t.charAt(0).toUpperCase()+t.slice(1)},titleize:function(e){return this.humanize(this.underscore(e)).replace(/(^|[\s¿\/]+)([a-z])/g,function(e,t,r,n,i){return e.replace(r,r.toUpperCase())})},tableize:function(e){return this.pluralize(this.underscore(e))},classify:function(e){return this.camelize(this.singularize(e.replace(/.*\./g,"")))},dasherize:function(e){return e.replace(/_/g,"-")},foreignKey:function(e,t){return null==t&&(t=!0),this.underscore(e)+(t?"_id":"id")},ordinal:function(e){var t=Math.abs(Number(e)),r=t%100;if(11===r||12===r||13===r)return"th";switch(t%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},ordinalize:function(e){return""+e+this.ordinal(e)},transliterate:function(e,t){var r=(t=t||{}).locale||"en",n=t.replacement||"?";return this.transliterations(r).transliterate(e,n)},parameterize:function(e,t){void 0===(t=t||{}).separator&&(t.separator="-"),null===t.separator&&(t.separator="");var r=this.transliterate(e,t);if(r=r.replace(/[^a-z0-9\-_]+/gi,t.separator),t.separator.length){var n=new RegExp(t.separator);r=(r=r.replace(new RegExp(n.source+"{2,}"),t.separator)).replace(new RegExp("^"+n.source+"|"+n.source+"$","i"),"")}return r.toLowerCase()},_applyInflections:function(e,t){var r,n,i,a=""+e;if(0===a.length)return a;var o=a.toLowerCase().match(/\b\w+$/);if(o&&this.inflections().uncountables.indexOf(o[0])>-1)return a;for(var s=0,u=t.length;s<u;s++)if(n=(r=t[s])[0],i=r[1],a.match(n)){a=a.replace(n,i);break}return a}};t.exports=n},{}],12:[function(e,t,r){(function(e,r){"use strict";var n={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Æ":"AE","Ç":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","×":"x","Ø":"O","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ý":"Y","Þ":"Th","ß":"ss","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","æ":"ae","ç":"c","è":"e","é":"e","ê":"e","ë":"e","ì":"i","í":"i","î":"i","ï":"i","ð":"d","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","ù":"u","ú":"u","û":"u","ü":"u","ý":"y","þ":"th","ÿ":"y","Ā":"A","ā":"a","Ă":"A","ă":"a","Ą":"A","ą":"a","Ć":"C","ć":"c","Ĉ":"C","ĉ":"c","Ċ":"C","ċ":"c","Č":"C","č":"c","Ď":"D","ď":"d","Đ":"D","đ":"d","Ē":"E","ē":"e","Ĕ":"E","ĕ":"e","Ė":"E","ė":"e","Ę":"E","ę":"e","Ě":"E","ě":"e","Ĝ":"G","ĝ":"g","Ğ":"G","ğ":"g","Ġ":"G","ġ":"g","Ģ":"G","ģ":"g","Ĥ":"H","ĥ":"h","Ħ":"H","ħ":"h","Ĩ":"I","ĩ":"i","Ī":"I","ī":"i","Ĭ":"I","ĭ":"i","Į":"I","į":"i","İ":"I","ı":"i","IJ":"IJ","ij":"ij","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","ĺ":"l","Ļ":"L","ļ":"l","Ľ":"L","ľ":"l","Ŀ":"L","ŀ":"l","Ł":"L","ł":"l","Ń":"N","ń":"n","Ņ":"N","ņ":"n","Ň":"N","ň":"n","ʼn":"'n","Ŋ":"NG","ŋ":"ng","Ō":"O","ō":"o","Ŏ":"O","ŏ":"o","Ő":"O","ő":"o","Œ":"OE","œ":"oe","Ŕ":"R","ŕ":"r","Ŗ":"R","ŗ":"r","Ř":"R","ř":"r","Ś":"S","ś":"s","Ŝ":"S","ŝ":"s","Ş":"S","ş":"s","Š":"S","š":"s","Ţ":"T","ţ":"t","Ť":"T","ť":"t","Ŧ":"T","ŧ":"t","Ũ":"U","ũ":"u","Ū":"U","ū":"u","Ŭ":"U","ŭ":"u","Ů":"U","ů":"u","Ű":"U","ű":"u","Ų":"U","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","ź":"z","Ż":"Z","ż":"z","Ž":"Z","ž":"z"};function i(){for(var e in this.approximations={},n)this.approximate(e,n[e])}i.getInstance=function(t){var n=void 0!==e?e:r;return n.__Inflector_Transliterator=n.__Inflector_Transliterator||{},n.__Inflector_Transliterator[t]=n.__Inflector_Transliterator[t]||new i,n.__Inflector_Transliterator[t]},i.prototype.approximate=function(e,t){this.approximations[e]=t},i.prototype.transliterate=function(e,t){var r=this;return e.replace(/[^\u0000-\u007f]/g,function(e){return r.approximations[e]||t||"?"})},t.exports=i}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:196}],13:[function(e,t,r){"use strict";t.exports={en:function(e){e.plural(/$/,"s"),e.plural(/s$/i,"s"),e.plural(/^(ax|test)is$/i,"$1es"),e.plural(/(octop|vir)us$/i,"$1i"),e.plural(/(octop|vir)i$/i,"$1i"),e.plural(/(alias|status)$/i,"$1es"),e.plural(/(bu)s$/i,"$1ses"),e.plural(/(buffal|tomat)o$/i,"$1oes"),e.plural(/([ti])um$/i,"$1a"),e.plural(/([ti])a$/i,"$1a"),e.plural(/sis$/i,"ses"),e.plural(/(?:([^f])fe|([lr])f)$/i,"$1$2ves"),e.plural(/(hive)$/i,"$1s"),e.plural(/([^aeiouy]|qu)y$/i,"$1ies"),e.plural(/(x|ch|ss|sh)$/i,"$1es"),e.plural(/(matr|vert|ind)(?:ix|ex)$/i,"$1ices"),e.plural(/^(m|l)ouse$/i,"$1ice"),e.plural(/^(m|l)ice$/i,"$1ice"),e.plural(/^(ox)$/i,"$1en"),e.plural(/^(oxen)$/i,"$1"),e.plural(/(quiz)$/i,"$1zes"),e.singular(/s$/i,""),e.singular(/(ss)$/i,"$1"),e.singular(/(n)ews$/i,"$1ews"),e.singular(/([ti])a$/i,"$1um"),e.singular(/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)(sis|ses)$/i,"$1sis"),e.singular(/(^analy)(sis|ses)$/i,"$1sis"),e.singular(/([^f])ves$/i,"$1fe"),e.singular(/(hive)s$/i,"$1"),e.singular(/(tive)s$/i,"$1"),e.singular(/([lr])ves$/i,"$1f"),e.singular(/([^aeiouy]|qu)ies$/i,"$1y"),e.singular(/(s)eries$/i,"$1eries"),e.singular(/(m)ovies$/i,"$1ovie"),e.singular(/(x|ch|ss|sh)es$/i,"$1"),e.singular(/^(m|l)ice$/i,"$1ouse"),e.singular(/(bus)(es)?$/i,"$1"),e.singular(/(o)es$/i,"$1"),e.singular(/(shoe)s$/i,"$1"),e.singular(/(cris|test)(is|es)$/i,"$1is"),e.singular(/^(a)x[ie]s$/i,"$1xis"),e.singular(/(octop|vir)(us|i)$/i,"$1us"),e.singular(/(alias|status)(es)?$/i,"$1"),e.singular(/^(ox)en/i,"$1"),e.singular(/(vert|ind)ices$/i,"$1ex"),e.singular(/(matr)ices$/i,"$1ix"),e.singular(/(quiz)zes$/i,"$1"),e.singular(/(database)s$/i,"$1"),e.irregular("person","people"),e.irregular("man","men"),e.irregular("child","children"),e.irregular("sex","sexes"),e.irregular("move","moves"),e.irregular("zombie","zombies"),e.uncountable("equipment","information","rice","money","species","series","fish","sheep","jeans","police")}}},{}],14:[function(e,t,r){"use strict";var n=Object.prototype.hasOwnProperty;t.exports=function(e,t){return n.call(e,t)}},{}],15:[function(e,t,r){"use strict";t.exports=function(e){return e.split("").map(function(e){return"(?:"+[e.toUpperCase(),e.toLowerCase()].join("|")+")"}).join("")}},{}],16:[function(e,t,r){"use strict";var n=Object.prototype.toString;t.exports=function(e){return"[object Function]"===n.call(e)}},{}],17:[function(e,t,r){"use strict";var n=Array.prototype.splice;t.exports=function(e,t){for(var r=e.length-1;r>=0;r--)e[r]===t&&n.call(e,r,1)}},{}],18:[function(e,t,r){var n=e("./_getNative")(e("./_root"),"DataView");t.exports=n},{"./_getNative":97,"./_root":139}],19:[function(e,t,r){var n=e("./_hashClear"),i=e("./_hashDelete"),a=e("./_hashGet"),o=e("./_hashHas"),s=e("./_hashSet");function u(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=i,u.prototype.get=a,u.prototype.has=o,u.prototype.set=s,t.exports=u},{"./_hashClear":105,"./_hashDelete":106,"./_hashGet":107,"./_hashHas":108,"./_hashSet":109}],20:[function(e,t,r){var n=e("./_listCacheClear"),i=e("./_listCacheDelete"),a=e("./_listCacheGet"),o=e("./_listCacheHas"),s=e("./_listCacheSet");function u(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=i,u.prototype.get=a,u.prototype.has=o,u.prototype.set=s,t.exports=u},{"./_listCacheClear":119,"./_listCacheDelete":120,"./_listCacheGet":121,"./_listCacheHas":122,"./_listCacheSet":123}],21:[function(e,t,r){var n=e("./_getNative")(e("./_root"),"Map");t.exports=n},{"./_getNative":97,"./_root":139}],22:[function(e,t,r){var n=e("./_mapCacheClear"),i=e("./_mapCacheDelete"),a=e("./_mapCacheGet"),o=e("./_mapCacheHas"),s=e("./_mapCacheSet");function u(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=i,u.prototype.get=a,u.prototype.has=o,u.prototype.set=s,t.exports=u},{"./_mapCacheClear":124,"./_mapCacheDelete":125,"./_mapCacheGet":126,"./_mapCacheHas":127,"./_mapCacheSet":128}],23:[function(e,t,r){var n=e("./_getNative")(e("./_root"),"Promise");t.exports=n},{"./_getNative":97,"./_root":139}],24:[function(e,t,r){var n=e("./_getNative")(e("./_root"),"Set");t.exports=n},{"./_getNative":97,"./_root":139}],25:[function(e,t,r){var n=e("./_MapCache"),i=e("./_setCacheAdd"),a=e("./_setCacheHas");function o(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new n;++t<r;)this.add(e[t])}o.prototype.add=o.prototype.push=i,o.prototype.has=a,t.exports=o},{"./_MapCache":22,"./_setCacheAdd":141,"./_setCacheHas":142}],26:[function(e,t,r){var n=e("./_ListCache"),i=e("./_stackClear"),a=e("./_stackDelete"),o=e("./_stackGet"),s=e("./_stackHas"),u=e("./_stackSet");function c(e){var t=this.__data__=new n(e);this.size=t.size}c.prototype.clear=i,c.prototype.delete=a,c.prototype.get=o,c.prototype.has=s,c.prototype.set=u,t.exports=c},{"./_ListCache":20,"./_stackClear":146,"./_stackDelete":147,"./_stackGet":148,"./_stackHas":149,"./_stackSet":150}],27:[function(e,t,r){var n=e("./_root").Symbol;t.exports=n},{"./_root":139}],28:[function(e,t,r){var n=e("./_root").Uint8Array;t.exports=n},{"./_root":139}],29:[function(e,t,r){var n=e("./_getNative")(e("./_root"),"WeakMap");t.exports=n},{"./_getNative":97,"./_root":139}],30:[function(e,t,r){t.exports=function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}},{}],31:[function(e,t,r){t.exports=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}},{}],32:[function(e,t,r){t.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,i=0,a=[];++r<n;){var o=e[r];t(o,r,e)&&(a[i++]=o)}return a}},{}],33:[function(e,t,r){var n=e("./_baseTimes"),i=e("./isArguments"),a=e("./isArray"),o=e("./isBuffer"),s=e("./_isIndex"),u=e("./isTypedArray"),c=Object.prototype.hasOwnProperty;t.exports=function(e,t){var r=a(e),l=!r&&i(e),f=!r&&!l&&o(e),p=!r&&!l&&!f&&u(e),_=r||l||f||p,h=_?n(e.length,String):[],y=h.length;for(var v in e)!t&&!c.call(e,v)||_&&("length"==v||f&&("offset"==v||"parent"==v)||p&&("buffer"==v||"byteLength"==v||"byteOffset"==v)||s(v,y))||h.push(v);return h}},{"./_baseTimes":71,"./_isIndex":112,"./isArguments":166,"./isArray":167,"./isBuffer":170,"./isTypedArray":178}],34:[function(e,t,r){t.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}},{}],35:[function(e,t,r){t.exports=function(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}},{}],36:[function(e,t,r){t.exports=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}},{}],37:[function(e,t,r){var n=e("./_baseAssignValue"),i=e("./eq");t.exports=function(e,t,r){(void 0===r||i(e[t],r))&&(void 0!==r||t in e)||n(e,t,r)}},{"./_baseAssignValue":40,"./eq":157}],38:[function(e,t,r){var n=e("./_baseAssignValue"),i=e("./eq"),a=Object.prototype.hasOwnProperty;t.exports=function(e,t,r){var o=e[t];a.call(e,t)&&i(o,r)&&(void 0!==r||t in e)||n(e,t,r)}},{"./_baseAssignValue":40,"./eq":157}],39:[function(e,t,r){var n=e("./eq");t.exports=function(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}},{"./eq":157}],40:[function(e,t,r){var n=e("./_defineProperty");t.exports=function(e,t,r){"__proto__"==t&&n?n(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}},{"./_defineProperty":87}],41:[function(e,t,r){var n=e("./isObject"),i=Object.create,a=function(){function e(){}return function(t){if(!n(t))return{};if(i)return i(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();t.exports=a},{"./isObject":174}],42:[function(e,t,r){var n=e("./_baseForOwn"),i=e("./_createBaseEach")(n);t.exports=i},{"./_baseForOwn":46,"./_createBaseEach":84}],43:[function(e,t,r){t.exports=function(e,t,r,n){for(var i=e.length,a=r+(n?1:-1);n?a--:++a<i;)if(t(e[a],a,e))return a;return-1}},{}],44:[function(e,t,r){var n=e("./_arrayPush"),i=e("./_isFlattenable");t.exports=function e(t,r,a,o,s){var u=-1,c=t.length;for(a||(a=i),s||(s=[]);++u<c;){var l=t[u];r>0&&a(l)?r>1?e(l,r-1,a,o,s):n(s,l):o||(s[s.length]=l)}return s}},{"./_arrayPush":35,"./_isFlattenable":111}],45:[function(e,t,r){var n=e("./_createBaseFor")();t.exports=n},{"./_createBaseFor":85}],46:[function(e,t,r){var n=e("./_baseFor"),i=e("./keys");t.exports=function(e,t){return e&&n(e,t,i)}},{"./_baseFor":45,"./keys":179}],47:[function(e,t,r){var n=e("./_castPath"),i=e("./_toKey");t.exports=function(e,t){for(var r=0,a=(t=n(t,e)).length;null!=e&&r<a;)e=e[i(t[r++])];return r&&r==a?e:void 0}},{"./_castPath":76,"./_toKey":152}],48:[function(e,t,r){var n=e("./_arrayPush"),i=e("./isArray");t.exports=function(e,t,r){var a=t(e);return i(e)?a:n(a,r(e))}},{"./_arrayPush":35,"./isArray":167}],49:[function(e,t,r){var n=e("./_Symbol"),i=e("./_getRawTag"),a=e("./_objectToString"),o="[object Null]",s="[object Undefined]",u=n?n.toStringTag:void 0;t.exports=function(e){return null==e?void 0===e?s:o:u&&u in Object(e)?i(e):a(e)}},{"./_Symbol":27,"./_getRawTag":99,"./_objectToString":136}],50:[function(e,t,r){t.exports=function(e,t){return null!=e&&t in Object(e)}},{}],51:[function(e,t,r){var n=e("./_baseGetTag"),i=e("./isObjectLike"),a="[object Arguments]";t.exports=function(e){return i(e)&&n(e)==a}},{"./_baseGetTag":49,"./isObjectLike":175}],52:[function(e,t,r){var n=e("./_baseIsEqualDeep"),i=e("./isObjectLike");t.exports=function e(t,r,a,o,s){return t===r||(null==t||null==r||!i(t)&&!i(r)?t!=t&&r!=r:n(t,r,a,o,e,s))}},{"./_baseIsEqualDeep":53,"./isObjectLike":175}],53:[function(e,t,r){var n=e("./_Stack"),i=e("./_equalArrays"),a=e("./_equalByTag"),o=e("./_equalObjects"),s=e("./_getTag"),u=e("./isArray"),c=e("./isBuffer"),l=e("./isTypedArray"),f=1,p="[object Arguments]",_="[object Array]",h="[object Object]",y=Object.prototype.hasOwnProperty;t.exports=function(e,t,r,v,b,d){var g=u(e),x=u(t),m=g?_:s(e),A=x?_:s(t),j=(m=m==p?h:m)==h,O=(A=A==p?h:A)==h,w=m==A;if(w&&c(e)){if(!c(t))return!1;g=!0,j=!1}if(w&&!j)return d||(d=new n),g||l(e)?i(e,t,r,v,b,d):a(e,t,m,r,v,b,d);if(!(r&f)){var $=j&&y.call(e,"__wrapped__"),k=O&&y.call(t,"__wrapped__");if($||k){var I=$?e.value():e,C=k?t.value():t;return d||(d=new n),b(I,C,r,v,d)}}return!!w&&(d||(d=new n),o(e,t,r,v,b,d))}},{"./_Stack":26,"./_equalArrays":88,"./_equalByTag":89,"./_equalObjects":90,"./_getTag":102,"./isArray":167,"./isBuffer":170,"./isTypedArray":178}],54:[function(e,t,r){var n=e("./_Stack"),i=e("./_baseIsEqual"),a=1,o=2;t.exports=function(e,t,r,s){var u=r.length,c=u,l=!s;if(null==e)return!c;for(e=Object(e);u--;){var f=r[u];if(l&&f[2]?f[1]!==e[f[0]]:!(f[0]in e))return!1}for(;++u<c;){var p=(f=r[u])[0],_=e[p],h=f[1];if(l&&f[2]){if(void 0===_&&!(p in e))return!1}else{var y=new n;if(s)var v=s(_,h,p,e,t,y);if(!(void 0===v?i(h,_,a|o,s,y):v))return!1}}return!0}},{"./_Stack":26,"./_baseIsEqual":52}],55:[function(e,t,r){var n=e("./isFunction"),i=e("./_isMasked"),a=e("./isObject"),o=e("./_toSource"),s=/^\[object .+?Constructor\]$/,u=Function.prototype,c=Object.prototype,l=u.toString,f=c.hasOwnProperty,p=RegExp("^"+l.call(f).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(e){return!(!a(e)||i(e))&&(n(e)?p:s).test(o(e))}},{"./_isMasked":116,"./_toSource":153,"./isFunction":171,"./isObject":174}],56:[function(e,t,r){var n=e("./_baseGetTag"),i=e("./isLength"),a=e("./isObjectLike"),o={};o["[object Float32Array]"]=o["[object Float64Array]"]=o["[object Int8Array]"]=o["[object Int16Array]"]=o["[object Int32Array]"]=o["[object Uint8Array]"]=o["[object Uint8ClampedArray]"]=o["[object Uint16Array]"]=o["[object Uint32Array]"]=!0,o["[object Arguments]"]=o["[object Array]"]=o["[object ArrayBuffer]"]=o["[object Boolean]"]=o["[object DataView]"]=o["[object Date]"]=o["[object Error]"]=o["[object Function]"]=o["[object Map]"]=o["[object Number]"]=o["[object Object]"]=o["[object RegExp]"]=o["[object Set]"]=o["[object String]"]=o["[object WeakMap]"]=!1,t.exports=function(e){return a(e)&&i(e.length)&&!!o[n(e)]}},{"./_baseGetTag":49,"./isLength":172,"./isObjectLike":175}],57:[function(e,t,r){var n=e("./_baseMatches"),i=e("./_baseMatchesProperty"),a=e("./identity"),o=e("./isArray"),s=e("./property");t.exports=function(e){return"function"==typeof e?e:null==e?a:"object"==typeof e?o(e)?i(e[0],e[1]):n(e):s(e)}},{"./_baseMatches":60,"./_baseMatchesProperty":61,"./identity":165,"./isArray":167,"./property":187}],58:[function(e,t,r){var n=e("./_isPrototype"),i=e("./_nativeKeys"),a=Object.prototype.hasOwnProperty;t.exports=function(e){if(!n(e))return i(e);var t=[];for(var r in Object(e))a.call(e,r)&&"constructor"!=r&&t.push(r);return t}},{"./_isPrototype":117,"./_nativeKeys":133}],59:[function(e,t,r){var n=e("./isObject"),i=e("./_isPrototype"),a=e("./_nativeKeysIn"),o=Object.prototype.hasOwnProperty;t.exports=function(e){if(!n(e))return a(e);var t=i(e),r=[];for(var s in e)("constructor"!=s||!t&&o.call(e,s))&&r.push(s);return r}},{"./_isPrototype":117,"./_nativeKeysIn":134,"./isObject":174}],60:[function(e,t,r){var n=e("./_baseIsMatch"),i=e("./_getMatchData"),a=e("./_matchesStrictComparable");t.exports=function(e){var t=i(e);return 1==t.length&&t[0][2]?a(t[0][0],t[0][1]):function(r){return r===e||n(r,e,t)}}},{"./_baseIsMatch":54,"./_getMatchData":96,"./_matchesStrictComparable":130}],61:[function(e,t,r){var n=e("./_baseIsEqual"),i=e("./get"),a=e("./hasIn"),o=e("./_isKey"),s=e("./_isStrictComparable"),u=e("./_matchesStrictComparable"),c=e("./_toKey"),l=1,f=2;t.exports=function(e,t){return o(e)&&s(t)?u(c(e),t):function(r){var o=i(r,e);return void 0===o&&o===t?a(r,e):n(t,o,l|f)}}},{"./_baseIsEqual":52,"./_isKey":114,"./_isStrictComparable":118,"./_matchesStrictComparable":130,"./_toKey":152,"./get":163,"./hasIn":164}],62:[function(e,t,r){var n=e("./_Stack"),i=e("./_assignMergeValue"),a=e("./_baseFor"),o=e("./_baseMergeDeep"),s=e("./isObject"),u=e("./keysIn"),c=e("./_safeGet");t.exports=function e(t,r,l,f,p){t!==r&&a(r,function(a,u){if(s(a))p||(p=new n),o(t,r,u,l,e,f,p);else{var _=f?f(c(t,u),a,u+"",t,r,p):void 0;void 0===_&&(_=a),i(t,u,_)}},u)}},{"./_Stack":26,"./_assignMergeValue":37,"./_baseFor":45,"./_baseMergeDeep":63,"./_safeGet":140,"./isObject":174,"./keysIn":180}],63:[function(e,t,r){var n=e("./_assignMergeValue"),i=e("./_cloneBuffer"),a=e("./_cloneTypedArray"),o=e("./_copyArray"),s=e("./_initCloneObject"),u=e("./isArguments"),c=e("./isArray"),l=e("./isArrayLikeObject"),f=e("./isBuffer"),p=e("./isFunction"),_=e("./isObject"),h=e("./isPlainObject"),y=e("./isTypedArray"),v=e("./_safeGet"),b=e("./toPlainObject");t.exports=function(e,t,r,d,g,x,m){var A=v(e,r),j=v(t,r),O=m.get(j);if(O)n(e,r,O);else{var w=x?x(A,j,r+"",e,t,m):void 0,$=void 0===w;if($){var k=c(j),I=!k&&f(j),C=!k&&!I&&y(j);w=j,k||I||C?c(A)?w=A:l(A)?w=o(A):I?($=!1,w=i(j,!0)):C?($=!1,w=a(j,!0)):w=[]:h(j)||u(j)?(w=A,u(A)?w=b(A):_(A)&&!p(A)||(w=s(j))):$=!1}$&&(m.set(j,w),g(w,j,d,x,m),m.delete(j)),n(e,r,w)}}},{"./_assignMergeValue":37,"./_cloneBuffer":78,"./_cloneTypedArray":79,"./_copyArray":80,"./_initCloneObject":110,"./_safeGet":140,"./isArguments":166,"./isArray":167,"./isArrayLikeObject":169,"./isBuffer":170,"./isFunction":171,"./isObject":174,"./isPlainObject":176,"./isTypedArray":178,"./toPlainObject":193}],64:[function(e,t,r){var n=e("./_basePickBy"),i=e("./hasIn");t.exports=function(e,t){return n(e,t,function(t,r){return i(e,r)})}},{"./_basePickBy":65,"./hasIn":164}],65:[function(e,t,r){var n=e("./_baseGet"),i=e("./_baseSet"),a=e("./_castPath");t.exports=function(e,t,r){for(var o=-1,s=t.length,u={};++o<s;){var c=t[o],l=n(e,c);r(l,c)&&i(u,a(c,e),l)}return u}},{"./_baseGet":47,"./_baseSet":69,"./_castPath":76}],66:[function(e,t,r){t.exports=function(e){return function(t){return null==t?void 0:t[e]}}},{}],67:[function(e,t,r){var n=e("./_baseGet");t.exports=function(e){return function(t){return n(t,e)}}},{"./_baseGet":47}],68:[function(e,t,r){var n=e("./identity"),i=e("./_overRest"),a=e("./_setToString");t.exports=function(e,t){return a(i(e,t,n),e+"")}},{"./_overRest":138,"./_setToString":144,"./identity":165}],69:[function(e,t,r){var n=e("./_assignValue"),i=e("./_castPath"),a=e("./_isIndex"),o=e("./isObject"),s=e("./_toKey");t.exports=function(e,t,r,u){if(!o(e))return e;for(var c=-1,l=(t=i(t,e)).length,f=l-1,p=e;null!=p&&++c<l;){var _=s(t[c]),h=r;if(c!=f){var y=p[_];void 0===(h=u?u(y,_,p):void 0)&&(h=o(y)?y:a(t[c+1])?[]:{})}n(p,_,h),p=p[_]}return e}},{"./_assignValue":38,"./_castPath":76,"./_isIndex":112,"./_toKey":152,"./isObject":174}],70:[function(e,t,r){var n=e("./constant"),i=e("./_defineProperty"),a=e("./identity"),o=i?function(e,t){return i(e,"toString",{configurable:!0,enumerable:!1,value:n(t),writable:!0})}:a;t.exports=o},{"./_defineProperty":87,"./constant":155,"./identity":165}],71:[function(e,t,r){t.exports=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}},{}],72:[function(e,t,r){var n=e("./_Symbol"),i=e("./_arrayMap"),a=e("./isArray"),o=e("./isSymbol"),s=1/0,u=n?n.prototype:void 0,c=u?u.toString:void 0;t.exports=function e(t){if("string"==typeof t)return t;if(a(t))return i(t,e)+"";if(o(t))return c?c.call(t):"";var r=t+"";return"0"==r&&1/t==-s?"-0":r}},{"./_Symbol":27,"./_arrayMap":34,"./isArray":167,"./isSymbol":177}],73:[function(e,t,r){t.exports=function(e){return function(t){return e(t)}}},{}],74:[function(e,t,r){t.exports=function(e,t){return e.has(t)}},{}],75:[function(e,t,r){var n=e("./identity");t.exports=function(e){return"function"==typeof e?e:n}},{"./identity":165}],76:[function(e,t,r){var n=e("./isArray"),i=e("./_isKey"),a=e("./_stringToPath"),o=e("./toString");t.exports=function(e,t){return n(e)?e:i(e,t)?[e]:a(o(e))}},{"./_isKey":114,"./_stringToPath":151,"./isArray":167,"./toString":194}],77:[function(e,t,r){var n=e("./_Uint8Array");t.exports=function(e){var t=new e.constructor(e.byteLength);return new n(t).set(new n(e)),t}},{"./_Uint8Array":28}],78:[function(e,t,r){var n=e("./_root"),i="object"==typeof r&&r&&!r.nodeType&&r,a=i&&"object"==typeof t&&t&&!t.nodeType&&t,o=a&&a.exports===i?n.Buffer:void 0,s=o?o.allocUnsafe:void 0;t.exports=function(e,t){if(t)return e.slice();var r=e.length,n=s?s(r):new e.constructor(r);return e.copy(n),n}},{"./_root":139}],79:[function(e,t,r){var n=e("./_cloneArrayBuffer");t.exports=function(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}},{"./_cloneArrayBuffer":77}],80:[function(e,t,r){t.exports=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}},{}],81:[function(e,t,r){var n=e("./_assignValue"),i=e("./_baseAssignValue");t.exports=function(e,t,r,a){var o=!r;r||(r={});for(var s=-1,u=t.length;++s<u;){var c=t[s],l=a?a(r[c],e[c],c,r,e):void 0;void 0===l&&(l=e[c]),o?i(r,c,l):n(r,c,l)}return r}},{"./_assignValue":38,"./_baseAssignValue":40}],82:[function(e,t,r){var n=e("./_root")["__core-js_shared__"];t.exports=n},{"./_root":139}],83:[function(e,t,r){var n=e("./_baseRest"),i=e("./_isIterateeCall");t.exports=function(e){return n(function(t,r){var n=-1,a=r.length,o=a>1?r[a-1]:void 0,s=a>2?r[2]:void 0;for(o=e.length>3&&"function"==typeof o?(a--,o):void 0,s&&i(r[0],r[1],s)&&(o=a<3?void 0:o,a=1),t=Object(t);++n<a;){var u=r[n];u&&e(t,u,n,o)}return t})}},{"./_baseRest":68,"./_isIterateeCall":113}],84:[function(e,t,r){var n=e("./isArrayLike");t.exports=function(e,t){return function(r,i){if(null==r)return r;if(!n(r))return e(r,i);for(var a=r.length,o=t?a:-1,s=Object(r);(t?o--:++o<a)&&!1!==i(s[o],o,s););return r}}},{"./isArrayLike":168}],85:[function(e,t,r){t.exports=function(e){return function(t,r,n){for(var i=-1,a=Object(t),o=n(t),s=o.length;s--;){var u=o[e?s:++i];if(!1===r(a[u],u,a))break}return t}}},{}],86:[function(e,t,r){var n=e("./_baseIteratee"),i=e("./isArrayLike"),a=e("./keys");t.exports=function(e){return function(t,r,o){var s=Object(t);if(!i(t)){var u=n(r,3);t=a(t),r=function(e){return u(s[e],e,s)}}var c=e(t,r,o);return c>-1?s[u?t[c]:c]:void 0}}},{"./_baseIteratee":57,"./isArrayLike":168,"./keys":179}],87:[function(e,t,r){var n=e("./_getNative"),i=function(){try{var e=n(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();t.exports=i},{"./_getNative":97}],88:[function(e,t,r){var n=e("./_SetCache"),i=e("./_arraySome"),a=e("./_cacheHas"),o=1,s=2;t.exports=function(e,t,r,u,c,l){var f=r&o,p=e.length,_=t.length;if(p!=_&&!(f&&_>p))return!1;var h=l.get(e);if(h&&l.get(t))return h==t;var y=-1,v=!0,b=r&s?new n:void 0;for(l.set(e,t),l.set(t,e);++y<p;){var d=e[y],g=t[y];if(u)var x=f?u(g,d,y,t,e,l):u(d,g,y,e,t,l);if(void 0!==x){if(x)continue;v=!1;break}if(b){if(!i(t,function(e,t){if(!a(b,t)&&(d===e||c(d,e,r,u,l)))return b.push(t)})){v=!1;break}}else if(d!==g&&!c(d,g,r,u,l)){v=!1;break}}return l.delete(e),l.delete(t),v}},{"./_SetCache":25,"./_arraySome":36,"./_cacheHas":74}],89:[function(e,t,r){var n=e("./_Symbol"),i=e("./_Uint8Array"),a=e("./eq"),o=e("./_equalArrays"),s=e("./_mapToArray"),u=e("./_setToArray"),c=1,l=2,f="[object Boolean]",p="[object Date]",_="[object Error]",h="[object Map]",y="[object Number]",v="[object RegExp]",b="[object Set]",d="[object String]",g="[object Symbol]",x="[object ArrayBuffer]",m="[object DataView]",A=n?n.prototype:void 0,j=A?A.valueOf:void 0;t.exports=function(e,t,r,n,A,O,w){switch(r){case m:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case x:return!(e.byteLength!=t.byteLength||!O(new i(e),new i(t)));case f:case p:case y:return a(+e,+t);case _:return e.name==t.name&&e.message==t.message;case v:case d:return e==t+"";case h:var $=s;case b:var k=n&c;if($||($=u),e.size!=t.size&&!k)return!1;var I=w.get(e);if(I)return I==t;n|=l,w.set(e,t);var C=o($(e),$(t),n,A,O,w);return w.delete(e),C;case g:if(j)return j.call(e)==j.call(t)}return!1}},{"./_Symbol":27,"./_Uint8Array":28,"./_equalArrays":88,"./_mapToArray":129,"./_setToArray":143,"./eq":157}],90:[function(e,t,r){var n=e("./_getAllKeys"),i=1,a=Object.prototype.hasOwnProperty;t.exports=function(e,t,r,o,s,u){var c=r&i,l=n(e),f=l.length;if(f!=n(t).length&&!c)return!1;for(var p=f;p--;){var _=l[p];if(!(c?_ in t:a.call(t,_)))return!1}var h=u.get(e);if(h&&u.get(t))return h==t;var y=!0;u.set(e,t),u.set(t,e);for(var v=c;++p<f;){var b=e[_=l[p]],d=t[_];if(o)var g=c?o(d,b,_,t,e,u):o(b,d,_,e,t,u);if(!(void 0===g?b===d||s(b,d,r,o,u):g)){y=!1;break}v||(v="constructor"==_)}if(y&&!v){var x=e.constructor,m=t.constructor;x!=m&&"constructor"in e&&"constructor"in t&&!("function"==typeof x&&x instanceof x&&"function"==typeof m&&m instanceof m)&&(y=!1)}return u.delete(e),u.delete(t),y}},{"./_getAllKeys":93}],91:[function(e,t,r){var n=e("./flatten"),i=e("./_overRest"),a=e("./_setToString");t.exports=function(e){return a(i(e,void 0,n),e+"")}},{"./_overRest":138,"./_setToString":144,"./flatten":161}],92:[function(e,t,r){(function(e){var r="object"==typeof e&&e&&e.Object===Object&&e;t.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],93:[function(e,t,r){var n=e("./_baseGetAllKeys"),i=e("./_getSymbols"),a=e("./keys");t.exports=function(e){return n(e,a,i)}},{"./_baseGetAllKeys":48,"./_getSymbols":100,"./keys":179}],94:[function(e,t,r){var n=e("./_baseGetAllKeys"),i=e("./_getSymbolsIn"),a=e("./keysIn");t.exports=function(e){return n(e,a,i)}},{"./_baseGetAllKeys":48,"./_getSymbolsIn":101,"./keysIn":180}],95:[function(e,t,r){var n=e("./_isKeyable");t.exports=function(e,t){var r=e.__data__;return n(t)?r["string"==typeof t?"string":"hash"]:r.map}},{"./_isKeyable":115}],96:[function(e,t,r){var n=e("./_isStrictComparable"),i=e("./keys");t.exports=function(e){for(var t=i(e),r=t.length;r--;){var a=t[r],o=e[a];t[r]=[a,o,n(o)]}return t}},{"./_isStrictComparable":118,"./keys":179}],97:[function(e,t,r){var n=e("./_baseIsNative"),i=e("./_getValue");t.exports=function(e,t){var r=i(e,t);return n(r)?r:void 0}},{"./_baseIsNative":55,"./_getValue":103}],98:[function(e,t,r){var n=e("./_overArg")(Object.getPrototypeOf,Object);t.exports=n},{"./_overArg":137}],99:[function(e,t,r){var n=e("./_Symbol"),i=Object.prototype,a=i.hasOwnProperty,o=i.toString,s=n?n.toStringTag:void 0;t.exports=function(e){var t=a.call(e,s),r=e[s];try{e[s]=void 0;var n=!0}catch(e){}var i=o.call(e);return n&&(t?e[s]=r:delete e[s]),i}},{"./_Symbol":27}],100:[function(e,t,r){var n=e("./_arrayFilter"),i=e("./stubArray"),a=Object.prototype.propertyIsEnumerable,o=Object.getOwnPropertySymbols,s=o?function(e){return null==e?[]:(e=Object(e),n(o(e),function(t){return a.call(e,t)}))}:i;t.exports=s},{"./_arrayFilter":32,"./stubArray":188}],101:[function(e,t,r){var n=e("./_arrayPush"),i=e("./_getPrototype"),a=e("./_getSymbols"),o=e("./stubArray"),s=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)n(t,a(e)),e=i(e);return t}:o;t.exports=s},{"./_arrayPush":35,"./_getPrototype":98,"./_getSymbols":100,"./stubArray":188}],102:[function(e,t,r){var n=e("./_DataView"),i=e("./_Map"),a=e("./_Promise"),o=e("./_Set"),s=e("./_WeakMap"),u=e("./_baseGetTag"),c=e("./_toSource"),l=c(n),f=c(i),p=c(a),_=c(o),h=c(s),y=u;(n&&"[object DataView]"!=y(new n(new ArrayBuffer(1)))||i&&"[object Map]"!=y(new i)||a&&"[object Promise]"!=y(a.resolve())||o&&"[object Set]"!=y(new o)||s&&"[object WeakMap]"!=y(new s))&&(y=function(e){var t=u(e),r="[object Object]"==t?e.constructor:void 0,n=r?c(r):"";if(n)switch(n){case l:return"[object DataView]";case f:return"[object Map]";case p:return"[object Promise]";case _:return"[object Set]";case h:return"[object WeakMap]"}return t}),t.exports=y},{"./_DataView":18,"./_Map":21,"./_Promise":23,"./_Set":24,"./_WeakMap":29,"./_baseGetTag":49,"./_toSource":153}],103:[function(e,t,r){t.exports=function(e,t){return null==e?void 0:e[t]}},{}],104:[function(e,t,r){var n=e("./_castPath"),i=e("./isArguments"),a=e("./isArray"),o=e("./_isIndex"),s=e("./isLength"),u=e("./_toKey");t.exports=function(e,t,r){for(var c=-1,l=(t=n(t,e)).length,f=!1;++c<l;){var p=u(t[c]);if(!(f=null!=e&&r(e,p)))break;e=e[p]}return f||++c!=l?f:!!(l=null==e?0:e.length)&&s(l)&&o(p,l)&&(a(e)||i(e))}},{"./_castPath":76,"./_isIndex":112,"./_toKey":152,"./isArguments":166,"./isArray":167,"./isLength":172}],105:[function(e,t,r){var n=e("./_nativeCreate");t.exports=function(){this.__data__=n?n(null):{},this.size=0}},{"./_nativeCreate":132}],106:[function(e,t,r){t.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},{}],107:[function(e,t,r){var n=e("./_nativeCreate"),i="__lodash_hash_undefined__",a=Object.prototype.hasOwnProperty;t.exports=function(e){var t=this.__data__;if(n){var r=t[e];return r===i?void 0:r}return a.call(t,e)?t[e]:void 0}},{"./_nativeCreate":132}],108:[function(e,t,r){var n=e("./_nativeCreate"),i=Object.prototype.hasOwnProperty;t.exports=function(e){var t=this.__data__;return n?void 0!==t[e]:i.call(t,e)}},{"./_nativeCreate":132}],109:[function(e,t,r){var n=e("./_nativeCreate"),i="__lodash_hash_undefined__";t.exports=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=n&&void 0===t?i:t,this}},{"./_nativeCreate":132}],110:[function(e,t,r){var n=e("./_baseCreate"),i=e("./_getPrototype"),a=e("./_isPrototype");t.exports=function(e){return"function"!=typeof e.constructor||a(e)?{}:n(i(e))}},{"./_baseCreate":41,"./_getPrototype":98,"./_isPrototype":117}],111:[function(e,t,r){var n=e("./_Symbol"),i=e("./isArguments"),a=e("./isArray"),o=n?n.isConcatSpreadable:void 0;t.exports=function(e){return a(e)||i(e)||!!(o&&e&&e[o])}},{"./_Symbol":27,"./isArguments":166,"./isArray":167}],112:[function(e,t,r){var n=9007199254740991,i=/^(?:0|[1-9]\d*)$/;t.exports=function(e,t){var r=typeof e;return!!(t=null==t?n:t)&&("number"==r||"symbol"!=r&&i.test(e))&&e>-1&&e%1==0&&e<t}},{}],113:[function(e,t,r){var n=e("./eq"),i=e("./isArrayLike"),a=e("./_isIndex"),o=e("./isObject");t.exports=function(e,t,r){if(!o(r))return!1;var s=typeof t;return!!("number"==s?i(r)&&a(t,r.length):"string"==s&&t in r)&&n(r[t],e)}},{"./_isIndex":112,"./eq":157,"./isArrayLike":168,"./isObject":174}],114:[function(e,t,r){var n=e("./isArray"),i=e("./isSymbol"),a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,o=/^\w*$/;t.exports=function(e,t){if(n(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!i(e))||o.test(e)||!a.test(e)||null!=t&&e in Object(t)}},{"./isArray":167,"./isSymbol":177}],115:[function(e,t,r){t.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},{}],116:[function(e,t,r){var n,i=e("./_coreJsData"),a=(n=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";t.exports=function(e){return!!a&&a in e}},{"./_coreJsData":82}],117:[function(e,t,r){var n=Object.prototype;t.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||n)}},{}],118:[function(e,t,r){var n=e("./isObject");t.exports=function(e){return e==e&&!n(e)}},{"./isObject":174}],119:[function(e,t,r){t.exports=function(){this.__data__=[],this.size=0}},{}],120:[function(e,t,r){var n=e("./_assocIndexOf"),i=Array.prototype.splice;t.exports=function(e){var t=this.__data__,r=n(t,e);return!(r<0||(r==t.length-1?t.pop():i.call(t,r,1),--this.size,0))}},{"./_assocIndexOf":39}],121:[function(e,t,r){var n=e("./_assocIndexOf");t.exports=function(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}},{"./_assocIndexOf":39}],122:[function(e,t,r){var n=e("./_assocIndexOf");t.exports=function(e){return n(this.__data__,e)>-1}},{"./_assocIndexOf":39}],123:[function(e,t,r){var n=e("./_assocIndexOf");t.exports=function(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}},{"./_assocIndexOf":39}],124:[function(e,t,r){var n=e("./_Hash"),i=e("./_ListCache"),a=e("./_Map");t.exports=function(){this.size=0,this.__data__={hash:new n,map:new(a||i),string:new n}}},{"./_Hash":19,"./_ListCache":20,"./_Map":21}],125:[function(e,t,r){var n=e("./_getMapData");t.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}},{"./_getMapData":95}],126:[function(e,t,r){var n=e("./_getMapData");t.exports=function(e){return n(this,e).get(e)}},{"./_getMapData":95}],127:[function(e,t,r){var n=e("./_getMapData");t.exports=function(e){return n(this,e).has(e)}},{"./_getMapData":95}],128:[function(e,t,r){var n=e("./_getMapData");t.exports=function(e,t){var r=n(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}},{"./_getMapData":95}],129:[function(e,t,r){t.exports=function(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r}},{}],130:[function(e,t,r){t.exports=function(e,t){return function(r){return null!=r&&r[e]===t&&(void 0!==t||e in Object(r))}}},{}],131:[function(e,t,r){var n=e("./memoize"),i=500;t.exports=function(e){var t=n(e,function(e){return r.size===i&&r.clear(),e}),r=t.cache;return t}},{"./memoize":183}],132:[function(e,t,r){var n=e("./_getNative")(Object,"create");t.exports=n},{"./_getNative":97}],133:[function(e,t,r){var n=e("./_overArg")(Object.keys,Object);t.exports=n},{"./_overArg":137}],134:[function(e,t,r){t.exports=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}},{}],135:[function(e,t,r){var n=e("./_freeGlobal"),i="object"==typeof r&&r&&!r.nodeType&&r,a=i&&"object"==typeof t&&t&&!t.nodeType&&t,o=a&&a.exports===i&&n.process,s=function(){try{var e=a&&a.require&&a.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(e){}}();t.exports=s},{"./_freeGlobal":92}],136:[function(e,t,r){var n=Object.prototype.toString;t.exports=function(e){return n.call(e)}},{}],137:[function(e,t,r){t.exports=function(e,t){return function(r){return e(t(r))}}},{}],138:[function(e,t,r){var n=e("./_apply"),i=Math.max;t.exports=function(e,t,r){return t=i(void 0===t?e.length-1:t,0),function(){for(var a=arguments,o=-1,s=i(a.length-t,0),u=Array(s);++o<s;)u[o]=a[t+o];o=-1;for(var c=Array(t+1);++o<t;)c[o]=a[o];return c[t]=r(u),n(e,this,c)}}},{"./_apply":30}],139:[function(e,t,r){var n=e("./_freeGlobal"),i="object"==typeof self&&self&&self.Object===Object&&self,a=n||i||Function("return this")();t.exports=a},{"./_freeGlobal":92}],140:[function(e,t,r){t.exports=function(e,t){if("__proto__"!=t)return e[t]}},{}],141:[function(e,t,r){var n="__lodash_hash_undefined__";t.exports=function(e){return this.__data__.set(e,n),this}},{}],142:[function(e,t,r){t.exports=function(e){return this.__data__.has(e)}},{}],143:[function(e,t,r){t.exports=function(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r}},{}],144:[function(e,t,r){var n=e("./_baseSetToString"),i=e("./_shortOut")(n);t.exports=i},{"./_baseSetToString":70,"./_shortOut":145}],145:[function(e,t,r){var n=800,i=16,a=Date.now;t.exports=function(e){var t=0,r=0;return function(){var o=a(),s=i-(o-r);if(r=o,s>0){if(++t>=n)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}},{}],146:[function(e,t,r){var n=e("./_ListCache");t.exports=function(){this.__data__=new n,this.size=0}},{"./_ListCache":20}],147:[function(e,t,r){t.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},{}],148:[function(e,t,r){t.exports=function(e){return this.__data__.get(e)}},{}],149:[function(e,t,r){t.exports=function(e){return this.__data__.has(e)}},{}],150:[function(e,t,r){var n=e("./_ListCache"),i=e("./_Map"),a=e("./_MapCache"),o=200;t.exports=function(e,t){var r=this.__data__;if(r instanceof n){var s=r.__data__;if(!i||s.length<o-1)return s.push([e,t]),this.size=++r.size,this;r=this.__data__=new a(s)}return r.set(e,t),this.size=r.size,this}},{"./_ListCache":20,"./_Map":21,"./_MapCache":22}],151:[function(e,t,r){var n=e("./_memoizeCapped"),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,a=/\\(\\)?/g,o=n(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(i,function(e,r,n,i){t.push(n?i.replace(a,"$1"):r||e)}),t});t.exports=o},{"./_memoizeCapped":131}],152:[function(e,t,r){var n=e("./isSymbol"),i=1/0;t.exports=function(e){if("string"==typeof e||n(e))return e;var t=e+"";return"0"==t&&1/e==-i?"-0":t}},{"./isSymbol":177}],153:[function(e,t,r){var n=Function.prototype.toString;t.exports=function(e){if(null!=e){try{return n.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},{}],154:[function(e,t,r){var n=e("./_copyObject"),i=e("./_createAssigner"),a=e("./keysIn"),o=i(function(e,t){n(t,a(t),e)});t.exports=o},{"./_copyObject":81,"./_createAssigner":83,"./keysIn":180}],155:[function(e,t,r){t.exports=function(e){return function(){return e}}},{}],156:[function(e,t,r){t.exports=e("./forEach")},{"./forEach":162}],157:[function(e,t,r){t.exports=function(e,t){return e===t||e!=e&&t!=t}},{}],158:[function(e,t,r){t.exports=e("./assignIn")},{"./assignIn":154}],159:[function(e,t,r){var n=e("./_createFind")(e("./findIndex"));t.exports=n},{"./_createFind":86,"./findIndex":160}],160:[function(e,t,r){var n=e("./_baseFindIndex"),i=e("./_baseIteratee"),a=e("./toInteger"),o=Math.max;t.exports=function(e,t,r){var s=null==e?0:e.length;if(!s)return-1;var u=null==r?0:a(r);return u<0&&(u=o(s+u,0)),n(e,i(t,3),u)}},{"./_baseFindIndex":43,"./_baseIteratee":57,"./toInteger":191}],161:[function(e,t,r){var n=e("./_baseFlatten");t.exports=function(e){return null!=e&&e.length?n(e,1):[]}},{"./_baseFlatten":44}],162:[function(e,t,r){var n=e("./_arrayEach"),i=e("./_baseEach"),a=e("./_castFunction"),o=e("./isArray");t.exports=function(e,t){return(o(e)?n:i)(e,a(t))}},{"./_arrayEach":31,"./_baseEach":42,"./_castFunction":75,"./isArray":167}],163:[function(e,t,r){var n=e("./_baseGet");t.exports=function(e,t,r){var i=null==e?void 0:n(e,t);return void 0===i?r:i}},{"./_baseGet":47}],164:[function(e,t,r){var n=e("./_baseHasIn"),i=e("./_hasPath");t.exports=function(e,t){return null!=e&&i(e,t,n)}},{"./_baseHasIn":50,"./_hasPath":104}],165:[function(e,t,r){t.exports=function(e){return e}},{}],166:[function(e,t,r){var n=e("./_baseIsArguments"),i=e("./isObjectLike"),a=Object.prototype,o=a.hasOwnProperty,s=a.propertyIsEnumerable,u=n(function(){return arguments}())?n:function(e){return i(e)&&o.call(e,"callee")&&!s.call(e,"callee")};t.exports=u},{"./_baseIsArguments":51,"./isObjectLike":175}],167:[function(e,t,r){var n=Array.isArray;t.exports=n},{}],168:[function(e,t,r){var n=e("./isFunction"),i=e("./isLength");t.exports=function(e){return null!=e&&i(e.length)&&!n(e)}},{"./isFunction":171,"./isLength":172}],169:[function(e,t,r){var n=e("./isArrayLike"),i=e("./isObjectLike");t.exports=function(e){return i(e)&&n(e)}},{"./isArrayLike":168,"./isObjectLike":175}],170:[function(e,t,r){var n=e("./_root"),i=e("./stubFalse"),a="object"==typeof r&&r&&!r.nodeType&&r,o=a&&"object"==typeof t&&t&&!t.nodeType&&t,s=o&&o.exports===a?n.Buffer:void 0,u=(s?s.isBuffer:void 0)||i;t.exports=u},{"./_root":139,"./stubFalse":189}],171:[function(e,t,r){var n=e("./_baseGetTag"),i=e("./isObject"),a="[object AsyncFunction]",o="[object Function]",s="[object GeneratorFunction]",u="[object Proxy]";t.exports=function(e){if(!i(e))return!1;var t=n(e);return t==o||t==s||t==a||t==u}},{"./_baseGetTag":49,"./isObject":174}],172:[function(e,t,r){var n=9007199254740991;t.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=n}},{}],173:[function(e,t,r){t.exports=function(e){return null==e}},{}],174:[function(e,t,r){t.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},{}],175:[function(e,t,r){t.exports=function(e){return null!=e&&"object"==typeof e}},{}],176:[function(e,t,r){var n=e("./_baseGetTag"),i=e("./_getPrototype"),a=e("./isObjectLike"),o="[object Object]",s=Function.prototype,u=Object.prototype,c=s.toString,l=u.hasOwnProperty,f=c.call(Object);t.exports=function(e){if(!a(e)||n(e)!=o)return!1;var t=i(e);if(null===t)return!0;var r=l.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&c.call(r)==f}},{"./_baseGetTag":49,"./_getPrototype":98,"./isObjectLike":175}],177:[function(e,t,r){var n=e("./_baseGetTag"),i=e("./isObjectLike"),a="[object Symbol]";t.exports=function(e){return"symbol"==typeof e||i(e)&&n(e)==a}},{"./_baseGetTag":49,"./isObjectLike":175}],178:[function(e,t,r){var n=e("./_baseIsTypedArray"),i=e("./_baseUnary"),a=e("./_nodeUtil"),o=a&&a.isTypedArray,s=o?i(o):n;t.exports=s},{"./_baseIsTypedArray":56,"./_baseUnary":73,"./_nodeUtil":135}],179:[function(e,t,r){var n=e("./_arrayLikeKeys"),i=e("./_baseKeys"),a=e("./isArrayLike");t.exports=function(e){return a(e)?n(e):i(e)}},{"./_arrayLikeKeys":33,"./_baseKeys":58,"./isArrayLike":168}],180:[function(e,t,r){var n=e("./_arrayLikeKeys"),i=e("./_baseKeysIn"),a=e("./isArrayLike");t.exports=function(e){return a(e)?n(e,!0):i(e)}},{"./_arrayLikeKeys":33,"./_baseKeysIn":59,"./isArrayLike":168}],181:[function(e,t,r){var n=e("./_baseAssignValue"),i=e("./_baseForOwn"),a=e("./_baseIteratee");t.exports=function(e,t){var r={};return t=a(t,3),i(e,function(e,i,a){n(r,t(e,i,a),e)}),r}},{"./_baseAssignValue":40,"./_baseForOwn":46,"./_baseIteratee":57}],182:[function(e,t,r){var n=e("./_baseAssignValue"),i=e("./_baseForOwn"),a=e("./_baseIteratee");t.exports=function(e,t){var r={};return t=a(t,3),i(e,function(e,i,a){n(r,i,t(e,i,a))}),r}},{"./_baseAssignValue":40,"./_baseForOwn":46,"./_baseIteratee":57}],183:[function(e,t,r){var n=e("./_MapCache"),i="Expected a function";function a(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(i);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var o=e.apply(this,n);return r.cache=a.set(i,o)||a,o};return r.cache=new(a.Cache||n),r}a.Cache=n,t.exports=a},{"./_MapCache":22}],184:[function(e,t,r){var n=e("./_baseMerge"),i=e("./_createAssigner")(function(e,t,r){n(e,t,r)});t.exports=i},{"./_baseMerge":62,"./_createAssigner":83}],185:[function(e,t,r){var n=e("./_basePick"),i=e("./_flatRest")(function(e,t){return null==e?{}:n(e,t)});t.exports=i},{"./_basePick":64,"./_flatRest":91}],186:[function(e,t,r){var n=e("./_arrayMap"),i=e("./_baseIteratee"),a=e("./_basePickBy"),o=e("./_getAllKeysIn");t.exports=function(e,t){if(null==e)return{};var r=n(o(e),function(e){return[e]});return t=i(t),a(e,r,function(e,r){return t(e,r[0])})}},{"./_arrayMap":34,"./_baseIteratee":57,"./_basePickBy":65,"./_getAllKeysIn":94}],187:[function(e,t,r){var n=e("./_baseProperty"),i=e("./_basePropertyDeep"),a=e("./_isKey"),o=e("./_toKey");t.exports=function(e){return a(e)?n(o(e)):i(e)}},{"./_baseProperty":66,"./_basePropertyDeep":67,"./_isKey":114,"./_toKey":152}],188:[function(e,t,r){t.exports=function(){return[]}},{}],189:[function(e,t,r){t.exports=function(){return!1}},{}],190:[function(e,t,r){var n=e("./toNumber"),i=1/0,a=1.7976931348623157e308;t.exports=function(e){return e?(e=n(e))===i||e===-i?(e<0?-1:1)*a:e==e?e:0:0===e?e:0}},{"./toNumber":192}],191:[function(e,t,r){var n=e("./toFinite");t.exports=function(e){var t=n(e),r=t%1;return t==t?r?t-r:t:0}},{"./toFinite":190}],192:[function(e,t,r){var n=e("./isObject"),i=e("./isSymbol"),a=NaN,o=/^\s+|\s+$/g,s=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt;t.exports=function(e){if("number"==typeof e)return e;if(i(e))return a;if(n(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=n(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(o,"");var r=u.test(e);return r||c.test(e)?l(e.slice(2),r?2:8):s.test(e)?a:+e}},{"./isObject":174,"./isSymbol":177}],193:[function(e,t,r){var n=e("./_copyObject"),i=e("./keysIn");t.exports=function(e){return n(e,i(e))}},{"./_copyObject":81,"./keysIn":180}],194:[function(e,t,r){var n=e("./_baseToString");t.exports=function(e){return null==e?"":n(e)}},{"./_baseToString":72}],195:[function(e,t,r){var n=e("./_arrayEach"),i=e("./_baseCreate"),a=e("./_baseForOwn"),o=e("./_baseIteratee"),s=e("./_getPrototype"),u=e("./isArray"),c=e("./isBuffer"),l=e("./isFunction"),f=e("./isObject"),p=e("./isTypedArray");t.exports=function(e,t,r){var _=u(e),h=_||c(e)||p(e);if(t=o(t,4),null==r){var y=e&&e.constructor;r=h?_?new y:[]:f(e)&&l(y)?i(s(e)):{}}return(h?n:a)(e,function(e,n,i){return t(r,e,n,i)}),r}},{"./_arrayEach":31,"./_baseCreate":41,"./_baseForOwn":46,"./_baseIteratee":57,"./_getPrototype":98,"./isArray":167,"./isBuffer":170,"./isFunction":171,"./isObject":174,"./isTypedArray":178}],196:[function(e,t,r){var n,i,a=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function u(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(e){i=s}}();var c,l=[],f=!1,p=-1;function _(){f&&c&&(f=!1,c.length?l=c.concat(l):p=-1,l.length&&h())}function h(){if(!f){var e=u(_);f=!0;for(var t=l.length;t;){for(c=l,l=[];++p<t;)c&&c[p].run();p=-1,t=l.length}c=null,f=!1,function(e){if(i===clearTimeout)return clearTimeout(e);if((i===s||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(e);try{i(e)}catch(t){try{return i.call(null,e)}catch(t){return i.call(this,e)}}}(e)}}function y(e,t){this.fun=e,this.array=t}function v(){}a.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];l.push(new y(e,t)),1!==l.length||f||u(h)},y.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={},a.on=v,a.addListener=v,a.once=v,a.off=v,a.removeListener=v,a.removeAllListeners=v,a.emit=v,a.prependListener=v,a.prependOnceListener=v,a.listeners=function(e){return[]},a.binding=function(e){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(e){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},{}],"jsonapi-serializer":[function(e,t,r){t.exports={Serializer:e("./lib/serializer"),Deserializer:e("./lib/deserializer"),Error:e("./lib/error")}},{"./lib/deserializer":2,"./lib/error":4,"./lib/serializer":7}]},{},["jsonapi-serializer"]);
diff --git a/backend/vendor/assets/javascripts/jsuri.js b/backend/vendor/assets/javascripts/jsuri.js
deleted file mode 100755
index 45031c9b99..0000000000
--- a/backend/vendor/assets/javascripts/jsuri.js
+++ /dev/null
@@ -1,458 +0,0 @@
-/*!
- * jsUri
- * https://github.com/derek-watson/jsUri
- *
- * Copyright 2013, Derek Watson
- * Released under the MIT license.
- *
- * Includes parseUri regular expressions
- * http://blog.stevenlevithan.com/archives/parseuri
- * Copyright 2007, Steven Levithan
- * Released under the MIT license.
- */
-
- /*globals define, module */
-
-(function(global) {
-
- var re = {
- starts_with_slashes: /^\/+/,
- ends_with_slashes: /\/+$/,
- pluses: /\+/g,
- query_separator: /[&;]/,
- uri_parser: /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*)(?::([^:@]*))?)?@)?(\[[0-9a-fA-F:.]+\]|[^:\/?#]*)(?::(\d+|(?=:)))?(:)?)((((?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/
- };
-
- /**
- * Define forEach for older js environments
- * @see https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/forEach#Compatibility
- */
- if (!Array.prototype.forEach) {
- Array.prototype.forEach = function(callback, thisArg) {
- var T, k;
-
- if (this == null) {
- throw new TypeError(' this is null or not defined');
- }
-
- var O = Object(this);
- var len = O.length >>> 0;
-
- if (typeof callback !== "function") {
- throw new TypeError(callback + ' is not a function');
- }
-
- if (arguments.length > 1) {
- T = thisArg;
- }
-
- k = 0;
-
- while (k < len) {
- var kValue;
- if (k in O) {
- kValue = O[k];
- callback.call(T, kValue, k, O);
- }
- k++;
- }
- };
- }
-
- /**
- * unescape a query param value
- * @param {string} s encoded value
- * @return {string} decoded value
- */
- function decode(s) {
- if (s) {
- s = s.toString().replace(re.pluses, '%20');
- s = decodeURIComponent(s);
- }
- return s;
- }
-
- /**
- * Breaks a uri string down into its individual parts
- * @param {string} str uri
- * @return {object} parts
- */
- function parseUri(str) {
- var parser = re.uri_parser;
- var parserKeys = ["source", "protocol", "authority", "userInfo", "user", "password", "host", "port", "isColonUri", "relative", "path", "directory", "file", "query", "anchor"];
- var m = parser.exec(str || '');
- var parts = {};
-
- parserKeys.forEach(function(key, i) {
- parts[key] = m[i] || '';
- });
-
- return parts;
- }
-
- /**
- * Breaks a query string down into an array of key/value pairs
- * @param {string} str query
- * @return {array} array of arrays (key/value pairs)
- */
- function parseQuery(str) {
- var i, ps, p, n, k, v, l;
- var pairs = [];
-
- if (typeof(str) === 'undefined' || str === null || str === '') {
- return pairs;
- }
-
- if (str.indexOf('?') === 0) {
- str = str.substring(1);
- }
-
- ps = str.toString().split(re.query_separator);
-
- for (i = 0, l = ps.length; i < l; i++) {
- p = ps[i];
- n = p.indexOf('=');
-
- if (n !== 0) {
- k = decode(p.substring(0, n));
- v = decode(p.substring(n + 1));
- pairs.push(n === -1 ? [p, null] : [k, v]);
- }
-
- }
- return pairs;
- }
-
- /**
- * Creates a new Uri object
- * @constructor
- * @param {string} str
- */
- function Uri(str) {
- this.uriParts = parseUri(str);
- this.queryPairs = parseQuery(this.uriParts.query);
- this.hasAuthorityPrefixUserPref = null;
- }
-
- /**
- * Define getter/setter methods
- */
- ['protocol', 'userInfo', 'host', 'port', 'path', 'anchor'].forEach(function(key) {
- Uri.prototype[key] = function(val) {
- if (typeof val !== 'undefined') {
- this.uriParts[key] = val;
- }
- return this.uriParts[key];
- };
- });
-
- /**
- * if there is no protocol, the leading // can be enabled or disabled
- * @param {Boolean} val
- * @return {Boolean}
- */
- Uri.prototype.hasAuthorityPrefix = function(val) {
- if (typeof val !== 'undefined') {
- this.hasAuthorityPrefixUserPref = val;
- }
-
- if (this.hasAuthorityPrefixUserPref === null) {
- return (this.uriParts.source.indexOf('//') !== -1);
- } else {
- return this.hasAuthorityPrefixUserPref;
- }
- };
-
- Uri.prototype.isColonUri = function (val) {
- if (typeof val !== 'undefined') {
- this.uriParts.isColonUri = !!val;
- } else {
- return !!this.uriParts.isColonUri;
- }
- };
-
- /**
- * Serializes the internal state of the query pairs
- * @param {string} [val] set a new query string
- * @return {string} query string
- */
- Uri.prototype.query = function(val) {
- var s = '', i, param, l;
-
- if (typeof val !== 'undefined') {
- this.queryPairs = parseQuery(val);
- }
-
- for (i = 0, l = this.queryPairs.length; i < l; i++) {
- param = this.queryPairs[i];
- if (s.length > 0) {
- s += '&';
- }
- if (param[1] === null) {
- s += param[0];
- } else {
- s += param[0];
- s += '=';
- if (typeof param[1] !== 'undefined') {
- s += encodeURIComponent(param[1]);
- }
- }
- }
- return s.length > 0 ? '?' + s : s;
- };
-
- /**
- * returns the first query param value found for the key
- * @param {string} key query key
- * @return {string} first value found for key
- */
- Uri.prototype.getQueryParamValue = function (key) {
- var param, i, l;
- for (i = 0, l = this.queryPairs.length; i < l; i++) {
- param = this.queryPairs[i];
- if (key === param[0]) {
- return param[1];
- }
- }
- };
-
- /**
- * returns an array of query param values for the key
- * @param {string} key query key
- * @return {array} array of values
- */
- Uri.prototype.getQueryParamValues = function (key) {
- var arr = [], i, param, l;
- for (i = 0, l = this.queryPairs.length; i < l; i++) {
- param = this.queryPairs[i];
- if (key === param[0]) {
- arr.push(param[1]);
- }
- }
- return arr;
- };
-
- /**
- * removes query parameters
- * @param {string} key remove values for key
- * @param {val} [val] remove a specific value, otherwise removes all
- * @return {Uri} returns self for fluent chaining
- */
- Uri.prototype.deleteQueryParam = function (key, val) {
- var arr = [], i, param, keyMatchesFilter, valMatchesFilter, l;
-
- for (i = 0, l = this.queryPairs.length; i < l; i++) {
-
- param = this.queryPairs[i];
- keyMatchesFilter = decode(param[0]) === decode(key);
- valMatchesFilter = param[1] === val;
-
- if ((arguments.length === 1 && !keyMatchesFilter) || (arguments.length === 2 && (!keyMatchesFilter || !valMatchesFilter))) {
- arr.push(param);
- }
- }
-
- this.queryPairs = arr;
-
- return this;
- };
-
- /**
- * adds a query parameter
- * @param {string} key add values for key
- * @param {string} val value to add
- * @param {integer} [index] specific index to add the value at
- * @return {Uri} returns self for fluent chaining
- */
- Uri.prototype.addQueryParam = function (key, val, index) {
- if (arguments.length === 3 && index !== -1) {
- index = Math.min(index, this.queryPairs.length);
- this.queryPairs.splice(index, 0, [key, val]);
- } else if (arguments.length > 0) {
- this.queryPairs.push([key, val]);
- }
- return this;
- };
-
- /**
- * test for the existence of a query parameter
- * @param {string} key check values for key
- * @return {Boolean} true if key exists, otherwise false
- */
- Uri.prototype.hasQueryParam = function (key) {
- var i, len = this.queryPairs.length;
- for (i = 0; i < len; i++) {
- if (this.queryPairs[i][0] == key)
- return true;
- }
- return false;
- };
-
- /**
- * replaces query param values
- * @param {string} key key to replace value for
- * @param {string} newVal new value
- * @param {string} [oldVal] replace only one specific value (otherwise replaces all)
- * @return {Uri} returns self for fluent chaining
- */
- Uri.prototype.replaceQueryParam = function (key, newVal, oldVal) {
- var index = -1, len = this.queryPairs.length, i, param;
-
- if (arguments.length === 3) {
- for (i = 0; i < len; i++) {
- param = this.queryPairs[i];
- if (decode(param[0]) === decode(key) && decodeURIComponent(param[1]) === decode(oldVal)) {
- index = i;
- break;
- }
- }
- if (index >= 0) {
- this.deleteQueryParam(key, decode(oldVal)).addQueryParam(key, newVal, index);
- }
- } else {
- for (i = 0; i < len; i++) {
- param = this.queryPairs[i];
- if (decode(param[0]) === decode(key)) {
- index = i;
- break;
- }
- }
- this.deleteQueryParam(key);
- this.addQueryParam(key, newVal, index);
- }
- return this;
- };
-
- /**
- * Define fluent setter methods (setProtocol, setHasAuthorityPrefix, etc)
- */
- ['protocol', 'hasAuthorityPrefix', 'isColonUri', 'userInfo', 'host', 'port', 'path', 'query', 'anchor'].forEach(function(key) {
- var method = 'set' + key.charAt(0).toUpperCase() + key.slice(1);
- Uri.prototype[method] = function(val) {
- this[key](val);
- return this;
- };
- });
-
- /**
- * Scheme name, colon and doubleslash, as required
- * @return {string} http:// or possibly just //
- */
- Uri.prototype.scheme = function() {
- var s = '';
-
- if (this.protocol()) {
- s += this.protocol();
- if (this.protocol().indexOf(':') !== this.protocol().length - 1) {
- s += ':';
- }
- s += '//';
- } else {
- if (this.hasAuthorityPrefix() && this.host()) {
- s += '//';
- }
- }
-
- return s;
- };
-
- /**
- * Same as Mozilla nsIURI.prePath
- * @return {string} scheme://user:password@host:port
- * @see https://developer.mozilla.org/en/nsIURI
- */
- Uri.prototype.origin = function() {
- var s = this.scheme();
-
- if (this.userInfo() && this.host()) {
- s += this.userInfo();
- if (this.userInfo().indexOf('@') !== this.userInfo().length - 1) {
- s += '@';
- }
- }
-
- if (this.host()) {
- s += this.host();
- if (this.port() || (this.path() && this.path().substr(0, 1).match(/[0-9]/))) {
- s += ':' + this.port();
- }
- }
-
- return s;
- };
-
- /**
- * Adds a trailing slash to the path
- */
- Uri.prototype.addTrailingSlash = function() {
- var path = this.path() || '';
-
- if (path.substr(-1) !== '/') {
- this.path(path + '/');
- }
-
- return this;
- };
-
- /**
- * Serializes the internal state of the Uri object
- * @return {string}
- */
- Uri.prototype.toString = function() {
- var path, s = this.origin();
-
- if (this.isColonUri()) {
- if (this.path()) {
- s += ':'+this.path();
- }
- } else if (this.path()) {
- path = this.path();
- if (!(re.ends_with_slashes.test(s) || re.starts_with_slashes.test(path))) {
- s += '/';
- } else {
- if (s) {
- s.replace(re.ends_with_slashes, '/');
- }
- path = path.replace(re.starts_with_slashes, '/');
- }
- s += path;
- } else {
- if (this.host() && (this.query().toString() || this.anchor())) {
- s += '/';
- }
- }
- if (this.query().toString()) {
- s += this.query().toString();
- }
-
- if (this.anchor()) {
- if (this.anchor().indexOf('#') !== 0) {
- s += '#';
- }
- s += this.anchor();
- }
-
- return s;
- };
-
- /**
- * Clone a Uri object
- * @return {Uri} duplicate copy of the Uri
- */
- Uri.prototype.clone = function() {
- return new Uri(this.toString());
- };
-
- /**
- * export via AMD or CommonJS, otherwise leak a global
- */
- if (typeof define === 'function' && define.amd) {
- define(function() {
- return Uri;
- });
- } else if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {
- module.exports = Uri;
- } else {
- global.Uri = Uri;
- }
-}(this));
diff --git a/backend/vendor/assets/javascripts/modernizr.js b/backend/vendor/assets/javascripts/modernizr.js
deleted file mode 100644
index 509b26885f..0000000000
--- a/backend/vendor/assets/javascripts/modernizr.js
+++ /dev/null
@@ -1,3 +0,0 @@
-/*! modernizr 3.5.0 (Custom Build) | MIT *
- * https://modernizr.com/download/?-cssanimations-csstransforms-csstransforms3d-csstransitions-inlinesvg-svg-domprefixes-prefixes-setclasses-shiv-testallprops-testprop-teststyles !*/
-!function(e,t,n){function r(e,t){return typeof e===t}function o(){var e,t,n,o,i,s,a;for(var l in C)if(C.hasOwnProperty(l)){if(e=[],t=C[l],t.name&&(e.push(t.name.toLowerCase()),t.options&&t.options.aliases&&t.options.aliases.length))for(n=0;n<t.options.aliases.length;n++)e.push(t.options.aliases[n].toLowerCase());for(o=r(t.fn,"function")?t.fn():t.fn,i=0;i<e.length;i++)s=e[i],a=s.split("."),1===a.length?Modernizr[a[0]]=o:(!Modernizr[a[0]]||Modernizr[a[0]]instanceof Boolean||(Modernizr[a[0]]=new Boolean(Modernizr[a[0]])),Modernizr[a[0]][a[1]]=o),S.push((o?"":"no-")+a.join("-"))}}function i(e){var t=E.className,n=Modernizr._config.classPrefix||"";if(b&&(t=t.baseVal),Modernizr._config.enableJSClass){var r=new RegExp("(^|\\s)"+n+"no-js(\\s|$)");t=t.replace(r,"$1"+n+"js$2")}Modernizr._config.enableClasses&&(t+=" "+n+e.join(" "+n),b?E.className.baseVal=t:E.className=t)}function s(e,t){return!!~(""+e).indexOf(t)}function a(){return"function"!=typeof t.createElement?t.createElement(arguments[0]):b?t.createElementNS.call(t,"http://www.w3.org/2000/svg",arguments[0]):t.createElement.apply(t,arguments)}function l(e){return e.replace(/([a-z])-([a-z])/g,function(e,t,n){return t+n.toUpperCase()}).replace(/^-/,"")}function c(e,t){return function(){return e.apply(t,arguments)}}function u(e,t,n){var o;for(var i in e)if(e[i]in t)return n===!1?e[i]:(o=t[e[i]],r(o,"function")?c(o,n||t):o);return!1}function f(e){return e.replace(/([A-Z])/g,function(e,t){return"-"+t.toLowerCase()}).replace(/^ms-/,"-ms-")}function d(t,n,r){var o;if("getComputedStyle"in e){o=getComputedStyle.call(e,t,n);var i=e.console;if(null!==o)r&&(o=o.getPropertyValue(r));else if(i){var s=i.error?"error":"log";i[s].call(i,"getComputedStyle returning null, its possible modernizr test results are inaccurate")}}else o=!n&&t.currentStyle&&t.currentStyle[r];return o}function p(){var e=t.body;return e||(e=a(b?"svg":"body"),e.fake=!0),e}function m(e,n,r,o){var i,s,l,c,u="modernizr",f=a("div"),d=p();if(parseInt(r,10))for(;r--;)l=a("div"),l.id=o?o[r]:u+(r+1),f.appendChild(l);return i=a("style"),i.type="text/css",i.id="s"+u,(d.fake?d:f).appendChild(i),d.appendChild(f),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(t.createTextNode(e)),f.id=u,d.fake&&(d.style.background="",d.style.overflow="hidden",c=E.style.overflow,E.style.overflow="hidden",E.appendChild(d)),s=n(f,e),d.fake?(d.parentNode.removeChild(d),E.style.overflow=c,E.offsetHeight):f.parentNode.removeChild(f),!!s}function h(t,r){var o=t.length;if("CSS"in e&&"supports"in e.CSS){for(;o--;)if(e.CSS.supports(f(t[o]),r))return!0;return!1}if("CSSSupportsRule"in e){for(var i=[];o--;)i.push("("+f(t[o])+":"+r+")");return i=i.join(" or "),m("@supports ("+i+") { #modernizr { position: absolute; } }",function(e){return"absolute"==d(e,null,"position")})}return n}function g(e,t,o,i){function c(){f&&(delete P.style,delete P.modElem)}if(i=r(i,"undefined")?!1:i,!r(o,"undefined")){var u=h(e,o);if(!r(u,"undefined"))return u}for(var f,d,p,m,g,v=["modernizr","tspan","samp"];!P.style&&v.length;)f=!0,P.modElem=a(v.shift()),P.style=P.modElem.style;for(p=e.length,d=0;p>d;d++)if(m=e[d],g=P.style[m],s(m,"-")&&(m=l(m)),P.style[m]!==n){if(i||r(o,"undefined"))return c(),"pfx"==t?m:!0;try{P.style[m]=o}catch(y){}if(P.style[m]!=g)return c(),"pfx"==t?m:!0}return c(),!1}function v(e,t,n,o,i){var s=e.charAt(0).toUpperCase()+e.slice(1),a=(e+" "+T.join(s+" ")+s).split(" ");return r(t,"string")||r(t,"undefined")?g(a,t,o,i):(a=(e+" "+_.join(s+" ")+s).split(" "),u(a,t,n))}function y(e,t,r){return v(e,n,n,t,r)}var S=[],C=[],w={_version:"3.5.0",_config:{classPrefix:"",enableClasses:!0,enableJSClass:!0,usePrefixes:!0},_q:[],on:function(e,t){var n=this;setTimeout(function(){t(n[e])},0)},addTest:function(e,t,n){C.push({name:e,fn:t,options:n})},addAsyncTest:function(e){C.push({name:null,fn:e})}},Modernizr=function(){};Modernizr.prototype=w,Modernizr=new Modernizr;var E=t.documentElement,b="svg"===E.nodeName.toLowerCase(),x="Moz O ms Webkit",_=w._config.usePrefixes?x.toLowerCase().split(" "):[];w._domPrefixes=_;var N=w._config.usePrefixes?" -webkit- -moz- -o- -ms- ".split(" "):["",""];w._prefixes=N;var T=w._config.usePrefixes?x.split(" "):[];w._cssomPrefixes=T;b||!function(e,t){function n(e,t){var n=e.createElement("p"),r=e.getElementsByTagName("head")[0]||e.documentElement;return n.innerHTML="x<style>"+t+"</style>",r.insertBefore(n.lastChild,r.firstChild)}function r(){var e=S.elements;return"string"==typeof e?e.split(" "):e}function o(e,t){var n=S.elements;"string"!=typeof n&&(n=n.join(" ")),"string"!=typeof e&&(e=e.join(" ")),S.elements=n+" "+e,c(t)}function i(e){var t=y[e[g]];return t||(t={},v++,e[g]=v,y[v]=t),t}function s(e,n,r){if(n||(n=t),f)return n.createElement(e);r||(r=i(n));var o;return o=r.cache[e]?r.cache[e].cloneNode():h.test(e)?(r.cache[e]=r.createElem(e)).cloneNode():r.createElem(e),!o.canHaveChildren||m.test(e)||o.tagUrn?o:r.frag.appendChild(o)}function a(e,n){if(e||(e=t),f)return e.createDocumentFragment();n=n||i(e);for(var o=n.frag.cloneNode(),s=0,a=r(),l=a.length;l>s;s++)o.createElement(a[s]);return o}function l(e,t){t.cache||(t.cache={},t.createElem=e.createElement,t.createFrag=e.createDocumentFragment,t.frag=t.createFrag()),e.createElement=function(n){return S.shivMethods?s(n,e,t):t.createElem(n)},e.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+r().join().replace(/[\w\-:]+/g,function(e){return t.createElem(e),t.frag.createElement(e),'c("'+e+'")'})+");return n}")(S,t.frag)}function c(e){e||(e=t);var r=i(e);return!S.shivCSS||u||r.hasCSS||(r.hasCSS=!!n(e,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),f||l(e,r),e}var u,f,d="3.7.3",p=e.html5||{},m=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,h=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,g="_html5shiv",v=0,y={};!function(){try{var e=t.createElement("a");e.innerHTML="<xyz></xyz>",u="hidden"in e,f=1==e.childNodes.length||function(){t.createElement("a");var e=t.createDocumentFragment();return"undefined"==typeof e.cloneNode||"undefined"==typeof e.createDocumentFragment||"undefined"==typeof e.createElement}()}catch(n){u=!0,f=!0}}();var S={elements:p.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:d,shivCSS:p.shivCSS!==!1,supportsUnknownElements:f,shivMethods:p.shivMethods!==!1,type:"default",shivDocument:c,createElement:s,createDocumentFragment:a,addElements:o};e.html5=S,c(t),"object"==typeof module&&module.exports&&(module.exports=S)}("undefined"!=typeof e?e:this,t);var z={elem:a("modernizr")};Modernizr._q.push(function(){delete z.elem});var P={style:z.elem.style};Modernizr._q.unshift(function(){delete P.style});var k=w.testStyles=m;w.testAllProps=v,w.testAllProps=y;w.testProp=function(e,t,r){return g([e],n,t,r)};Modernizr.addTest("cssanimations",y("animationName","a",!0)),Modernizr.addTest("csstransforms",function(){return-1===navigator.userAgent.indexOf("Android 2.")&&y("transform","scale(1)",!0)}),Modernizr.addTest("inlinesvg",function(){var e=a("div");return e.innerHTML="<svg/>","http://www.w3.org/2000/svg"==("undefined"!=typeof SVGRect&&e.firstChild&&e.firstChild.namespaceURI)}),Modernizr.addTest("csstransitions",y("transition","all",!0));var j="CSS"in e&&"supports"in e.CSS,F="supportsCSS"in e;Modernizr.addTest("supports",j||F),Modernizr.addTest("csstransforms3d",function(){var e=!!y("perspective","1px",!0),t=Modernizr._config.usePrefixes;if(e&&(!t||"webkitPerspective"in E.style)){var n,r="#modernizr{width:0;height:0}";Modernizr.supports?n="@supports (perspective: 1px)":(n="@media (transform-3d)",t&&(n+=",(-webkit-transform-3d)")),n+="{#modernizr{width:7px;height:18px;margin:0;padding:0;border:0}}",k(r+n,function(t){e=7===t.offsetWidth&&18===t.offsetHeight})}return e}),Modernizr.addTest("svg",!!t.createElementNS&&!!t.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect),o(),i(S),delete w.addTest,delete w.addAsyncTest;for(var M=0;M<Modernizr._q.length;M++)Modernizr._q[M]();e.Modernizr=Modernizr}(window,document);
\ No newline at end of file
diff --git a/backend/vendor/assets/javascripts/purify.js b/backend/vendor/assets/javascripts/purify.js
deleted file mode 100644
index 28eea31bc4..0000000000
--- a/backend/vendor/assets/javascripts/purify.js
+++ /dev/null
@@ -1,1217 +0,0 @@
-/*! @license DOMPurify | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.0.8/LICENSE */
-
-(function (global, factory) {
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
- typeof define === 'function' && define.amd ? define(factory) :
- (global = global || self, global.DOMPurify = factory());
-}(this, function () { 'use strict';
-
- function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
-
- var hasOwnProperty = Object.hasOwnProperty,
- setPrototypeOf = Object.setPrototypeOf,
- isFrozen = Object.isFrozen,
- objectKeys = Object.keys;
- var freeze = Object.freeze,
- seal = Object.seal; // eslint-disable-line import/no-mutable-exports
-
- var _ref = typeof Reflect !== 'undefined' && Reflect,
- apply = _ref.apply,
- construct = _ref.construct;
-
- if (!apply) {
- apply = function apply(fun, thisValue, args) {
- return fun.apply(thisValue, args);
- };
- }
-
- if (!freeze) {
- freeze = function freeze(x) {
- return x;
- };
- }
-
- if (!seal) {
- seal = function seal(x) {
- return x;
- };
- }
-
- if (!construct) {
- construct = function construct(Func, args) {
- return new (Function.prototype.bind.apply(Func, [null].concat(_toConsumableArray(args))))();
- };
- }
-
- var arrayForEach = unapply(Array.prototype.forEach);
- var arrayIndexOf = unapply(Array.prototype.indexOf);
- var arrayJoin = unapply(Array.prototype.join);
- var arrayPop = unapply(Array.prototype.pop);
- var arrayPush = unapply(Array.prototype.push);
- var arraySlice = unapply(Array.prototype.slice);
-
- var stringToLowerCase = unapply(String.prototype.toLowerCase);
- var stringMatch = unapply(String.prototype.match);
- var stringReplace = unapply(String.prototype.replace);
- var stringIndexOf = unapply(String.prototype.indexOf);
- var stringTrim = unapply(String.prototype.trim);
-
- var regExpTest = unapply(RegExp.prototype.test);
- var regExpCreate = unconstruct(RegExp);
-
- var typeErrorCreate = unconstruct(TypeError);
-
- function unapply(func) {
- return function (thisArg) {
- for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- args[_key - 1] = arguments[_key];
- }
-
- return apply(func, thisArg, args);
- };
- }
-
- function unconstruct(func) {
- return function () {
- for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
- args[_key2] = arguments[_key2];
- }
-
- return construct(func, args);
- };
- }
-
- /* Add properties to a lookup table */
- function addToSet(set, array) {
- if (setPrototypeOf) {
- // Make 'in' and truthy checks like Boolean(set.constructor)
- // independent of any properties defined on Object.prototype.
- // Prevent prototype setters from intercepting set as a this value.
- setPrototypeOf(set, null);
- }
-
- var l = array.length;
- while (l--) {
- var element = array[l];
- if (typeof element === 'string') {
- var lcElement = stringToLowerCase(element);
- if (lcElement !== element) {
- // Config presets (e.g. tags.js, attrs.js) are immutable.
- if (!isFrozen(array)) {
- array[l] = lcElement;
- }
-
- element = lcElement;
- }
- }
-
- set[element] = true;
- }
-
- return set;
- }
-
- /* Shallow clone an object */
- function clone(object) {
- var newObject = {};
-
- var property = void 0;
- for (property in object) {
- if (apply(hasOwnProperty, object, [property])) {
- newObject[property] = object[property];
- }
- }
-
- return newObject;
- }
-
- var html = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']);
-
- // SVG
- var svg = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'audio', 'canvas', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'video', 'view', 'vkern']);
-
- var svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']);
-
- var mathMl = freeze(['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom', 'mroot', 'mrow', 'ms', 'mspace', 'msqrt', 'mstyle', 'msub', 'msup', 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover']);
-
- var text = freeze(['#text']);
-
- var html$1 = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'pattern', 'placeholder', 'playsinline', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'xmlns']);
-
- var svg$1 = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'tabindex', 'targetx', 'targety', 'transform', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);
-
- var mathMl$1 = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']);
-
- var xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);
-
- // eslint-disable-next-line unicorn/better-regex
- var MUSTACHE_EXPR = seal(/\{\{[\s\S]*|[\s\S]*\}\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode
- var ERB_EXPR = seal(/<%[\s\S]*|[\s\S]*%>/gm);
- var DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]/); // eslint-disable-line no-useless-escape
- var ARIA_ATTR = seal(/^aria-[\-\w]+$/); // eslint-disable-line no-useless-escape
- var IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i // eslint-disable-line no-useless-escape
- );
- var IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i);
- var ATTR_WHITESPACE = seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g // eslint-disable-line no-control-regex
- );
-
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
-
- function _toConsumableArray$1(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
-
- var getGlobal = function getGlobal() {
- return typeof window === 'undefined' ? null : window;
- };
-
- /**
- * Creates a no-op policy for internal use only.
- * Don't export this function outside this module!
- * @param {?TrustedTypePolicyFactory} trustedTypes The policy factory.
- * @param {Document} document The document object (to determine policy name suffix)
- * @return {?TrustedTypePolicy} The policy created (or null, if Trusted Types
- * are not supported).
- */
- var _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, document) {
- if ((typeof trustedTypes === 'undefined' ? 'undefined' : _typeof(trustedTypes)) !== 'object' || typeof trustedTypes.createPolicy !== 'function') {
- return null;
- }
-
- // Allow the callers to control the unique policy name
- // by adding a data-tt-policy-suffix to the script element with the DOMPurify.
- // Policy creation with duplicate names throws in Trusted Types.
- var suffix = null;
- var ATTR_NAME = 'data-tt-policy-suffix';
- if (document.currentScript && document.currentScript.hasAttribute(ATTR_NAME)) {
- suffix = document.currentScript.getAttribute(ATTR_NAME);
- }
-
- var policyName = 'dompurify' + (suffix ? '#' + suffix : '');
-
- try {
- return trustedTypes.createPolicy(policyName, {
- createHTML: function createHTML(html$$1) {
- return html$$1;
- }
- });
- } catch (_) {
- // Policy creation failed (most likely another DOMPurify script has
- // already run). Skip creating the policy, as this will only cause errors
- // if TT are enforced.
- console.warn('TrustedTypes policy ' + policyName + ' could not be created.');
- return null;
- }
- };
-
- function createDOMPurify() {
- var window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();
-
- var DOMPurify = function DOMPurify(root) {
- return createDOMPurify(root);
- };
-
- /**
- * Version label, exposed for easier checks
- * if DOMPurify is up to date or not
- */
- DOMPurify.version = '2.0.12';
-
- /**
- * Array of elements that DOMPurify removed during sanitation.
- * Empty if nothing was removed.
- */
- DOMPurify.removed = [];
-
- if (!window || !window.document || window.document.nodeType !== 9) {
- // Not running in a browser, provide a factory function
- // so that you can pass your own Window
- DOMPurify.isSupported = false;
-
- return DOMPurify;
- }
-
- var originalDocument = window.document;
- var removeTitle = false;
-
- var document = window.document;
- var DocumentFragment = window.DocumentFragment,
- HTMLTemplateElement = window.HTMLTemplateElement,
- Node = window.Node,
- NodeFilter = window.NodeFilter,
- _window$NamedNodeMap = window.NamedNodeMap,
- NamedNodeMap = _window$NamedNodeMap === undefined ? window.NamedNodeMap || window.MozNamedAttrMap : _window$NamedNodeMap,
- Text = window.Text,
- Comment = window.Comment,
- DOMParser = window.DOMParser,
- trustedTypes = window.trustedTypes;
-
- // As per issue #47, the web-components registry is inherited by a
- // new document created via createHTMLDocument. As per the spec
- // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)
- // a new empty registry is used when creating a template contents owner
- // document, so we use that as our parent document to ensure nothing
- // is inherited.
-
- if (typeof HTMLTemplateElement === 'function') {
- var template = document.createElement('template');
- if (template.content && template.content.ownerDocument) {
- document = template.content.ownerDocument;
- }
- }
-
- var trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, originalDocument);
- var emptyHTML = trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML('') : '';
-
- var _document = document,
- implementation = _document.implementation,
- createNodeIterator = _document.createNodeIterator,
- getElementsByTagName = _document.getElementsByTagName,
- createDocumentFragment = _document.createDocumentFragment;
- var importNode = originalDocument.importNode;
-
-
- var hooks = {};
-
- /**
- * Expose whether this browser supports running the full DOMPurify.
- */
- DOMPurify.isSupported = implementation && typeof implementation.createHTMLDocument !== 'undefined' && document.documentMode !== 9;
-
- var MUSTACHE_EXPR$$1 = MUSTACHE_EXPR,
- ERB_EXPR$$1 = ERB_EXPR,
- DATA_ATTR$$1 = DATA_ATTR,
- ARIA_ATTR$$1 = ARIA_ATTR,
- IS_SCRIPT_OR_DATA$$1 = IS_SCRIPT_OR_DATA,
- ATTR_WHITESPACE$$1 = ATTR_WHITESPACE;
- var IS_ALLOWED_URI$$1 = IS_ALLOWED_URI;
-
- /**
- * We consider the elements and attributes below to be safe. Ideally
- * don't add any new ones but feel free to remove unwanted ones.
- */
-
- /* allowed element names */
-
- var ALLOWED_TAGS = null;
- var DEFAULT_ALLOWED_TAGS = addToSet({}, [].concat(_toConsumableArray$1(html), _toConsumableArray$1(svg), _toConsumableArray$1(svgFilters), _toConsumableArray$1(mathMl), _toConsumableArray$1(text)));
-
- /* Allowed attribute names */
- var ALLOWED_ATTR = null;
- var DEFAULT_ALLOWED_ATTR = addToSet({}, [].concat(_toConsumableArray$1(html$1), _toConsumableArray$1(svg$1), _toConsumableArray$1(mathMl$1), _toConsumableArray$1(xml)));
-
- /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */
- var FORBID_TAGS = null;
-
- /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */
- var FORBID_ATTR = null;
-
- /* Decide if ARIA attributes are okay */
- var ALLOW_ARIA_ATTR = true;
-
- /* Decide if custom data attributes are okay */
- var ALLOW_DATA_ATTR = true;
-
- /* Decide if unknown protocols are okay */
- var ALLOW_UNKNOWN_PROTOCOLS = false;
-
- /* Output should be safe for jQuery's $() factory? */
- var SAFE_FOR_JQUERY = false;
-
- /* Output should be safe for common template engines.
- * This means, DOMPurify removes data attributes, mustaches and ERB
- */
- var SAFE_FOR_TEMPLATES = false;
-
- /* Decide if document with <html>... should be returned */
- var WHOLE_DOCUMENT = false;
-
- /* Track whether config is already set on this instance of DOMPurify. */
- var SET_CONFIG = false;
-
- /* Decide if all elements (e.g. style, script) must be children of
- * document.body. By default, browsers might move them to document.head */
- var FORCE_BODY = false;
-
- /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html
- * string (or a TrustedHTML object if Trusted Types are supported).
- * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead
- */
- var RETURN_DOM = false;
-
- /* Decide if a DOM `DocumentFragment` should be returned, instead of a html
- * string (or a TrustedHTML object if Trusted Types are supported) */
- var RETURN_DOM_FRAGMENT = false;
-
- /* If `RETURN_DOM` or `RETURN_DOM_FRAGMENT` is enabled, decide if the returned DOM
- * `Node` is imported into the current `Document`. If this flag is not enabled the
- * `Node` will belong (its ownerDocument) to a fresh `HTMLDocument`, created by
- * DOMPurify. */
- var RETURN_DOM_IMPORT = false;
-
- /* Try to return a Trusted Type object instead of a string, retrun a string in
- * case Trusted Types are not supported */
- var RETURN_TRUSTED_TYPE = false;
-
- /* Output should be free from DOM clobbering attacks? */
- var SANITIZE_DOM = true;
-
- /* Keep element content when removing element? */
- var KEEP_CONTENT = true;
-
- /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead
- * of importing it into a new Document and returning a sanitized copy */
- var IN_PLACE = false;
-
- /* Allow usage of profiles like html, svg and mathMl */
- var USE_PROFILES = {};
-
- /* Tags to ignore content of when KEEP_CONTENT is true */
- var FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'plaintext', 'script', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']);
-
- /* Tags that are safe for data: URIs */
- var DATA_URI_TAGS = null;
- var DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);
-
- /* Attributes safe for values like "javascript:" */
- var URI_SAFE_ATTRIBUTES = null;
- var DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'summary', 'title', 'value', 'style', 'xmlns']);
-
- /* Keep a reference to config to pass to hooks */
- var CONFIG = null;
-
- /* Ideally, do not touch anything below this line */
- /* ______________________________________________ */
-
- var formElement = document.createElement('form');
-
- /**
- * _parseConfig
- *
- * @param {Object} cfg optional config literal
- */
- // eslint-disable-next-line complexity
- var _parseConfig = function _parseConfig(cfg) {
- if (CONFIG && CONFIG === cfg) {
- return;
- }
-
- /* Shield configuration object from tampering */
- if (!cfg || (typeof cfg === 'undefined' ? 'undefined' : _typeof(cfg)) !== 'object') {
- cfg = {};
- }
-
- /* Set configuration parameters */
- ALLOWED_TAGS = 'ALLOWED_TAGS' in cfg ? addToSet({}, cfg.ALLOWED_TAGS) : DEFAULT_ALLOWED_TAGS;
- ALLOWED_ATTR = 'ALLOWED_ATTR' in cfg ? addToSet({}, cfg.ALLOWED_ATTR) : DEFAULT_ALLOWED_ATTR;
- URI_SAFE_ATTRIBUTES = 'ADD_URI_SAFE_ATTR' in cfg ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), cfg.ADD_URI_SAFE_ATTR) : DEFAULT_URI_SAFE_ATTRIBUTES;
- DATA_URI_TAGS = 'ADD_DATA_URI_TAGS' in cfg ? addToSet(clone(DEFAULT_DATA_URI_TAGS), cfg.ADD_DATA_URI_TAGS) : DEFAULT_DATA_URI_TAGS;
- FORBID_TAGS = 'FORBID_TAGS' in cfg ? addToSet({}, cfg.FORBID_TAGS) : {};
- FORBID_ATTR = 'FORBID_ATTR' in cfg ? addToSet({}, cfg.FORBID_ATTR) : {};
- USE_PROFILES = 'USE_PROFILES' in cfg ? cfg.USE_PROFILES : false;
- ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true
- ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true
- ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false
- SAFE_FOR_JQUERY = cfg.SAFE_FOR_JQUERY || false; // Default false
- SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false
- WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false
- RETURN_DOM = cfg.RETURN_DOM || false; // Default false
- RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false
- RETURN_DOM_IMPORT = cfg.RETURN_DOM_IMPORT || false; // Default false
- RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false
- FORCE_BODY = cfg.FORCE_BODY || false; // Default false
- SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true
- KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true
- IN_PLACE = cfg.IN_PLACE || false; // Default false
- IS_ALLOWED_URI$$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI$$1;
- if (SAFE_FOR_TEMPLATES) {
- ALLOW_DATA_ATTR = false;
- }
-
- if (RETURN_DOM_FRAGMENT) {
- RETURN_DOM = true;
- }
-
- /* Parse profile info */
- if (USE_PROFILES) {
- ALLOWED_TAGS = addToSet({}, [].concat(_toConsumableArray$1(text)));
- ALLOWED_ATTR = [];
- if (USE_PROFILES.html === true) {
- addToSet(ALLOWED_TAGS, html);
- addToSet(ALLOWED_ATTR, html$1);
- }
-
- if (USE_PROFILES.svg === true) {
- addToSet(ALLOWED_TAGS, svg);
- addToSet(ALLOWED_ATTR, svg$1);
- addToSet(ALLOWED_ATTR, xml);
- }
-
- if (USE_PROFILES.svgFilters === true) {
- addToSet(ALLOWED_TAGS, svgFilters);
- addToSet(ALLOWED_ATTR, svg$1);
- addToSet(ALLOWED_ATTR, xml);
- }
-
- if (USE_PROFILES.mathMl === true) {
- addToSet(ALLOWED_TAGS, mathMl);
- addToSet(ALLOWED_ATTR, mathMl$1);
- addToSet(ALLOWED_ATTR, xml);
- }
- }
-
- /* Merge configuration parameters */
- if (cfg.ADD_TAGS) {
- if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {
- ALLOWED_TAGS = clone(ALLOWED_TAGS);
- }
-
- addToSet(ALLOWED_TAGS, cfg.ADD_TAGS);
- }
-
- if (cfg.ADD_ATTR) {
- if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {
- ALLOWED_ATTR = clone(ALLOWED_ATTR);
- }
-
- addToSet(ALLOWED_ATTR, cfg.ADD_ATTR);
- }
-
- if (cfg.ADD_URI_SAFE_ATTR) {
- addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR);
- }
-
- /* Add #text in case KEEP_CONTENT is set to true */
- if (KEEP_CONTENT) {
- ALLOWED_TAGS['#text'] = true;
- }
-
- /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */
- if (WHOLE_DOCUMENT) {
- addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);
- }
-
- /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */
- if (ALLOWED_TAGS.table) {
- addToSet(ALLOWED_TAGS, ['tbody']);
- delete FORBID_TAGS.tbody;
- }
-
- // Prevent further manipulation of configuration.
- // Not available in IE8, Safari 5, etc.
- if (freeze) {
- freeze(cfg);
- }
-
- CONFIG = cfg;
- };
-
- /**
- * _forceRemove
- *
- * @param {Node} node a DOM node
- */
- var _forceRemove = function _forceRemove(node) {
- arrayPush(DOMPurify.removed, { element: node });
- try {
- // eslint-disable-next-line unicorn/prefer-node-remove
- node.parentNode.removeChild(node);
- } catch (_) {
- node.outerHTML = emptyHTML;
- }
- };
-
- /**
- * _removeAttribute
- *
- * @param {String} name an Attribute name
- * @param {Node} node a DOM node
- */
- var _removeAttribute = function _removeAttribute(name, node) {
- try {
- arrayPush(DOMPurify.removed, {
- attribute: node.getAttributeNode(name),
- from: node
- });
- } catch (_) {
- arrayPush(DOMPurify.removed, {
- attribute: null,
- from: node
- });
- }
-
- node.removeAttribute(name);
- };
-
- /**
- * _initDocument
- *
- * @param {String} dirty a string of dirty markup
- * @return {Document} a DOM, filled with the dirty markup
- */
- var _initDocument = function _initDocument(dirty) {
- /* Create a HTML document */
- var doc = void 0;
- var leadingWhitespace = void 0;
-
- if (FORCE_BODY) {
- dirty = '<remove></remove>' + dirty;
- } else {
- /* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */
- var matches = stringMatch(dirty, /^[\r\n\t ]+/);
- leadingWhitespace = matches && matches[0];
- }
-
- var dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;
- /* Use the DOMParser API by default, fallback later if needs be */
- try {
- doc = new DOMParser().parseFromString(dirtyPayload, 'text/html');
- } catch (_) {}
-
- /* Remove title to fix a mXSS bug in older MS Edge */
- if (removeTitle) {
- addToSet(FORBID_TAGS, ['title']);
- }
-
- /* Use createHTMLDocument in case DOMParser is not available */
- if (!doc || !doc.documentElement) {
- doc = implementation.createHTMLDocument('');
- var _doc = doc,
- body = _doc.body;
-
- body.parentNode.removeChild(body.parentNode.firstElementChild);
- body.outerHTML = dirtyPayload;
- }
-
- if (dirty && leadingWhitespace) {
- doc.body.insertBefore(document.createTextNode(leadingWhitespace), doc.body.childNodes[0] || null);
- }
-
- /* Work on whole document or just its body */
- return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0];
- };
-
- /* Here we test for a broken feature in Edge that might cause mXSS */
- if (DOMPurify.isSupported) {
- (function () {
- try {
- var doc = _initDocument('<x/><title>&lt;/title&gt;&lt;img&gt;');
- if (regExpTest(/<\/title/, doc.querySelector('title').innerHTML)) {
- removeTitle = true;
- }
- } catch (_) {}
- })();
- }
-
- /**
- * _createIterator
- *
- * @param {Document} root document/fragment to create iterator for
- * @return {Iterator} iterator instance
- */
- var _createIterator = function _createIterator(root) {
- return createNodeIterator.call(root.ownerDocument || root, root, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT, function () {
- return NodeFilter.FILTER_ACCEPT;
- }, false);
- };
-
- /**
- * _isClobbered
- *
- * @param {Node} elm element to check for clobbering attacks
- * @return {Boolean} true if clobbered, false if safe
- */
- var _isClobbered = function _isClobbered(elm) {
- if (elm instanceof Text || elm instanceof Comment) {
- return false;
- }
-
- if (typeof elm.nodeName !== 'string' || typeof elm.textContent !== 'string' || typeof elm.removeChild !== 'function' || !(elm.attributes instanceof NamedNodeMap) || typeof elm.removeAttribute !== 'function' || typeof elm.setAttribute !== 'function' || typeof elm.namespaceURI !== 'string') {
- return true;
- }
-
- return false;
- };
-
- /**
- * _isNode
- *
- * @param {Node} obj object to check whether it's a DOM node
- * @return {Boolean} true is object is a DOM node
- */
- var _isNode = function _isNode(object) {
- return (typeof Node === 'undefined' ? 'undefined' : _typeof(Node)) === 'object' ? object instanceof Node : object && (typeof object === 'undefined' ? 'undefined' : _typeof(object)) === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string';
- };
-
- /**
- * _executeHook
- * Execute user configurable hooks
- *
- * @param {String} entryPoint Name of the hook's entry point
- * @param {Node} currentNode node to work on with the hook
- * @param {Object} data additional hook parameters
- */
- var _executeHook = function _executeHook(entryPoint, currentNode, data) {
- if (!hooks[entryPoint]) {
- return;
- }
-
- arrayForEach(hooks[entryPoint], function (hook) {
- hook.call(DOMPurify, currentNode, data, CONFIG);
- });
- };
-
- /**
- * _sanitizeElements
- *
- * @protect nodeName
- * @protect textContent
- * @protect removeChild
- *
- * @param {Node} currentNode to check for permission to exist
- * @return {Boolean} true if node was killed, false if left alive
- */
- // eslint-disable-next-line complexity
- var _sanitizeElements = function _sanitizeElements(currentNode) {
- var content = void 0;
-
- /* Execute a hook if present */
- _executeHook('beforeSanitizeElements', currentNode, null);
-
- /* Check if element is clobbered or can clobber */
- if (_isClobbered(currentNode)) {
- _forceRemove(currentNode);
- return true;
- }
-
- /* Now let's check the element's type and name */
- var tagName = stringToLowerCase(currentNode.nodeName);
-
- /* Execute a hook if present */
- _executeHook('uponSanitizeElement', currentNode, {
- tagName: tagName,
- allowedTags: ALLOWED_TAGS
- });
-
- /* Take care of an mXSS pattern using p, br inside svg, math */
- if ((tagName === 'svg' || tagName === 'math') && currentNode.querySelectorAll('p, br').length !== 0) {
- _forceRemove(currentNode);
- return true;
- }
-
- /* Remove element if anything forbids its presence */
- if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
- /* Keep content except for bad-listed elements */
- if (KEEP_CONTENT && !FORBID_CONTENTS[tagName] && typeof currentNode.insertAdjacentHTML === 'function') {
- try {
- var htmlToInsert = currentNode.innerHTML;
- currentNode.insertAdjacentHTML('AfterEnd', trustedTypesPolicy ? trustedTypesPolicy.createHTML(htmlToInsert) : htmlToInsert);
- } catch (_) {}
- }
-
- _forceRemove(currentNode);
- return true;
- }
-
- /* Remove in case a noscript/noembed XSS is suspected */
- if (tagName === 'noscript' && regExpTest(/<\/noscript/i, currentNode.innerHTML)) {
- _forceRemove(currentNode);
- return true;
- }
-
- if (tagName === 'noembed' && regExpTest(/<\/noembed/i, currentNode.innerHTML)) {
- _forceRemove(currentNode);
- return true;
- }
-
- /* Convert markup to cover jQuery behavior */
- if (SAFE_FOR_JQUERY && !currentNode.firstElementChild && (!currentNode.content || !currentNode.content.firstElementChild) && regExpTest(/</g, currentNode.textContent)) {
- arrayPush(DOMPurify.removed, { element: currentNode.cloneNode() });
- if (currentNode.innerHTML) {
- currentNode.innerHTML = stringReplace(currentNode.innerHTML, /</g, '&lt;');
- } else {
- currentNode.innerHTML = stringReplace(currentNode.textContent, /</g, '&lt;');
- }
- }
-
- /* Sanitize element content to be template-safe */
- if (SAFE_FOR_TEMPLATES && currentNode.nodeType === 3) {
- /* Get the element's text content */
- content = currentNode.textContent;
- content = stringReplace(content, MUSTACHE_EXPR$$1, ' ');
- content = stringReplace(content, ERB_EXPR$$1, ' ');
- if (currentNode.textContent !== content) {
- arrayPush(DOMPurify.removed, { element: currentNode.cloneNode() });
- currentNode.textContent = content;
- }
- }
-
- /* Execute a hook if present */
- _executeHook('afterSanitizeElements', currentNode, null);
-
- return false;
- };
-
- /**
- * _isValidAttribute
- *
- * @param {string} lcTag Lowercase tag name of containing element.
- * @param {string} lcName Lowercase attribute name.
- * @param {string} value Attribute value.
- * @return {Boolean} Returns true if `value` is valid, otherwise false.
- */
- // eslint-disable-next-line complexity
- var _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {
- /* Make sure attribute cannot clobber */
- if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {
- return false;
- }
-
- /* Allow valid data-* attributes: At least one character after "-"
- (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)
- XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)
- We don't need to check the value; it's always URI safe. */
- if (ALLOW_DATA_ATTR && regExpTest(DATA_ATTR$$1, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR$$1, lcName)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {
- return false;
-
- /* Check value is safe. First, is attr inert? If so, is safe */
- } else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$$1, stringReplace(value, ATTR_WHITESPACE$$1, ''))) ; else if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]) ; else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA$$1, stringReplace(value, ATTR_WHITESPACE$$1, ''))) ; else if (!value) ; else {
- return false;
- }
-
- return true;
- };
-
- /**
- * _sanitizeAttributes
- *
- * @protect attributes
- * @protect nodeName
- * @protect removeAttribute
- * @protect setAttribute
- *
- * @param {Node} currentNode to sanitize
- */
- // eslint-disable-next-line complexity
- var _sanitizeAttributes = function _sanitizeAttributes(currentNode) {
- var attr = void 0;
- var value = void 0;
- var lcName = void 0;
- var idAttr = void 0;
- var l = void 0;
- /* Execute a hook if present */
- _executeHook('beforeSanitizeAttributes', currentNode, null);
-
- var attributes = currentNode.attributes;
-
- /* Check if we have attributes; if not we might have a text node */
-
- if (!attributes) {
- return;
- }
-
- var hookEvent = {
- attrName: '',
- attrValue: '',
- keepAttr: true,
- allowedAttributes: ALLOWED_ATTR
- };
- l = attributes.length;
-
- /* Go backwards over all attributes; safely remove bad ones */
- while (l--) {
- attr = attributes[l];
- var _attr = attr,
- name = _attr.name,
- namespaceURI = _attr.namespaceURI;
-
- value = stringTrim(attr.value);
- lcName = stringToLowerCase(name);
-
- /* Execute a hook if present */
- hookEvent.attrName = lcName;
- hookEvent.attrValue = value;
- hookEvent.keepAttr = true;
- hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set
- _executeHook('uponSanitizeAttribute', currentNode, hookEvent);
- value = hookEvent.attrValue;
- /* Did the hooks approve of the attribute? */
- if (hookEvent.forceKeepAttr) {
- continue;
- }
-
- /* Remove attribute */
- // Safari (iOS + Mac), last tested v8.0.5, crashes if you try to
- // remove a "name" attribute from an <img> tag that has an "id"
- // attribute at the time.
- if (lcName === 'name' && currentNode.nodeName === 'IMG' && attributes.id) {
- idAttr = attributes.id;
- attributes = arraySlice(attributes, []);
- _removeAttribute('id', currentNode);
- _removeAttribute(name, currentNode);
- if (arrayIndexOf(attributes, idAttr) > l) {
- currentNode.setAttribute('id', idAttr.value);
- }
- } else if (
- // This works around a bug in Safari, where input[type=file]
- // cannot be dynamically set after type has been removed
- currentNode.nodeName === 'INPUT' && lcName === 'type' && value === 'file' && hookEvent.keepAttr && (ALLOWED_ATTR[lcName] || !FORBID_ATTR[lcName])) {
- continue;
- } else {
- // This avoids a crash in Safari v9.0 with double-ids.
- // The trick is to first set the id to be empty and then to
- // remove the attribute
- if (name === 'id') {
- currentNode.setAttribute(name, '');
- }
-
- _removeAttribute(name, currentNode);
- }
-
- /* Did the hooks approve of the attribute? */
- if (!hookEvent.keepAttr) {
- continue;
- }
-
- /* Work around a security issue in jQuery 3.0 */
- if (SAFE_FOR_JQUERY && regExpTest(/\/>/i, value)) {
- _removeAttribute(name, currentNode);
- continue;
- }
-
- /* Take care of an mXSS pattern using namespace switches */
- if (regExpTest(/svg|math/i, currentNode.namespaceURI) && regExpTest(regExpCreate('</(' + arrayJoin(objectKeys(FORBID_CONTENTS), '|') + ')', 'i'), value)) {
- _removeAttribute(name, currentNode);
- continue;
- }
-
- /* Sanitize attribute content to be template-safe */
- if (SAFE_FOR_TEMPLATES) {
- value = stringReplace(value, MUSTACHE_EXPR$$1, ' ');
- value = stringReplace(value, ERB_EXPR$$1, ' ');
- }
-
- /* Is `value` valid for this attribute? */
- var lcTag = currentNode.nodeName.toLowerCase();
- if (!_isValidAttribute(lcTag, lcName, value)) {
- continue;
- }
-
- /* Handle invalid data-* attribute set by try-catching it */
- try {
- if (namespaceURI) {
- currentNode.setAttributeNS(namespaceURI, name, value);
- } else {
- /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. "x-schema". */
- currentNode.setAttribute(name, value);
- }
-
- arrayPop(DOMPurify.removed);
- } catch (_) {}
- }
-
- /* Execute a hook if present */
- _executeHook('afterSanitizeAttributes', currentNode, null);
- };
-
- /**
- * _sanitizeShadowDOM
- *
- * @param {DocumentFragment} fragment to iterate over recursively
- */
- var _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) {
- var shadowNode = void 0;
- var shadowIterator = _createIterator(fragment);
-
- /* Execute a hook if present */
- _executeHook('beforeSanitizeShadowDOM', fragment, null);
-
- while (shadowNode = shadowIterator.nextNode()) {
- /* Execute a hook if present */
- _executeHook('uponSanitizeShadowNode', shadowNode, null);
-
- /* Sanitize tags and elements */
- if (_sanitizeElements(shadowNode)) {
- continue;
- }
-
- /* Deep shadow DOM detected */
- if (shadowNode.content instanceof DocumentFragment) {
- _sanitizeShadowDOM(shadowNode.content);
- }
-
- /* Check attributes, sanitize if necessary */
- _sanitizeAttributes(shadowNode);
- }
-
- /* Execute a hook if present */
- _executeHook('afterSanitizeShadowDOM', fragment, null);
- };
-
- /**
- * Sanitize
- * Public method providing core sanitation functionality
- *
- * @param {String|Node} dirty string or DOM node
- * @param {Object} configuration object
- */
- // eslint-disable-next-line complexity
- DOMPurify.sanitize = function (dirty, cfg) {
- var body = void 0;
- var importedNode = void 0;
- var currentNode = void 0;
- var oldNode = void 0;
- var returnNode = void 0;
- /* Make sure we have a string to sanitize.
- DO NOT return early, as this will return the wrong type if
- the user has requested a DOM object rather than a string */
- if (!dirty) {
- dirty = '<!-->';
- }
-
- /* Stringify, in case dirty is an object */
- if (typeof dirty !== 'string' && !_isNode(dirty)) {
- // eslint-disable-next-line no-negated-condition
- if (typeof dirty.toString !== 'function') {
- throw typeErrorCreate('toString is not a function');
- } else {
- dirty = dirty.toString();
- if (typeof dirty !== 'string') {
- throw typeErrorCreate('dirty is not a string, aborting');
- }
- }
- }
-
- /* Check we can run. Otherwise fall back or ignore */
- if (!DOMPurify.isSupported) {
- if (_typeof(window.toStaticHTML) === 'object' || typeof window.toStaticHTML === 'function') {
- if (typeof dirty === 'string') {
- return window.toStaticHTML(dirty);
- }
-
- if (_isNode(dirty)) {
- return window.toStaticHTML(dirty.outerHTML);
- }
- }
-
- return dirty;
- }
-
- /* Assign config vars */
- if (!SET_CONFIG) {
- _parseConfig(cfg);
- }
-
- /* Clean up removed elements */
- DOMPurify.removed = [];
-
- /* Check if dirty is correctly typed for IN_PLACE */
- if (typeof dirty === 'string') {
- IN_PLACE = false;
- }
-
- if (IN_PLACE) ; else if (dirty instanceof Node) {
- /* If dirty is a DOM element, append to an empty document to avoid
- elements being stripped by the parser */
- body = _initDocument('<!-->');
- importedNode = body.ownerDocument.importNode(dirty, true);
- if (importedNode.nodeType === 1 && importedNode.nodeName === 'BODY') {
- /* Node is already a body, use as is */
- body = importedNode;
- } else if (importedNode.nodeName === 'HTML') {
- body = importedNode;
- } else {
- // eslint-disable-next-line unicorn/prefer-node-append
- body.appendChild(importedNode);
- }
- } else {
- /* Exit directly if we have nothing to do */
- if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT &&
- // eslint-disable-next-line unicorn/prefer-includes
- dirty.indexOf('<') === -1) {
- return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;
- }
-
- /* Initialize the document to work on */
- body = _initDocument(dirty);
-
- /* Check we have a DOM node from the data */
- if (!body) {
- return RETURN_DOM ? null : emptyHTML;
- }
- }
-
- /* Remove first element node (ours) if FORCE_BODY is set */
- if (body && FORCE_BODY) {
- _forceRemove(body.firstChild);
- }
-
- /* Get node iterator */
- var nodeIterator = _createIterator(IN_PLACE ? dirty : body);
-
- /* Now start iterating over the created document */
- while (currentNode = nodeIterator.nextNode()) {
- /* Fix IE's strange behavior with manipulated textNodes #89 */
- if (currentNode.nodeType === 3 && currentNode === oldNode) {
- continue;
- }
-
- /* Sanitize tags and elements */
- if (_sanitizeElements(currentNode)) {
- continue;
- }
-
- /* Shadow DOM detected, sanitize it */
- if (currentNode.content instanceof DocumentFragment) {
- _sanitizeShadowDOM(currentNode.content);
- }
-
- /* Check attributes, sanitize if necessary */
- _sanitizeAttributes(currentNode);
-
- oldNode = currentNode;
- }
-
- oldNode = null;
-
- /* If we sanitized `dirty` in-place, return it. */
- if (IN_PLACE) {
- return dirty;
- }
-
- /* Return sanitized string or DOM */
- if (RETURN_DOM) {
- if (RETURN_DOM_FRAGMENT) {
- returnNode = createDocumentFragment.call(body.ownerDocument);
-
- while (body.firstChild) {
- // eslint-disable-next-line unicorn/prefer-node-append
- returnNode.appendChild(body.firstChild);
- }
- } else {
- returnNode = body;
- }
-
- if (RETURN_DOM_IMPORT) {
- /*
- AdoptNode() is not used because internal state is not reset
- (e.g. the past names map of a HTMLFormElement), this is safe
- in theory but we would rather not risk another attack vector.
- The state that is cloned by importNode() is explicitly defined
- by the specs.
- */
- returnNode = importNode.call(originalDocument, returnNode, true);
- }
-
- return returnNode;
- }
-
- var serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;
-
- /* Sanitize final string template-safe */
- if (SAFE_FOR_TEMPLATES) {
- serializedHTML = stringReplace(serializedHTML, MUSTACHE_EXPR$$1, ' ');
- serializedHTML = stringReplace(serializedHTML, ERB_EXPR$$1, ' ');
- }
-
- return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;
- };
-
- /**
- * Public method to set the configuration once
- * setConfig
- *
- * @param {Object} cfg configuration object
- */
- DOMPurify.setConfig = function (cfg) {
- _parseConfig(cfg);
- SET_CONFIG = true;
- };
-
- /**
- * Public method to remove the configuration
- * clearConfig
- *
- */
- DOMPurify.clearConfig = function () {
- CONFIG = null;
- SET_CONFIG = false;
- };
-
- /**
- * Public method to check if an attribute value is valid.
- * Uses last set config, if any. Otherwise, uses config defaults.
- * isValidAttribute
- *
- * @param {string} tag Tag name of containing element.
- * @param {string} attr Attribute name.
- * @param {string} value Attribute value.
- * @return {Boolean} Returns true if `value` is valid. Otherwise, returns false.
- */
- DOMPurify.isValidAttribute = function (tag, attr, value) {
- /* Initialize shared config vars if necessary. */
- if (!CONFIG) {
- _parseConfig({});
- }
-
- var lcTag = stringToLowerCase(tag);
- var lcName = stringToLowerCase(attr);
- return _isValidAttribute(lcTag, lcName, value);
- };
-
- /**
- * AddHook
- * Public method to add DOMPurify hooks
- *
- * @param {String} entryPoint entry point for the hook to add
- * @param {Function} hookFunction function to execute
- */
- DOMPurify.addHook = function (entryPoint, hookFunction) {
- if (typeof hookFunction !== 'function') {
- return;
- }
-
- hooks[entryPoint] = hooks[entryPoint] || [];
- arrayPush(hooks[entryPoint], hookFunction);
- };
-
- /**
- * RemoveHook
- * Public method to remove a DOMPurify hook at a given entryPoint
- * (pops it from the stack of hooks if more are present)
- *
- * @param {String} entryPoint entry point for the hook to remove
- */
- DOMPurify.removeHook = function (entryPoint) {
- if (hooks[entryPoint]) {
- arrayPop(hooks[entryPoint]);
- }
- };
-
- /**
- * RemoveHooks
- * Public method to remove all DOMPurify hooks at a given entryPoint
- *
- * @param {String} entryPoint entry point for the hooks to remove
- */
- DOMPurify.removeHooks = function (entryPoint) {
- if (hooks[entryPoint]) {
- hooks[entryPoint] = [];
- }
- };
-
- /**
- * RemoveAllHooks
- * Public method to remove all DOMPurify hooks
- *
- */
- DOMPurify.removeAllHooks = function () {
- hooks = {};
- };
-
- return DOMPurify;
- }
-
- var purify = createDOMPurify();
-
- return purify;
-
-}));
diff --git a/backend/vendor/assets/javascripts/sortable.js b/backend/vendor/assets/javascripts/sortable.js
deleted file mode 100644
index d3b3dc0c31..0000000000
--- a/backend/vendor/assets/javascripts/sortable.js
+++ /dev/null
@@ -1,2 +0,0 @@
-/*! Sortable 1.13.0 - MIT | git://github.com/SortableJS/Sortable.git */
-!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).Sortable=e()}(this,function(){"use strict";function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function a(){return(a=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t}).apply(this,arguments)}function I(i){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},e=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(e=e.concat(Object.getOwnPropertySymbols(r).filter(function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))),e.forEach(function(t){var e,n,o;e=i,o=r[n=t],n in e?Object.defineProperty(e,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[n]=o})}return i}function l(t,e){if(null==t)return{};var n,o,i=function(t,e){if(null==t)return{};var n,o,i={},r=Object.keys(t);for(o=0;o<r.length;o++)n=r[o],0<=e.indexOf(n)||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(o=0;o<r.length;o++)n=r[o],0<=e.indexOf(n)||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function e(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function t(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var w=t(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),E=t(/Edge/i),c=t(/firefox/i),u=t(/safari/i)&&!t(/chrome/i)&&!t(/android/i),n=t(/iP(ad|od|hone)/i),i=t(/chrome/i)&&t(/android/i),r={capture:!1,passive:!1};function d(t,e,n){t.addEventListener(e,n,!w&&r)}function s(t,e,n){t.removeEventListener(e,n,!w&&r)}function h(t,e){if(e){if(">"===e[0]&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(t){return!1}return!1}}function P(t,e,n,o){if(t){n=n||document;do{if(null!=e&&(">"===e[0]?t.parentNode===n&&h(t,e):h(t,e))||o&&t===n)return t;if(t===n)break}while(t=(i=t).host&&i!==document&&i.host.nodeType?i.host:i.parentNode)}var i;return null}var f,p=/\s+/g;function k(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var o=(" "+t.className+" ").replace(p," ").replace(" "+e+" "," ");t.className=(o+(n?" "+e:"")).replace(p," ")}}function R(t,e,n){var o=t&&t.style;if(o){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];e in o||-1!==e.indexOf("webkit")||(e="-webkit-"+e),o[e]=n+("string"==typeof n?"":"px")}}function v(t,e){var n="";if("string"==typeof t)n=t;else do{var o=R(t,"transform");o&&"none"!==o&&(n=o+" "+n)}while(!e&&(t=t.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function g(t,e,n){if(t){var o=t.getElementsByTagName(e),i=0,r=o.length;if(n)for(;i<r;i++)n(o[i],i);return o}return[]}function A(){var t=document.scrollingElement;return t||document.documentElement}function X(t,e,n,o,i){if(t.getBoundingClientRect||t===window){var r,a,l,s,c,u,d;if(d=t!==window&&t.parentNode&&t!==A()?(a=(r=t.getBoundingClientRect()).top,l=r.left,s=r.bottom,c=r.right,u=r.height,r.width):(l=a=0,s=window.innerHeight,c=window.innerWidth,u=window.innerHeight,window.innerWidth),(e||n)&&t!==window&&(i=i||t.parentNode,!w))do{if(i&&i.getBoundingClientRect&&("none"!==R(i,"transform")||n&&"static"!==R(i,"position"))){var h=i.getBoundingClientRect();a-=h.top+parseInt(R(i,"border-top-width")),l-=h.left+parseInt(R(i,"border-left-width")),s=a+r.height,c=l+r.width;break}}while(i=i.parentNode);if(o&&t!==window){var f=v(i||t),p=f&&f.a,g=f&&f.d;f&&(s=(a/=g)+(u/=g),c=(l/=p)+(d/=p))}return{top:a,left:l,bottom:s,right:c,width:d,height:u}}}function Y(t,e,n){for(var o=H(t,!0),i=X(t)[e];o;){var r=X(o)[n];if(!("top"===n||"left"===n?r<=i:i<=r))return o;if(o===A())break;o=H(o,!1)}return!1}function m(t,e,n){for(var o=0,i=0,r=t.children;i<r.length;){if("none"!==r[i].style.display&&r[i]!==Rt.ghost&&r[i]!==Rt.dragged&&P(r[i],n.draggable,t,!1)){if(o===e)return r[i];o++}i++}return null}function B(t,e){for(var n=t.lastElementChild;n&&(n===Rt.ghost||"none"===R(n,"display")||e&&!h(n,e));)n=n.previousElementSibling;return n||null}function F(t,e){var n=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)"TEMPLATE"===t.nodeName.toUpperCase()||t===Rt.clone||e&&!h(t,e)||n++;return n}function b(t){var e=0,n=0,o=A();if(t)do{var i=v(t),r=i.a,a=i.d;e+=t.scrollLeft*r,n+=t.scrollTop*a}while(t!==o&&(t=t.parentNode));return[e,n]}function H(t,e){if(!t||!t.getBoundingClientRect)return A();var n=t,o=!1;do{if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=R(n);if(n.clientWidth<n.scrollWidth&&("auto"==i.overflowX||"scroll"==i.overflowX)||n.clientHeight<n.scrollHeight&&("auto"==i.overflowY||"scroll"==i.overflowY)){if(!n.getBoundingClientRect||n===document.body)return A();if(o||e)return n;o=!0}}}while(n=n.parentNode);return A()}function y(t,e){return Math.round(t.top)===Math.round(e.top)&&Math.round(t.left)===Math.round(e.left)&&Math.round(t.height)===Math.round(e.height)&&Math.round(t.width)===Math.round(e.width)}function D(e,n){return function(){if(!f){var t=arguments;1===t.length?e.call(this,t[0]):e.apply(this,t),f=setTimeout(function(){f=void 0},n)}}}function L(t,e,n){t.scrollLeft+=e,t.scrollTop+=n}function S(t){var e=window.Polymer,n=window.jQuery||window.Zepto;return e&&e.dom?e.dom(t).cloneNode(!0):n?n(t).clone(!0)[0]:t.cloneNode(!0)}function _(t,e){R(t,"position","absolute"),R(t,"top",e.top),R(t,"left",e.left),R(t,"width",e.width),R(t,"height",e.height)}function C(t){R(t,"position",""),R(t,"top",""),R(t,"left",""),R(t,"width",""),R(t,"height","")}var j="Sortable"+(new Date).getTime();function T(){var e,o=[];return{captureAnimationState:function(){o=[],this.options.animation&&[].slice.call(this.el.children).forEach(function(t){if("none"!==R(t,"display")&&t!==Rt.ghost){o.push({target:t,rect:X(t)});var e=I({},o[o.length-1].rect);if(t.thisAnimationDuration){var n=v(t,!0);n&&(e.top-=n.f,e.left-=n.e)}t.fromRect=e}})},addAnimationState:function(t){o.push(t)},removeAnimationState:function(t){o.splice(function(t,e){for(var n in t)if(t.hasOwnProperty(n))for(var o in e)if(e.hasOwnProperty(o)&&e[o]===t[n][o])return Number(n);return-1}(o,{target:t}),1)},animateAll:function(t){var c=this;if(!this.options.animation)return clearTimeout(e),void("function"==typeof t&&t());var u=!1,d=0;o.forEach(function(t){var e=0,n=t.target,o=n.fromRect,i=X(n),r=n.prevFromRect,a=n.prevToRect,l=t.rect,s=v(n,!0);s&&(i.top-=s.f,i.left-=s.e),n.toRect=i,n.thisAnimationDuration&&y(r,i)&&!y(o,i)&&(l.top-i.top)/(l.left-i.left)==(o.top-i.top)/(o.left-i.left)&&(e=function(t,e,n,o){return Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))/Math.sqrt(Math.pow(e.top-n.top,2)+Math.pow(e.left-n.left,2))*o.animation}(l,r,a,c.options)),y(i,o)||(n.prevFromRect=o,n.prevToRect=i,e||(e=c.options.animation),c.animate(n,l,i,e)),e&&(u=!0,d=Math.max(d,e),clearTimeout(n.animationResetTimer),n.animationResetTimer=setTimeout(function(){n.animationTime=0,n.prevFromRect=null,n.fromRect=null,n.prevToRect=null,n.thisAnimationDuration=null},e),n.thisAnimationDuration=e)}),clearTimeout(e),u?e=setTimeout(function(){"function"==typeof t&&t()},d):"function"==typeof t&&t(),o=[]},animate:function(t,e,n,o){if(o){R(t,"transition",""),R(t,"transform","");var i=v(this.el),r=i&&i.a,a=i&&i.d,l=(e.left-n.left)/(r||1),s=(e.top-n.top)/(a||1);t.animatingX=!!l,t.animatingY=!!s,R(t,"transform","translate3d("+l+"px,"+s+"px,0)"),this.forRepaintDummy=function(t){return t.offsetWidth}(t),R(t,"transition","transform "+o+"ms"+(this.options.easing?" "+this.options.easing:"")),R(t,"transform","translate3d(0,0,0)"),"number"==typeof t.animated&&clearTimeout(t.animated),t.animated=setTimeout(function(){R(t,"transition",""),R(t,"transform",""),t.animated=!1,t.animatingX=!1,t.animatingY=!1},o)}}}}var x=[],M={initializeByDefault:!0},O={mount:function(e){for(var t in M)!M.hasOwnProperty(t)||t in e||(e[t]=M[t]);x.forEach(function(t){if(t.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),x.push(e)},pluginEvent:function(e,n,o){var t=this;this.eventCanceled=!1,o.cancel=function(){t.eventCanceled=!0};var i=e+"Global";x.forEach(function(t){n[t.pluginName]&&(n[t.pluginName][i]&&n[t.pluginName][i](I({sortable:n},o)),n.options[t.pluginName]&&n[t.pluginName][e]&&n[t.pluginName][e](I({sortable:n},o)))})},initializePlugins:function(o,i,r,t){for(var e in x.forEach(function(t){var e=t.pluginName;if(o.options[e]||t.initializeByDefault){var n=new t(o,i,o.options);n.sortable=o,n.options=o.options,o[e]=n,a(r,n.defaults)}}),o.options)if(o.options.hasOwnProperty(e)){var n=this.modifyOption(o,e,o.options[e]);void 0!==n&&(o.options[e]=n)}},getEventProperties:function(e,n){var o={};return x.forEach(function(t){"function"==typeof t.eventProperties&&a(o,t.eventProperties.call(n[t.pluginName],e))}),o},modifyOption:function(e,n,o){var i;return x.forEach(function(t){e[t.pluginName]&&t.optionListeners&&"function"==typeof t.optionListeners[n]&&(i=t.optionListeners[n].call(e[t.pluginName],o))}),i}};function N(t){var e=t.sortable,n=t.rootEl,o=t.name,i=t.targetEl,r=t.cloneEl,a=t.toEl,l=t.fromEl,s=t.oldIndex,c=t.newIndex,u=t.oldDraggableIndex,d=t.newDraggableIndex,h=t.originalEvent,f=t.putSortable,p=t.extraEventProperties;if(e=e||n&&n[j]){var g,v=e.options,m="on"+o.charAt(0).toUpperCase()+o.substr(1);!window.CustomEvent||w||E?(g=document.createEvent("Event")).initEvent(o,!0,!0):g=new CustomEvent(o,{bubbles:!0,cancelable:!0}),g.to=a||n,g.from=l||n,g.item=i||n,g.clone=r,g.oldIndex=s,g.newIndex=c,g.oldDraggableIndex=u,g.newDraggableIndex=d,g.originalEvent=h,g.pullMode=f?f.lastPutMode:void 0;var b=I({},p,O.getEventProperties(o,e));for(var y in b)g[y]=b[y];n&&n.dispatchEvent(g),v[m]&&v[m].call(e,g)}}function K(t,e,n){var o=2<arguments.length&&void 0!==n?n:{},i=o.evt,r=l(o,["evt"]);O.pluginEvent.bind(Rt)(t,e,I({dragEl:z,parentEl:G,ghostEl:U,rootEl:q,nextEl:V,lastDownEl:Z,cloneEl:Q,cloneHidden:$,dragStarted:dt,putSortable:it,activeSortable:Rt.active,originalEvent:i,oldIndex:J,oldDraggableIndex:et,newIndex:tt,newDraggableIndex:nt,hideGhostForTarget:At,unhideGhostForTarget:It,cloneNowHidden:function(){$=!0},cloneNowShown:function(){$=!1},dispatchSortableEvent:function(t){W({sortable:e,name:t,originalEvent:i})}},r))}function W(t){N(I({putSortable:it,cloneEl:Q,targetEl:z,rootEl:q,oldIndex:J,oldDraggableIndex:et,newIndex:tt,newDraggableIndex:nt},t))}var z,G,U,q,V,Z,Q,$,J,tt,et,nt,ot,it,rt,at,lt,st,ct,ut,dt,ht,ft,pt,gt,vt=!1,mt=!1,bt=[],yt=!1,wt=!1,Et=[],Dt=!1,St=[],_t="undefined"!=typeof document,Ct=n,Tt=E||w?"cssFloat":"float",xt=_t&&!i&&!n&&"draggable"in document.createElement("div"),Mt=function(){if(_t){if(w)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),Ot=function(t,e){var n=R(t),o=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=m(t,0,e),r=m(t,1,e),a=i&&R(i),l=r&&R(r),s=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+X(i).width,c=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+X(r).width;if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&a.float&&"none"!==a.float){var u="left"===a.float?"left":"right";return!r||"both"!==l.clear&&l.clear!==u?"horizontal":"vertical"}return i&&("block"===a.display||"flex"===a.display||"table"===a.display||"grid"===a.display||o<=s&&"none"===n[Tt]||r&&"none"===n[Tt]&&o<s+c)?"vertical":"horizontal"},Nt=function(t){function s(a,l){return function(t,e,n,o){var i=t.options.group.name&&e.options.group.name&&t.options.group.name===e.options.group.name;if(null==a&&(l||i))return!0;if(null==a||!1===a)return!1;if(l&&"clone"===a)return a;if("function"==typeof a)return s(a(t,e,n,o),l)(t,e,n,o);var r=(l?t:e).options.group.name;return!0===a||"string"==typeof a&&a===r||a.join&&-1<a.indexOf(r)}}var e={},n=t.group;n&&"object"==o(n)||(n={name:n}),e.name=n.name,e.checkPull=s(n.pull,!0),e.checkPut=s(n.put),e.revertClone=n.revertClone,t.group=e},At=function(){!Mt&&U&&R(U,"display","none")},It=function(){!Mt&&U&&R(U,"display","")};_t&&document.addEventListener("click",function(t){if(mt)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),mt=!1},!0);function Pt(t){if(z){var e=function(r,a){var l;return bt.some(function(t){if(!B(t)){var e=X(t),n=t[j].options.emptyInsertThreshold,o=r>=e.left-n&&r<=e.right+n,i=a>=e.top-n&&a<=e.bottom+n;return n&&o&&i?l=t:void 0}}),l}((t=t.touches?t.touches[0]:t).clientX,t.clientY);if(e){var n={};for(var o in t)t.hasOwnProperty(o)&&(n[o]=t[o]);n.target=n.rootEl=e,n.preventDefault=void 0,n.stopPropagation=void 0,e[j]._onDragOver(n)}}}function kt(t){z&&z.parentNode[j]._isOutsideThisEl(t.target)}function Rt(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=a({},e),t[j]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Ot(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(t,e){t.setData("Text",e.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==Rt.supportPointer&&"PointerEvent"in window&&!u,emptyInsertThreshold:5};for(var o in O.initializePlugins(this,t,n),n)o in e||(e[o]=n[o]);for(var i in Nt(e),this)"_"===i.charAt(0)&&"function"==typeof this[i]&&(this[i]=this[i].bind(this));this.nativeDraggable=!e.forceFallback&&xt,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?d(t,"pointerdown",this._onTapStart):(d(t,"mousedown",this._onTapStart),d(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(d(t,"dragover",this),d(t,"dragenter",this)),bt.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),a(this,T())}function Xt(t,e,n,o,i,r,a,l){var s,c,u=t[j],d=u.options.onMove;return!window.CustomEvent||w||E?(s=document.createEvent("Event")).initEvent("move",!0,!0):s=new CustomEvent("move",{bubbles:!0,cancelable:!0}),s.to=e,s.from=t,s.dragged=n,s.draggedRect=o,s.related=i||e,s.relatedRect=r||X(e),s.willInsertAfter=l,s.originalEvent=a,t.dispatchEvent(s),d&&(c=d.call(u,s,a)),c}function Yt(t){t.draggable=!1}function Bt(){Dt=!1}function Ft(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,o=0;n--;)o+=e.charCodeAt(n);return o.toString(36)}function Ht(t){return setTimeout(t,0)}function Lt(t){return clearTimeout(t)}Rt.prototype={constructor:Rt,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(ht=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,z):this.options.direction},_onTapStart:function(e){if(e.cancelable){var n=this,o=this.el,t=this.options,i=t.preventOnFilter,r=e.type,a=e.touches&&e.touches[0]||e.pointerType&&"touch"===e.pointerType&&e,l=(a||e).target,s=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||l,c=t.filter;if(function(t){St.length=0;var e=t.getElementsByTagName("input"),n=e.length;for(;n--;){var o=e[n];o.checked&&St.push(o)}}(o),!z&&!(/mousedown|pointerdown/.test(r)&&0!==e.button||t.disabled)&&!s.isContentEditable&&(this.nativeDraggable||!u||!l||"SELECT"!==l.tagName.toUpperCase())&&!((l=P(l,t.draggable,o,!1))&&l.animated||Z===l)){if(J=F(l),et=F(l,t.draggable),"function"==typeof c){if(c.call(this,e,l,this))return W({sortable:n,rootEl:s,name:"filter",targetEl:l,toEl:o,fromEl:o}),K("filter",n,{evt:e}),void(i&&e.cancelable&&e.preventDefault())}else if(c&&(c=c.split(",").some(function(t){if(t=P(s,t.trim(),o,!1))return W({sortable:n,rootEl:t,name:"filter",targetEl:l,fromEl:o,toEl:o}),K("filter",n,{evt:e}),!0})))return void(i&&e.cancelable&&e.preventDefault());t.handle&&!P(s,t.handle,o,!1)||this._prepareDragStart(e,a,l)}}},_prepareDragStart:function(t,e,n){var o,i=this,r=i.el,a=i.options,l=r.ownerDocument;if(n&&!z&&n.parentNode===r){var s=X(n);if(q=r,G=(z=n).parentNode,V=z.nextSibling,Z=n,ot=a.group,rt={target:Rt.dragged=z,clientX:(e||t).clientX,clientY:(e||t).clientY},ct=rt.clientX-s.left,ut=rt.clientY-s.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,z.style["will-change"]="all",o=function(){K("delayEnded",i,{evt:t}),Rt.eventCanceled?i._onDrop():(i._disableDelayedDragEvents(),!c&&i.nativeDraggable&&(z.draggable=!0),i._triggerDragStart(t,e),W({sortable:i,name:"choose",originalEvent:t}),k(z,a.chosenClass,!0))},a.ignore.split(",").forEach(function(t){g(z,t.trim(),Yt)}),d(l,"dragover",Pt),d(l,"mousemove",Pt),d(l,"touchmove",Pt),d(l,"mouseup",i._onDrop),d(l,"touchend",i._onDrop),d(l,"touchcancel",i._onDrop),c&&this.nativeDraggable&&(this.options.touchStartThreshold=4,z.draggable=!0),K("delayStart",this,{evt:t}),!a.delay||a.delayOnTouchOnly&&!e||this.nativeDraggable&&(E||w))o();else{if(Rt.eventCanceled)return void this._onDrop();d(l,"mouseup",i._disableDelayedDrag),d(l,"touchend",i._disableDelayedDrag),d(l,"touchcancel",i._disableDelayedDrag),d(l,"mousemove",i._delayedDragTouchMoveHandler),d(l,"touchmove",i._delayedDragTouchMoveHandler),a.supportPointer&&d(l,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(o,a.delay)}}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){z&&Yt(z),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;s(t,"mouseup",this._disableDelayedDrag),s(t,"touchend",this._disableDelayedDrag),s(t,"touchcancel",this._disableDelayedDrag),s(t,"mousemove",this._delayedDragTouchMoveHandler),s(t,"touchmove",this._delayedDragTouchMoveHandler),s(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?d(document,"pointermove",this._onTouchMove):d(document,e?"touchmove":"mousemove",this._onTouchMove):(d(z,"dragend",this),d(q,"dragstart",this._onDragStart));try{document.selection?Ht(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch(t){}},_dragStarted:function(t,e){if(vt=!1,q&&z){K("dragStarted",this,{evt:e}),this.nativeDraggable&&d(document,"dragover",kt);var n=this.options;t||k(z,n.dragClass,!1),k(z,n.ghostClass,!0),Rt.active=this,t&&this._appendGhost(),W({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(at){this._lastX=at.clientX,this._lastY=at.clientY,At();for(var t=document.elementFromPoint(at.clientX,at.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(at.clientX,at.clientY))!==e;)e=t;if(z.parentNode[j]._isOutsideThisEl(t),e)do{if(e[j]){if(e[j]._onDragOver({clientX:at.clientX,clientY:at.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break}t=e}while(e=e.parentNode);It()}},_onTouchMove:function(t){if(rt){var e=this.options,n=e.fallbackTolerance,o=e.fallbackOffset,i=t.touches?t.touches[0]:t,r=U&&v(U,!0),a=U&&r&&r.a,l=U&&r&&r.d,s=Ct&&gt&&b(gt),c=(i.clientX-rt.clientX+o.x)/(a||1)+(s?s[0]-Et[0]:0)/(a||1),u=(i.clientY-rt.clientY+o.y)/(l||1)+(s?s[1]-Et[1]:0)/(l||1);if(!Rt.active&&!vt){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<n)return;this._onDragStart(t,!0)}if(U){r?(r.e+=c-(lt||0),r.f+=u-(st||0)):r={a:1,b:0,c:0,d:1,e:c,f:u};var d="matrix(".concat(r.a,",").concat(r.b,",").concat(r.c,",").concat(r.d,",").concat(r.e,",").concat(r.f,")");R(U,"webkitTransform",d),R(U,"mozTransform",d),R(U,"msTransform",d),R(U,"transform",d),lt=c,st=u,at=i}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!U){var t=this.options.fallbackOnBody?document.body:q,e=X(z,!0,Ct,!0,t),n=this.options;if(Ct){for(gt=t;"static"===R(gt,"position")&&"none"===R(gt,"transform")&&gt!==document;)gt=gt.parentNode;gt!==document.body&&gt!==document.documentElement?(gt===document&&(gt=A()),e.top+=gt.scrollTop,e.left+=gt.scrollLeft):gt=A(),Et=b(gt)}k(U=z.cloneNode(!0),n.ghostClass,!1),k(U,n.fallbackClass,!0),k(U,n.dragClass,!0),R(U,"transition",""),R(U,"transform",""),R(U,"box-sizing","border-box"),R(U,"margin",0),R(U,"top",e.top),R(U,"left",e.left),R(U,"width",e.width),R(U,"height",e.height),R(U,"opacity","0.8"),R(U,"position",Ct?"absolute":"fixed"),R(U,"zIndex","100000"),R(U,"pointerEvents","none"),Rt.ghost=U,t.appendChild(U),R(U,"transform-origin",ct/parseInt(U.style.width)*100+"% "+ut/parseInt(U.style.height)*100+"%")}},_onDragStart:function(t,e){var n=this,o=t.dataTransfer,i=n.options;K("dragStart",this,{evt:t}),Rt.eventCanceled?this._onDrop():(K("setupClone",this),Rt.eventCanceled||((Q=S(z)).draggable=!1,Q.style["will-change"]="",this._hideClone(),k(Q,this.options.chosenClass,!1),Rt.clone=Q),n.cloneId=Ht(function(){K("clone",n),Rt.eventCanceled||(n.options.removeCloneOnHide||q.insertBefore(Q,z),n._hideClone(),W({sortable:n,name:"clone"}))}),e||k(z,i.dragClass,!0),e?(mt=!0,n._loopId=setInterval(n._emulateDragOver,50)):(s(document,"mouseup",n._onDrop),s(document,"touchend",n._onDrop),s(document,"touchcancel",n._onDrop),o&&(o.effectAllowed="move",i.setData&&i.setData.call(n,o,z)),d(document,"drop",n),R(z,"transform","translateZ(0)")),vt=!0,n._dragStartId=Ht(n._dragStarted.bind(n,e,t)),d(document,"selectstart",n),dt=!0,u&&R(document.body,"user-select","none"))},_onDragOver:function(n){var o,i,r,a,l=this.el,s=n.target,e=this.options,t=e.group,c=Rt.active,u=ot===t,d=e.sort,h=it||c,f=this,p=!1;if(!Dt){if(void 0!==n.preventDefault&&n.cancelable&&n.preventDefault(),s=P(s,e.draggable,l,!0),M("dragOver"),Rt.eventCanceled)return p;if(z.contains(n.target)||s.animated&&s.animatingX&&s.animatingY||f._ignoreWhileAnimating===s)return N(!1);if(mt=!1,c&&!e.disabled&&(u?d||(r=!q.contains(z)):it===this||(this.lastPutMode=ot.checkPull(this,c,z,n))&&t.checkPut(this,c,z,n))){if(a="vertical"===this._getDirection(n,s),o=X(z),M("dragOverValid"),Rt.eventCanceled)return p;if(r)return G=q,O(),this._hideClone(),M("revert"),Rt.eventCanceled||(V?q.insertBefore(z,V):q.appendChild(z)),N(!0);var g=B(l,e.draggable);if(!g||function(t,e,n){var o=X(B(n.el,n.options.draggable));return e?t.clientX>o.right+10||t.clientX<=o.right&&t.clientY>o.bottom&&t.clientX>=o.left:t.clientX>o.right&&t.clientY>o.top||t.clientX<=o.right&&t.clientY>o.bottom+10}(n,a,this)&&!g.animated){if(g===z)return N(!1);if(g&&l===n.target&&(s=g),s&&(i=X(s)),!1!==Xt(q,l,z,o,s,i,n,!!s))return O(),l.appendChild(z),G=l,A(),N(!0)}else if(s.parentNode===l){i=X(s);var v,m,b,y=z.parentNode!==l,w=!function(t,e,n){var o=n?t.left:t.top,i=n?t.right:t.bottom,r=n?t.width:t.height,a=n?e.left:e.top,l=n?e.right:e.bottom,s=n?e.width:e.height;return o===a||i===l||o+r/2===a+s/2}(z.animated&&z.toRect||o,s.animated&&s.toRect||i,a),E=a?"top":"left",D=Y(s,"top","top")||Y(z,"top","top"),S=D?D.scrollTop:void 0;if(ht!==s&&(m=i[E],yt=!1,wt=!w&&e.invertSwap||y),0!==(v=function(t,e,n,o,i,r,a,l){var s=o?t.clientY:t.clientX,c=o?n.height:n.width,u=o?n.top:n.left,d=o?n.bottom:n.right,h=!1;if(!a)if(l&&pt<c*i){if(!yt&&(1===ft?u+c*r/2<s:s<d-c*r/2)&&(yt=!0),yt)h=!0;else if(1===ft?s<u+pt:d-pt<s)return-ft}else if(u+c*(1-i)/2<s&&s<d-c*(1-i)/2)return function(t){return F(z)<F(t)?1:-1}(e);if((h=h||a)&&(s<u+c*r/2||d-c*r/2<s))return u+c/2<s?1:-1;return 0}(n,s,i,a,w?1:e.swapThreshold,null==e.invertedSwapThreshold?e.swapThreshold:e.invertedSwapThreshold,wt,ht===s)))for(var _=F(z);_-=v,(b=G.children[_])&&("none"===R(b,"display")||b===U););if(0===v||b===s)return N(!1);ft=v;var C=(ht=s).nextElementSibling,T=!1,x=Xt(q,l,z,o,s,i,n,T=1===v);if(!1!==x)return 1!==x&&-1!==x||(T=1===x),Dt=!0,setTimeout(Bt,30),O(),T&&!C?l.appendChild(z):s.parentNode.insertBefore(z,T?C:s),D&&L(D,0,S-D.scrollTop),G=z.parentNode,void 0===m||wt||(pt=Math.abs(m-X(s)[E])),A(),N(!0)}if(l.contains(z))return N(!1)}return!1}function M(t,e){K(t,f,I({evt:n,isOwner:u,axis:a?"vertical":"horizontal",revert:r,dragRect:o,targetRect:i,canSort:d,fromSortable:h,target:s,completed:N,onMove:function(t,e){return Xt(q,l,z,o,t,X(t),n,e)},changed:A},e))}function O(){M("dragOverAnimationCapture"),f.captureAnimationState(),f!==h&&h.captureAnimationState()}function N(t){return M("dragOverCompleted",{insertion:t}),t&&(u?c._hideClone():c._showClone(f),f!==h&&(k(z,it?it.options.ghostClass:c.options.ghostClass,!1),k(z,e.ghostClass,!0)),it!==f&&f!==Rt.active?it=f:f===Rt.active&&it&&(it=null),h===f&&(f._ignoreWhileAnimating=s),f.animateAll(function(){M("dragOverAnimationComplete"),f._ignoreWhileAnimating=null}),f!==h&&(h.animateAll(),h._ignoreWhileAnimating=null)),(s===z&&!z.animated||s===l&&!s.animated)&&(ht=null),e.dragoverBubble||n.rootEl||s===document||(z.parentNode[j]._isOutsideThisEl(n.target),t||Pt(n)),!e.dragoverBubble&&n.stopPropagation&&n.stopPropagation(),p=!0}function A(){tt=F(z),nt=F(z,e.draggable),W({sortable:f,name:"change",toEl:l,newIndex:tt,newDraggableIndex:nt,originalEvent:n})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){s(document,"mousemove",this._onTouchMove),s(document,"touchmove",this._onTouchMove),s(document,"pointermove",this._onTouchMove),s(document,"dragover",Pt),s(document,"mousemove",Pt),s(document,"touchmove",Pt)},_offUpEvents:function(){var t=this.el.ownerDocument;s(t,"mouseup",this._onDrop),s(t,"touchend",this._onDrop),s(t,"pointerup",this._onDrop),s(t,"touchcancel",this._onDrop),s(document,"selectstart",this)},_onDrop:function(t){var e=this.el,n=this.options;tt=F(z),nt=F(z,n.draggable),K("drop",this,{evt:t}),G=z&&z.parentNode,tt=F(z),nt=F(z,n.draggable),Rt.eventCanceled||(yt=wt=vt=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Lt(this.cloneId),Lt(this._dragStartId),this.nativeDraggable&&(s(document,"drop",this),s(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),u&&R(document.body,"user-select",""),R(z,"transform",""),t&&(dt&&(t.cancelable&&t.preventDefault(),n.dropBubble||t.stopPropagation()),U&&U.parentNode&&U.parentNode.removeChild(U),(q===G||it&&"clone"!==it.lastPutMode)&&Q&&Q.parentNode&&Q.parentNode.removeChild(Q),z&&(this.nativeDraggable&&s(z,"dragend",this),Yt(z),z.style["will-change"]="",dt&&!vt&&k(z,it?it.options.ghostClass:this.options.ghostClass,!1),k(z,this.options.chosenClass,!1),W({sortable:this,name:"unchoose",toEl:G,newIndex:null,newDraggableIndex:null,originalEvent:t}),q!==G?(0<=tt&&(W({rootEl:G,name:"add",toEl:G,fromEl:q,originalEvent:t}),W({sortable:this,name:"remove",toEl:G,originalEvent:t}),W({rootEl:G,name:"sort",toEl:G,fromEl:q,originalEvent:t}),W({sortable:this,name:"sort",toEl:G,originalEvent:t})),it&&it.save()):tt!==J&&0<=tt&&(W({sortable:this,name:"update",toEl:G,originalEvent:t}),W({sortable:this,name:"sort",toEl:G,originalEvent:t})),Rt.active&&(null!=tt&&-1!==tt||(tt=J,nt=et),W({sortable:this,name:"end",toEl:G,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){K("nulling",this),q=z=G=U=V=Q=Z=$=rt=at=dt=tt=nt=J=et=ht=ft=it=ot=Rt.dragged=Rt.ghost=Rt.clone=Rt.active=null,St.forEach(function(t){t.checked=!0}),St.length=lt=st=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":z&&(this._onDragOver(t),function(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move");t.cancelable&&t.preventDefault()}(t));break;case"selectstart":t.preventDefault()}},toArray:function(){for(var t,e=[],n=this.el.children,o=0,i=n.length,r=this.options;o<i;o++)P(t=n[o],r.draggable,this.el,!1)&&e.push(t.getAttribute(r.dataIdAttr)||Ft(t));return e},sort:function(t,e){var o={},i=this.el;this.toArray().forEach(function(t,e){var n=i.children[e];P(n,this.options.draggable,i,!1)&&(o[t]=n)},this),e&&this.captureAnimationState(),t.forEach(function(t){o[t]&&(i.removeChild(o[t]),i.appendChild(o[t]))}),e&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,e){return P(t,e||this.options.draggable,this.el,!1)},option:function(t,e){var n=this.options;if(void 0===e)return n[t];var o=O.modifyOption(this,t,e);n[t]=void 0!==o?o:e,"group"===t&&Nt(n)},destroy:function(){K("destroy",this);var t=this.el;t[j]=null,s(t,"mousedown",this._onTapStart),s(t,"touchstart",this._onTapStart),s(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(s(t,"dragover",this),s(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(t){t.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),bt.splice(bt.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!$){if(K("hideClone",this),Rt.eventCanceled)return;R(Q,"display","none"),this.options.removeCloneOnHide&&Q.parentNode&&Q.parentNode.removeChild(Q),$=!0}},_showClone:function(t){if("clone"===t.lastPutMode){if($){if(K("showClone",this),Rt.eventCanceled)return;z.parentNode!=q||this.options.group.revertClone?V?q.insertBefore(Q,V):q.appendChild(Q):q.insertBefore(Q,z),this.options.group.revertClone&&this.animate(z,Q),R(Q,"display",""),$=!1}}else this._hideClone()}},_t&&d(document,"touchmove",function(t){(Rt.active||vt)&&t.cancelable&&t.preventDefault()}),Rt.utils={on:d,off:s,css:R,find:g,is:function(t,e){return!!P(t,e,t,!1)},extend:function(t,e){if(t&&e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t},throttle:D,closest:P,toggleClass:k,clone:S,index:F,nextTick:Ht,cancelNextTick:Lt,detectDirection:Ot,getChild:m},Rt.get=function(t){return t[j]},Rt.mount=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];e[0].constructor===Array&&(e=e[0]),e.forEach(function(t){if(!t.prototype||!t.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(t));t.utils&&(Rt.utils=I({},Rt.utils,t.utils)),O.mount(t)})},Rt.create=function(t,e){return new Rt(t,e)};var jt,Kt,Wt,zt,Gt,Ut,qt=[],Vt=!(Rt.version="1.13.0");function Zt(){qt.forEach(function(t){clearInterval(t.pid)}),qt=[]}function Qt(){clearInterval(Ut)}function $t(t){var e=t.originalEvent,n=t.putSortable,o=t.dragEl,i=t.activeSortable,r=t.dispatchSortableEvent,a=t.hideGhostForTarget,l=t.unhideGhostForTarget;if(e){var s=n||i;a();var c=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:e,u=document.elementFromPoint(c.clientX,c.clientY);l(),s&&!s.el.contains(u)&&(r("spill"),this.onSpill({dragEl:o,putSortable:n}))}}var Jt,te=D(function(n,t,e,o){if(t.scroll){var i,r=(n.touches?n.touches[0]:n).clientX,a=(n.touches?n.touches[0]:n).clientY,l=t.scrollSensitivity,s=t.scrollSpeed,c=A(),u=!1;Kt!==e&&(Kt=e,Zt(),jt=t.scroll,i=t.scrollFn,!0===jt&&(jt=H(e,!0)));var d=0,h=jt;do{var f=h,p=X(f),g=p.top,v=p.bottom,m=p.left,b=p.right,y=p.width,w=p.height,E=void 0,D=void 0,S=f.scrollWidth,_=f.scrollHeight,C=R(f),T=f.scrollLeft,x=f.scrollTop;D=f===c?(E=y<S&&("auto"===C.overflowX||"scroll"===C.overflowX||"visible"===C.overflowX),w<_&&("auto"===C.overflowY||"scroll"===C.overflowY||"visible"===C.overflowY)):(E=y<S&&("auto"===C.overflowX||"scroll"===C.overflowX),w<_&&("auto"===C.overflowY||"scroll"===C.overflowY));var M=E&&(Math.abs(b-r)<=l&&T+y<S)-(Math.abs(m-r)<=l&&!!T),O=D&&(Math.abs(v-a)<=l&&x+w<_)-(Math.abs(g-a)<=l&&!!x);if(!qt[d])for(var N=0;N<=d;N++)qt[N]||(qt[N]={});qt[d].vx==M&&qt[d].vy==O&&qt[d].el===f||(qt[d].el=f,qt[d].vx=M,qt[d].vy=O,clearInterval(qt[d].pid),0==M&&0==O||(u=!0,qt[d].pid=setInterval(function(){o&&0===this.layer&&Rt.active._onTouchMove(Gt);var t=qt[this.layer].vy?qt[this.layer].vy*s:0,e=qt[this.layer].vx?qt[this.layer].vx*s:0;"function"==typeof i&&"continue"!==i.call(Rt.dragged.parentNode[j],e,t,n,Gt,qt[this.layer].el)||L(qt[this.layer].el,e,t)}.bind({layer:d}),24))),d++}while(t.bubbleScroll&&h!==c&&(h=H(h,!1)));Vt=u}},30);function ee(){}function ne(){}ee.prototype={startIndex:null,dragStart:function(t){var e=t.oldDraggableIndex;this.startIndex=e},onSpill:function(t){var e=t.dragEl,n=t.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var o=m(this.sortable.el,this.startIndex,this.options);o?this.sortable.el.insertBefore(e,o):this.sortable.el.appendChild(e),this.sortable.animateAll(),n&&n.animateAll()},drop:$t},a(ee,{pluginName:"revertOnSpill"}),ne.prototype={onSpill:function(t){var e=t.dragEl,n=t.putSortable||this.sortable;n.captureAnimationState(),e.parentNode&&e.parentNode.removeChild(e),n.animateAll()},drop:$t},a(ne,{pluginName:"removeOnSpill"});var oe,ie,re,ae,le,se=[],ce=[],ue=!1,de=!1,he=!1;function fe(o,i){ce.forEach(function(t,e){var n=i.children[t.sortableIndex+(o?Number(e):0)];n?i.insertBefore(t,n):i.appendChild(t)})}function pe(){se.forEach(function(t){t!==re&&t.parentNode&&t.parentNode.removeChild(t)})}return Rt.mount(new function(){function t(){for(var t in this.defaults={scroll:!0,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)"_"===t.charAt(0)&&"function"==typeof this[t]&&(this[t]=this[t].bind(this))}return t.prototype={dragStarted:function(t){var e=t.originalEvent;this.sortable.nativeDraggable?d(document,"dragover",this._handleAutoScroll):this.options.supportPointer?d(document,"pointermove",this._handleFallbackAutoScroll):e.touches?d(document,"touchmove",this._handleFallbackAutoScroll):d(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){var e=t.originalEvent;this.options.dragOverBubble||e.rootEl||this._handleAutoScroll(e)},drop:function(){this.sortable.nativeDraggable?s(document,"dragover",this._handleAutoScroll):(s(document,"pointermove",this._handleFallbackAutoScroll),s(document,"touchmove",this._handleFallbackAutoScroll),s(document,"mousemove",this._handleFallbackAutoScroll)),Qt(),Zt(),clearTimeout(f),f=void 0},nulling:function(){Gt=Kt=jt=Vt=Ut=Wt=zt=null,qt.length=0},_handleFallbackAutoScroll:function(t){this._handleAutoScroll(t,!0)},_handleAutoScroll:function(e,n){var o=this,i=(e.touches?e.touches[0]:e).clientX,r=(e.touches?e.touches[0]:e).clientY,t=document.elementFromPoint(i,r);if(Gt=e,n||E||w||u){te(e,this.options,t,n);var a=H(t,!0);!Vt||Ut&&i===Wt&&r===zt||(Ut&&Qt(),Ut=setInterval(function(){var t=H(document.elementFromPoint(i,r),!0);t!==a&&(a=t,Zt()),te(e,o.options,t,n)},10),Wt=i,zt=r)}else{if(!this.options.bubbleScroll||H(t,!0)===A())return void Zt();te(e,this.options,H(t,!1),!1)}}},a(t,{pluginName:"scroll",initializeByDefault:!0})}),Rt.mount(ne,ee),Rt.mount(new function(){function t(){this.defaults={swapClass:"sortable-swap-highlight"}}return t.prototype={dragStart:function(t){var e=t.dragEl;Jt=e},dragOverValid:function(t){var e=t.completed,n=t.target,o=t.onMove,i=t.activeSortable,r=t.changed,a=t.cancel;if(i.options.swap){var l=this.sortable.el,s=this.options;if(n&&n!==l){var c=Jt;Jt=!1!==o(n)?(k(n,s.swapClass,!0),n):null,c&&c!==Jt&&k(c,s.swapClass,!1)}r(),e(!0),a()}},drop:function(t){var e=t.activeSortable,n=t.putSortable,o=t.dragEl,i=n||this.sortable,r=this.options;Jt&&k(Jt,r.swapClass,!1),Jt&&(r.swap||n&&n.options.swap)&&o!==Jt&&(i.captureAnimationState(),i!==e&&e.captureAnimationState(),function(t,e){var n,o,i=t.parentNode,r=e.parentNode;if(!i||!r||i.isEqualNode(e)||r.isEqualNode(t))return;n=F(t),o=F(e),i.isEqualNode(r)&&n<o&&o++;i.insertBefore(e,i.children[n]),r.insertBefore(t,r.children[o])}(o,Jt),i.animateAll(),i!==e&&e.animateAll())},nulling:function(){Jt=null}},a(t,{pluginName:"swap",eventProperties:function(){return{swapItem:Jt}}})}),Rt.mount(new function(){function t(o){for(var t in this)"_"===t.charAt(0)&&"function"==typeof this[t]&&(this[t]=this[t].bind(this));o.options.supportPointer?d(document,"pointerup",this._deselectMultiDrag):(d(document,"mouseup",this._deselectMultiDrag),d(document,"touchend",this._deselectMultiDrag)),d(document,"keydown",this._checkKeyDown),d(document,"keyup",this._checkKeyUp),this.defaults={selectedClass:"sortable-selected",multiDragKey:null,setData:function(t,e){var n="";se.length&&ie===o?se.forEach(function(t,e){n+=(e?", ":"")+t.textContent}):n=e.textContent,t.setData("Text",n)}}}return t.prototype={multiDragKeyDown:!1,isMultiDrag:!1,delayStartGlobal:function(t){var e=t.dragEl;re=e},delayEnded:function(){this.isMultiDrag=~se.indexOf(re)},setupClone:function(t){var e=t.sortable,n=t.cancel;if(this.isMultiDrag){for(var o=0;o<se.length;o++)ce.push(S(se[o])),ce[o].sortableIndex=se[o].sortableIndex,ce[o].draggable=!1,ce[o].style["will-change"]="",k(ce[o],this.options.selectedClass,!1),se[o]===re&&k(ce[o],this.options.chosenClass,!1);e._hideClone(),n()}},clone:function(t){var e=t.sortable,n=t.rootEl,o=t.dispatchSortableEvent,i=t.cancel;this.isMultiDrag&&(this.options.removeCloneOnHide||se.length&&ie===e&&(fe(!0,n),o("clone"),i()))},showClone:function(t){var e=t.cloneNowShown,n=t.rootEl,o=t.cancel;this.isMultiDrag&&(fe(!1,n),ce.forEach(function(t){R(t,"display","")}),e(),le=!1,o())},hideClone:function(t){var e=this,n=(t.sortable,t.cloneNowHidden),o=t.cancel;this.isMultiDrag&&(ce.forEach(function(t){R(t,"display","none"),e.options.removeCloneOnHide&&t.parentNode&&t.parentNode.removeChild(t)}),n(),le=!0,o())},dragStartGlobal:function(t){t.sortable;!this.isMultiDrag&&ie&&ie.multiDrag._deselectMultiDrag(),se.forEach(function(t){t.sortableIndex=F(t)}),se=se.sort(function(t,e){return t.sortableIndex-e.sortableIndex}),he=!0},dragStarted:function(t){var e=this,n=t.sortable;if(this.isMultiDrag){if(this.options.sort&&(n.captureAnimationState(),this.options.animation)){se.forEach(function(t){t!==re&&R(t,"position","absolute")});var o=X(re,!1,!0,!0);se.forEach(function(t){t!==re&&_(t,o)}),ue=de=!0}n.animateAll(function(){ue=de=!1,e.options.animation&&se.forEach(function(t){C(t)}),e.options.sort&&pe()})}},dragOver:function(t){var e=t.target,n=t.completed,o=t.cancel;de&&~se.indexOf(e)&&(n(!1),o())},revert:function(t){var e=t.fromSortable,n=t.rootEl,o=t.sortable,i=t.dragRect;1<se.length&&(se.forEach(function(t){o.addAnimationState({target:t,rect:de?X(t):i}),C(t),t.fromRect=i,e.removeAnimationState(t)}),de=!1,function(o,i){se.forEach(function(t,e){var n=i.children[t.sortableIndex+(o?Number(e):0)];n?i.insertBefore(t,n):i.appendChild(t)})}(!this.options.removeCloneOnHide,n))},dragOverCompleted:function(t){var e=t.sortable,n=t.isOwner,o=t.insertion,i=t.activeSortable,r=t.parentEl,a=t.putSortable,l=this.options;if(o){if(n&&i._hideClone(),ue=!1,l.animation&&1<se.length&&(de||!n&&!i.options.sort&&!a)){var s=X(re,!1,!0,!0);se.forEach(function(t){t!==re&&(_(t,s),r.appendChild(t))}),de=!0}if(!n)if(de||pe(),1<se.length){var c=le;i._showClone(e),i.options.animation&&!le&&c&&ce.forEach(function(t){i.addAnimationState({target:t,rect:ae}),t.fromRect=ae,t.thisAnimationDuration=null})}else i._showClone(e)}},dragOverAnimationCapture:function(t){var e=t.dragRect,n=t.isOwner,o=t.activeSortable;if(se.forEach(function(t){t.thisAnimationDuration=null}),o.options.animation&&!n&&o.multiDrag.isMultiDrag){ae=a({},e);var i=v(re,!0);ae.top-=i.f,ae.left-=i.e}},dragOverAnimationComplete:function(){de&&(de=!1,pe())},drop:function(t){var e=t.originalEvent,n=t.rootEl,o=t.parentEl,i=t.sortable,r=t.dispatchSortableEvent,a=t.oldIndex,l=t.putSortable,s=l||this.sortable;if(e){var c=this.options,u=o.children;if(!he)if(c.multiDragKey&&!this.multiDragKeyDown&&this._deselectMultiDrag(),k(re,c.selectedClass,!~se.indexOf(re)),~se.indexOf(re))se.splice(se.indexOf(re),1),oe=null,N({sortable:i,rootEl:n,name:"deselect",targetEl:re,originalEvt:e});else{if(se.push(re),N({sortable:i,rootEl:n,name:"select",targetEl:re,originalEvt:e}),e.shiftKey&&oe&&i.el.contains(oe)){var d,h,f=F(oe),p=F(re);if(~f&&~p&&f!==p)for(d=f<p?(h=f,p):(h=p,f+1);h<d;h++)~se.indexOf(u[h])||(k(u[h],c.selectedClass,!0),se.push(u[h]),N({sortable:i,rootEl:n,name:"select",targetEl:u[h],originalEvt:e}))}else oe=re;ie=s}if(he&&this.isMultiDrag){if((o[j].options.sort||o!==n)&&1<se.length){var g=X(re),v=F(re,":not(."+this.options.selectedClass+")");if(!ue&&c.animation&&(re.thisAnimationDuration=null),s.captureAnimationState(),!ue&&(c.animation&&(re.fromRect=g,se.forEach(function(t){if(t.thisAnimationDuration=null,t!==re){var e=de?X(t):g;t.fromRect=e,s.addAnimationState({target:t,rect:e})}})),pe(),se.forEach(function(t){u[v]?o.insertBefore(t,u[v]):o.appendChild(t),v++}),a===F(re))){var m=!1;se.forEach(function(t){t.sortableIndex===F(t)||(m=!0)}),m&&r("update")}se.forEach(function(t){C(t)}),s.animateAll()}ie=s}(n===o||l&&"clone"!==l.lastPutMode)&&ce.forEach(function(t){t.parentNode&&t.parentNode.removeChild(t)})}},nullingGlobal:function(){this.isMultiDrag=he=!1,ce.length=0},destroyGlobal:function(){this._deselectMultiDrag(),s(document,"pointerup",this._deselectMultiDrag),s(document,"mouseup",this._deselectMultiDrag),s(document,"touchend",this._deselectMultiDrag),s(document,"keydown",this._checkKeyDown),s(document,"keyup",this._checkKeyUp)},_deselectMultiDrag:function(t){if(!(void 0!==he&&he||ie!==this.sortable||t&&P(t.target,this.options.draggable,this.sortable.el,!1)||t&&0!==t.button))for(;se.length;){var e=se[0];k(e,this.options.selectedClass,!1),se.shift(),N({sortable:this.sortable,rootEl:this.sortable.el,name:"deselect",targetEl:e,originalEvt:t})}},_checkKeyDown:function(t){t.key===this.options.multiDragKey&&(this.multiDragKeyDown=!0)},_checkKeyUp:function(t){t.key===this.options.multiDragKey&&(this.multiDragKeyDown=!1)}},a(t,{pluginName:"multiDrag",utils:{select:function(t){var e=t.parentNode[j];e&&e.options.multiDrag&&!~se.indexOf(t)&&(ie&&ie!==e&&(ie.multiDrag._deselectMultiDrag(),ie=e),k(t,e.options.selectedClass,!0),se.push(t))},deselect:function(t){var e=t.parentNode[j],n=se.indexOf(t);e&&e.options.multiDrag&&~n&&(k(t,e.options.selectedClass,!1),se.splice(n,1))}},eventProperties:function(){var n=this,o=[],i=[];return se.forEach(function(t){var e;o.push({multiDragElement:t,index:t.sortableIndex}),e=de&&t!==re?-1:de?F(t,":not(."+n.options.selectedClass+")"):F(t),i.push({multiDragElement:t,index:e})}),{items:e(se),clones:[].concat(ce),oldIndicies:o,newIndicies:i}},optionListeners:{multiDragKey:function(t){return"ctrl"===(t=t.toLowerCase())?t="Control":1<t.length&&(t=t.charAt(0).toUpperCase()+t.substr(1)),t}}})}),Rt});
diff --git a/backend/vendor/assets/javascripts/sweetalert2.js b/backend/vendor/assets/javascripts/sweetalert2.js
deleted file mode 100644
index 393f957832..0000000000
--- a/backend/vendor/assets/javascripts/sweetalert2.js
+++ /dev/null
@@ -1,2 +0,0 @@
-!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).Sweetalert2=e()}(this,function(){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function s(t,e,n){return e&&o(t.prototype,e),n&&o(t,n),t}function u(){return(u=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n,o=arguments[e];for(n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])}return t}).apply(this,arguments)}function c(t){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function l(t,e){return(l=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function d(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}function i(t,e,n){return(i=d()?Reflect.construct:function(t,e,n){var o=[null];o.push.apply(o,e);o=new(Function.bind.apply(t,o));return n&&l(o,n.prototype),o}).apply(null,arguments)}function p(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function f(t,e,n){return(f="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){t=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=c(t)););return t}(t,e);if(t){e=Object.getOwnPropertyDescriptor(t,e);return e.get?e.get.call(n):e.value}})(t,e,n||t)}function m(t){return t.charAt(0).toUpperCase()+t.slice(1)}function h(e){return Object.keys(e).map(function(t){return e[t]})}function g(t){return Array.prototype.slice.call(t)}function v(t,e){e='"'.concat(t,'" is deprecated and will be removed in the next major release. Please use "').concat(e,'" instead.'),-1===Y.indexOf(e)&&(Y.push(e),W(e))}function b(t){return t&&"function"==typeof t.toPromise}function y(t){return b(t)?t.toPromise():Promise.resolve(t)}function w(t){return t&&Promise.resolve(t)===t}function C(t){return t instanceof Element||"object"===r(t=t)&&t.jquery}function k(){return document.body.querySelector(".".concat($.container))}function e(t){var e=k();return e?e.querySelector(t):null}function t(t){return e(".".concat(t))}function A(){return t($.popup)}function x(){return t($.icon)}function B(){return t($.title)}function P(){return t($.content)}function O(){return t($["html-container"])}function E(){return t($.image)}function n(){return t($["progress-steps"])}function S(){return t($["validation-message"])}function T(){return e(".".concat($.actions," .").concat($.confirm))}function L(){return e(".".concat($.actions," .").concat($.deny))}function D(){return e(".".concat($.loader))}function q(){return e(".".concat($.actions," .").concat($.cancel))}function j(){return t($.actions)}function M(){return t($.header)}function I(){return t($.footer)}function H(){return t($["timer-progress-bar"])}function V(){return t($.close)}function R(){var t=g(A().querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])')).sort(function(t,e){return t=parseInt(t.getAttribute("tabindex")),(e=parseInt(e.getAttribute("tabindex")))<t?1:t<e?-1:0}),e=g(A().querySelectorAll('\n a[href],\n area[href],\n input:not([disabled]),\n select:not([disabled]),\n textarea:not([disabled]),\n button:not([disabled]),\n iframe,\n object,\n embed,\n [tabindex="0"],\n [contenteditable],\n audio[controls],\n video[controls],\n summary\n')).filter(function(t){return"-1"!==t.getAttribute("tabindex")});return function(t){for(var e=[],n=0;n<t.length;n++)-1===e.indexOf(t[n])&&e.push(t[n]);return e}(t.concat(e)).filter(function(t){return wt(t)})}function N(){return!G()&&!document.body.classList.contains($["no-backdrop"])}function U(e,t){e.textContent="",t&&(t=(new DOMParser).parseFromString(t,"text/html"),g(t.querySelector("head").childNodes).forEach(function(t){e.appendChild(t)}),g(t.querySelector("body").childNodes).forEach(function(t){e.appendChild(t)}))}function _(t,e){if(e){for(var n=e.split(/\s+/),o=0;o<n.length;o++)if(!t.classList.contains(n[o]))return;return 1}}function F(t,e,n){var o,i;if(i=e,g((o=t).classList).forEach(function(t){-1===h($).indexOf(t)&&-1===h(X).indexOf(t)&&-1===h(i.showClass).indexOf(t)&&o.classList.remove(t)}),e.customClass&&e.customClass[n]){if("string"!=typeof e.customClass[n]&&!e.customClass[n].forEach)return W("Invalid type of customClass.".concat(n,'! Expected string or iterable object, got "').concat(r(e.customClass[n]),'"'));vt(t,e.customClass[n])}}var z="SweetAlert2:",W=function(t){console.warn("".concat(z," ").concat("object"===r(t)?t.join(" "):t))},K=function(t){console.error("".concat(z," ").concat(t))},Y=[],Z=function(t){return"function"==typeof t?t():t},Q=Object.freeze({cancel:"cancel",backdrop:"backdrop",close:"close",esc:"esc",timer:"timer"}),J=function(t){var e,n={};for(e in t)n[t[e]]="swal2-"+t[e];return n},$=J(["container","shown","height-auto","iosfix","popup","modal","no-backdrop","no-transition","toast","toast-shown","toast-column","show","hide","close","title","header","content","html-container","actions","confirm","deny","cancel","footer","icon","icon-content","image","input","file","range","select","radio","checkbox","label","textarea","inputerror","input-label","validation-message","progress-steps","active-progress-step","progress-step","progress-step-line","loader","loading","styled","top","top-start","top-end","top-left","top-right","center","center-start","center-end","center-left","center-right","bottom","bottom-start","bottom-end","bottom-left","bottom-right","grow-row","grow-column","grow-fullscreen","rtl","timer-progress-bar","timer-progress-bar-container","scrollbar-measure","icon-success","icon-warning","icon-info","icon-question","icon-error"]),X=J(["success","warning","info","question","error"]),G=function(){return document.body.classList.contains($["toast-shown"])},tt={previousBodyPadding:null};function et(t,e){if(!e)return null;switch(e){case"select":case"textarea":case"file":return yt(t,$[e]);case"checkbox":return t.querySelector(".".concat($.checkbox," input"));case"radio":return t.querySelector(".".concat($.radio," input:checked"))||t.querySelector(".".concat($.radio," input:first-child"));case"range":return t.querySelector(".".concat($.range," input"));default:return yt(t,$.input)}}function nt(t){var e;t.focus(),"file"!==t.type&&(e=t.value,t.value="",t.value=e)}function ot(t,e,n){t&&e&&(e="string"==typeof e?e.split(/\s+/).filter(Boolean):e).forEach(function(e){t.forEach?t.forEach(function(t){n?t.classList.add(e):t.classList.remove(e)}):n?t.classList.add(e):t.classList.remove(e)})}function it(t,e,n){(n=n==="".concat(parseInt(n))?parseInt(n):n)||0===parseInt(n)?t.style[e]="number"==typeof n?"".concat(n,"px"):n:t.style.removeProperty(e)}function rt(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"flex";t.style.display=e}function at(t){t.style.display="none"}function st(t,e,n,o){(e=t.querySelector(e))&&(e.style[n]=o)}function ut(t,e,n){e?rt(t,n):at(t)}function ct(t){return!!(t.scrollHeight>t.clientHeight)}function lt(t){var e=window.getComputedStyle(t),t=parseFloat(e.getPropertyValue("animation-duration")||"0"),e=parseFloat(e.getPropertyValue("transition-duration")||"0");return 0<t||0<e}function dt(t){var e=1<arguments.length&&void 0!==arguments[1]&&arguments[1],n=H();wt(n)&&(e&&(n.style.transition="none",n.style.width="100%"),setTimeout(function(){n.style.transition="width ".concat(t/1e3,"s linear"),n.style.width="0%"},10))}function pt(){return"undefined"==typeof window||"undefined"==typeof document}function ft(t){Mn.isVisible()&&gt!==t.target.value&&Mn.resetValidationMessage(),gt=t.target.value}function mt(t,e){t instanceof HTMLElement?e.appendChild(t):"object"===r(t)?At(t,e):t&&U(e,t)}function ht(t,e){var n=j(),o=D(),i=T(),r=L(),a=q();e.showConfirmButton||e.showDenyButton||e.showCancelButton||at(n),F(n,e,"actions"),Pt(i,"confirm",e),Pt(r,"deny",e),Pt(a,"cancel",e),function(t,e,n,o){if(!o.buttonsStyling)return bt([t,e,n],$.styled);vt([t,e,n],$.styled),o.confirmButtonColor&&(t.style.backgroundColor=o.confirmButtonColor);o.denyButtonColor&&(e.style.backgroundColor=o.denyButtonColor);o.cancelButtonColor&&(n.style.backgroundColor=o.cancelButtonColor)}(i,r,a,e),e.reverseButtons&&(n.insertBefore(a,o),n.insertBefore(r,o),n.insertBefore(i,o)),U(o,e.loaderHtml),F(o,e,"loader")}var gt,vt=function(t,e){ot(t,e,!0)},bt=function(t,e){ot(t,e,!1)},yt=function(t,e){for(var n=0;n<t.childNodes.length;n++)if(_(t.childNodes[n],e))return t.childNodes[n]},wt=function(t){return!(!t||!(t.offsetWidth||t.offsetHeight||t.getClientRects().length))},Ct='\n <div aria-labelledby="'.concat($.title,'" aria-describedby="').concat($.content,'" class="').concat($.popup,'" tabindex="-1">\n <div class="').concat($.header,'">\n <ul class="').concat($["progress-steps"],'"></ul>\n <div class="').concat($.icon,'"></div>\n <img class="').concat($.image,'" />\n <h2 class="').concat($.title,'" id="').concat($.title,'"></h2>\n <button type="button" class="').concat($.close,'"></button>\n </div>\n <div class="').concat($.content,'">\n <div id="').concat($.content,'" class="').concat($["html-container"],'"></div>\n <input class="').concat($.input,'" />\n <input type="file" class="').concat($.file,'" />\n <div class="').concat($.range,'">\n <input type="range" />\n <output></output>\n </div>\n <select class="').concat($.select,'"></select>\n <div class="').concat($.radio,'"></div>\n <label for="').concat($.checkbox,'" class="').concat($.checkbox,'">\n <input type="checkbox" />\n <span class="').concat($.label,'"></span>\n </label>\n <textarea class="').concat($.textarea,'"></textarea>\n <div class="').concat($["validation-message"],'" id="').concat($["validation-message"],'"></div>\n </div>\n <div class="').concat($.actions,'">\n <div class="').concat($.loader,'"></div>\n <button type="button" class="').concat($.confirm,'"></button>\n <button type="button" class="').concat($.deny,'"></button>\n <button type="button" class="').concat($.cancel,'"></button>\n </div>\n <div class="').concat($.footer,'"></div>\n <div class="').concat($["timer-progress-bar-container"],'">\n <div class="').concat($["timer-progress-bar"],'"></div>\n </div>\n </div>\n').replace(/(^|\n)\s*/g,""),kt=function(t){var e,n,o,i,r,a=!!(i=k())&&(i.parentNode.removeChild(i),bt([document.documentElement,document.body],[$["no-backdrop"],$["toast-shown"],$["has-column"]]),!0);pt()?K("SweetAlert2 requires document to initialize"):((r=document.createElement("div")).className=$.container,a&&vt(r,$["no-transition"]),U(r,Ct),(i="string"==typeof(e=t.target)?document.querySelector(e):e).appendChild(r),a=t,(e=A()).setAttribute("role",a.toast?"alert":"dialog"),e.setAttribute("aria-live",a.toast?"polite":"assertive"),a.toast||e.setAttribute("aria-modal","true"),r=i,"rtl"===window.getComputedStyle(r).direction&&vt(k(),$.rtl),t=P(),a=yt(t,$.input),e=yt(t,$.file),n=t.querySelector(".".concat($.range," input")),o=t.querySelector(".".concat($.range," output")),i=yt(t,$.select),r=t.querySelector(".".concat($.checkbox," input")),t=yt(t,$.textarea),a.oninput=ft,e.onchange=ft,i.onchange=ft,r.onchange=ft,t.oninput=ft,n.oninput=function(t){ft(t),o.value=n.value},n.onchange=function(t){ft(t),n.nextSibling.value=n.value})},At=function(t,e){t.jquery?xt(e,t):U(e,t.toString())},xt=function(t,e){if(t.textContent="",0 in e)for(var n=0;n in e;n++)t.appendChild(e[n].cloneNode(!0));else t.appendChild(e.cloneNode(!0))},Bt=function(){if(pt())return!1;var t,e=document.createElement("div"),n={WebkitAnimation:"webkitAnimationEnd",OAnimation:"oAnimationEnd oanimationend",animation:"animationend"};for(t in n)if(Object.prototype.hasOwnProperty.call(n,t)&&void 0!==e.style[t])return n[t];return!1}();function Pt(t,e,n){ut(t,n["show".concat(m(e),"Button")],"inline-block"),U(t,n["".concat(e,"ButtonText")]),t.setAttribute("aria-label",n["".concat(e,"ButtonAriaLabel")]),t.className=$[e],F(t,n,"".concat(e,"Button")),vt(t,n["".concat(e,"ButtonClass")])}function Ot(t,e){var n,o,i=k();i&&(o=i,"string"==typeof(n=e.backdrop)?o.style.background=n:n||vt([document.documentElement,document.body],$["no-backdrop"]),!e.backdrop&&e.allowOutsideClick&&W('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`'),o=i,(n=e.position)in $?vt(o,$[n]):(W('The "position" parameter is not valid, defaulting to "center"'),vt(o,$.center)),n=i,!(o=e.grow)||"string"!=typeof o||(o="grow-".concat(o))in $&&vt(n,$[o]),F(i,e,"container"),(e=document.body.getAttribute("data-swal2-queue-step"))&&(i.setAttribute("data-queue-step",e),document.body.removeAttribute("data-swal2-queue-step")))}function Et(t,e){t.placeholder&&!e.inputPlaceholder||(t.placeholder=e.inputPlaceholder)}function St(t,e,n){var o,i;n.inputLabel&&(t.id=$.input,o=document.createElement("label"),i=$["input-label"],o.setAttribute("for",t.id),o.className=i,vt(o,n.customClass.inputLabel),o.innerText=n.inputLabel,e.insertAdjacentElement("beforebegin",o))}var Tt={promise:new WeakMap,innerParams:new WeakMap,domCache:new WeakMap},Lt=["input","file","range","select","radio","checkbox","textarea"],Dt=function(t){if(!It[t.input])return K('Unexpected type of input! Expected "text", "email", "password", "number", "tel", "select", "radio", "checkbox", "textarea", "file" or "url", got "'.concat(t.input,'"'));var e=Mt(t.input),n=It[t.input](e,t);rt(n),setTimeout(function(){nt(n)})},qt=function(t,e){var n=et(P(),t);if(n)for(var o in!function(t){for(var e=0;e<t.attributes.length;e++){var n=t.attributes[e].name;-1===["type","value","style"].indexOf(n)&&t.removeAttribute(n)}}(n),e)"range"===t&&"placeholder"===o||n.setAttribute(o,e[o])},jt=function(t){var e=Mt(t.input);t.customClass&&vt(e,t.customClass.input)},Mt=function(t){t=$[t]||$.input;return yt(P(),t)},It={};It.text=It.email=It.password=It.number=It.tel=It.url=function(t,e){return"string"==typeof e.inputValue||"number"==typeof e.inputValue?t.value=e.inputValue:w(e.inputValue)||W('Unexpected type of inputValue! Expected "string", "number" or "Promise", got "'.concat(r(e.inputValue),'"')),St(t,t,e),Et(t,e),t.type=e.input,t},It.file=function(t,e){return St(t,t,e),Et(t,e),t},It.range=function(t,e){var n=t.querySelector("input"),o=t.querySelector("output");return n.value=e.inputValue,n.type=e.input,o.value=e.inputValue,St(n,t,e),t},It.select=function(t,e){var n;return t.textContent="",e.inputPlaceholder&&(n=document.createElement("option"),U(n,e.inputPlaceholder),n.value="",n.disabled=!0,n.selected=!0,t.appendChild(n)),St(t,t,e),t},It.radio=function(t){return t.textContent="",t},It.checkbox=function(t,e){var n=et(P(),"checkbox");n.value=1,n.id=$.checkbox,n.checked=Boolean(e.inputValue);n=t.querySelector("span");return U(n,e.inputPlaceholder),t},It.textarea=function(e,t){e.value=t.inputValue,Et(e,t),St(e,e,t);function n(t){return parseInt(window.getComputedStyle(t).paddingLeft)+parseInt(window.getComputedStyle(t).paddingRight)}var o;return"MutationObserver"in window&&(o=parseInt(window.getComputedStyle(A()).width),new MutationObserver(function(){var t=e.offsetWidth+n(A())+n(P());A().style.width=o<t?"".concat(t,"px"):null}).observe(e,{attributes:!0,attributeFilter:["style"]})),e};function Ht(t,e){var o,i,r,n=O();F(n,e,"htmlContainer"),e.html?(mt(e.html,n),rt(n,"block")):e.text?(n.textContent=e.text,rt(n,"block")):at(n),t=t,o=e,i=P(),t=Tt.innerParams.get(t),r=!t||o.input!==t.input,Lt.forEach(function(t){var e=$[t],n=yt(i,e);qt(t,o.inputAttributes),n.className=e,r&&at(n)}),o.input&&(r&&Dt(o),jt(o)),F(P(),e,"content")}function Vt(){return k()&&k().getAttribute("data-queue-step")}function Rt(t,o){var i=n();if(!o.progressSteps||0===o.progressSteps.length)return at(i),0;rt(i),i.textContent="";var r=parseInt(void 0===o.currentProgressStep?Vt():o.currentProgressStep);r>=o.progressSteps.length&&W("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),o.progressSteps.forEach(function(t,e){var n,t=(n=t,t=document.createElement("li"),vt(t,$["progress-step"]),U(t,n),t);i.appendChild(t),e===r&&vt(t,$["active-progress-step"]),e!==o.progressSteps.length-1&&(t=o,e=document.createElement("li"),vt(e,$["progress-step-line"]),t.progressStepsDistance&&(e.style.width=t.progressStepsDistance),e=e,i.appendChild(e))})}function Nt(t,e){var n,o=M();F(o,e,"header"),Rt(0,e),n=t,o=e,t=Tt.innerParams.get(n),n=x(),t&&o.icon===t.icon?(Wt(n,o),Ft(n,o)):o.icon||o.iconHtml?o.icon&&-1===Object.keys(X).indexOf(o.icon)?(K('Unknown icon! Expected "success", "error", "warning", "info" or "question", got "'.concat(o.icon,'"')),at(n)):(rt(n),Wt(n,o),Ft(n,o),vt(n,o.showClass.icon)):at(n),function(t){var e=E();if(!t.imageUrl)return at(e);rt(e,""),e.setAttribute("src",t.imageUrl),e.setAttribute("alt",t.imageAlt),it(e,"width",t.imageWidth),it(e,"height",t.imageHeight),e.className=$.image,F(e,t,"image")}(e),o=e,n=B(),ut(n,o.title||o.titleText),o.title&&mt(o.title,n),o.titleText&&(n.innerText=o.titleText),F(n,o,"title"),o=e,e=V(),U(e,o.closeButtonHtml),F(e,o,"closeButton"),ut(e,o.showCloseButton),e.setAttribute("aria-label",o.closeButtonAriaLabel)}function Ut(t,e){var n,o,i;i=e,n=k(),o=A(),i.toast?(it(n,"width",i.width),o.style.width="100%"):it(o,"width",i.width),it(o,"padding",i.padding),i.background&&(o.style.background=i.background),at(S()),Qt(o,i),Ot(0,e),Nt(t,e),Ht(t,e),ht(0,e),i=e,t=I(),ut(t,i.footer),i.footer&&mt(i.footer,t),F(t,i,"footer"),"function"==typeof e.didRender?e.didRender(A()):"function"==typeof e.onRender&&e.onRender(A())}function _t(){return T()&&T().click()}var Ft=function(t,e){for(var n in X)e.icon!==n&&bt(t,X[n]);vt(t,X[e.icon]),Kt(t,e),zt(),F(t,e,"icon")},zt=function(){for(var t=A(),e=window.getComputedStyle(t).getPropertyValue("background-color"),n=t.querySelectorAll("[class^=swal2-success-circular-line], .swal2-success-fix"),o=0;o<n.length;o++)n[o].style.backgroundColor=e},Wt=function(t,e){t.textContent="",e.iconHtml?U(t,Yt(e.iconHtml)):"success"===e.icon?U(t,'\n <div class="swal2-success-circular-line-left"></div>\n <span class="swal2-success-line-tip"></span> <span class="swal2-success-line-long"></span>\n <div class="swal2-success-ring"></div> <div class="swal2-success-fix"></div>\n <div class="swal2-success-circular-line-right"></div>\n '):"error"===e.icon?U(t,'\n <span class="swal2-x-mark">\n <span class="swal2-x-mark-line-left"></span>\n <span class="swal2-x-mark-line-right"></span>\n </span>\n '):U(t,Yt({question:"?",warning:"!",info:"i"}[e.icon]))},Kt=function(t,e){if(e.iconColor){t.style.color=e.iconColor,t.style.borderColor=e.iconColor;for(var n=0,o=[".swal2-success-line-tip",".swal2-success-line-long",".swal2-x-mark-line-left",".swal2-x-mark-line-right"];n<o.length;n++)st(t,o[n],"backgroundColor",e.iconColor);st(t,".swal2-success-ring","borderColor",e.iconColor)}},Yt=function(t){return'<div class="'.concat($["icon-content"],'">').concat(t,"</div>")},Zt=[],Qt=function(t,e){t.className="".concat($.popup," ").concat(wt(t)?e.showClass.popup:""),e.toast?(vt([document.documentElement,document.body],$["toast-shown"]),vt(t,$.toast)):vt(t,$.modal),F(t,e,"popup"),"string"==typeof e.customClass&&vt(t,e.customClass),e.icon&&vt(t,$["icon-".concat(e.icon)])};function Jt(t){(e=A())||Mn.fire();var e=A(),n=j(),o=D();!t&&wt(T())&&(t=T()),rt(n),t&&(at(t),o.setAttribute("data-button-to-replace",t.className)),o.parentNode.insertBefore(o,t),vt([e,n],$.loading),rt(o),e.setAttribute("data-loading",!0),e.setAttribute("aria-busy",!0),e.focus()}function $t(){return new Promise(function(t){var e=window.scrollX,n=window.scrollY;te.restoreFocusTimeout=setTimeout(function(){te.previousActiveElement&&te.previousActiveElement.focus?(te.previousActiveElement.focus(),te.previousActiveElement=null):document.body&&document.body.focus(),t()},100),void 0!==e&&void 0!==n&&window.scrollTo(e,n)})}function Xt(){if(te.timeout)return function(){var t=H(),e=parseInt(window.getComputedStyle(t).width);t.style.removeProperty("transition"),t.style.width="100%";var n=parseInt(window.getComputedStyle(t).width),n=parseInt(e/n*100);t.style.removeProperty("transition"),t.style.width="".concat(n,"%")}(),te.timeout.stop()}function Gt(){if(te.timeout){var t=te.timeout.start();return dt(t),t}}var te={},ee=!1,ne={};function oe(t){for(var e=t.target;e&&e!==document;e=e.parentNode)for(var n in ne){var o=e.getAttribute(n);if(o)return void ne[n].fire({template:o})}}function ie(t){return Object.prototype.hasOwnProperty.call(se,t)}function re(t){return ce[t]}function ae(t){for(var e in t)ie(n=e)||W('Unknown parameter "'.concat(n,'"')),t.toast&&(n=e,-1!==le.indexOf(n)&&W('The parameter "'.concat(n,'" is incompatible with toasts'))),re(e=e)&&v(e,re(e));var n}var se={title:"",titleText:"",text:"",html:"",footer:"",icon:void 0,iconColor:void 0,iconHtml:void 0,template:void 0,toast:!1,animation:!0,showClass:{popup:"swal2-show",backdrop:"swal2-backdrop-show",icon:"swal2-icon-show"},hideClass:{popup:"swal2-hide",backdrop:"swal2-backdrop-hide",icon:"swal2-icon-hide"},customClass:{},target:"body",backdrop:!0,heightAuto:!0,allowOutsideClick:!0,allowEscapeKey:!0,allowEnterKey:!0,stopKeydownPropagation:!0,keydownListenerCapture:!1,showConfirmButton:!0,showDenyButton:!1,showCancelButton:!1,preConfirm:void 0,preDeny:void 0,confirmButtonText:"OK",confirmButtonAriaLabel:"",confirmButtonColor:void 0,denyButtonText:"No",denyButtonAriaLabel:"",denyButtonColor:void 0,cancelButtonText:"Cancel",cancelButtonAriaLabel:"",cancelButtonColor:void 0,buttonsStyling:!0,reverseButtons:!1,focusConfirm:!0,focusDeny:!1,focusCancel:!1,showCloseButton:!1,closeButtonHtml:"&times;",closeButtonAriaLabel:"Close this dialog",loaderHtml:"",showLoaderOnConfirm:!1,showLoaderOnDeny:!1,imageUrl:void 0,imageWidth:void 0,imageHeight:void 0,imageAlt:"",timer:void 0,timerProgressBar:!1,width:void 0,padding:void 0,background:void 0,input:void 0,inputPlaceholder:"",inputLabel:"",inputValue:"",inputOptions:{},inputAutoTrim:!0,inputAttributes:{},inputValidator:void 0,returnInputValueOnDeny:!1,validationMessage:void 0,grow:!1,position:"center",progressSteps:[],currentProgressStep:void 0,progressStepsDistance:void 0,onBeforeOpen:void 0,onOpen:void 0,willOpen:void 0,didOpen:void 0,onRender:void 0,didRender:void 0,onClose:void 0,onAfterClose:void 0,willClose:void 0,didClose:void 0,onDestroy:void 0,didDestroy:void 0,scrollbarPadding:!0},ue=["allowEscapeKey","allowOutsideClick","background","buttonsStyling","cancelButtonAriaLabel","cancelButtonColor","cancelButtonText","closeButtonAriaLabel","closeButtonHtml","confirmButtonAriaLabel","confirmButtonColor","confirmButtonText","currentProgressStep","customClass","denyButtonAriaLabel","denyButtonColor","denyButtonText","didClose","didDestroy","footer","hideClass","html","icon","iconColor","iconHtml","imageAlt","imageHeight","imageUrl","imageWidth","onAfterClose","onClose","onDestroy","progressSteps","reverseButtons","showCancelButton","showCloseButton","showConfirmButton","showDenyButton","text","title","titleText","willClose"],ce={animation:'showClass" and "hideClass',onBeforeOpen:"willOpen",onOpen:"didOpen",onRender:"didRender",onClose:"willClose",onAfterClose:"didClose",onDestroy:"didDestroy"},le=["allowOutsideClick","allowEnterKey","backdrop","focusConfirm","focusDeny","focusCancel","heightAuto","keydownListenerCapture"],de=Object.freeze({isValidParameter:ie,isUpdatableParameter:function(t){return-1!==ue.indexOf(t)},isDeprecatedParameter:re,argsToParams:function(n){var o={};return"object"!==r(n[0])||C(n[0])?["title","html","icon"].forEach(function(t,e){e=n[e];"string"==typeof e||C(e)?o[t]=e:void 0!==e&&K("Unexpected type of ".concat(t,'! Expected "string" or "Element", got ').concat(r(e)))}):u(o,n[0]),o},isVisible:function(){return wt(A())},clickConfirm:_t,clickDeny:function(){return L()&&L().click()},clickCancel:function(){return q()&&q().click()},getContainer:k,getPopup:A,getTitle:B,getContent:P,getHtmlContainer:O,getImage:E,getIcon:x,getInputLabel:function(){return t($["input-label"])},getCloseButton:V,getActions:j,getConfirmButton:T,getDenyButton:L,getCancelButton:q,getLoader:D,getHeader:M,getFooter:I,getTimerProgressBar:H,getFocusableElements:R,getValidationMessage:S,isLoading:function(){return A().hasAttribute("data-loading")},fire:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return i(this,e)},mixin:function(r){return function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&l(t,e)}(i,t);var n,o,e=(n=i,o=d(),function(){var t,e=c(n);return p(this,o?(t=c(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))});function i(){return a(this,i),e.apply(this,arguments)}return s(i,[{key:"_main",value:function(t,e){return f(c(i.prototype),"_main",this).call(this,t,u({},r,e))}}]),i}(this)},queue:function(t){var r=this;Zt=t;function a(t,e){Zt=[],t(e)}var s=[];return new Promise(function(i){!function e(n,o){n<Zt.length?(document.body.setAttribute("data-swal2-queue-step",n),r.fire(Zt[n]).then(function(t){void 0!==t.value?(s.push(t.value),e(n+1,o)):a(i,{dismiss:t.dismiss})})):a(i,{value:s})}(0)})},getQueueStep:Vt,insertQueueStep:function(t,e){return e&&e<Zt.length?Zt.splice(e,0,t):Zt.push(t)},deleteQueueStep:function(t){void 0!==Zt[t]&&Zt.splice(t,1)},showLoading:Jt,enableLoading:Jt,getTimerLeft:function(){return te.timeout&&te.timeout.getTimerLeft()},stopTimer:Xt,resumeTimer:Gt,toggleTimer:function(){var t=te.timeout;return t&&(t.running?Xt:Gt)()},increaseTimer:function(t){if(te.timeout){t=te.timeout.increase(t);return dt(t,!0),t}},isTimerRunning:function(){return te.timeout&&te.timeout.isRunning()},bindClickHandler:function(){ne[0<arguments.length&&void 0!==arguments[0]?arguments[0]:"data-swal-template"]=this,ee||(document.body.addEventListener("click",oe),ee=!0)}});function pe(){var t,e;Tt.innerParams.get(this)&&(t=Tt.domCache.get(this),at(t.loader),(e=t.popup.getElementsByClassName(t.loader.getAttribute("data-button-to-replace"))).length?rt(e[0],"inline-block"):wt(T())||wt(L())||wt(q())||at(t.actions),bt([t.popup,t.actions],$.loading),t.popup.removeAttribute("aria-busy"),t.popup.removeAttribute("data-loading"),t.confirmButton.disabled=!1,t.denyButton.disabled=!1,t.cancelButton.disabled=!1)}function fe(){null===tt.previousBodyPadding&&document.body.scrollHeight>window.innerHeight&&(tt.previousBodyPadding=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight="".concat(tt.previousBodyPadding+function(){var t=document.createElement("div");t.className=$["scrollbar-measure"],document.body.appendChild(t);var e=t.getBoundingClientRect().width-t.clientWidth;return document.body.removeChild(t),e}(),"px"))}function me(){return!!window.MSInputMethodContext&&!!document.documentMode}function he(){var t=k(),e=A();t.style.removeProperty("align-items"),e.offsetTop<0&&(t.style.alignItems="flex-start")}var ge=function(){navigator.userAgent.match(/(CriOS|FxiOS|EdgiOS|YaBrowser|UCBrowser)/i)||A().scrollHeight>window.innerHeight-44&&(k().style.paddingBottom="".concat(44,"px"))},ve=function(){var e,t=k();t.ontouchstart=function(t){e=be(t)},t.ontouchmove=function(t){e&&(t.preventDefault(),t.stopPropagation())}},be=function(t){var e=t.target,n=k();return!ye(t)&&!we(t)&&(e===n||!(ct(n)||"INPUT"===e.tagName||ct(P())&&P().contains(e)))},ye=function(t){return t.touches&&t.touches.length&&"stylus"===t.touches[0].touchType},we=function(t){return t.touches&&1<t.touches.length},Ce={swalPromiseResolve:new WeakMap};function ke(t,e,n,o){n?Ee(t,o):($t().then(function(){return Ee(t,o)}),te.keydownTarget.removeEventListener("keydown",te.keydownHandler,{capture:te.keydownListenerCapture}),te.keydownHandlerAdded=!1),e.parentNode&&!document.body.getAttribute("data-swal2-queue-step")&&e.parentNode.removeChild(e),N()&&(null!==tt.previousBodyPadding&&(document.body.style.paddingRight="".concat(tt.previousBodyPadding,"px"),tt.previousBodyPadding=null),_(document.body,$.iosfix)&&(e=parseInt(document.body.style.top,10),bt(document.body,$.iosfix),document.body.style.top="",document.body.scrollTop=-1*e),"undefined"!=typeof window&&me()&&window.removeEventListener("resize",he),g(document.body.children).forEach(function(t){t.hasAttribute("data-previous-aria-hidden")?(t.setAttribute("aria-hidden",t.getAttribute("data-previous-aria-hidden")),t.removeAttribute("data-previous-aria-hidden")):t.removeAttribute("aria-hidden")})),bt([document.documentElement,document.body],[$.shown,$["height-auto"],$["no-backdrop"],$["toast-shown"],$["toast-column"]])}function Ae(t){var e,n,o,i=A();i&&(t=xe(t),(e=Tt.innerParams.get(this))&&!_(i,e.hideClass.popup)&&(n=Ce.swalPromiseResolve.get(this),bt(i,e.showClass.popup),vt(i,e.hideClass.popup),o=k(),bt(o,e.showClass.backdrop),vt(o,e.hideClass.backdrop),Be(this,i,e),n(t)))}function xe(t){return void 0===t?{isConfirmed:!1,isDenied:!1,isDismissed:!0}:u({isConfirmed:!1,isDenied:!1,isDismissed:!1},t)}function Be(t,e,n){var o=k(),i=Bt&&lt(e),r=n.onClose,a=n.onAfterClose,s=n.willClose,n=n.didClose;Pe(e,s,r),i?Oe(t,e,o,n||a):ke(t,o,G(),n||a)}var Pe=function(t,e,n){null!==e&&"function"==typeof e?e(t):null!==n&&"function"==typeof n&&n(t)},Oe=function(t,e,n,o){te.swalCloseEventFinishedCallback=ke.bind(null,t,n,G(),o),e.addEventListener(Bt,function(t){t.target===e&&(te.swalCloseEventFinishedCallback(),delete te.swalCloseEventFinishedCallback)})},Ee=function(t,e){setTimeout(function(){"function"==typeof e&&e(),t._destroy()})};function Se(t,e,n){var o=Tt.domCache.get(t);e.forEach(function(t){o[t].disabled=n})}function Te(t,e){if(!t)return!1;if("radio"===t.type)for(var n=t.parentNode.parentNode.querySelectorAll("input"),o=0;o<n.length;o++)n[o].disabled=e;else t.disabled=e}var Le=function(){function n(t,e){a(this,n),this.callback=t,this.remaining=e,this.running=!1,this.start()}return s(n,[{key:"start",value:function(){return this.running||(this.running=!0,this.started=new Date,this.id=setTimeout(this.callback,this.remaining)),this.remaining}},{key:"stop",value:function(){return this.running&&(this.running=!1,clearTimeout(this.id),this.remaining-=new Date-this.started),this.remaining}},{key:"increase",value:function(t){var e=this.running;return e&&this.stop(),this.remaining+=t,e&&this.start(),this.remaining}},{key:"getTimerLeft",value:function(){return this.running&&(this.stop(),this.start()),this.remaining}},{key:"isRunning",value:function(){return this.running}}]),n}(),De={email:function(t,e){return/^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]{2,24}$/.test(t)?Promise.resolve():Promise.resolve(e||"Invalid email address")},url:function(t,e){return/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(t)?Promise.resolve():Promise.resolve(e||"Invalid URL")}};function qe(t){var e,n;(e=t).inputValidator||Object.keys(De).forEach(function(t){e.input===t&&(e.inputValidator=De[t])}),t.showLoaderOnConfirm&&!t.preConfirm&&W("showLoaderOnConfirm is set to true, but preConfirm is not defined.\nshowLoaderOnConfirm should be used together with preConfirm, see usage example:\nhttps://sweetalert2.github.io/#ajax-request"),t.animation=Z(t.animation),(n=t).target&&("string"!=typeof n.target||document.querySelector(n.target))&&("string"==typeof n.target||n.target.appendChild)||(W('Target parameter is not valid, defaulting to "body"'),n.target="body"),"string"==typeof t.title&&(t.title=t.title.split("\n").join("<br />")),kt(t)}function je(t){var e=k(),n=A();"function"==typeof t.willOpen?t.willOpen(n):"function"==typeof t.onBeforeOpen&&t.onBeforeOpen(n);var o=window.getComputedStyle(document.body).overflowY;Je(e,n,t),setTimeout(function(){Ze(e,n)},10),N()&&(Qe(e,t.scrollbarPadding,o),g(document.body.children).forEach(function(t){t===k()||function(t,e){if("function"==typeof t.contains)return t.contains(e)}(t,k())||(t.hasAttribute("aria-hidden")&&t.setAttribute("data-previous-aria-hidden",t.getAttribute("aria-hidden")),t.setAttribute("aria-hidden","true"))})),G()||te.previousActiveElement||(te.previousActiveElement=document.activeElement),Ye(n,t),bt(e,$["no-transition"])}function Me(t){var e=A();t.target===e&&(t=k(),e.removeEventListener(Bt,Me),t.style.overflowY="auto")}function Ie(t,e){t.closePopup({isConfirmed:!0,value:e})}function He(t,e,n){var o=R();if(o.length)return(e+=n)===o.length?e=0:-1===e&&(e=o.length-1),o[e].focus();A().focus()}var Ve=["swal-title","swal-html","swal-footer"],Re=function(t){var n={};return g(t.querySelectorAll("swal-param")).forEach(function(t){Ke(t,["name","value"]);var e=t.getAttribute("name"),t=t.getAttribute("value");"boolean"==typeof se[e]&&"false"===t&&(t=!1),"object"===r(se[e])&&(t=JSON.parse(t)),n[e]=t}),n},Ne=function(t){var n={};return g(t.querySelectorAll("swal-button")).forEach(function(t){Ke(t,["type","color","aria-label"]);var e=t.getAttribute("type");n["".concat(e,"ButtonText")]=t.innerHTML,n["show".concat(m(e),"Button")]=!0,t.hasAttribute("color")&&(n["".concat(e,"ButtonColor")]=t.getAttribute("color")),t.hasAttribute("aria-label")&&(n["".concat(e,"ButtonAriaLabel")]=t.getAttribute("aria-label"))}),n},Ue=function(t){var e={},t=t.querySelector("swal-image");return t&&(Ke(t,["src","width","height","alt"]),t.hasAttribute("src")&&(e.imageUrl=t.getAttribute("src")),t.hasAttribute("width")&&(e.imageWidth=t.getAttribute("width")),t.hasAttribute("height")&&(e.imageHeight=t.getAttribute("height")),t.hasAttribute("alt")&&(e.imageAlt=t.getAttribute("alt"))),e},_e=function(t){var e={},t=t.querySelector("swal-icon");return t&&(Ke(t,["type","color"]),t.hasAttribute("type")&&(e.icon=t.getAttribute("type")),t.hasAttribute("color")&&(e.iconColor=t.getAttribute("color")),e.iconHtml=t.innerHTML),e},Fe=function(t){var n={},e=t.querySelector("swal-input");e&&(Ke(e,["type","label","placeholder","value"]),n.input=e.getAttribute("type")||"text",e.hasAttribute("label")&&(n.inputLabel=e.getAttribute("label")),e.hasAttribute("placeholder")&&(n.inputPlaceholder=e.getAttribute("placeholder")),e.hasAttribute("value")&&(n.inputValue=e.getAttribute("value")));t=t.querySelectorAll("swal-input-option");return t.length&&(n.inputOptions={},g(t).forEach(function(t){Ke(t,["value"]);var e=t.getAttribute("value"),t=t.innerHTML;n.inputOptions[e]=t})),n},ze=function(t,e){var n,o={};for(n in e){var i=e[n],r=t.querySelector(i);r&&(Ke(r,[]),o[i.replace(/^swal-/,"")]=r.innerHTML)}return o},We=function(e){var n=Ve.concat(["swal-param","swal-button","swal-image","swal-icon","swal-input","swal-input-option"]);g(e.querySelectorAll("*")).forEach(function(t){t.parentNode===e&&(t=t.tagName.toLowerCase(),-1===n.indexOf(t)&&W("Unrecognized element <".concat(t,">")))})},Ke=function(e,n){g(e.attributes).forEach(function(t){-1===n.indexOf(t.name)&&W(['Unrecognized attribute "'.concat(t.name,'" on <').concat(e.tagName.toLowerCase(),">."),"".concat(n.length?"Allowed attributes are: ".concat(n.join(", ")):"To set the value, use HTML within the element.")])})},Ye=function(t,e){"function"==typeof e.didOpen?setTimeout(function(){return e.didOpen(t)}):"function"==typeof e.onOpen&&setTimeout(function(){return e.onOpen(t)})},Ze=function(t,e){Bt&&lt(e)?(t.style.overflowY="hidden",e.addEventListener(Bt,Me)):t.style.overflowY="auto"},Qe=function(t,e,n){var o;(/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream||"MacIntel"===navigator.platform&&1<navigator.maxTouchPoints)&&!_(document.body,$.iosfix)&&(o=document.body.scrollTop,document.body.style.top="".concat(-1*o,"px"),vt(document.body,$.iosfix),ve(),ge()),"undefined"!=typeof window&&me()&&(he(),window.addEventListener("resize",he)),e&&"hidden"!==n&&fe(),setTimeout(function(){t.scrollTop=0})},Je=function(t,e,n){vt(t,n.showClass.backdrop),e.style.setProperty("opacity","0","important"),rt(e),setTimeout(function(){vt(e,n.showClass.popup),e.style.removeProperty("opacity")},10),vt([document.documentElement,document.body],$.shown),n.heightAuto&&n.backdrop&&!n.toast&&vt([document.documentElement,document.body],$["height-auto"])},$e=function(t){return t.checked?1:0},Xe=function(t){return t.checked?t.value:null},Ge=function(t){return t.files.length?null!==t.getAttribute("multiple")?t.files:t.files[0]:null},tn=function(e,n){function o(t){return nn[n.input](i,on(t),n)}var i=P();b(n.inputOptions)||w(n.inputOptions)?(Jt(T()),y(n.inputOptions).then(function(t){e.hideLoading(),o(t)})):"object"===r(n.inputOptions)?o(n.inputOptions):K("Unexpected type of inputOptions! Expected object, Map or Promise, got ".concat(r(n.inputOptions)))},en=function(e,n){var o=e.getInput();at(o),y(n.inputValue).then(function(t){o.value="number"===n.input?parseFloat(t)||0:"".concat(t),rt(o),o.focus(),e.hideLoading()}).catch(function(t){K("Error in inputValue promise: ".concat(t)),o.value="",rt(o),o.focus(),e.hideLoading()})},nn={select:function(t,e,i){function o(t,e,n){var o=document.createElement("option");o.value=n,U(o,e),o.selected=rn(n,i.inputValue),t.appendChild(o)}var r=yt(t,$.select);e.forEach(function(t){var e,n=t[0],t=t[1];Array.isArray(t)?((e=document.createElement("optgroup")).label=n,e.disabled=!1,r.appendChild(e),t.forEach(function(t){return o(e,t[1],t[0])})):o(r,t,n)}),r.focus()},radio:function(t,e,i){var r=yt(t,$.radio);e.forEach(function(t){var e=t[0],n=t[1],o=document.createElement("input"),t=document.createElement("label");o.type="radio",o.name=$.radio,o.value=e,rn(e,i.inputValue)&&(o.checked=!0);e=document.createElement("span");U(e,n),e.className=$.label,t.appendChild(o),t.appendChild(e),r.appendChild(t)});e=r.querySelectorAll("input");e.length&&e[0].focus()}},on=function n(o){var i=[];return"undefined"!=typeof Map&&o instanceof Map?o.forEach(function(t,e){"object"===r(t)&&(t=n(t)),i.push([e,t])}):Object.keys(o).forEach(function(t){var e=o[t];"object"===r(e)&&(e=n(e)),i.push([t,e])}),i},rn=function(t,e){return e&&e.toString()===t.toString()},an=function(t,e,n){var o=function(t,e){var n=t.getInput();if(!n)return null;switch(e.input){case"checkbox":return $e(n);case"radio":return Xe(n);case"file":return Ge(n);default:return e.inputAutoTrim?n.value.trim():n.value}}(t,e);e.inputValidator?sn(t,e,o):t.getInput().checkValidity()?("deny"===n?un:cn)(t,e,o):(t.enableButtons(),t.showValidationMessage(e.validationMessage))},sn=function(e,n,o){e.disableInput(),Promise.resolve().then(function(){return y(n.inputValidator(o,n.validationMessage))}).then(function(t){e.enableButtons(),e.enableInput(),t?e.showValidationMessage(t):cn(e,n,o)})},un=function(e,t,n){t.showLoaderOnDeny&&Jt(L()),t.preDeny?Promise.resolve().then(function(){return y(t.preDeny(n,t.validationMessage))}).then(function(t){!1===t?e.hideLoading():e.closePopup({isDenied:!0,value:void 0===t?n:t})}):e.closePopup({isDenied:!0,value:n})},cn=function(e,t,n){t.showLoaderOnConfirm&&Jt(),t.preConfirm?(e.resetValidationMessage(),Promise.resolve().then(function(){return y(t.preConfirm(n,t.validationMessage))}).then(function(t){wt(S())||!1===t?e.hideLoading():Ie(e,void 0===t?n:t)})):Ie(e,n)},ln=["ArrowRight","ArrowDown","Right","Down"],dn=["ArrowLeft","ArrowUp","Left","Up"],pn=["Escape","Esc"],fn=function(t,e,n){var o=Tt.innerParams.get(t);o&&(o.stopKeydownPropagation&&e.stopPropagation(),"Enter"===e.key?mn(t,e,o):"Tab"===e.key?hn(e,o):-1!==[].concat(ln,dn).indexOf(e.key)?gn(e.key):-1!==pn.indexOf(e.key)&&vn(e,o,n))},mn=function(t,e,n){e.isComposing||e.target&&t.getInput()&&e.target.outerHTML===t.getInput().outerHTML&&-1===["textarea","file"].indexOf(n.input)&&(_t(),e.preventDefault())},hn=function(t,e){for(var n=t.target,o=R(),i=-1,r=0;r<o.length;r++)if(n===o[r]){i=r;break}t.shiftKey?He(0,i,-1):He(0,i,1),t.stopPropagation(),t.preventDefault()},gn=function(t){-1!==[T(),L(),q()].indexOf(document.activeElement)&&(t=-1!==ln.indexOf(t)?"nextElementSibling":"previousElementSibling",(t=document.activeElement[t])&&t.focus())},vn=function(t,e,n){Z(e.allowEscapeKey)&&(t.preventDefault(),n(Q.esc))},bn=function(e,t,n){t.popup.onclick=function(){var t=Tt.innerParams.get(e);t.showConfirmButton||t.showDenyButton||t.showCancelButton||t.showCloseButton||t.timer||t.input||n(Q.close)}},yn=!1,wn=function(e){e.popup.onmousedown=function(){e.container.onmouseup=function(t){e.container.onmouseup=void 0,t.target===e.container&&(yn=!0)}}},Cn=function(e){e.container.onmousedown=function(){e.popup.onmouseup=function(t){e.popup.onmouseup=void 0,t.target!==e.popup&&!e.popup.contains(t.target)||(yn=!0)}}},kn=function(n,o,i){o.container.onclick=function(t){var e=Tt.innerParams.get(n);yn?yn=!1:t.target===o.container&&Z(e.allowOutsideClick)&&i(Q.backdrop)}};function An(t,e){var n=function(t){t="string"==typeof t.template?document.querySelector(t.template):t.template;if(!t)return{};t=t.content||t;return We(t),u(Re(t),Ne(t),Ue(t),_e(t),Fe(t),ze(t,Ve))}(t),o=u({},se.showClass,e.showClass,n.showClass,t.showClass),i=u({},se.hideClass,e.hideClass,n.hideClass,t.hideClass);return(n=u({},se,e,n,t)).showClass=o,n.hideClass=i,!1===t.animation&&(n.showClass={popup:"swal2-noanimation",backdrop:"swal2-noanimation"},n.hideClass={}),n}function xn(a,s,u){return new Promise(function(t){function e(t){a.closePopup({isDismissed:!0,dismiss:t})}var n,o,i,r;Ce.swalPromiseResolve.set(a,t),s.confirmButton.onclick=function(){return e=u,(t=a).disableButtons(),void(e.input?an(t,e,"confirm"):cn(t,e,!0));var t,e},s.denyButton.onclick=function(){return e=u,(t=a).disableButtons(),void(e.returnInputValueOnDeny?an(t,e,"deny"):un(t,e,!1));var t,e},s.cancelButton.onclick=function(){return t=e,a.disableButtons(),void t(Q.cancel);var t},s.closeButton.onclick=function(){return e(Q.close)},n=a,r=s,t=e,Tt.innerParams.get(n).toast?bn(n,r,t):(wn(r),Cn(r),kn(n,r,t)),o=a,r=u,i=e,(t=te).keydownTarget&&t.keydownHandlerAdded&&(t.keydownTarget.removeEventListener("keydown",t.keydownHandler,{capture:t.keydownListenerCapture}),t.keydownHandlerAdded=!1),r.toast||(t.keydownHandler=function(t){return fn(o,t,i)},t.keydownTarget=r.keydownListenerCapture?window:A(),t.keydownListenerCapture=r.keydownListenerCapture,t.keydownTarget.addEventListener("keydown",t.keydownHandler,{capture:t.keydownListenerCapture}),t.keydownHandlerAdded=!0),(u.toast&&(u.input||u.footer||u.showCloseButton)?vt:bt)(document.body,$["toast-column"]),r=a,"select"===(t=u).input||"radio"===t.input?tn(r,t):-1!==["text","email","number","tel","textarea"].indexOf(t.input)&&(b(t.inputValue)||w(t.inputValue))&&en(r,t),je(u),Pn(te,u,e),On(s,u),setTimeout(function(){s.container.scrollTop=0})})}function Bn(t){var e={popup:A(),container:k(),content:P(),actions:j(),confirmButton:T(),denyButton:L(),cancelButton:q(),loader:D(),closeButton:V(),validationMessage:S(),progressSteps:n()};return Tt.domCache.set(t,e),e}var Pn=function(t,e,n){var o=H();at(o),e.timer&&(t.timeout=new Le(function(){n("timer"),delete t.timeout},e.timer),e.timerProgressBar&&(rt(o),setTimeout(function(){t.timeout&&t.timeout.running&&dt(e.timer)})))},On=function(t,e){if(!e.toast)return Z(e.allowEnterKey)?void(En(t,e)||He(0,-1,1)):Sn()},En=function(t,e){return e.focusDeny&&wt(t.denyButton)?(t.denyButton.focus(),!0):e.focusCancel&&wt(t.cancelButton)?(t.cancelButton.focus(),!0):!(!e.focusConfirm||!wt(t.confirmButton))&&(t.confirmButton.focus(),!0)},Sn=function(){document.activeElement&&"function"==typeof document.activeElement.blur&&document.activeElement.blur()};function Tn(t){"function"==typeof t.didDestroy?t.didDestroy():"function"==typeof t.onDestroy&&t.onDestroy()}function Ln(t){delete t.params,delete te.keydownHandler,delete te.keydownTarget,qn(Tt),qn(Ce)}var Dn,qn=function(t){for(var e in t)t[e]=new WeakMap},J=Object.freeze({hideLoading:pe,disableLoading:pe,getInput:function(t){var e=Tt.innerParams.get(t||this);return(t=Tt.domCache.get(t||this))?et(t.content,e.input):null},close:Ae,closePopup:Ae,closeModal:Ae,closeToast:Ae,enableButtons:function(){Se(this,["confirmButton","denyButton","cancelButton"],!1)},disableButtons:function(){Se(this,["confirmButton","denyButton","cancelButton"],!0)},enableInput:function(){return Te(this.getInput(),!1)},disableInput:function(){return Te(this.getInput(),!0)},showValidationMessage:function(t){var e=Tt.domCache.get(this),n=Tt.innerParams.get(this);U(e.validationMessage,t),e.validationMessage.className=$["validation-message"],n.customClass&&n.customClass.validationMessage&&vt(e.validationMessage,n.customClass.validationMessage),rt(e.validationMessage),(e=this.getInput())&&(e.setAttribute("aria-invalid",!0),e.setAttribute("aria-describedBy",$["validation-message"]),nt(e),vt(e,$.inputerror))},resetValidationMessage:function(){var t=Tt.domCache.get(this);t.validationMessage&&at(t.validationMessage),(t=this.getInput())&&(t.removeAttribute("aria-invalid"),t.removeAttribute("aria-describedBy"),bt(t,$.inputerror))},getProgressSteps:function(){return Tt.domCache.get(this).progressSteps},_main:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return ae(u({},e,t)),te.currentInstance&&te.currentInstance._destroy(),te.currentInstance=this,qe(t=An(t,e)),Object.freeze(t),te.timeout&&(te.timeout.stop(),delete te.timeout),clearTimeout(te.restoreFocusTimeout),e=Bn(this),Ut(this,t),Tt.innerParams.set(this,t),xn(this,e,t)},update:function(e){var t=A(),n=Tt.innerParams.get(this);if(!t||_(t,n.hideClass.popup))return W("You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.");var o={};Object.keys(e).forEach(function(t){Mn.isUpdatableParameter(t)?o[t]=e[t]:W('Invalid parameter to update: "'.concat(t,'". Updatable params are listed here: https://github.com/sweetalert2/sweetalert2/blob/master/src/utils/params.js\n\nIf you think this parameter should be updatable, request it here: https://github.com/sweetalert2/sweetalert2/issues/new?template=02_feature_request.md'))}),n=u({},n,o),Ut(this,n),Tt.innerParams.set(this,n),Object.defineProperties(this,{params:{value:u({},this.params,e),writable:!1,enumerable:!0}})},_destroy:function(){var t=Tt.domCache.get(this),e=Tt.innerParams.get(this);e&&(t.popup&&te.swalCloseEventFinishedCallback&&(te.swalCloseEventFinishedCallback(),delete te.swalCloseEventFinishedCallback),te.deferDisposalTimer&&(clearTimeout(te.deferDisposalTimer),delete te.deferDisposalTimer),Tn(e),Ln(this))}}),jn=function(){function i(){if(a(this,i),"undefined"!=typeof window){"undefined"==typeof Promise&&K("This package requires a Promise library, please include a shim to enable it in this browser (See: https://github.com/sweetalert2/sweetalert2/wiki/Migration-from-SweetAlert-to-SweetAlert2#1-ie-support)"),Dn=this;for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var o=Object.freeze(this.constructor.argsToParams(e));Object.defineProperties(this,{params:{value:o,writable:!1,enumerable:!0,configurable:!0}});o=this._main(this.params);Tt.promise.set(this,o)}}return s(i,[{key:"then",value:function(t){return Tt.promise.get(this).then(t)}},{key:"finally",value:function(t){return Tt.promise.get(this).finally(t)}}]),i}();u(jn.prototype,J),u(jn,de),Object.keys(J).forEach(function(t){jn[t]=function(){if(Dn)return Dn[t].apply(Dn,arguments)}}),jn.DismissReason=Q,jn.version="10.15.7";var Mn=jn;return Mn.default=Mn}),void 0!==this&&this.Sweetalert2&&(this.swal=this.sweetAlert=this.Swal=this.SweetAlert=this.Sweetalert2);
-"undefined"!=typeof document&&function(e,t){var n=e.createElement("style");if(e.getElementsByTagName("head")[0].appendChild(n),n.styleSheet)n.styleSheet.disabled||(n.styleSheet.cssText=t);else try{n.innerHTML=t}catch(e){n.innerText=t}}(document,".swal2-popup.swal2-toast{flex-direction:row;align-items:center;width:auto;padding:.625em;overflow-y:hidden;background:#fff;box-shadow:0 0 .625em #d9d9d9}.swal2-popup.swal2-toast .swal2-header{flex-direction:row;padding:0}.swal2-popup.swal2-toast .swal2-title{flex-grow:1;justify-content:flex-start;margin:0 .6em;font-size:1em}.swal2-popup.swal2-toast .swal2-footer{margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-popup.swal2-toast .swal2-close{position:static;width:.8em;height:.8em;line-height:.8}.swal2-popup.swal2-toast .swal2-content{justify-content:flex-start;padding:0;font-size:1em}.swal2-popup.swal2-toast .swal2-icon{width:2em;min-width:2em;height:2em;margin:0}.swal2-popup.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:700}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.swal2-popup.swal2-toast .swal2-icon .swal2-icon-content{font-size:.25em}}.swal2-popup.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-popup.swal2-toast .swal2-actions{flex-basis:auto!important;width:auto;height:auto;margin:0 .3125em;padding:0}.swal2-popup.swal2-toast .swal2-styled{margin:.125em .3125em;padding:.3125em .625em;font-size:1em}.swal2-popup.swal2-toast .swal2-styled:focus{box-shadow:0 0 0 1px #fff,0 0 0 3px rgba(100,150,200,.5)}.swal2-popup.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;transform:rotate(45deg);border-radius:50%}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.8em;left:-.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-popup.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{-webkit-animation:swal2-toast-animate-success-line-tip .75s;animation:swal2-toast-animate-success-line-tip .75s}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{-webkit-animation:swal2-toast-animate-success-line-long .75s;animation:swal2-toast-animate-success-line-long .75s}.swal2-popup.swal2-toast.swal2-show{-webkit-animation:swal2-toast-show .5s;animation:swal2-toast-show .5s}.swal2-popup.swal2-toast.swal2-hide{-webkit-animation:swal2-toast-hide .1s forwards;animation:swal2-toast-hide .1s forwards}.swal2-container{display:flex;position:fixed;z-index:1060;top:0;right:0;bottom:0;left:0;flex-direction:row;align-items:center;justify-content:center;padding:.625em;overflow-x:hidden;transition:background-color .1s;-webkit-overflow-scrolling:touch}.swal2-container.swal2-backdrop-show,.swal2-container.swal2-noanimation{background:rgba(0,0,0,.4)}.swal2-container.swal2-backdrop-hide{background:0 0!important}.swal2-container.swal2-top{align-items:flex-start}.swal2-container.swal2-top-left,.swal2-container.swal2-top-start{align-items:flex-start;justify-content:flex-start}.swal2-container.swal2-top-end,.swal2-container.swal2-top-right{align-items:flex-start;justify-content:flex-end}.swal2-container.swal2-center{align-items:center}.swal2-container.swal2-center-left,.swal2-container.swal2-center-start{align-items:center;justify-content:flex-start}.swal2-container.swal2-center-end,.swal2-container.swal2-center-right{align-items:center;justify-content:flex-end}.swal2-container.swal2-bottom{align-items:flex-end}.swal2-container.swal2-bottom-left,.swal2-container.swal2-bottom-start{align-items:flex-end;justify-content:flex-start}.swal2-container.swal2-bottom-end,.swal2-container.swal2-bottom-right{align-items:flex-end;justify-content:flex-end}.swal2-container.swal2-bottom-end>:first-child,.swal2-container.swal2-bottom-left>:first-child,.swal2-container.swal2-bottom-right>:first-child,.swal2-container.swal2-bottom-start>:first-child,.swal2-container.swal2-bottom>:first-child{margin-top:auto}.swal2-container.swal2-grow-fullscreen>.swal2-modal{display:flex!important;flex:1;align-self:stretch;justify-content:center}.swal2-container.swal2-grow-row>.swal2-modal{display:flex!important;flex:1;align-content:center;justify-content:center}.swal2-container.swal2-grow-column{flex:1;flex-direction:column}.swal2-container.swal2-grow-column.swal2-bottom,.swal2-container.swal2-grow-column.swal2-center,.swal2-container.swal2-grow-column.swal2-top{align-items:center}.swal2-container.swal2-grow-column.swal2-bottom-left,.swal2-container.swal2-grow-column.swal2-bottom-start,.swal2-container.swal2-grow-column.swal2-center-left,.swal2-container.swal2-grow-column.swal2-center-start,.swal2-container.swal2-grow-column.swal2-top-left,.swal2-container.swal2-grow-column.swal2-top-start{align-items:flex-start}.swal2-container.swal2-grow-column.swal2-bottom-end,.swal2-container.swal2-grow-column.swal2-bottom-right,.swal2-container.swal2-grow-column.swal2-center-end,.swal2-container.swal2-grow-column.swal2-center-right,.swal2-container.swal2-grow-column.swal2-top-end,.swal2-container.swal2-grow-column.swal2-top-right{align-items:flex-end}.swal2-container.swal2-grow-column>.swal2-modal{display:flex!important;flex:1;align-content:center;justify-content:center}.swal2-container.swal2-no-transition{transition:none!important}.swal2-container:not(.swal2-top):not(.swal2-top-start):not(.swal2-top-end):not(.swal2-top-left):not(.swal2-top-right):not(.swal2-center-start):not(.swal2-center-end):not(.swal2-center-left):not(.swal2-center-right):not(.swal2-bottom):not(.swal2-bottom-start):not(.swal2-bottom-end):not(.swal2-bottom-left):not(.swal2-bottom-right):not(.swal2-grow-fullscreen)>.swal2-modal{margin:auto}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.swal2-container .swal2-modal{margin:0!important}}.swal2-popup{display:none;position:relative;box-sizing:border-box;flex-direction:column;justify-content:center;width:32em;max-width:100%;padding:1.25em;border:none;border-radius:5px;background:#fff;font-family:inherit;font-size:1rem}.swal2-popup:focus{outline:0}.swal2-popup.swal2-loading{overflow-y:hidden}.swal2-header{display:flex;flex-direction:column;align-items:center;padding:0 1.8em}.swal2-title{position:relative;max-width:100%;margin:0 0 .4em;padding:0;color:#595959;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;word-wrap:break-word}.swal2-actions{display:flex;z-index:1;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:center;width:100%;margin:1.25em auto 0;padding:0 1.6em}.swal2-actions:not(.swal2-loading) .swal2-styled[disabled]{opacity:.4}.swal2-actions:not(.swal2-loading) .swal2-styled:hover{background-image:linear-gradient(rgba(0,0,0,.1),rgba(0,0,0,.1))}.swal2-actions:not(.swal2-loading) .swal2-styled:active{background-image:linear-gradient(rgba(0,0,0,.2),rgba(0,0,0,.2))}.swal2-loader{display:none;align-items:center;justify-content:center;width:2.2em;height:2.2em;margin:0 1.875em;-webkit-animation:swal2-rotate-loading 1.5s linear 0s infinite normal;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-width:.25em;border-style:solid;border-radius:100%;border-color:#2778c4 transparent #2778c4 transparent}.swal2-styled{margin:.3125em;padding:.625em 1.1em;box-shadow:none;font-weight:500}.swal2-styled:not([disabled]){cursor:pointer}.swal2-styled.swal2-confirm{border:0;border-radius:.25em;background:initial;background-color:#2778c4;color:#fff;font-size:1.0625em}.swal2-styled.swal2-deny{border:0;border-radius:.25em;background:initial;background-color:#d14529;color:#fff;font-size:1.0625em}.swal2-styled.swal2-cancel{border:0;border-radius:.25em;background:initial;background-color:#757575;color:#fff;font-size:1.0625em}.swal2-styled:focus{outline:0;box-shadow:0 0 0 3px rgba(100,150,200,.5)}.swal2-styled::-moz-focus-inner{border:0}.swal2-footer{justify-content:center;margin:1.25em 0 0;padding:1em 0 0;border-top:1px solid #eee;color:#545454;font-size:1em}.swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;height:.25em;overflow:hidden;border-bottom-right-radius:5px;border-bottom-left-radius:5px}.swal2-timer-progress-bar{width:100%;height:.25em;background:rgba(0,0,0,.2)}.swal2-image{max-width:100%;margin:1.25em auto}.swal2-close{position:absolute;z-index:2;top:0;right:0;align-items:center;justify-content:center;width:1.2em;height:1.2em;padding:0;overflow:hidden;transition:color .1s ease-out;border:none;border-radius:5px;background:0 0;color:#ccc;font-family:serif;font-size:2.5em;line-height:1.2;cursor:pointer}.swal2-close:hover{transform:none;background:0 0;color:#f27474}.swal2-close:focus{outline:0;box-shadow:inset 0 0 0 3px rgba(100,150,200,.5)}.swal2-close::-moz-focus-inner{border:0}.swal2-content{z-index:1;justify-content:center;margin:0;padding:0 1.6em;color:#545454;font-size:1.125em;font-weight:400;line-height:normal;text-align:center;word-wrap:break-word}.swal2-checkbox,.swal2-file,.swal2-input,.swal2-radio,.swal2-select,.swal2-textarea{margin:1em auto}.swal2-file,.swal2-input,.swal2-textarea{box-sizing:border-box;width:100%;transition:border-color .3s,box-shadow .3s;border:1px solid #d9d9d9;border-radius:.1875em;background:inherit;box-shadow:inset 0 1px 1px rgba(0,0,0,.06);color:inherit;font-size:1.125em}.swal2-file.swal2-inputerror,.swal2-input.swal2-inputerror,.swal2-textarea.swal2-inputerror{border-color:#f27474!important;box-shadow:0 0 2px #f27474!important}.swal2-file:focus,.swal2-input:focus,.swal2-textarea:focus{border:1px solid #b4dbed;outline:0;box-shadow:0 0 0 3px rgba(100,150,200,.5)}.swal2-file::-moz-placeholder,.swal2-input::-moz-placeholder,.swal2-textarea::-moz-placeholder{color:#ccc}.swal2-file:-ms-input-placeholder,.swal2-input:-ms-input-placeholder,.swal2-textarea:-ms-input-placeholder{color:#ccc}.swal2-file::placeholder,.swal2-input::placeholder,.swal2-textarea::placeholder{color:#ccc}.swal2-range{margin:1em auto;background:#fff}.swal2-range input{width:80%}.swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}.swal2-range input,.swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}.swal2-input{height:2.625em;padding:0 .75em}.swal2-input[type=number]{max-width:10em}.swal2-file{background:inherit;font-size:1.125em}.swal2-textarea{height:6.75em;padding:.75em}.swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:inherit;color:inherit;font-size:1.125em}.swal2-checkbox,.swal2-radio{align-items:center;justify-content:center;background:#fff;color:inherit}.swal2-checkbox label,.swal2-radio label{margin:0 .6em;font-size:1.125em}.swal2-checkbox input,.swal2-radio input{margin:0 .4em}.swal2-input-label{display:flex;justify-content:center;margin:1em auto}.swal2-validation-message{align-items:center;justify-content:center;margin:0 -2.7em;padding:.625em;overflow:hidden;background:#f0f0f0;color:#666;font-size:1em;font-weight:300}.swal2-validation-message::before{content:\"!\";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}.swal2-icon{position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:1.25em auto 1.875em;border:.25em solid transparent;border-radius:50%;border-color:#000;font-family:inherit;line-height:5em;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}.swal2-icon.swal2-error{border-color:#f27474;color:#f27474}.swal2-icon.swal2-error .swal2-x-mark{position:relative;flex-grow:1}.swal2-icon.swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}.swal2-icon.swal2-error.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-error.swal2-icon-show .swal2-x-mark{-webkit-animation:swal2-animate-error-x-mark .5s;animation:swal2-animate-error-x-mark .5s}.swal2-icon.swal2-warning{border-color:#facea8;color:#f8bb86}.swal2-icon.swal2-info{border-color:#9de0f6;color:#3fc3ee}.swal2-icon.swal2-question{border-color:#c9dae1;color:#87adbd}.swal2-icon.swal2-success{border-color:#a5dc86;color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;transform:rotate(45deg);border-radius:50%}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}.swal2-icon.swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-.25em;left:-.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}.swal2-icon.swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}.swal2-icon.swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}.swal2-icon.swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-line-tip{-webkit-animation:swal2-animate-success-line-tip .75s;animation:swal2-animate-success-line-tip .75s}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-line-long{-webkit-animation:swal2-animate-success-line-long .75s;animation:swal2-animate-success-line-long .75s}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-circular-line-right{-webkit-animation:swal2-rotate-success-circular-line 4.25s ease-in;animation:swal2-rotate-success-circular-line 4.25s ease-in}.swal2-progress-steps{flex-wrap:wrap;align-items:center;max-width:100%;margin:0 0 1.25em;padding:0;background:inherit;font-weight:600}.swal2-progress-steps li{display:inline-block;position:relative}.swal2-progress-steps .swal2-progress-step{z-index:20;flex-shrink:0;width:2em;height:2em;border-radius:2em;background:#2778c4;color:#fff;line-height:2em;text-align:center}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#2778c4}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:#add8e6;color:#fff}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:#add8e6}.swal2-progress-steps .swal2-progress-step-line{z-index:10;flex-shrink:0;width:2.5em;height:.4em;margin:0 -1px;background:#2778c4}[class^=swal2]{-webkit-tap-highlight-color:transparent}.swal2-show{-webkit-animation:swal2-show .3s;animation:swal2-show .3s}.swal2-hide{-webkit-animation:swal2-hide .15s forwards;animation:swal2-hide .15s forwards}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{right:auto;left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}@supports (-ms-accelerator:true){.swal2-range input{width:100%!important}.swal2-range output{display:none}}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.swal2-range input{width:100%!important}.swal2-range output{display:none}}@-webkit-keyframes swal2-toast-show{0%{transform:translateY(-.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0)}}@keyframes swal2-toast-show{0%{transform:translateY(-.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0)}}@-webkit-keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@-webkit-keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@-webkit-keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@-webkit-keyframes swal2-show{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}100%{transform:scale(1)}}@keyframes swal2-show{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}100%{transform:scale(1)}}@-webkit-keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(.5);opacity:0}}@keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(.5);opacity:0}}@-webkit-keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@-webkit-keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@-webkit-keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@-webkit-keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(.4);opacity:0}50%{margin-top:1.625em;transform:scale(.4);opacity:0}80%{margin-top:-.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(.4);opacity:0}50%{margin-top:1.625em;transform:scale(.4);opacity:0}80%{margin-top:-.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@-webkit-keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0);opacity:1}}@-webkit-keyframes swal2-rotate-loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes swal2-rotate-loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto!important}body.swal2-no-backdrop .swal2-container{top:auto;right:auto;bottom:auto;left:auto;max-width:calc(100% - .625em * 2);background-color:transparent!important}body.swal2-no-backdrop .swal2-container>.swal2-modal{box-shadow:0 0 10px rgba(0,0,0,.4)}body.swal2-no-backdrop .swal2-container.swal2-top{top:0;left:50%;transform:translateX(-50%)}body.swal2-no-backdrop .swal2-container.swal2-top-left,body.swal2-no-backdrop .swal2-container.swal2-top-start{top:0;left:0}body.swal2-no-backdrop .swal2-container.swal2-top-end,body.swal2-no-backdrop .swal2-container.swal2-top-right{top:0;right:0}body.swal2-no-backdrop .swal2-container.swal2-center{top:50%;left:50%;transform:translate(-50%,-50%)}body.swal2-no-backdrop .swal2-container.swal2-center-left,body.swal2-no-backdrop .swal2-container.swal2-center-start{top:50%;left:0;transform:translateY(-50%)}body.swal2-no-backdrop .swal2-container.swal2-center-end,body.swal2-no-backdrop .swal2-container.swal2-center-right{top:50%;right:0;transform:translateY(-50%)}body.swal2-no-backdrop .swal2-container.swal2-bottom{bottom:0;left:50%;transform:translateX(-50%)}body.swal2-no-backdrop .swal2-container.swal2-bottom-left,body.swal2-no-backdrop .swal2-container.swal2-bottom-start{bottom:0;left:0}body.swal2-no-backdrop .swal2-container.swal2-bottom-end,body.swal2-no-backdrop .swal2-container.swal2-bottom-right{right:0;bottom:0}@media print{body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow-y:scroll!important}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) .swal2-container{position:static!important}}body.swal2-toast-shown .swal2-container{background-color:transparent}body.swal2-toast-shown .swal2-container.swal2-top{top:0;right:auto;bottom:auto;left:50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{top:0;right:0;bottom:auto;left:auto}body.swal2-toast-shown .swal2-container.swal2-top-left,body.swal2-toast-shown .swal2-container.swal2-top-start{top:0;right:auto;bottom:auto;left:0}body.swal2-toast-shown .swal2-container.swal2-center-left,body.swal2-toast-shown .swal2-container.swal2-center-start{top:50%;right:auto;bottom:auto;left:0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{top:50%;right:auto;bottom:auto;left:50%;transform:translate(-50%,-50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{top:50%;right:0;bottom:auto;left:auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-left,body.swal2-toast-shown .swal2-container.swal2-bottom-start{top:auto;right:auto;bottom:0;left:0}body.swal2-toast-shown .swal2-container.swal2-bottom{top:auto;right:auto;bottom:0;left:50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{top:auto;right:0;bottom:0;left:auto}body.swal2-toast-column .swal2-toast{flex-direction:column;align-items:stretch}body.swal2-toast-column .swal2-toast .swal2-actions{flex:1;align-self:stretch;height:2.2em;margin-top:.3125em}body.swal2-toast-column .swal2-toast .swal2-loading{justify-content:center}body.swal2-toast-column .swal2-toast .swal2-input{height:2em;margin:.3125em auto;font-size:1em}body.swal2-toast-column .swal2-toast .swal2-validation-message{font-size:1em}");
diff --git a/backend/vendor/assets/javascripts/underscore-min.js b/backend/vendor/assets/javascripts/underscore-min.js
deleted file mode 100644
index 3c3eec027b..0000000000
--- a/backend/vendor/assets/javascripts/underscore-min.js
+++ /dev/null
@@ -1,5 +0,0 @@
-// Underscore.js 1.8.3
-// http://underscorejs.org
-// (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
-// Underscore may be freely distributed under the MIT license.
-(function(){function n(n){function t(t,r,e,u,i,o){for(;i>=0&&o>i;i+=n){var a=u?u[i]:i;e=r(e,t[a],a,t)}return e}return function(r,e,u,i){e=b(e,i,4);var o=!k(r)&&m.keys(r),a=(o||r).length,c=n>0?0:a-1;return arguments.length<3&&(u=r[o?o[c]:c],c+=n),t(r,e,u,o,c,a)}}function t(n){return function(t,r,e){r=x(r,e);for(var u=O(t),i=n>0?0:u-1;i>=0&&u>i;i+=n)if(r(t[i],i,t))return i;return-1}}function r(n,t,r){return function(e,u,i){var o=0,a=O(e);if("number"==typeof i)n>0?o=i>=0?i:Math.max(i+a,o):a=i>=0?Math.min(i+1,a):i+a+1;else if(r&&i&&a)return i=r(e,u),e[i]===u?i:-1;if(u!==u)return i=t(l.call(e,o,a),m.isNaN),i>=0?i+o:-1;for(i=n>0?o:a-1;i>=0&&a>i;i+=n)if(e[i]===u)return i;return-1}}function e(n,t){var r=I.length,e=n.constructor,u=m.isFunction(e)&&e.prototype||a,i="constructor";for(m.has(n,i)&&!m.contains(t,i)&&t.push(i);r--;)i=I[r],i in n&&n[i]!==u[i]&&!m.contains(t,i)&&t.push(i)}var u=this,i=u._,o=Array.prototype,a=Object.prototype,c=Function.prototype,f=o.push,l=o.slice,s=a.toString,p=a.hasOwnProperty,h=Array.isArray,v=Object.keys,g=c.bind,y=Object.create,d=function(){},m=function(n){return n instanceof m?n:this instanceof m?void(this._wrapped=n):new m(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=m),exports._=m):u._=m,m.VERSION="1.8.3";var b=function(n,t,r){if(t===void 0)return n;switch(null==r?3:r){case 1:return function(r){return n.call(t,r)};case 2:return function(r,e){return n.call(t,r,e)};case 3:return function(r,e,u){return n.call(t,r,e,u)};case 4:return function(r,e,u,i){return n.call(t,r,e,u,i)}}return function(){return n.apply(t,arguments)}},x=function(n,t,r){return null==n?m.identity:m.isFunction(n)?b(n,t,r):m.isObject(n)?m.matcher(n):m.property(n)};m.iteratee=function(n,t){return x(n,t,1/0)};var _=function(n,t){return function(r){var e=arguments.length;if(2>e||null==r)return r;for(var u=1;e>u;u++)for(var i=arguments[u],o=n(i),a=o.length,c=0;a>c;c++){var f=o[c];t&&r[f]!==void 0||(r[f]=i[f])}return r}},j=function(n){if(!m.isObject(n))return{};if(y)return y(n);d.prototype=n;var t=new d;return d.prototype=null,t},w=function(n){return function(t){return null==t?void 0:t[n]}},A=Math.pow(2,53)-1,O=w("length"),k=function(n){var t=O(n);return"number"==typeof t&&t>=0&&A>=t};m.each=m.forEach=function(n,t,r){t=b(t,r);var e,u;if(k(n))for(e=0,u=n.length;u>e;e++)t(n[e],e,n);else{var i=m.keys(n);for(e=0,u=i.length;u>e;e++)t(n[i[e]],i[e],n)}return n},m.map=m.collect=function(n,t,r){t=x(t,r);for(var e=!k(n)&&m.keys(n),u=(e||n).length,i=Array(u),o=0;u>o;o++){var a=e?e[o]:o;i[o]=t(n[a],a,n)}return i},m.reduce=m.foldl=m.inject=n(1),m.reduceRight=m.foldr=n(-1),m.find=m.detect=function(n,t,r){var e;return e=k(n)?m.findIndex(n,t,r):m.findKey(n,t,r),e!==void 0&&e!==-1?n[e]:void 0},m.filter=m.select=function(n,t,r){var e=[];return t=x(t,r),m.each(n,function(n,r,u){t(n,r,u)&&e.push(n)}),e},m.reject=function(n,t,r){return m.filter(n,m.negate(x(t)),r)},m.every=m.all=function(n,t,r){t=x(t,r);for(var e=!k(n)&&m.keys(n),u=(e||n).length,i=0;u>i;i++){var o=e?e[i]:i;if(!t(n[o],o,n))return!1}return!0},m.some=m.any=function(n,t,r){t=x(t,r);for(var e=!k(n)&&m.keys(n),u=(e||n).length,i=0;u>i;i++){var o=e?e[i]:i;if(t(n[o],o,n))return!0}return!1},m.contains=m.includes=m.include=function(n,t,r,e){return k(n)||(n=m.values(n)),("number"!=typeof r||e)&&(r=0),m.indexOf(n,t,r)>=0},m.invoke=function(n,t){var r=l.call(arguments,2),e=m.isFunction(t);return m.map(n,function(n){var u=e?t:n[t];return null==u?u:u.apply(n,r)})},m.pluck=function(n,t){return m.map(n,m.property(t))},m.where=function(n,t){return m.filter(n,m.matcher(t))},m.findWhere=function(n,t){return m.find(n,m.matcher(t))},m.max=function(n,t,r){var e,u,i=-1/0,o=-1/0;if(null==t&&null!=n){n=k(n)?n:m.values(n);for(var a=0,c=n.length;c>a;a++)e=n[a],e>i&&(i=e)}else t=x(t,r),m.each(n,function(n,r,e){u=t(n,r,e),(u>o||u===-1/0&&i===-1/0)&&(i=n,o=u)});return i},m.min=function(n,t,r){var e,u,i=1/0,o=1/0;if(null==t&&null!=n){n=k(n)?n:m.values(n);for(var a=0,c=n.length;c>a;a++)e=n[a],i>e&&(i=e)}else t=x(t,r),m.each(n,function(n,r,e){u=t(n,r,e),(o>u||1/0===u&&1/0===i)&&(i=n,o=u)});return i},m.shuffle=function(n){for(var t,r=k(n)?n:m.values(n),e=r.length,u=Array(e),i=0;e>i;i++)t=m.random(0,i),t!==i&&(u[i]=u[t]),u[t]=r[i];return u},m.sample=function(n,t,r){return null==t||r?(k(n)||(n=m.values(n)),n[m.random(n.length-1)]):m.shuffle(n).slice(0,Math.max(0,t))},m.sortBy=function(n,t,r){return t=x(t,r),m.pluck(m.map(n,function(n,r,e){return{value:n,index:r,criteria:t(n,r,e)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(r>e||r===void 0)return 1;if(e>r||e===void 0)return-1}return n.index-t.index}),"value")};var F=function(n){return function(t,r,e){var u={};return r=x(r,e),m.each(t,function(e,i){var o=r(e,i,t);n(u,e,o)}),u}};m.groupBy=F(function(n,t,r){m.has(n,r)?n[r].push(t):n[r]=[t]}),m.indexBy=F(function(n,t,r){n[r]=t}),m.countBy=F(function(n,t,r){m.has(n,r)?n[r]++:n[r]=1}),m.toArray=function(n){return n?m.isArray(n)?l.call(n):k(n)?m.map(n,m.identity):m.values(n):[]},m.size=function(n){return null==n?0:k(n)?n.length:m.keys(n).length},m.partition=function(n,t,r){t=x(t,r);var e=[],u=[];return m.each(n,function(n,r,i){(t(n,r,i)?e:u).push(n)}),[e,u]},m.first=m.head=m.take=function(n,t,r){return null==n?void 0:null==t||r?n[0]:m.initial(n,n.length-t)},m.initial=function(n,t,r){return l.call(n,0,Math.max(0,n.length-(null==t||r?1:t)))},m.last=function(n,t,r){return null==n?void 0:null==t||r?n[n.length-1]:m.rest(n,Math.max(0,n.length-t))},m.rest=m.tail=m.drop=function(n,t,r){return l.call(n,null==t||r?1:t)},m.compact=function(n){return m.filter(n,m.identity)};var S=function(n,t,r,e){for(var u=[],i=0,o=e||0,a=O(n);a>o;o++){var c=n[o];if(k(c)&&(m.isArray(c)||m.isArguments(c))){t||(c=S(c,t,r));var f=0,l=c.length;for(u.length+=l;l>f;)u[i++]=c[f++]}else r||(u[i++]=c)}return u};m.flatten=function(n,t){return S(n,t,!1)},m.without=function(n){return m.difference(n,l.call(arguments,1))},m.uniq=m.unique=function(n,t,r,e){m.isBoolean(t)||(e=r,r=t,t=!1),null!=r&&(r=x(r,e));for(var u=[],i=[],o=0,a=O(n);a>o;o++){var c=n[o],f=r?r(c,o,n):c;t?(o&&i===f||u.push(c),i=f):r?m.contains(i,f)||(i.push(f),u.push(c)):m.contains(u,c)||u.push(c)}return u},m.union=function(){return m.uniq(S(arguments,!0,!0))},m.intersection=function(n){for(var t=[],r=arguments.length,e=0,u=O(n);u>e;e++){var i=n[e];if(!m.contains(t,i)){for(var o=1;r>o&&m.contains(arguments[o],i);o++);o===r&&t.push(i)}}return t},m.difference=function(n){var t=S(arguments,!0,!0,1);return m.filter(n,function(n){return!m.contains(t,n)})},m.zip=function(){return m.unzip(arguments)},m.unzip=function(n){for(var t=n&&m.max(n,O).length||0,r=Array(t),e=0;t>e;e++)r[e]=m.pluck(n,e);return r},m.object=function(n,t){for(var r={},e=0,u=O(n);u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},m.findIndex=t(1),m.findLastIndex=t(-1),m.sortedIndex=function(n,t,r,e){r=x(r,e,1);for(var u=r(t),i=0,o=O(n);o>i;){var a=Math.floor((i+o)/2);r(n[a])<u?i=a+1:o=a}return i},m.indexOf=r(1,m.findIndex,m.sortedIndex),m.lastIndexOf=r(-1,m.findLastIndex),m.range=function(n,t,r){null==t&&(t=n||0,n=0),r=r||1;for(var e=Math.max(Math.ceil((t-n)/r),0),u=Array(e),i=0;e>i;i++,n+=r)u[i]=n;return u};var E=function(n,t,r,e,u){if(!(e instanceof t))return n.apply(r,u);var i=j(n.prototype),o=n.apply(i,u);return m.isObject(o)?o:i};m.bind=function(n,t){if(g&&n.bind===g)return g.apply(n,l.call(arguments,1));if(!m.isFunction(n))throw new TypeError("Bind must be called on a function");var r=l.call(arguments,2),e=function(){return E(n,e,t,this,r.concat(l.call(arguments)))};return e},m.partial=function(n){var t=l.call(arguments,1),r=function(){for(var e=0,u=t.length,i=Array(u),o=0;u>o;o++)i[o]=t[o]===m?arguments[e++]:t[o];for(;e<arguments.length;)i.push(arguments[e++]);return E(n,r,this,this,i)};return r},m.bindAll=function(n){var t,r,e=arguments.length;if(1>=e)throw new Error("bindAll must be passed function names");for(t=1;e>t;t++)r=arguments[t],n[r]=m.bind(n[r],n);return n},m.memoize=function(n,t){var r=function(e){var u=r.cache,i=""+(t?t.apply(this,arguments):e);return m.has(u,i)||(u[i]=n.apply(this,arguments)),u[i]};return r.cache={},r},m.delay=function(n,t){var r=l.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},t)},m.defer=m.partial(m.delay,m,1),m.throttle=function(n,t,r){var e,u,i,o=null,a=0;r||(r={});var c=function(){a=r.leading===!1?0:m.now(),o=null,i=n.apply(e,u),o||(e=u=null)};return function(){var f=m.now();a||r.leading!==!1||(a=f);var l=t-(f-a);return e=this,u=arguments,0>=l||l>t?(o&&(clearTimeout(o),o=null),a=f,i=n.apply(e,u),o||(e=u=null)):o||r.trailing===!1||(o=setTimeout(c,l)),i}},m.debounce=function(n,t,r){var e,u,i,o,a,c=function(){var f=m.now()-o;t>f&&f>=0?e=setTimeout(c,t-f):(e=null,r||(a=n.apply(i,u),e||(i=u=null)))};return function(){i=this,u=arguments,o=m.now();var f=r&&!e;return e||(e=setTimeout(c,t)),f&&(a=n.apply(i,u),i=u=null),a}},m.wrap=function(n,t){return m.partial(t,n)},m.negate=function(n){return function(){return!n.apply(this,arguments)}},m.compose=function(){var n=arguments,t=n.length-1;return function(){for(var r=t,e=n[t].apply(this,arguments);r--;)e=n[r].call(this,e);return e}},m.after=function(n,t){return function(){return--n<1?t.apply(this,arguments):void 0}},m.before=function(n,t){var r;return function(){return--n>0&&(r=t.apply(this,arguments)),1>=n&&(t=null),r}},m.once=m.partial(m.before,2);var M=!{toString:null}.propertyIsEnumerable("toString"),I=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];m.keys=function(n){if(!m.isObject(n))return[];if(v)return v(n);var t=[];for(var r in n)m.has(n,r)&&t.push(r);return M&&e(n,t),t},m.allKeys=function(n){if(!m.isObject(n))return[];var t=[];for(var r in n)t.push(r);return M&&e(n,t),t},m.values=function(n){for(var t=m.keys(n),r=t.length,e=Array(r),u=0;r>u;u++)e[u]=n[t[u]];return e},m.mapObject=function(n,t,r){t=x(t,r);for(var e,u=m.keys(n),i=u.length,o={},a=0;i>a;a++)e=u[a],o[e]=t(n[e],e,n);return o},m.pairs=function(n){for(var t=m.keys(n),r=t.length,e=Array(r),u=0;r>u;u++)e[u]=[t[u],n[t[u]]];return e},m.invert=function(n){for(var t={},r=m.keys(n),e=0,u=r.length;u>e;e++)t[n[r[e]]]=r[e];return t},m.functions=m.methods=function(n){var t=[];for(var r in n)m.isFunction(n[r])&&t.push(r);return t.sort()},m.extend=_(m.allKeys),m.extendOwn=m.assign=_(m.keys),m.findKey=function(n,t,r){t=x(t,r);for(var e,u=m.keys(n),i=0,o=u.length;o>i;i++)if(e=u[i],t(n[e],e,n))return e},m.pick=function(n,t,r){var e,u,i={},o=n;if(null==o)return i;m.isFunction(t)?(u=m.allKeys(o),e=b(t,r)):(u=S(arguments,!1,!1,1),e=function(n,t,r){return t in r},o=Object(o));for(var a=0,c=u.length;c>a;a++){var f=u[a],l=o[f];e(l,f,o)&&(i[f]=l)}return i},m.omit=function(n,t,r){if(m.isFunction(t))t=m.negate(t);else{var e=m.map(S(arguments,!1,!1,1),String);t=function(n,t){return!m.contains(e,t)}}return m.pick(n,t,r)},m.defaults=_(m.allKeys,!0),m.create=function(n,t){var r=j(n);return t&&m.extendOwn(r,t),r},m.clone=function(n){return m.isObject(n)?m.isArray(n)?n.slice():m.extend({},n):n},m.tap=function(n,t){return t(n),n},m.isMatch=function(n,t){var r=m.keys(t),e=r.length;if(null==n)return!e;for(var u=Object(n),i=0;e>i;i++){var o=r[i];if(t[o]!==u[o]||!(o in u))return!1}return!0};var N=function(n,t,r,e){if(n===t)return 0!==n||1/n===1/t;if(null==n||null==t)return n===t;n instanceof m&&(n=n._wrapped),t instanceof m&&(t=t._wrapped);var u=s.call(n);if(u!==s.call(t))return!1;switch(u){case"[object RegExp]":case"[object String]":return""+n==""+t;case"[object Number]":return+n!==+n?+t!==+t:0===+n?1/+n===1/t:+n===+t;case"[object Date]":case"[object Boolean]":return+n===+t}var i="[object Array]"===u;if(!i){if("object"!=typeof n||"object"!=typeof t)return!1;var o=n.constructor,a=t.constructor;if(o!==a&&!(m.isFunction(o)&&o instanceof o&&m.isFunction(a)&&a instanceof a)&&"constructor"in n&&"constructor"in t)return!1}r=r||[],e=e||[];for(var c=r.length;c--;)if(r[c]===n)return e[c]===t;if(r.push(n),e.push(t),i){if(c=n.length,c!==t.length)return!1;for(;c--;)if(!N(n[c],t[c],r,e))return!1}else{var f,l=m.keys(n);if(c=l.length,m.keys(t).length!==c)return!1;for(;c--;)if(f=l[c],!m.has(t,f)||!N(n[f],t[f],r,e))return!1}return r.pop(),e.pop(),!0};m.isEqual=function(n,t){return N(n,t)},m.isEmpty=function(n){return null==n?!0:k(n)&&(m.isArray(n)||m.isString(n)||m.isArguments(n))?0===n.length:0===m.keys(n).length},m.isElement=function(n){return!(!n||1!==n.nodeType)},m.isArray=h||function(n){return"[object Array]"===s.call(n)},m.isObject=function(n){var t=typeof n;return"function"===t||"object"===t&&!!n},m.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(n){m["is"+n]=function(t){return s.call(t)==="[object "+n+"]"}}),m.isArguments(arguments)||(m.isArguments=function(n){return m.has(n,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(m.isFunction=function(n){return"function"==typeof n||!1}),m.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},m.isNaN=function(n){return m.isNumber(n)&&n!==+n},m.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"===s.call(n)},m.isNull=function(n){return null===n},m.isUndefined=function(n){return n===void 0},m.has=function(n,t){return null!=n&&p.call(n,t)},m.noConflict=function(){return u._=i,this},m.identity=function(n){return n},m.constant=function(n){return function(){return n}},m.noop=function(){},m.property=w,m.propertyOf=function(n){return null==n?function(){}:function(t){return n[t]}},m.matcher=m.matches=function(n){return n=m.extendOwn({},n),function(t){return m.isMatch(t,n)}},m.times=function(n,t,r){var e=Array(Math.max(0,n));t=b(t,r,1);for(var u=0;n>u;u++)e[u]=t(u);return e},m.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))},m.now=Date.now||function(){return(new Date).getTime()};var B={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},T=m.invert(B),R=function(n){var t=function(t){return n[t]},r="(?:"+m.keys(n).join("|")+")",e=RegExp(r),u=RegExp(r,"g");return function(n){return n=null==n?"":""+n,e.test(n)?n.replace(u,t):n}};m.escape=R(B),m.unescape=R(T),m.result=function(n,t,r){var e=null==n?void 0:n[t];return e===void 0&&(e=r),m.isFunction(e)?e.call(n):e};var q=0;m.uniqueId=function(n){var t=++q+"";return n?n+t:t},m.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var K=/(.)^/,z={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},D=/\\|'|\r|\n|\u2028|\u2029/g,L=function(n){return"\\"+z[n]};m.template=function(n,t,r){!t&&r&&(t=r),t=m.defaults({},t,m.templateSettings);var e=RegExp([(t.escape||K).source,(t.interpolate||K).source,(t.evaluate||K).source].join("|")+"|$","g"),u=0,i="__p+='";n.replace(e,function(t,r,e,o,a){return i+=n.slice(u,a).replace(D,L),u=a+t.length,r?i+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'":e?i+="'+\n((__t=("+e+"))==null?'':__t)+\n'":o&&(i+="';\n"+o+"\n__p+='"),t}),i+="';\n",t.variable||(i="with(obj||{}){\n"+i+"}\n"),i="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+i+"return __p;\n";try{var o=new Function(t.variable||"obj","_",i)}catch(a){throw a.source=i,a}var c=function(n){return o.call(this,n,m)},f=t.variable||"obj";return c.source="function("+f+"){\n"+i+"}",c},m.chain=function(n){var t=m(n);return t._chain=!0,t};var P=function(n,t){return n._chain?m(t).chain():t};m.mixin=function(n){m.each(m.functions(n),function(t){var r=m[t]=n[t];m.prototype[t]=function(){var n=[this._wrapped];return f.apply(n,arguments),P(this,r.apply(m,n))}})},m.mixin(m),m.each(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=o[n];m.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!==n&&"splice"!==n||0!==r.length||delete r[0],P(this,r)}}),m.each(["concat","join","slice"],function(n){var t=o[n];m.prototype[n]=function(){return P(this,t.apply(this._wrapped,arguments))}}),m.prototype.value=function(){return this._wrapped},m.prototype.valueOf=m.prototype.toJSON=m.prototype.value,m.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return m})}).call(this);
diff --git a/backend/vendor/assets/stylesheets/animate.css b/backend/vendor/assets/stylesheets/animate.css
deleted file mode 100644
index af545836e3..0000000000
--- a/backend/vendor/assets/stylesheets/animate.css
+++ /dev/null
@@ -1,9 +0,0 @@
-
-@charset "UTF-8";
-/*!
- * animate.css - https://animate.style/
- * Version - 4.0.0
- * Licensed under the MIT license - http://opensource.org/licenses/MIT
- *
- * Copyright (c) 2020 Animate.css
- */:root{--animate-duration:1s;--animate-delay:1s;--animate-repeat:1}.animate__animated{-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-duration:var(--animate-duration);animation-duration:var(--animate-duration);-webkit-animation-fill-mode:both;animation-fill-mode:both}.animate__animated.animate__infinite{-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite}.animate__animated.animate__repeat-1{-webkit-animation-iteration-count:1;animation-iteration-count:1;-webkit-animation-iteration-count:var(--animate-repeat);animation-iteration-count:var(--animate-repeat)}.animate__animated.animate__repeat-2{-webkit-animation-iteration-count:2;animation-iteration-count:2;-webkit-animation-iteration-count:calc(var(--animate-repeat)*2);animation-iteration-count:calc(var(--animate-repeat)*2)}.animate__animated.animate__repeat-3{-webkit-animation-iteration-count:3;animation-iteration-count:3;-webkit-animation-iteration-count:calc(var(--animate-repeat)*3);animation-iteration-count:calc(var(--animate-repeat)*3)}.animate__animated.animate__delay-1s{-webkit-animation-delay:1s;animation-delay:1s;-webkit-animation-delay:var(--animate-delay);animation-delay:var(--animate-delay)}.animate__animated.animate__delay-2s{-webkit-animation-delay:2s;animation-delay:2s;-webkit-animation-delay:calc(var(--animate-delay)*2);animation-delay:calc(var(--animate-delay)*2)}.animate__animated.animate__delay-3s{-webkit-animation-delay:3s;animation-delay:3s;-webkit-animation-delay:calc(var(--animate-delay)*3);animation-delay:calc(var(--animate-delay)*3)}.animate__animated.animate__delay-4s{-webkit-animation-delay:4s;animation-delay:4s;-webkit-animation-delay:calc(var(--animate-delay)*4);animation-delay:calc(var(--animate-delay)*4)}.animate__animated.animate__delay-5s{-webkit-animation-delay:5s;animation-delay:5s;-webkit-animation-delay:calc(var(--animate-delay)*5);animation-delay:calc(var(--animate-delay)*5)}.animate__animated.animate__faster{-webkit-animation-duration:.5s;animation-duration:.5s;-webkit-animation-duration:calc(var(--animate-duration)/2);animation-duration:calc(var(--animate-duration)/2)}.animate__animated.animate__fast{-webkit-animation-duration:.8s;animation-duration:.8s;-webkit-animation-duration:calc(var(--animate-duration)*0.8);animation-duration:calc(var(--animate-duration)*0.8)}.animate__animated.animate__slow{-webkit-animation-duration:2s;animation-duration:2s;-webkit-animation-duration:calc(var(--animate-duration)*2);animation-duration:calc(var(--animate-duration)*2)}.animate__animated.animate__slower{-webkit-animation-duration:3s;animation-duration:3s;-webkit-animation-duration:calc(var(--animate-duration)*3);animation-duration:calc(var(--animate-duration)*3)}@media (prefers-reduced-motion:reduce),print{.animate__animated{-webkit-animation-duration:1ms!important;animation-duration:1ms!important;-webkit-transition-duration:1ms!important;transition-duration:1ms!important;-webkit-animation-iteration-count:1!important;animation-iteration-count:1!important}.animate__animated[class*=Out]{opacity:0}}@-webkit-keyframes bounce{0%,20%,53%,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);animation-timing-function:cubic-bezier(.215,.61,.355,1);-webkit-transform:translateZ(0);transform:translateZ(0)}40%,43%{-webkit-animation-timing-function:cubic-bezier(.755,.05,.855,.06);animation-timing-function:cubic-bezier(.755,.05,.855,.06);-webkit-transform:translate3d(0,-30px,0) scaleY(1.1);transform:translate3d(0,-30px,0) scaleY(1.1)}70%{-webkit-animation-timing-function:cubic-bezier(.755,.05,.855,.06);animation-timing-function:cubic-bezier(.755,.05,.855,.06);-webkit-transform:translate3d(0,-15px,0) scaleY(1.05);transform:translate3d(0,-15px,0) scaleY(1.05)}80%{-webkit-transition-timing-function:cubic-bezier(.215,.61,.355,1);transition-timing-function:cubic-bezier(.215,.61,.355,1);-webkit-transform:translateZ(0) scaleY(.95);transform:translateZ(0) scaleY(.95)}90%{-webkit-transform:translate3d(0,-4px,0) scaleY(1.02);transform:translate3d(0,-4px,0) scaleY(1.02)}}@keyframes bounce{0%,20%,53%,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);animation-timing-function:cubic-bezier(.215,.61,.355,1);-webkit-transform:translateZ(0);transform:translateZ(0)}40%,43%{-webkit-animation-timing-function:cubic-bezier(.755,.05,.855,.06);animation-timing-function:cubic-bezier(.755,.05,.855,.06);-webkit-transform:translate3d(0,-30px,0) scaleY(1.1);transform:translate3d(0,-30px,0) scaleY(1.1)}70%{-webkit-animation-timing-function:cubic-bezier(.755,.05,.855,.06);animation-timing-function:cubic-bezier(.755,.05,.855,.06);-webkit-transform:translate3d(0,-15px,0) scaleY(1.05);transform:translate3d(0,-15px,0) scaleY(1.05)}80%{-webkit-transition-timing-function:cubic-bezier(.215,.61,.355,1);transition-timing-function:cubic-bezier(.215,.61,.355,1);-webkit-transform:translateZ(0) scaleY(.95);transform:translateZ(0) scaleY(.95)}90%{-webkit-transform:translate3d(0,-4px,0) scaleY(1.02);transform:translate3d(0,-4px,0) scaleY(1.02)}}.animate__bounce{-webkit-animation-name:bounce;animation-name:bounce;-webkit-transform-origin:center bottom;transform-origin:center bottom}@-webkit-keyframes flash{0%,50%,to{opacity:1}25%,75%{opacity:0}}@keyframes flash{0%,50%,to{opacity:1}25%,75%{opacity:0}}.animate__flash{-webkit-animation-name:flash;animation-name:flash}@-webkit-keyframes pulse{0%{-webkit-transform:scaleX(1);transform:scaleX(1)}50%{-webkit-transform:scale3d(1.05,1.05,1.05);transform:scale3d(1.05,1.05,1.05)}to{-webkit-transform:scaleX(1);transform:scaleX(1)}}@keyframes pulse{0%{-webkit-transform:scaleX(1);transform:scaleX(1)}50%{-webkit-transform:scale3d(1.05,1.05,1.05);transform:scale3d(1.05,1.05,1.05)}to{-webkit-transform:scaleX(1);transform:scaleX(1)}}.animate__pulse{-webkit-animation-name:pulse;animation-name:pulse;-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}@-webkit-keyframes rubberBand{0%{-webkit-transform:scaleX(1);transform:scaleX(1)}30%{-webkit-transform:scale3d(1.25,.75,1);transform:scale3d(1.25,.75,1)}40%{-webkit-transform:scale3d(.75,1.25,1);transform:scale3d(.75,1.25,1)}50%{-webkit-transform:scale3d(1.15,.85,1);transform:scale3d(1.15,.85,1)}65%{-webkit-transform:scale3d(.95,1.05,1);transform:scale3d(.95,1.05,1)}75%{-webkit-transform:scale3d(1.05,.95,1);transform:scale3d(1.05,.95,1)}to{-webkit-transform:scaleX(1);transform:scaleX(1)}}@keyframes rubberBand{0%{-webkit-transform:scaleX(1);transform:scaleX(1)}30%{-webkit-transform:scale3d(1.25,.75,1);transform:scale3d(1.25,.75,1)}40%{-webkit-transform:scale3d(.75,1.25,1);transform:scale3d(.75,1.25,1)}50%{-webkit-transform:scale3d(1.15,.85,1);transform:scale3d(1.15,.85,1)}65%{-webkit-transform:scale3d(.95,1.05,1);transform:scale3d(.95,1.05,1)}75%{-webkit-transform:scale3d(1.05,.95,1);transform:scale3d(1.05,.95,1)}to{-webkit-transform:scaleX(1);transform:scaleX(1)}}.animate__rubberBand{-webkit-animation-name:rubberBand;animation-name:rubberBand}@-webkit-keyframes shakeX{0%,to{-webkit-transform:translateZ(0);transform:translateZ(0)}10%,30%,50%,70%,90%{-webkit-transform:translate3d(-10px,0,0);transform:translate3d(-10px,0,0)}20%,40%,60%,80%{-webkit-transform:translate3d(10px,0,0);transform:translate3d(10px,0,0)}}@keyframes shakeX{0%,to{-webkit-transform:translateZ(0);transform:translateZ(0)}10%,30%,50%,70%,90%{-webkit-transform:translate3d(-10px,0,0);transform:translate3d(-10px,0,0)}20%,40%,60%,80%{-webkit-transform:translate3d(10px,0,0);transform:translate3d(10px,0,0)}}.animate__shakeX{-webkit-animation-name:shakeX;animation-name:shakeX}@-webkit-keyframes shakeY{0%,to{-webkit-transform:translateZ(0);transform:translateZ(0)}10%,30%,50%,70%,90%{-webkit-transform:translate3d(0,-10px,0);transform:translate3d(0,-10px,0)}20%,40%,60%,80%{-webkit-transform:translate3d(0,10px,0);transform:translate3d(0,10px,0)}}@keyframes shakeY{0%,to{-webkit-transform:translateZ(0);transform:translateZ(0)}10%,30%,50%,70%,90%{-webkit-transform:translate3d(0,-10px,0);transform:translate3d(0,-10px,0)}20%,40%,60%,80%{-webkit-transform:translate3d(0,10px,0);transform:translate3d(0,10px,0)}}.animate__shakeY{-webkit-animation-name:shakeY;animation-name:shakeY}@-webkit-keyframes headShake{0%{-webkit-transform:translateX(0);transform:translateX(0)}6.5%{-webkit-transform:translateX(-6px) rotateY(-9deg);transform:translateX(-6px) rotateY(-9deg)}18.5%{-webkit-transform:translateX(5px) rotateY(7deg);transform:translateX(5px) rotateY(7deg)}31.5%{-webkit-transform:translateX(-3px) rotateY(-5deg);transform:translateX(-3px) rotateY(-5deg)}43.5%{-webkit-transform:translateX(2px) rotateY(3deg);transform:translateX(2px) rotateY(3deg)}50%{-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes headShake{0%{-webkit-transform:translateX(0);transform:translateX(0)}6.5%{-webkit-transform:translateX(-6px) rotateY(-9deg);transform:translateX(-6px) rotateY(-9deg)}18.5%{-webkit-transform:translateX(5px) rotateY(7deg);transform:translateX(5px) rotateY(7deg)}31.5%{-webkit-transform:translateX(-3px) rotateY(-5deg);transform:translateX(-3px) rotateY(-5deg)}43.5%{-webkit-transform:translateX(2px) rotateY(3deg);transform:translateX(2px) rotateY(3deg)}50%{-webkit-transform:translateX(0);transform:translateX(0)}}.animate__headShake{-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out;-webkit-animation-name:headShake;animation-name:headShake}@-webkit-keyframes swing{20%{-webkit-transform:rotate(15deg);transform:rotate(15deg)}40%{-webkit-transform:rotate(-10deg);transform:rotate(-10deg)}60%{-webkit-transform:rotate(5deg);transform:rotate(5deg)}80%{-webkit-transform:rotate(-5deg);transform:rotate(-5deg)}to{-webkit-transform:rotate(0deg);transform:rotate(0deg)}}@keyframes swing{20%{-webkit-transform:rotate(15deg);transform:rotate(15deg)}40%{-webkit-transform:rotate(-10deg);transform:rotate(-10deg)}60%{-webkit-transform:rotate(5deg);transform:rotate(5deg)}80%{-webkit-transform:rotate(-5deg);transform:rotate(-5deg)}to{-webkit-transform:rotate(0deg);transform:rotate(0deg)}}.animate__swing{-webkit-transform-origin:top center;transform-origin:top center;-webkit-animation-name:swing;animation-name:swing}@-webkit-keyframes tada{0%{-webkit-transform:scaleX(1);transform:scaleX(1)}10%,20%{-webkit-transform:scale3d(.9,.9,.9) rotate(-3deg);transform:scale3d(.9,.9,.9) rotate(-3deg)}30%,50%,70%,90%{-webkit-transform:scale3d(1.1,1.1,1.1) rotate(3deg);transform:scale3d(1.1,1.1,1.1) rotate(3deg)}40%,60%,80%{-webkit-transform:scale3d(1.1,1.1,1.1) rotate(-3deg);transform:scale3d(1.1,1.1,1.1) rotate(-3deg)}to{-webkit-transform:scaleX(1);transform:scaleX(1)}}@keyframes tada{0%{-webkit-transform:scaleX(1);transform:scaleX(1)}10%,20%{-webkit-transform:scale3d(.9,.9,.9) rotate(-3deg);transform:scale3d(.9,.9,.9) rotate(-3deg)}30%,50%,70%,90%{-webkit-transform:scale3d(1.1,1.1,1.1) rotate(3deg);transform:scale3d(1.1,1.1,1.1) rotate(3deg)}40%,60%,80%{-webkit-transform:scale3d(1.1,1.1,1.1) rotate(-3deg);transform:scale3d(1.1,1.1,1.1) rotate(-3deg)}to{-webkit-transform:scaleX(1);transform:scaleX(1)}}.animate__tada{-webkit-animation-name:tada;animation-name:tada}@-webkit-keyframes wobble{0%{-webkit-transform:translateZ(0);transform:translateZ(0)}15%{-webkit-transform:translate3d(-25%,0,0) rotate(-5deg);transform:translate3d(-25%,0,0) rotate(-5deg)}30%{-webkit-transform:translate3d(20%,0,0) rotate(3deg);transform:translate3d(20%,0,0) rotate(3deg)}45%{-webkit-transform:translate3d(-15%,0,0) rotate(-3deg);transform:translate3d(-15%,0,0) rotate(-3deg)}60%{-webkit-transform:translate3d(10%,0,0) rotate(2deg);transform:translate3d(10%,0,0) rotate(2deg)}75%{-webkit-transform:translate3d(-5%,0,0) rotate(-1deg);transform:translate3d(-5%,0,0) rotate(-1deg)}to{-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes wobble{0%{-webkit-transform:translateZ(0);transform:translateZ(0)}15%{-webkit-transform:translate3d(-25%,0,0) rotate(-5deg);transform:translate3d(-25%,0,0) rotate(-5deg)}30%{-webkit-transform:translate3d(20%,0,0) rotate(3deg);transform:translate3d(20%,0,0) rotate(3deg)}45%{-webkit-transform:translate3d(-15%,0,0) rotate(-3deg);transform:translate3d(-15%,0,0) rotate(-3deg)}60%{-webkit-transform:translate3d(10%,0,0) rotate(2deg);transform:translate3d(10%,0,0) rotate(2deg)}75%{-webkit-transform:translate3d(-5%,0,0) rotate(-1deg);transform:translate3d(-5%,0,0) rotate(-1deg)}to{-webkit-transform:translateZ(0);transform:translateZ(0)}}.animate__wobble{-webkit-animation-name:wobble;animation-name:wobble}@-webkit-keyframes jello{0%,11.1%,to{-webkit-transform:translateZ(0);transform:translateZ(0)}22.2%{-webkit-transform:skewX(-12.5deg) skewY(-12.5deg);transform:skewX(-12.5deg) skewY(-12.5deg)}33.3%{-webkit-transform:skewX(6.25deg) skewY(6.25deg);transform:skewX(6.25deg) skewY(6.25deg)}44.4%{-webkit-transform:skewX(-3.125deg) skewY(-3.125deg);transform:skewX(-3.125deg) skewY(-3.125deg)}55.5%{-webkit-transform:skewX(1.5625deg) skewY(1.5625deg);transform:skewX(1.5625deg) skewY(1.5625deg)}66.6%{-webkit-transform:skewX(-.78125deg) skewY(-.78125deg);transform:skewX(-.78125deg) skewY(-.78125deg)}77.7%{-webkit-transform:skewX(.390625deg) skewY(.390625deg);transform:skewX(.390625deg) skewY(.390625deg)}88.8%{-webkit-transform:skewX(-.1953125deg) skewY(-.1953125deg);transform:skewX(-.1953125deg) skewY(-.1953125deg)}}@keyframes jello{0%,11.1%,to{-webkit-transform:translateZ(0);transform:translateZ(0)}22.2%{-webkit-transform:skewX(-12.5deg) skewY(-12.5deg);transform:skewX(-12.5deg) skewY(-12.5deg)}33.3%{-webkit-transform:skewX(6.25deg) skewY(6.25deg);transform:skewX(6.25deg) skewY(6.25deg)}44.4%{-webkit-transform:skewX(-3.125deg) skewY(-3.125deg);transform:skewX(-3.125deg) skewY(-3.125deg)}55.5%{-webkit-transform:skewX(1.5625deg) skewY(1.5625deg);transform:skewX(1.5625deg) skewY(1.5625deg)}66.6%{-webkit-transform:skewX(-.78125deg) skewY(-.78125deg);transform:skewX(-.78125deg) skewY(-.78125deg)}77.7%{-webkit-transform:skewX(.390625deg) skewY(.390625deg);transform:skewX(.390625deg) skewY(.390625deg)}88.8%{-webkit-transform:skewX(-.1953125deg) skewY(-.1953125deg);transform:skewX(-.1953125deg) skewY(-.1953125deg)}}.animate__jello{-webkit-animation-name:jello;animation-name:jello;-webkit-transform-origin:center;transform-origin:center}@-webkit-keyframes heartBeat{0%{-webkit-transform:scale(1);transform:scale(1)}14%{-webkit-transform:scale(1.3);transform:scale(1.3)}28%{-webkit-transform:scale(1);transform:scale(1)}42%{-webkit-transform:scale(1.3);transform:scale(1.3)}70%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes heartBeat{0%{-webkit-transform:scale(1);transform:scale(1)}14%{-webkit-transform:scale(1.3);transform:scale(1.3)}28%{-webkit-transform:scale(1);transform:scale(1)}42%{-webkit-transform:scale(1.3);transform:scale(1.3)}70%{-webkit-transform:scale(1);transform:scale(1)}}.animate__heartBeat{-webkit-animation-name:heartBeat;animation-name:heartBeat;-webkit-animation-duration:1.3s;animation-duration:1.3s;-webkit-animation-duration:calc(var(--animate-duration)*1.3);animation-duration:calc(var(--animate-duration)*1.3);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}@-webkit-keyframes backInDown{0%{-webkit-transform:translateY(-1200px) scale(.7);transform:translateY(-1200px) scale(.7);opacity:.7}80%{-webkit-transform:translateY(0) scale(.7);transform:translateY(0) scale(.7);opacity:.7}to{-webkit-transform:scale(1);transform:scale(1);opacity:1}}@keyframes backInDown{0%{-webkit-transform:translateY(-1200px) scale(.7);transform:translateY(-1200px) scale(.7);opacity:.7}80%{-webkit-transform:translateY(0) scale(.7);transform:translateY(0) scale(.7);opacity:.7}to{-webkit-transform:scale(1);transform:scale(1);opacity:1}}.animate__backInDown{-webkit-animation-name:backInDown;animation-name:backInDown}@-webkit-keyframes backInLeft{0%{-webkit-transform:translateX(-2000px) scale(.7);transform:translateX(-2000px) scale(.7);opacity:.7}80%{-webkit-transform:translateX(0) scale(.7);transform:translateX(0) scale(.7);opacity:.7}to{-webkit-transform:scale(1);transform:scale(1);opacity:1}}@keyframes backInLeft{0%{-webkit-transform:translateX(-2000px) scale(.7);transform:translateX(-2000px) scale(.7);opacity:.7}80%{-webkit-transform:translateX(0) scale(.7);transform:translateX(0) scale(.7);opacity:.7}to{-webkit-transform:scale(1);transform:scale(1);opacity:1}}.animate__backInLeft{-webkit-animation-name:backInLeft;animation-name:backInLeft}@-webkit-keyframes backInRight{0%{-webkit-transform:translateX(2000px) scale(.7);transform:translateX(2000px) scale(.7);opacity:.7}80%{-webkit-transform:translateX(0) scale(.7);transform:translateX(0) scale(.7);opacity:.7}to{-webkit-transform:scale(1);transform:scale(1);opacity:1}}@keyframes backInRight{0%{-webkit-transform:translateX(2000px) scale(.7);transform:translateX(2000px) scale(.7);opacity:.7}80%{-webkit-transform:translateX(0) scale(.7);transform:translateX(0) scale(.7);opacity:.7}to{-webkit-transform:scale(1);transform:scale(1);opacity:1}}.animate__backInRight{-webkit-animation-name:backInRight;animation-name:backInRight}@-webkit-keyframes backInUp{0%{-webkit-transform:translateY(1200px) scale(.7);transform:translateY(1200px) scale(.7);opacity:.7}80%{-webkit-transform:translateY(0) scale(.7);transform:translateY(0) scale(.7);opacity:.7}to{-webkit-transform:scale(1);transform:scale(1);opacity:1}}@keyframes backInUp{0%{-webkit-transform:translateY(1200px) scale(.7);transform:translateY(1200px) scale(.7);opacity:.7}80%{-webkit-transform:translateY(0) scale(.7);transform:translateY(0) scale(.7);opacity:.7}to{-webkit-transform:scale(1);transform:scale(1);opacity:1}}.animate__backInUp{-webkit-animation-name:backInUp;animation-name:backInUp}@-webkit-keyframes backOutDown{0%{-webkit-transform:scale(1);transform:scale(1);opacity:1}20%{-webkit-transform:translateY(0) scale(.7);transform:translateY(0) scale(.7);opacity:.7}to{-webkit-transform:translateY(700px) scale(.7);transform:translateY(700px) scale(.7);opacity:.7}}@keyframes backOutDown{0%{-webkit-transform:scale(1);transform:scale(1);opacity:1}20%{-webkit-transform:translateY(0) scale(.7);transform:translateY(0) scale(.7);opacity:.7}to{-webkit-transform:translateY(700px) scale(.7);transform:translateY(700px) scale(.7);opacity:.7}}.animate__backOutDown{-webkit-animation-name:backOutDown;animation-name:backOutDown}@-webkit-keyframes backOutLeft{0%{-webkit-transform:scale(1);transform:scale(1);opacity:1}20%{-webkit-transform:translateX(0) scale(.7);transform:translateX(0) scale(.7);opacity:.7}to{-webkit-transform:translateX(-2000px) scale(.7);transform:translateX(-2000px) scale(.7);opacity:.7}}@keyframes backOutLeft{0%{-webkit-transform:scale(1);transform:scale(1);opacity:1}20%{-webkit-transform:translateX(0) scale(.7);transform:translateX(0) scale(.7);opacity:.7}to{-webkit-transform:translateX(-2000px) scale(.7);transform:translateX(-2000px) scale(.7);opacity:.7}}.animate__backOutLeft{-webkit-animation-name:backOutLeft;animation-name:backOutLeft}@-webkit-keyframes backOutRight{0%{-webkit-transform:scale(1);transform:scale(1);opacity:1}20%{-webkit-transform:translateX(0) scale(.7);transform:translateX(0) scale(.7);opacity:.7}to{-webkit-transform:translateX(2000px) scale(.7);transform:translateX(2000px) scale(.7);opacity:.7}}@keyframes backOutRight{0%{-webkit-transform:scale(1);transform:scale(1);opacity:1}20%{-webkit-transform:translateX(0) scale(.7);transform:translateX(0) scale(.7);opacity:.7}to{-webkit-transform:translateX(2000px) scale(.7);transform:translateX(2000px) scale(.7);opacity:.7}}.animate__backOutRight{-webkit-animation-name:backOutRight;animation-name:backOutRight}@-webkit-keyframes backOutUp{0%{-webkit-transform:scale(1);transform:scale(1);opacity:1}20%{-webkit-transform:translateY(0) scale(.7);transform:translateY(0) scale(.7);opacity:.7}to{-webkit-transform:translateY(-700px) scale(.7);transform:translateY(-700px) scale(.7);opacity:.7}}@keyframes backOutUp{0%{-webkit-transform:scale(1);transform:scale(1);opacity:1}20%{-webkit-transform:translateY(0) scale(.7);transform:translateY(0) scale(.7);opacity:.7}to{-webkit-transform:translateY(-700px) scale(.7);transform:translateY(-700px) scale(.7);opacity:.7}}.animate__backOutUp{-webkit-animation-name:backOutUp;animation-name:backOutUp}@-webkit-keyframes bounceIn{0%,20%,40%,60%,80%,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;-webkit-transform:scale3d(.3,.3,.3);transform:scale3d(.3,.3,.3)}20%{-webkit-transform:scale3d(1.1,1.1,1.1);transform:scale3d(1.1,1.1,1.1)}40%{-webkit-transform:scale3d(.9,.9,.9);transform:scale3d(.9,.9,.9)}60%{opacity:1;-webkit-transform:scale3d(1.03,1.03,1.03);transform:scale3d(1.03,1.03,1.03)}80%{-webkit-transform:scale3d(.97,.97,.97);transform:scale3d(.97,.97,.97)}to{opacity:1;-webkit-transform:scaleX(1);transform:scaleX(1)}}@keyframes bounceIn{0%,20%,40%,60%,80%,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;-webkit-transform:scale3d(.3,.3,.3);transform:scale3d(.3,.3,.3)}20%{-webkit-transform:scale3d(1.1,1.1,1.1);transform:scale3d(1.1,1.1,1.1)}40%{-webkit-transform:scale3d(.9,.9,.9);transform:scale3d(.9,.9,.9)}60%{opacity:1;-webkit-transform:scale3d(1.03,1.03,1.03);transform:scale3d(1.03,1.03,1.03)}80%{-webkit-transform:scale3d(.97,.97,.97);transform:scale3d(.97,.97,.97)}to{opacity:1;-webkit-transform:scaleX(1);transform:scaleX(1)}}.animate__bounceIn{-webkit-animation-duration:.75s;animation-duration:.75s;-webkit-animation-duration:calc(var(--animate-duration)*0.75);animation-duration:calc(var(--animate-duration)*0.75);-webkit-animation-name:bounceIn;animation-name:bounceIn}@-webkit-keyframes bounceInDown{0%,60%,75%,90%,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;-webkit-transform:translate3d(0,-3000px,0) scaleY(3);transform:translate3d(0,-3000px,0) scaleY(3)}60%{opacity:1;-webkit-transform:translate3d(0,25px,0) scaleY(.9);transform:translate3d(0,25px,0) scaleY(.9)}75%{-webkit-transform:translate3d(0,-10px,0) scaleY(.95);transform:translate3d(0,-10px,0) scaleY(.95)}90%{-webkit-transform:translate3d(0,5px,0) scaleY(.985);transform:translate3d(0,5px,0) scaleY(.985)}to{-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes bounceInDown{0%,60%,75%,90%,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;-webkit-transform:translate3d(0,-3000px,0) scaleY(3);transform:translate3d(0,-3000px,0) scaleY(3)}60%{opacity:1;-webkit-transform:translate3d(0,25px,0) scaleY(.9);transform:translate3d(0,25px,0) scaleY(.9)}75%{-webkit-transform:translate3d(0,-10px,0) scaleY(.95);transform:translate3d(0,-10px,0) scaleY(.95)}90%{-webkit-transform:translate3d(0,5px,0) scaleY(.985);transform:translate3d(0,5px,0) scaleY(.985)}to{-webkit-transform:translateZ(0);transform:translateZ(0)}}.animate__bounceInDown{-webkit-animation-name:bounceInDown;animation-name:bounceInDown}@-webkit-keyframes bounceInLeft{0%,60%,75%,90%,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;-webkit-transform:translate3d(-3000px,0,0) scaleX(3);transform:translate3d(-3000px,0,0) scaleX(3)}60%{opacity:1;-webkit-transform:translate3d(25px,0,0) scaleX(1);transform:translate3d(25px,0,0) scaleX(1)}75%{-webkit-transform:translate3d(-10px,0,0) scaleX(.98);transform:translate3d(-10px,0,0) scaleX(.98)}90%{-webkit-transform:translate3d(5px,0,0) scaleX(.995);transform:translate3d(5px,0,0) scaleX(.995)}to{-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes bounceInLeft{0%,60%,75%,90%,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;-webkit-transform:translate3d(-3000px,0,0) scaleX(3);transform:translate3d(-3000px,0,0) scaleX(3)}60%{opacity:1;-webkit-transform:translate3d(25px,0,0) scaleX(1);transform:translate3d(25px,0,0) scaleX(1)}75%{-webkit-transform:translate3d(-10px,0,0) scaleX(.98);transform:translate3d(-10px,0,0) scaleX(.98)}90%{-webkit-transform:translate3d(5px,0,0) scaleX(.995);transform:translate3d(5px,0,0) scaleX(.995)}to{-webkit-transform:translateZ(0);transform:translateZ(0)}}.animate__bounceInLeft{-webkit-animation-name:bounceInLeft;animation-name:bounceInLeft}@-webkit-keyframes bounceInRight{0%,60%,75%,90%,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;-webkit-transform:translate3d(3000px,0,0) scaleX(3);transform:translate3d(3000px,0,0) scaleX(3)}60%{opacity:1;-webkit-transform:translate3d(-25px,0,0) scaleX(1);transform:translate3d(-25px,0,0) scaleX(1)}75%{-webkit-transform:translate3d(10px,0,0) scaleX(.98);transform:translate3d(10px,0,0) scaleX(.98)}90%{-webkit-transform:translate3d(-5px,0,0) scaleX(.995);transform:translate3d(-5px,0,0) scaleX(.995)}to{-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes bounceInRight{0%,60%,75%,90%,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;-webkit-transform:translate3d(3000px,0,0) scaleX(3);transform:translate3d(3000px,0,0) scaleX(3)}60%{opacity:1;-webkit-transform:translate3d(-25px,0,0) scaleX(1);transform:translate3d(-25px,0,0) scaleX(1)}75%{-webkit-transform:translate3d(10px,0,0) scaleX(.98);transform:translate3d(10px,0,0) scaleX(.98)}90%{-webkit-transform:translate3d(-5px,0,0) scaleX(.995);transform:translate3d(-5px,0,0) scaleX(.995)}to{-webkit-transform:translateZ(0);transform:translateZ(0)}}.animate__bounceInRight{-webkit-animation-name:bounceInRight;animation-name:bounceInRight}@-webkit-keyframes bounceInUp{0%,60%,75%,90%,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;-webkit-transform:translate3d(0,3000px,0) scaleY(5);transform:translate3d(0,3000px,0) scaleY(5)}60%{opacity:1;-webkit-transform:translate3d(0,-20px,0) scaleY(.9);transform:translate3d(0,-20px,0) scaleY(.9)}75%{-webkit-transform:translate3d(0,10px,0) scaleY(.95);transform:translate3d(0,10px,0) scaleY(.95)}90%{-webkit-transform:translate3d(0,-5px,0) scaleY(.985);transform:translate3d(0,-5px,0) scaleY(.985)}to{-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes bounceInUp{0%,60%,75%,90%,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;-webkit-transform:translate3d(0,3000px,0) scaleY(5);transform:translate3d(0,3000px,0) scaleY(5)}60%{opacity:1;-webkit-transform:translate3d(0,-20px,0) scaleY(.9);transform:translate3d(0,-20px,0) scaleY(.9)}75%{-webkit-transform:translate3d(0,10px,0) scaleY(.95);transform:translate3d(0,10px,0) scaleY(.95)}90%{-webkit-transform:translate3d(0,-5px,0) scaleY(.985);transform:translate3d(0,-5px,0) scaleY(.985)}to{-webkit-transform:translateZ(0);transform:translateZ(0)}}.animate__bounceInUp{-webkit-animation-name:bounceInUp;animation-name:bounceInUp}@-webkit-keyframes bounceOut{20%{-webkit-transform:scale3d(.9,.9,.9);transform:scale3d(.9,.9,.9)}50%,55%{opacity:1;-webkit-transform:scale3d(1.1,1.1,1.1);transform:scale3d(1.1,1.1,1.1)}to{opacity:0;-webkit-transform:scale3d(.3,.3,.3);transform:scale3d(.3,.3,.3)}}@keyframes bounceOut{20%{-webkit-transform:scale3d(.9,.9,.9);transform:scale3d(.9,.9,.9)}50%,55%{opacity:1;-webkit-transform:scale3d(1.1,1.1,1.1);transform:scale3d(1.1,1.1,1.1)}to{opacity:0;-webkit-transform:scale3d(.3,.3,.3);transform:scale3d(.3,.3,.3)}}.animate__bounceOut{-webkit-animation-duration:.75s;animation-duration:.75s;-webkit-animation-duration:calc(var(--animate-duration)*0.75);animation-duration:calc(var(--animate-duration)*0.75);-webkit-animation-name:bounceOut;animation-name:bounceOut}@-webkit-keyframes bounceOutDown{20%{-webkit-transform:translate3d(0,10px,0) scaleY(.985);transform:translate3d(0,10px,0) scaleY(.985)}40%,45%{opacity:1;-webkit-transform:translate3d(0,-20px,0) scaleY(.9);transform:translate3d(0,-20px,0) scaleY(.9)}to{opacity:0;-webkit-transform:translate3d(0,2000px,0) scaleY(3);transform:translate3d(0,2000px,0) scaleY(3)}}@keyframes bounceOutDown{20%{-webkit-transform:translate3d(0,10px,0) scaleY(.985);transform:translate3d(0,10px,0) scaleY(.985)}40%,45%{opacity:1;-webkit-transform:translate3d(0,-20px,0) scaleY(.9);transform:translate3d(0,-20px,0) scaleY(.9)}to{opacity:0;-webkit-transform:translate3d(0,2000px,0) scaleY(3);transform:translate3d(0,2000px,0) scaleY(3)}}.animate__bounceOutDown{-webkit-animation-name:bounceOutDown;animation-name:bounceOutDown}@-webkit-keyframes bounceOutLeft{20%{opacity:1;-webkit-transform:translate3d(20px,0,0) scaleX(.9);transform:translate3d(20px,0,0) scaleX(.9)}to{opacity:0;-webkit-transform:translate3d(-2000px,0,0) scaleX(2);transform:translate3d(-2000px,0,0) scaleX(2)}}@keyframes bounceOutLeft{20%{opacity:1;-webkit-transform:translate3d(20px,0,0) scaleX(.9);transform:translate3d(20px,0,0) scaleX(.9)}to{opacity:0;-webkit-transform:translate3d(-2000px,0,0) scaleX(2);transform:translate3d(-2000px,0,0) scaleX(2)}}.animate__bounceOutLeft{-webkit-animation-name:bounceOutLeft;animation-name:bounceOutLeft}@-webkit-keyframes bounceOutRight{20%{opacity:1;-webkit-transform:translate3d(-20px,0,0) scaleX(.9);transform:translate3d(-20px,0,0) scaleX(.9)}to{opacity:0;-webkit-transform:translate3d(2000px,0,0) scaleX(2);transform:translate3d(2000px,0,0) scaleX(2)}}@keyframes bounceOutRight{20%{opacity:1;-webkit-transform:translate3d(-20px,0,0) scaleX(.9);transform:translate3d(-20px,0,0) scaleX(.9)}to{opacity:0;-webkit-transform:translate3d(2000px,0,0) scaleX(2);transform:translate3d(2000px,0,0) scaleX(2)}}.animate__bounceOutRight{-webkit-animation-name:bounceOutRight;animation-name:bounceOutRight}@-webkit-keyframes bounceOutUp{20%{-webkit-transform:translate3d(0,-10px,0) scaleY(.985);transform:translate3d(0,-10px,0) scaleY(.985)}40%,45%{opacity:1;-webkit-transform:translate3d(0,20px,0) scaleY(.9);transform:translate3d(0,20px,0) scaleY(.9)}to{opacity:0;-webkit-transform:translate3d(0,-2000px,0) scaleY(3);transform:translate3d(0,-2000px,0) scaleY(3)}}@keyframes bounceOutUp{20%{-webkit-transform:translate3d(0,-10px,0) scaleY(.985);transform:translate3d(0,-10px,0) scaleY(.985)}40%,45%{opacity:1;-webkit-transform:translate3d(0,20px,0) scaleY(.9);transform:translate3d(0,20px,0) scaleY(.9)}to{opacity:0;-webkit-transform:translate3d(0,-2000px,0) scaleY(3);transform:translate3d(0,-2000px,0) scaleY(3)}}.animate__bounceOutUp{-webkit-animation-name:bounceOutUp;animation-name:bounceOutUp}@-webkit-keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.animate__fadeIn{-webkit-animation-name:fadeIn;animation-name:fadeIn}@-webkit-keyframes fadeInDown{0%{opacity:0;-webkit-transform:translate3d(0,-100%,0);transform:translate3d(0,-100%,0)}to{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes fadeInDown{0%{opacity:0;-webkit-transform:translate3d(0,-100%,0);transform:translate3d(0,-100%,0)}to{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}}.animate__fadeInDown{-webkit-animation-name:fadeInDown;animation-name:fadeInDown}@-webkit-keyframes fadeInDownBig{0%{opacity:0;-webkit-transform:translate3d(0,-2000px,0);transform:translate3d(0,-2000px,0)}to{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes fadeInDownBig{0%{opacity:0;-webkit-transform:translate3d(0,-2000px,0);transform:translate3d(0,-2000px,0)}to{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}}.animate__fadeInDownBig{-webkit-animation-name:fadeInDownBig;animation-name:fadeInDownBig}@-webkit-keyframes fadeInLeft{0%{opacity:0;-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}to{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes fadeInLeft{0%{opacity:0;-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}to{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}}.animate__fadeInLeft{-webkit-animation-name:fadeInLeft;animation-name:fadeInLeft}@-webkit-keyframes fadeInLeftBig{0%{opacity:0;-webkit-transform:translate3d(-2000px,0,0);transform:translate3d(-2000px,0,0)}to{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes fadeInLeftBig{0%{opacity:0;-webkit-transform:translate3d(-2000px,0,0);transform:translate3d(-2000px,0,0)}to{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}}.animate__fadeInLeftBig{-webkit-animation-name:fadeInLeftBig;animation-name:fadeInLeftBig}@-webkit-keyframes fadeInRight{0%{opacity:0;-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}to{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes fadeInRight{0%{opacity:0;-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}to{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}}.animate__fadeInRight{-webkit-animation-name:fadeInRight;animation-name:fadeInRight}@-webkit-keyframes fadeInRightBig{0%{opacity:0;-webkit-transform:translate3d(2000px,0,0);transform:translate3d(2000px,0,0)}to{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes fadeInRightBig{0%{opacity:0;-webkit-transform:translate3d(2000px,0,0);transform:translate3d(2000px,0,0)}to{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}}.animate__fadeInRightBig{-webkit-animation-name:fadeInRightBig;animation-name:fadeInRightBig}@-webkit-keyframes fadeInUp{0%{opacity:0;-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}to{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes fadeInUp{0%{opacity:0;-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}to{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}}.animate__fadeInUp{-webkit-animation-name:fadeInUp;animation-name:fadeInUp}@-webkit-keyframes fadeInUpBig{0%{opacity:0;-webkit-transform:translate3d(0,2000px,0);transform:translate3d(0,2000px,0)}to{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes fadeInUpBig{0%{opacity:0;-webkit-transform:translate3d(0,2000px,0);transform:translate3d(0,2000px,0)}to{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}}.animate__fadeInUpBig{-webkit-animation-name:fadeInUpBig;animation-name:fadeInUpBig}@-webkit-keyframes fadeInTopLeft{0%{opacity:0;-webkit-transform:translate3d(-100%,-100%,0);transform:translate3d(-100%,-100%,0)}to{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes fadeInTopLeft{0%{opacity:0;-webkit-transform:translate3d(-100%,-100%,0);transform:translate3d(-100%,-100%,0)}to{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}}.animate__fadeInTopLeft{-webkit-animation-name:fadeInTopLeft;animation-name:fadeInTopLeft}@-webkit-keyframes fadeInTopRight{0%{opacity:0;-webkit-transform:translate3d(100%,-100%,0);transform:translate3d(100%,-100%,0)}to{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes fadeInTopRight{0%{opacity:0;-webkit-transform:translate3d(100%,-100%,0);transform:translate3d(100%,-100%,0)}to{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}}.animate__fadeInTopRight{-webkit-animation-name:fadeInTopRight;animation-name:fadeInTopRight}@-webkit-keyframes fadeInBottomLeft{0%{opacity:0;-webkit-transform:translate3d(-100%,100%,0);transform:translate3d(-100%,100%,0)}to{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes fadeInBottomLeft{0%{opacity:0;-webkit-transform:translate3d(-100%,100%,0);transform:translate3d(-100%,100%,0)}to{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}}.animate__fadeInBottomLeft{-webkit-animation-name:fadeInBottomLeft;animation-name:fadeInBottomLeft}@-webkit-keyframes fadeInBottomRight{0%{opacity:0;-webkit-transform:translate3d(100%,100%,0);transform:translate3d(100%,100%,0)}to{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes fadeInBottomRight{0%{opacity:0;-webkit-transform:translate3d(100%,100%,0);transform:translate3d(100%,100%,0)}to{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}}.animate__fadeInBottomRight{-webkit-animation-name:fadeInBottomRight;animation-name:fadeInBottomRight}@-webkit-keyframes fadeOut{0%{opacity:1}to{opacity:0}}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}.animate__fadeOut{-webkit-animation-name:fadeOut;animation-name:fadeOut}@-webkit-keyframes fadeOutDown{0%{opacity:1}to{opacity:0;-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes fadeOutDown{0%{opacity:1}to{opacity:0;-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}.animate__fadeOutDown{-webkit-animation-name:fadeOutDown;animation-name:fadeOutDown}@-webkit-keyframes fadeOutDownBig{0%{opacity:1}to{opacity:0;-webkit-transform:translate3d(0,2000px,0);transform:translate3d(0,2000px,0)}}@keyframes fadeOutDownBig{0%{opacity:1}to{opacity:0;-webkit-transform:translate3d(0,2000px,0);transform:translate3d(0,2000px,0)}}.animate__fadeOutDownBig{-webkit-animation-name:fadeOutDownBig;animation-name:fadeOutDownBig}@-webkit-keyframes fadeOutLeft{0%{opacity:1}to{opacity:0;-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}}@keyframes fadeOutLeft{0%{opacity:1}to{opacity:0;-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}}.animate__fadeOutLeft{-webkit-animation-name:fadeOutLeft;animation-name:fadeOutLeft}@-webkit-keyframes fadeOutLeftBig{0%{opacity:1}to{opacity:0;-webkit-transform:translate3d(-2000px,0,0);transform:translate3d(-2000px,0,0)}}@keyframes fadeOutLeftBig{0%{opacity:1}to{opacity:0;-webkit-transform:translate3d(-2000px,0,0);transform:translate3d(-2000px,0,0)}}.animate__fadeOutLeftBig{-webkit-animation-name:fadeOutLeftBig;animation-name:fadeOutLeftBig}@-webkit-keyframes fadeOutRight{0%{opacity:1}to{opacity:0;-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}}@keyframes fadeOutRight{0%{opacity:1}to{opacity:0;-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}}.animate__fadeOutRight{-webkit-animation-name:fadeOutRight;animation-name:fadeOutRight}@-webkit-keyframes fadeOutRightBig{0%{opacity:1}to{opacity:0;-webkit-transform:translate3d(2000px,0,0);transform:translate3d(2000px,0,0)}}@keyframes fadeOutRightBig{0%{opacity:1}to{opacity:0;-webkit-transform:translate3d(2000px,0,0);transform:translate3d(2000px,0,0)}}.animate__fadeOutRightBig{-webkit-animation-name:fadeOutRightBig;animation-name:fadeOutRightBig}@-webkit-keyframes fadeOutUp{0%{opacity:1}to{opacity:0;-webkit-transform:translate3d(0,-100%,0);transform:translate3d(0,-100%,0)}}@keyframes fadeOutUp{0%{opacity:1}to{opacity:0;-webkit-transform:translate3d(0,-100%,0);transform:translate3d(0,-100%,0)}}.animate__fadeOutUp{-webkit-animation-name:fadeOutUp;animation-name:fadeOutUp}@-webkit-keyframes fadeOutUpBig{0%{opacity:1}to{opacity:0;-webkit-transform:translate3d(0,-2000px,0);transform:translate3d(0,-2000px,0)}}@keyframes fadeOutUpBig{0%{opacity:1}to{opacity:0;-webkit-transform:translate3d(0,-2000px,0);transform:translate3d(0,-2000px,0)}}.animate__fadeOutUpBig{-webkit-animation-name:fadeOutUpBig;animation-name:fadeOutUpBig}@-webkit-keyframes fadeOutTopLeft{0%{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}to{opacity:0;-webkit-transform:translate3d(-100%,-100%,0);transform:translate3d(-100%,-100%,0)}}@keyframes fadeOutTopLeft{0%{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}to{opacity:0;-webkit-transform:translate3d(-100%,-100%,0);transform:translate3d(-100%,-100%,0)}}.animate__fadeOutTopLeft{-webkit-animation-name:fadeOutTopLeft;animation-name:fadeOutTopLeft}@-webkit-keyframes fadeOutTopRight{0%{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}to{opacity:0;-webkit-transform:translate3d(100%,-100%,0);transform:translate3d(100%,-100%,0)}}@keyframes fadeOutTopRight{0%{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}to{opacity:0;-webkit-transform:translate3d(100%,-100%,0);transform:translate3d(100%,-100%,0)}}.animate__fadeOutTopRight{-webkit-animation-name:fadeOutTopRight;animation-name:fadeOutTopRight}@-webkit-keyframes fadeOutBottomRight{0%{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}to{opacity:0;-webkit-transform:translate3d(100%,100%,0);transform:translate3d(100%,100%,0)}}@keyframes fadeOutBottomRight{0%{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}to{opacity:0;-webkit-transform:translate3d(100%,100%,0);transform:translate3d(100%,100%,0)}}.animate__fadeOutBottomRight{-webkit-animation-name:fadeOutBottomRight;animation-name:fadeOutBottomRight}@-webkit-keyframes fadeOutBottomLeft{0%{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}to{opacity:0;-webkit-transform:translate3d(-100%,100%,0);transform:translate3d(-100%,100%,0)}}@keyframes fadeOutBottomLeft{0%{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}to{opacity:0;-webkit-transform:translate3d(-100%,100%,0);transform:translate3d(-100%,100%,0)}}.animate__fadeOutBottomLeft{-webkit-animation-name:fadeOutBottomLeft;animation-name:fadeOutBottomLeft}@-webkit-keyframes flip{0%{-webkit-transform:perspective(400px) scaleX(1) translateZ(0) rotateY(-1turn);transform:perspective(400px) scaleX(1) translateZ(0) rotateY(-1turn);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}40%{-webkit-transform:perspective(400px) scaleX(1) translateZ(150px) rotateY(-190deg);transform:perspective(400px) scaleX(1) translateZ(150px) rotateY(-190deg);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}50%{-webkit-transform:perspective(400px) scaleX(1) translateZ(150px) rotateY(-170deg);transform:perspective(400px) scaleX(1) translateZ(150px) rotateY(-170deg);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}80%{-webkit-transform:perspective(400px) scale3d(.95,.95,.95) translateZ(0) rotateY(0deg);transform:perspective(400px) scale3d(.95,.95,.95) translateZ(0) rotateY(0deg);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}to{-webkit-transform:perspective(400px) scaleX(1) translateZ(0) rotateY(0deg);transform:perspective(400px) scaleX(1) translateZ(0) rotateY(0deg);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}}@keyframes flip{0%{-webkit-transform:perspective(400px) scaleX(1) translateZ(0) rotateY(-1turn);transform:perspective(400px) scaleX(1) translateZ(0) rotateY(-1turn);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}40%{-webkit-transform:perspective(400px) scaleX(1) translateZ(150px) rotateY(-190deg);transform:perspective(400px) scaleX(1) translateZ(150px) rotateY(-190deg);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}50%{-webkit-transform:perspective(400px) scaleX(1) translateZ(150px) rotateY(-170deg);transform:perspective(400px) scaleX(1) translateZ(150px) rotateY(-170deg);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}80%{-webkit-transform:perspective(400px) scale3d(.95,.95,.95) translateZ(0) rotateY(0deg);transform:perspective(400px) scale3d(.95,.95,.95) translateZ(0) rotateY(0deg);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}to{-webkit-transform:perspective(400px) scaleX(1) translateZ(0) rotateY(0deg);transform:perspective(400px) scaleX(1) translateZ(0) rotateY(0deg);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}}.animate__animated.animate__flip{-webkit-backface-visibility:visible;backface-visibility:visible;-webkit-animation-name:flip;animation-name:flip}@-webkit-keyframes flipInX{0%{-webkit-transform:perspective(400px) rotateX(90deg);transform:perspective(400px) rotateX(90deg);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in;opacity:0}40%{-webkit-transform:perspective(400px) rotateX(-20deg);transform:perspective(400px) rotateX(-20deg);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}60%{-webkit-transform:perspective(400px) rotateX(10deg);transform:perspective(400px) rotateX(10deg);opacity:1}80%{-webkit-transform:perspective(400px) rotateX(-5deg);transform:perspective(400px) rotateX(-5deg)}to{-webkit-transform:perspective(400px);transform:perspective(400px)}}@keyframes flipInX{0%{-webkit-transform:perspective(400px) rotateX(90deg);transform:perspective(400px) rotateX(90deg);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in;opacity:0}40%{-webkit-transform:perspective(400px) rotateX(-20deg);transform:perspective(400px) rotateX(-20deg);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}60%{-webkit-transform:perspective(400px) rotateX(10deg);transform:perspective(400px) rotateX(10deg);opacity:1}80%{-webkit-transform:perspective(400px) rotateX(-5deg);transform:perspective(400px) rotateX(-5deg)}to{-webkit-transform:perspective(400px);transform:perspective(400px)}}.animate__flipInX{-webkit-backface-visibility:visible!important;backface-visibility:visible!important;-webkit-animation-name:flipInX;animation-name:flipInX}@-webkit-keyframes flipInY{0%{-webkit-transform:perspective(400px) rotateY(90deg);transform:perspective(400px) rotateY(90deg);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in;opacity:0}40%{-webkit-transform:perspective(400px) rotateY(-20deg);transform:perspective(400px) rotateY(-20deg);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}60%{-webkit-transform:perspective(400px) rotateY(10deg);transform:perspective(400px) rotateY(10deg);opacity:1}80%{-webkit-transform:perspective(400px) rotateY(-5deg);transform:perspective(400px) rotateY(-5deg)}to{-webkit-transform:perspective(400px);transform:perspective(400px)}}@keyframes flipInY{0%{-webkit-transform:perspective(400px) rotateY(90deg);transform:perspective(400px) rotateY(90deg);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in;opacity:0}40%{-webkit-transform:perspective(400px) rotateY(-20deg);transform:perspective(400px) rotateY(-20deg);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}60%{-webkit-transform:perspective(400px) rotateY(10deg);transform:perspective(400px) rotateY(10deg);opacity:1}80%{-webkit-transform:perspective(400px) rotateY(-5deg);transform:perspective(400px) rotateY(-5deg)}to{-webkit-transform:perspective(400px);transform:perspective(400px)}}.animate__flipInY{-webkit-backface-visibility:visible!important;backface-visibility:visible!important;-webkit-animation-name:flipInY;animation-name:flipInY}@-webkit-keyframes flipOutX{0%{-webkit-transform:perspective(400px);transform:perspective(400px)}30%{-webkit-transform:perspective(400px) rotateX(-20deg);transform:perspective(400px) rotateX(-20deg);opacity:1}to{-webkit-transform:perspective(400px) rotateX(90deg);transform:perspective(400px) rotateX(90deg);opacity:0}}@keyframes flipOutX{0%{-webkit-transform:perspective(400px);transform:perspective(400px)}30%{-webkit-transform:perspective(400px) rotateX(-20deg);transform:perspective(400px) rotateX(-20deg);opacity:1}to{-webkit-transform:perspective(400px) rotateX(90deg);transform:perspective(400px) rotateX(90deg);opacity:0}}.animate__flipOutX{-webkit-animation-duration:.75s;animation-duration:.75s;-webkit-animation-duration:calc(var(--animate-duration)*0.75);animation-duration:calc(var(--animate-duration)*0.75);-webkit-animation-name:flipOutX;animation-name:flipOutX;-webkit-backface-visibility:visible!important;backface-visibility:visible!important}@-webkit-keyframes flipOutY{0%{-webkit-transform:perspective(400px);transform:perspective(400px)}30%{-webkit-transform:perspective(400px) rotateY(-15deg);transform:perspective(400px) rotateY(-15deg);opacity:1}to{-webkit-transform:perspective(400px) rotateY(90deg);transform:perspective(400px) rotateY(90deg);opacity:0}}@keyframes flipOutY{0%{-webkit-transform:perspective(400px);transform:perspective(400px)}30%{-webkit-transform:perspective(400px) rotateY(-15deg);transform:perspective(400px) rotateY(-15deg);opacity:1}to{-webkit-transform:perspective(400px) rotateY(90deg);transform:perspective(400px) rotateY(90deg);opacity:0}}.animate__flipOutY{-webkit-animation-duration:.75s;animation-duration:.75s;-webkit-animation-duration:calc(var(--animate-duration)*0.75);animation-duration:calc(var(--animate-duration)*0.75);-webkit-backface-visibility:visible!important;backface-visibility:visible!important;-webkit-animation-name:flipOutY;animation-name:flipOutY}@-webkit-keyframes lightSpeedInRight{0%{-webkit-transform:translate3d(100%,0,0) skewX(-30deg);transform:translate3d(100%,0,0) skewX(-30deg);opacity:0}60%{-webkit-transform:skewX(20deg);transform:skewX(20deg);opacity:1}80%{-webkit-transform:skewX(-5deg);transform:skewX(-5deg)}to{-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes lightSpeedInRight{0%{-webkit-transform:translate3d(100%,0,0) skewX(-30deg);transform:translate3d(100%,0,0) skewX(-30deg);opacity:0}60%{-webkit-transform:skewX(20deg);transform:skewX(20deg);opacity:1}80%{-webkit-transform:skewX(-5deg);transform:skewX(-5deg)}to{-webkit-transform:translateZ(0);transform:translateZ(0)}}.animate__lightSpeedInRight{-webkit-animation-name:lightSpeedInRight;animation-name:lightSpeedInRight;-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}@-webkit-keyframes lightSpeedInLeft{0%{-webkit-transform:translate3d(-100%,0,0) skewX(30deg);transform:translate3d(-100%,0,0) skewX(30deg);opacity:0}60%{-webkit-transform:skewX(-20deg);transform:skewX(-20deg);opacity:1}80%{-webkit-transform:skewX(5deg);transform:skewX(5deg)}to{-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes lightSpeedInLeft{0%{-webkit-transform:translate3d(-100%,0,0) skewX(30deg);transform:translate3d(-100%,0,0) skewX(30deg);opacity:0}60%{-webkit-transform:skewX(-20deg);transform:skewX(-20deg);opacity:1}80%{-webkit-transform:skewX(5deg);transform:skewX(5deg)}to{-webkit-transform:translateZ(0);transform:translateZ(0)}}.animate__lightSpeedInLeft{-webkit-animation-name:lightSpeedInLeft;animation-name:lightSpeedInLeft;-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}@-webkit-keyframes lightSpeedOutRight{0%{opacity:1}to{-webkit-transform:translate3d(100%,0,0) skewX(30deg);transform:translate3d(100%,0,0) skewX(30deg);opacity:0}}@keyframes lightSpeedOutRight{0%{opacity:1}to{-webkit-transform:translate3d(100%,0,0) skewX(30deg);transform:translate3d(100%,0,0) skewX(30deg);opacity:0}}.animate__lightSpeedOutRight{-webkit-animation-name:lightSpeedOutRight;animation-name:lightSpeedOutRight;-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}@-webkit-keyframes lightSpeedOutLeft{0%{opacity:1}to{-webkit-transform:translate3d(-100%,0,0) skewX(-30deg);transform:translate3d(-100%,0,0) skewX(-30deg);opacity:0}}@keyframes lightSpeedOutLeft{0%{opacity:1}to{-webkit-transform:translate3d(-100%,0,0) skewX(-30deg);transform:translate3d(-100%,0,0) skewX(-30deg);opacity:0}}.animate__lightSpeedOutLeft{-webkit-animation-name:lightSpeedOutLeft;animation-name:lightSpeedOutLeft;-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}@-webkit-keyframes rotateIn{0%{-webkit-transform:rotate(-200deg);transform:rotate(-200deg);opacity:0}to{-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1}}@keyframes rotateIn{0%{-webkit-transform:rotate(-200deg);transform:rotate(-200deg);opacity:0}to{-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1}}.animate__rotateIn{-webkit-animation-name:rotateIn;animation-name:rotateIn;-webkit-transform-origin:center;transform-origin:center}@-webkit-keyframes rotateInDownLeft{0%{-webkit-transform:rotate(-45deg);transform:rotate(-45deg);opacity:0}to{-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1}}@keyframes rotateInDownLeft{0%{-webkit-transform:rotate(-45deg);transform:rotate(-45deg);opacity:0}to{-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1}}.animate__rotateInDownLeft{-webkit-animation-name:rotateInDownLeft;animation-name:rotateInDownLeft;-webkit-transform-origin:left bottom;transform-origin:left bottom}@-webkit-keyframes rotateInDownRight{0%{-webkit-transform:rotate(45deg);transform:rotate(45deg);opacity:0}to{-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1}}@keyframes rotateInDownRight{0%{-webkit-transform:rotate(45deg);transform:rotate(45deg);opacity:0}to{-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1}}.animate__rotateInDownRight{-webkit-animation-name:rotateInDownRight;animation-name:rotateInDownRight;-webkit-transform-origin:right bottom;transform-origin:right bottom}@-webkit-keyframes rotateInUpLeft{0%{-webkit-transform:rotate(45deg);transform:rotate(45deg);opacity:0}to{-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1}}@keyframes rotateInUpLeft{0%{-webkit-transform:rotate(45deg);transform:rotate(45deg);opacity:0}to{-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1}}.animate__rotateInUpLeft{-webkit-animation-name:rotateInUpLeft;animation-name:rotateInUpLeft;-webkit-transform-origin:left bottom;transform-origin:left bottom}@-webkit-keyframes rotateInUpRight{0%{-webkit-transform:rotate(-90deg);transform:rotate(-90deg);opacity:0}to{-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1}}@keyframes rotateInUpRight{0%{-webkit-transform:rotate(-90deg);transform:rotate(-90deg);opacity:0}to{-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1}}.animate__rotateInUpRight{-webkit-animation-name:rotateInUpRight;animation-name:rotateInUpRight;-webkit-transform-origin:right bottom;transform-origin:right bottom}@-webkit-keyframes rotateOut{0%{opacity:1}to{-webkit-transform:rotate(200deg);transform:rotate(200deg);opacity:0}}@keyframes rotateOut{0%{opacity:1}to{-webkit-transform:rotate(200deg);transform:rotate(200deg);opacity:0}}.animate__rotateOut{-webkit-animation-name:rotateOut;animation-name:rotateOut;-webkit-transform-origin:center;transform-origin:center}@-webkit-keyframes rotateOutDownLeft{0%{opacity:1}to{-webkit-transform:rotate(45deg);transform:rotate(45deg);opacity:0}}@keyframes rotateOutDownLeft{0%{opacity:1}to{-webkit-transform:rotate(45deg);transform:rotate(45deg);opacity:0}}.animate__rotateOutDownLeft{-webkit-animation-name:rotateOutDownLeft;animation-name:rotateOutDownLeft;-webkit-transform-origin:left bottom;transform-origin:left bottom}@-webkit-keyframes rotateOutDownRight{0%{opacity:1}to{-webkit-transform:rotate(-45deg);transform:rotate(-45deg);opacity:0}}@keyframes rotateOutDownRight{0%{opacity:1}to{-webkit-transform:rotate(-45deg);transform:rotate(-45deg);opacity:0}}.animate__rotateOutDownRight{-webkit-animation-name:rotateOutDownRight;animation-name:rotateOutDownRight;-webkit-transform-origin:right bottom;transform-origin:right bottom}@-webkit-keyframes rotateOutUpLeft{0%{opacity:1}to{-webkit-transform:rotate(-45deg);transform:rotate(-45deg);opacity:0}}@keyframes rotateOutUpLeft{0%{opacity:1}to{-webkit-transform:rotate(-45deg);transform:rotate(-45deg);opacity:0}}.animate__rotateOutUpLeft{-webkit-animation-name:rotateOutUpLeft;animation-name:rotateOutUpLeft;-webkit-transform-origin:left bottom;transform-origin:left bottom}@-webkit-keyframes rotateOutUpRight{0%{opacity:1}to{-webkit-transform:rotate(90deg);transform:rotate(90deg);opacity:0}}@keyframes rotateOutUpRight{0%{opacity:1}to{-webkit-transform:rotate(90deg);transform:rotate(90deg);opacity:0}}.animate__rotateOutUpRight{-webkit-animation-name:rotateOutUpRight;animation-name:rotateOutUpRight;-webkit-transform-origin:right bottom;transform-origin:right bottom}@-webkit-keyframes hinge{0%{-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}20%,60%{-webkit-transform:rotate(80deg);transform:rotate(80deg);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}40%,80%{-webkit-transform:rotate(60deg);transform:rotate(60deg);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out;opacity:1}to{-webkit-transform:translate3d(0,700px,0);transform:translate3d(0,700px,0);opacity:0}}@keyframes hinge{0%{-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}20%,60%{-webkit-transform:rotate(80deg);transform:rotate(80deg);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}40%,80%{-webkit-transform:rotate(60deg);transform:rotate(60deg);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out;opacity:1}to{-webkit-transform:translate3d(0,700px,0);transform:translate3d(0,700px,0);opacity:0}}.animate__hinge{-webkit-animation-duration:2s;animation-duration:2s;-webkit-animation-duration:calc(var(--animate-duration)*2);animation-duration:calc(var(--animate-duration)*2);-webkit-animation-name:hinge;animation-name:hinge;-webkit-transform-origin:top left;transform-origin:top left}@-webkit-keyframes jackInTheBox{0%{opacity:0;-webkit-transform:scale(.1) rotate(30deg);transform:scale(.1) rotate(30deg);-webkit-transform-origin:center bottom;transform-origin:center bottom}50%{-webkit-transform:rotate(-10deg);transform:rotate(-10deg)}70%{-webkit-transform:rotate(3deg);transform:rotate(3deg)}to{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@keyframes jackInTheBox{0%{opacity:0;-webkit-transform:scale(.1) rotate(30deg);transform:scale(.1) rotate(30deg);-webkit-transform-origin:center bottom;transform-origin:center bottom}50%{-webkit-transform:rotate(-10deg);transform:rotate(-10deg)}70%{-webkit-transform:rotate(3deg);transform:rotate(3deg)}to{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}.animate__jackInTheBox{-webkit-animation-name:jackInTheBox;animation-name:jackInTheBox}@-webkit-keyframes rollIn{0%{opacity:0;-webkit-transform:translate3d(-100%,0,0) rotate(-120deg);transform:translate3d(-100%,0,0) rotate(-120deg)}to{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes rollIn{0%{opacity:0;-webkit-transform:translate3d(-100%,0,0) rotate(-120deg);transform:translate3d(-100%,0,0) rotate(-120deg)}to{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}}.animate__rollIn{-webkit-animation-name:rollIn;animation-name:rollIn}@-webkit-keyframes rollOut{0%{opacity:1}to{opacity:0;-webkit-transform:translate3d(100%,0,0) rotate(120deg);transform:translate3d(100%,0,0) rotate(120deg)}}@keyframes rollOut{0%{opacity:1}to{opacity:0;-webkit-transform:translate3d(100%,0,0) rotate(120deg);transform:translate3d(100%,0,0) rotate(120deg)}}.animate__rollOut{-webkit-animation-name:rollOut;animation-name:rollOut}@-webkit-keyframes zoomIn{0%{opacity:0;-webkit-transform:scale3d(.3,.3,.3);transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes zoomIn{0%{opacity:0;-webkit-transform:scale3d(.3,.3,.3);transform:scale3d(.3,.3,.3)}50%{opacity:1}}.animate__zoomIn{-webkit-animation-name:zoomIn;animation-name:zoomIn}@-webkit-keyframes zoomInDown{0%{opacity:0;-webkit-transform:scale3d(.1,.1,.1) translate3d(0,-1000px,0);transform:scale3d(.1,.1,.1) translate3d(0,-1000px,0);-webkit-animation-timing-function:cubic-bezier(.55,.055,.675,.19);animation-timing-function:cubic-bezier(.55,.055,.675,.19)}60%{opacity:1;-webkit-transform:scale3d(.475,.475,.475) translate3d(0,60px,0);transform:scale3d(.475,.475,.475) translate3d(0,60px,0);-webkit-animation-timing-function:cubic-bezier(.175,.885,.32,1);animation-timing-function:cubic-bezier(.175,.885,.32,1)}}@keyframes zoomInDown{0%{opacity:0;-webkit-transform:scale3d(.1,.1,.1) translate3d(0,-1000px,0);transform:scale3d(.1,.1,.1) translate3d(0,-1000px,0);-webkit-animation-timing-function:cubic-bezier(.55,.055,.675,.19);animation-timing-function:cubic-bezier(.55,.055,.675,.19)}60%{opacity:1;-webkit-transform:scale3d(.475,.475,.475) translate3d(0,60px,0);transform:scale3d(.475,.475,.475) translate3d(0,60px,0);-webkit-animation-timing-function:cubic-bezier(.175,.885,.32,1);animation-timing-function:cubic-bezier(.175,.885,.32,1)}}.animate__zoomInDown{-webkit-animation-name:zoomInDown;animation-name:zoomInDown}@-webkit-keyframes zoomInLeft{0%{opacity:0;-webkit-transform:scale3d(.1,.1,.1) translate3d(-1000px,0,0);transform:scale3d(.1,.1,.1) translate3d(-1000px,0,0);-webkit-animation-timing-function:cubic-bezier(.55,.055,.675,.19);animation-timing-function:cubic-bezier(.55,.055,.675,.19)}60%{opacity:1;-webkit-transform:scale3d(.475,.475,.475) translate3d(10px,0,0);transform:scale3d(.475,.475,.475) translate3d(10px,0,0);-webkit-animation-timing-function:cubic-bezier(.175,.885,.32,1);animation-timing-function:cubic-bezier(.175,.885,.32,1)}}@keyframes zoomInLeft{0%{opacity:0;-webkit-transform:scale3d(.1,.1,.1) translate3d(-1000px,0,0);transform:scale3d(.1,.1,.1) translate3d(-1000px,0,0);-webkit-animation-timing-function:cubic-bezier(.55,.055,.675,.19);animation-timing-function:cubic-bezier(.55,.055,.675,.19)}60%{opacity:1;-webkit-transform:scale3d(.475,.475,.475) translate3d(10px,0,0);transform:scale3d(.475,.475,.475) translate3d(10px,0,0);-webkit-animation-timing-function:cubic-bezier(.175,.885,.32,1);animation-timing-function:cubic-bezier(.175,.885,.32,1)}}.animate__zoomInLeft{-webkit-animation-name:zoomInLeft;animation-name:zoomInLeft}@-webkit-keyframes zoomInRight{0%{opacity:0;-webkit-transform:scale3d(.1,.1,.1) translate3d(1000px,0,0);transform:scale3d(.1,.1,.1) translate3d(1000px,0,0);-webkit-animation-timing-function:cubic-bezier(.55,.055,.675,.19);animation-timing-function:cubic-bezier(.55,.055,.675,.19)}60%{opacity:1;-webkit-transform:scale3d(.475,.475,.475) translate3d(-10px,0,0);transform:scale3d(.475,.475,.475) translate3d(-10px,0,0);-webkit-animation-timing-function:cubic-bezier(.175,.885,.32,1);animation-timing-function:cubic-bezier(.175,.885,.32,1)}}@keyframes zoomInRight{0%{opacity:0;-webkit-transform:scale3d(.1,.1,.1) translate3d(1000px,0,0);transform:scale3d(.1,.1,.1) translate3d(1000px,0,0);-webkit-animation-timing-function:cubic-bezier(.55,.055,.675,.19);animation-timing-function:cubic-bezier(.55,.055,.675,.19)}60%{opacity:1;-webkit-transform:scale3d(.475,.475,.475) translate3d(-10px,0,0);transform:scale3d(.475,.475,.475) translate3d(-10px,0,0);-webkit-animation-timing-function:cubic-bezier(.175,.885,.32,1);animation-timing-function:cubic-bezier(.175,.885,.32,1)}}.animate__zoomInRight{-webkit-animation-name:zoomInRight;animation-name:zoomInRight}@-webkit-keyframes zoomInUp{0%{opacity:0;-webkit-transform:scale3d(.1,.1,.1) translate3d(0,1000px,0);transform:scale3d(.1,.1,.1) translate3d(0,1000px,0);-webkit-animation-timing-function:cubic-bezier(.55,.055,.675,.19);animation-timing-function:cubic-bezier(.55,.055,.675,.19)}60%{opacity:1;-webkit-transform:scale3d(.475,.475,.475) translate3d(0,-60px,0);transform:scale3d(.475,.475,.475) translate3d(0,-60px,0);-webkit-animation-timing-function:cubic-bezier(.175,.885,.32,1);animation-timing-function:cubic-bezier(.175,.885,.32,1)}}@keyframes zoomInUp{0%{opacity:0;-webkit-transform:scale3d(.1,.1,.1) translate3d(0,1000px,0);transform:scale3d(.1,.1,.1) translate3d(0,1000px,0);-webkit-animation-timing-function:cubic-bezier(.55,.055,.675,.19);animation-timing-function:cubic-bezier(.55,.055,.675,.19)}60%{opacity:1;-webkit-transform:scale3d(.475,.475,.475) translate3d(0,-60px,0);transform:scale3d(.475,.475,.475) translate3d(0,-60px,0);-webkit-animation-timing-function:cubic-bezier(.175,.885,.32,1);animation-timing-function:cubic-bezier(.175,.885,.32,1)}}.animate__zoomInUp{-webkit-animation-name:zoomInUp;animation-name:zoomInUp}@-webkit-keyframes zoomOut{0%{opacity:1}50%{opacity:0;-webkit-transform:scale3d(.3,.3,.3);transform:scale3d(.3,.3,.3)}to{opacity:0}}@keyframes zoomOut{0%{opacity:1}50%{opacity:0;-webkit-transform:scale3d(.3,.3,.3);transform:scale3d(.3,.3,.3)}to{opacity:0}}.animate__zoomOut{-webkit-animation-name:zoomOut;animation-name:zoomOut}@-webkit-keyframes zoomOutDown{40%{opacity:1;-webkit-transform:scale3d(.475,.475,.475) translate3d(0,-60px,0);transform:scale3d(.475,.475,.475) translate3d(0,-60px,0);-webkit-animation-timing-function:cubic-bezier(.55,.055,.675,.19);animation-timing-function:cubic-bezier(.55,.055,.675,.19)}to{opacity:0;-webkit-transform:scale3d(.1,.1,.1) translate3d(0,2000px,0);transform:scale3d(.1,.1,.1) translate3d(0,2000px,0);-webkit-animation-timing-function:cubic-bezier(.175,.885,.32,1);animation-timing-function:cubic-bezier(.175,.885,.32,1)}}@keyframes zoomOutDown{40%{opacity:1;-webkit-transform:scale3d(.475,.475,.475) translate3d(0,-60px,0);transform:scale3d(.475,.475,.475) translate3d(0,-60px,0);-webkit-animation-timing-function:cubic-bezier(.55,.055,.675,.19);animation-timing-function:cubic-bezier(.55,.055,.675,.19)}to{opacity:0;-webkit-transform:scale3d(.1,.1,.1) translate3d(0,2000px,0);transform:scale3d(.1,.1,.1) translate3d(0,2000px,0);-webkit-animation-timing-function:cubic-bezier(.175,.885,.32,1);animation-timing-function:cubic-bezier(.175,.885,.32,1)}}.animate__zoomOutDown{-webkit-animation-name:zoomOutDown;animation-name:zoomOutDown;-webkit-transform-origin:center bottom;transform-origin:center bottom}@-webkit-keyframes zoomOutLeft{40%{opacity:1;-webkit-transform:scale3d(.475,.475,.475) translate3d(42px,0,0);transform:scale3d(.475,.475,.475) translate3d(42px,0,0)}to{opacity:0;-webkit-transform:scale(.1) translate3d(-2000px,0,0);transform:scale(.1) translate3d(-2000px,0,0)}}@keyframes zoomOutLeft{40%{opacity:1;-webkit-transform:scale3d(.475,.475,.475) translate3d(42px,0,0);transform:scale3d(.475,.475,.475) translate3d(42px,0,0)}to{opacity:0;-webkit-transform:scale(.1) translate3d(-2000px,0,0);transform:scale(.1) translate3d(-2000px,0,0)}}.animate__zoomOutLeft{-webkit-animation-name:zoomOutLeft;animation-name:zoomOutLeft;-webkit-transform-origin:left center;transform-origin:left center}@-webkit-keyframes zoomOutRight{40%{opacity:1;-webkit-transform:scale3d(.475,.475,.475) translate3d(-42px,0,0);transform:scale3d(.475,.475,.475) translate3d(-42px,0,0)}to{opacity:0;-webkit-transform:scale(.1) translate3d(2000px,0,0);transform:scale(.1) translate3d(2000px,0,0)}}@keyframes zoomOutRight{40%{opacity:1;-webkit-transform:scale3d(.475,.475,.475) translate3d(-42px,0,0);transform:scale3d(.475,.475,.475) translate3d(-42px,0,0)}to{opacity:0;-webkit-transform:scale(.1) translate3d(2000px,0,0);transform:scale(.1) translate3d(2000px,0,0)}}.animate__zoomOutRight{-webkit-animation-name:zoomOutRight;animation-name:zoomOutRight;-webkit-transform-origin:right center;transform-origin:right center}@-webkit-keyframes zoomOutUp{40%{opacity:1;-webkit-transform:scale3d(.475,.475,.475) translate3d(0,60px,0);transform:scale3d(.475,.475,.475) translate3d(0,60px,0);-webkit-animation-timing-function:cubic-bezier(.55,.055,.675,.19);animation-timing-function:cubic-bezier(.55,.055,.675,.19)}to{opacity:0;-webkit-transform:scale3d(.1,.1,.1) translate3d(0,-2000px,0);transform:scale3d(.1,.1,.1) translate3d(0,-2000px,0);-webkit-animation-timing-function:cubic-bezier(.175,.885,.32,1);animation-timing-function:cubic-bezier(.175,.885,.32,1)}}@keyframes zoomOutUp{40%{opacity:1;-webkit-transform:scale3d(.475,.475,.475) translate3d(0,60px,0);transform:scale3d(.475,.475,.475) translate3d(0,60px,0);-webkit-animation-timing-function:cubic-bezier(.55,.055,.675,.19);animation-timing-function:cubic-bezier(.55,.055,.675,.19)}to{opacity:0;-webkit-transform:scale3d(.1,.1,.1) translate3d(0,-2000px,0);transform:scale3d(.1,.1,.1) translate3d(0,-2000px,0);-webkit-animation-timing-function:cubic-bezier(.175,.885,.32,1);animation-timing-function:cubic-bezier(.175,.885,.32,1)}}.animate__zoomOutUp{-webkit-animation-name:zoomOutUp;animation-name:zoomOutUp;-webkit-transform-origin:center bottom;transform-origin:center bottom}@-webkit-keyframes slideInDown{0%{-webkit-transform:translate3d(0,-100%,0);transform:translate3d(0,-100%,0);visibility:visible}to{-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes slideInDown{0%{-webkit-transform:translate3d(0,-100%,0);transform:translate3d(0,-100%,0);visibility:visible}to{-webkit-transform:translateZ(0);transform:translateZ(0)}}.animate__slideInDown{-webkit-animation-name:slideInDown;animation-name:slideInDown}@-webkit-keyframes slideInLeft{0%{-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0);visibility:visible}to{-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes slideInLeft{0%{-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0);visibility:visible}to{-webkit-transform:translateZ(0);transform:translateZ(0)}}.animate__slideInLeft{-webkit-animation-name:slideInLeft;animation-name:slideInLeft}@-webkit-keyframes slideInRight{0%{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0);visibility:visible}to{-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes slideInRight{0%{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0);visibility:visible}to{-webkit-transform:translateZ(0);transform:translateZ(0)}}.animate__slideInRight{-webkit-animation-name:slideInRight;animation-name:slideInRight}@-webkit-keyframes slideInUp{0%{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0);visibility:visible}to{-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes slideInUp{0%{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0);visibility:visible}to{-webkit-transform:translateZ(0);transform:translateZ(0)}}.animate__slideInUp{-webkit-animation-name:slideInUp;animation-name:slideInUp}@-webkit-keyframes slideOutDown{0%{-webkit-transform:translateZ(0);transform:translateZ(0)}to{visibility:hidden;-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes slideOutDown{0%{-webkit-transform:translateZ(0);transform:translateZ(0)}to{visibility:hidden;-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}.animate__slideOutDown{-webkit-animation-name:slideOutDown;animation-name:slideOutDown}@-webkit-keyframes slideOutLeft{0%{-webkit-transform:translateZ(0);transform:translateZ(0)}to{visibility:hidden;-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}}@keyframes slideOutLeft{0%{-webkit-transform:translateZ(0);transform:translateZ(0)}to{visibility:hidden;-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}}.animate__slideOutLeft{-webkit-animation-name:slideOutLeft;animation-name:slideOutLeft}@-webkit-keyframes slideOutRight{0%{-webkit-transform:translateZ(0);transform:translateZ(0)}to{visibility:hidden;-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}}@keyframes slideOutRight{0%{-webkit-transform:translateZ(0);transform:translateZ(0)}to{visibility:hidden;-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}}.animate__slideOutRight{-webkit-animation-name:slideOutRight;animation-name:slideOutRight}@-webkit-keyframes slideOutUp{0%{-webkit-transform:translateZ(0);transform:translateZ(0)}to{visibility:hidden;-webkit-transform:translate3d(0,-100%,0);transform:translate3d(0,-100%,0)}}@keyframes slideOutUp{0%{-webkit-transform:translateZ(0);transform:translateZ(0)}to{visibility:hidden;-webkit-transform:translate3d(0,-100%,0);transform:translate3d(0,-100%,0)}}.animate__slideOutUp{-webkit-animation-name:slideOutUp;animation-name:slideOutUp}
diff --git a/backend/vendor/assets/stylesheets/jquery.jstree/themes/spree/style.scss b/backend/vendor/assets/stylesheets/jquery.jstree/themes/spree/style.scss
deleted file mode 100755
index 0aa0d782f7..0000000000
--- a/backend/vendor/assets/stylesheets/jquery.jstree/themes/spree/style.scss
+++ /dev/null
@@ -1,230 +0,0 @@
-/*
- * jsTree Spree theme 1.0
- */
-
-.jstree-spree {
-
- li, li ul {
- border-color: #ededed;
- border-style: solid;
- }
-
- li {
- margin-left: 26px;
- border-width: 0 0 1px 0;
-
- &:last-of-type {
- border-bottom-width: 0;
- }
-
- ul {
- border-width: 1px 0 0 0;
- }
- }
-
- ins {
- position: relative;
- cursor: pointer;
- width: 24px;
- line-height: 1;
- height: 38px;
- vertical-align: middle;
- color: #555;
- background-image: url("data:image/svg+xml;charset=utf8,%3C?xml version='1.0' encoding='UTF-8' standalone='no'?%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg width='100%25' height='100%25' viewBox='0 0 512 512' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' xml:space='preserve' xmlns:serif='http://www.serif.com/' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;'%3E%3Cpath id='icon-chevron-right' d='M377.212,245.558l-221.539,-221.539c-5.769,-5.769 -15.115,-5.769 -20.885,0c-5.769,5.769 -5.769,15.116 0,20.885l211.097,211.096l-211.097,211.096c-5.769,5.769 -5.769,15.116 0,20.885c2.885,2.884 6.654,4.327 10.443,4.327c3.788,0 7.557,-1.443 10.442,-4.327l221.539,-221.539c5.769,-5.769 5.769,-15.115 0,-20.884Z' style='fill-rule:nonzero;stroke:%23000;stroke-width:9.5px;'/%3E%3C/svg%3E");
-
- display: inline-block;
- width: 1rem;
- height: 1rem;
- overflow: hidden !important;
- vertical-align: middle !important;
- background-repeat: no-repeat !important;
- background-size: 100% !important;
- background-position: center !important;
-
- &:before {
-
-
- position: absolute;
- top: 12px;
- padding-left: 4px;
- font-size: 12px;
- }
- }
-
- .jstree-open > ins {
- transform: rotate(90deg);
- transition: .3s ease-in-out;
- }
- .jstree-closed > ins {
- transform: rotate(0deg);
- transition: .3s ease-in-out;
-
- }
-
- .jstree-leaf > ins {
- background-position: -36px 0;
- }
-
- .jstree-locked a {
- color: silver;
- cursor: default;
- }
-
- a {
- line-height: 38px;
- height: 38px;
- padding: 0;
- color: #555;
- cursor: context-menu;
- -webkit-user-select: none;
- -moz-user-select: none;
- user-select: none;
- margin-left: 10px;
-
- &.jstree-search {
- color: aqua;
- }
-
- &.jstree-loading .jstree-icon {
- background: image-url("jquery.jstree/themes/spree/throbber.gif") center center no-repeat !important;
-
- &:before { content: '' }
- }
-
- .jstree-icon {
- vertical-align: middle;
- line-height: 20px;
- width: 20px;
- height: 24px;
- text-align: center;
- margin-right: 8px;
- pointer-events: none;
-
- background-image: url("data:image/svg+xml;charset=utf8,%3C?xml version='1.0' encoding='UTF-8' standalone='no'?%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg width='100%25' height='100%25' viewBox='0 0 512 512' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' xml:space='preserve' xmlns:serif='http://www.serif.com/' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;'%3E%3Cpath d='M64,448c-26.51,0 -48,-21.49 -48,-48l0,-288c0,-26.51 21.49,-48 48,-48l112,0c4.759,-0.008 9.274,2.103 12.32,5.76l48.48,58.24l195.2,0c8.809,0.039 15.929,7.191 15.929,16c0,8.809 -7.12,15.961 -15.929,16l-202.72,0c-4.703,-0.04 -9.15,-2.146 -12.16,-5.76l-48.64,-58.24l-104.48,0c-8.837,0 -16,7.163 -16,16l0,288c0,8.837 7.163,16 16,16c8.809,0.039 15.929,7.191 15.929,16c0,8.809 -7.12,15.961 -15.929,16Z' style='fill-rule:nonzero;stroke:%23000;stroke-width:1px;'/%3E%3Cpath d='M406.08,448l-342.08,0c-4.895,0.109 -9.571,-2.029 -12.691,-5.803c-3.119,-3.775 -4.339,-8.77 -3.309,-13.557l48,-224c1.61,-7.506 8.325,-12.811 16,-12.64l368,0c4.895,-0.109 9.571,2.029 12.691,5.803c3.119,3.775 4.339,8.77 3.309,13.557l-42.88,198.72c-4.76,22.161 -24.373,37.972 -47.04,37.92Zm-322.24,-32l322.24,0c7.675,0.171 14.39,-5.134 16,-12.64l38.08,-179.36l-336,0l-40.32,192Z' style='fill-rule:nonzero;stroke:%23000;stroke-width:1px;'/%3E%3C/svg%3E");
-
- }
- }
-
- .jstree-rename-input {
- height: 38px !important;
- line-height: 38px !important;
- left: 46px !important;
- padding: 0 5px !important;
- }
-
- .jstree-hovered {
- background: #e7f4f9;
- border: 1px solid #d8f0fa;
- padding: 0 3px 0 1px;
- text-shadow: 1px 1px 1px silver;
- }
-
- .jstree-clicked {
- background: #beebff;
- border: 1px solid #99defd;
- padding: 0 3px 0 1px;
- }
-
- .jstree-no-dots li,
- .jstree-no-dots .jstree-leaf > ins {
- background: transparent;
- }
-
- .jstree-no-dots .jstree-open > ins {
- background-position: -18px 0;
- }
-
- .jstree-no-dots .jstree-closed > ins {
- background-position: 0 0;
- }
-
- .jstree-no-icons a .jstree-icon {
- display: none;
- }
-
- .jstree-search {
- font-style: italic;
- }
-
- .jstree-no-icons .jstree-checkbox {
- display: inline-block;
- }
-
- .jstree-no-checkboxes .jstree-checkbox {
- display: none !important;
- }
-
- .jstree-checked > a > .jstree-checkbox {
- background-position: -38px -19px;
- }
-
- .jstree-unchecked > a > .jstree-checkbox {
- background-position: -2px -19px;
- }
-
- .jstree-undetermined > a > .jstree-checkbox {
- background-position: -20px -19px;
- }
-
- .jstree-checked > a > .checkbox:hover {
- background-position: -38px -37px;
- }
-
- .jstree-unchecked > a > .jstree-checkbox:hover {
- background-position: -2px -37px;
- }
-
- .jstree-undetermined > a > .jstree-checkbox:hover {
- background-position: -20px -37px;
- }
-}
-
-#vakata-dragged.jstree-spree ins {
- background: transparent !important;
-}
-
-#vakata-contextmenu.jstree-spree-context {
- background: #fbfbfb;
- border: 1px solid #eee;
- margin-top: 15px;
- margin-left: -4px;
- -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
- -moz-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
- box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
-
- li {
-
- ins { display: none }
- a { line-height: 38px }
- }
-
- a { color: #555; }
-
- a:hover,
- .vakata-hover > a {
- color: inherit;
- padding: 0 5px;
- background: #ededed;
- border: 1px solid #ededed;
- -webkit-border-radius: 2px;
- border-radius: 2px;
- }
-
- li.jstree-contextmenu-disabled a ,
- li.jstree-contextmenu-disabled a:hover {
- color: silver;
- background: transparent;
- border: 0;
- padding: 1px 4px;
- }
-
- li.vakata-separator {
- background: white;
- border-top: 1px solid #e0e0e0;
- margin: 0;
- }
-
- .icon {
- margin: 0 10px 0 5px;
- }
-}
diff --git a/backend/vendor/assets/stylesheets/jquery.jstree/themes/spree/throbber.gif b/backend/vendor/assets/stylesheets/jquery.jstree/themes/spree/throbber.gif
deleted file mode 100755
index 08eb9a0bab..0000000000
Binary files a/backend/vendor/assets/stylesheets/jquery.jstree/themes/spree/throbber.gif and /dev/null differ
diff --git a/bin/build-ci.rb b/bin/build-ci.rb
index 39b91bccce..5a24cea0a1 100755
--- a/bin/build-ci.rb
+++ b/bin/build-ci.rb
@@ -21,7 +21,7 @@ class Project
@name = name
end
- ALL = %w[api backend core emails].map(&method(:new)).freeze
+ ALL = %w[api core emails].map(&method(:new)).freeze
CORE_GEMS = %w[api core].freeze
# Install subproject
diff --git a/bin/build.sh b/bin/build.sh
index 16d617e220..3d39b79c44 100755
--- a/bin/build.sh
+++ b/bin/build.sh
@@ -27,12 +27,6 @@ echo "* Setup Spree API and running RSpec..."
echo "**************************************"
cd api; prepare_app; bundle exec rspec spec
-# Spree Backend
-echo "******************************************"
-echo "* Setup Spree Backend and running RSpec..."
-echo "******************************************"
-cd ../backend; prepare_app; bundle exec rspec spec
-
# Spree Core
echo "***************************************"
echo "* Setup Spree Core and running RSpec..."
diff --git a/bin/sandbox.sh b/bin/sandbox.sh
index daee61905f..7812acf27f 100755
--- a/bin/sandbox.sh
+++ b/bin/sandbox.sh
@@ -50,11 +50,17 @@ else
SPREE_GATEWAY_GEM="gem 'spree_gateway', github: 'spree/spree_gateway', branch: 'main'"
fi
+if [ "$SPREE_BACKEND_PATH" != "" ]; then
+ SPREE_BACKEND_GEM="gem 'spree_backend', path: '$SPREE_BACKEND_PATH'"
+else
+ SPREE_BACKEND_GEM="gem 'spree_backend', github: 'spree/spree_backend', branch: 'main'"
+fi
+
cat <<RUBY >> Gemfile
gem 'spree', path: '..'
-gem 'spree_backend', path: '../backend'
gem 'spree_emails', path: '../emails'
gem 'spree_sample', path: '../sample'
+$SPREE_BACKEND_GEM
$SPREE_AUTH_DEVISE_GEM
$SPREE_GATEWAY_GEM
gem 'spree_i18n', github: 'spree-contrib/spree_i18n', branch: 'main'
@@ -78,7 +84,7 @@ gem 'oj'
RUBY
cat <<RUBY >> config/environments/development.rb
-Rails.application.config.hosts << /.*\.lvh\.me/
+Rails.application.config.hosts.clear
RUBY
touch config/initializers/oj.rb
@@ -103,9 +109,7 @@ bundle install --gemfile Gemfile
bundle exec rails db:drop || true
bundle exec rails db:create
bundle exec rails g spree:install --auto-accept --user_class=Spree::User --sample=true
-if [ "$SPREE_HEADLESS" = "" ]; then
- bundle exec rails g spree:backend:install
- bundle exec rails g spree:emails:install
-fi
+bundle exec rails g spree:backend:install
+bundle exec rails g spree:emails:install
bundle exec rails g spree:auth:install
bundle exec rails g spree_gateway:install
diff --git a/cli/lib/spree_cli/templates/extension/extension.gemspec b/cli/lib/spree_cli/templates/extension/extension.gemspec
index f0c4cf7968..0b8e35adcf 100644
--- a/cli/lib/spree_cli/templates/extension/extension.gemspec
+++ b/cli/lib/spree_cli/templates/extension/extension.gemspec
@@ -22,7 +22,6 @@ Gem::Specification.new do |s|
s.requirements << 'none'
s.add_dependency 'spree', '>= <%= Gem.loaded_specs['spree_cli'].version %>'
- # s.add_dependency 'spree_backend' # uncomment to include Admin Panel changes
s.add_dependency 'spree_extension'
s.add_development_dependency 'spree_dev_tools'