alchemy-solidus 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +60 -23
- data/app/assets/images/alchemy/solidus/alchemy_module_icon.png +0 -0
- data/config/locales/alchemy_solidus_en.yml +5 -0
- data/config/locales/alchemy_solidus_it.yml +5 -0
- data/lib/alchemy/solidus/alchemy_in_solidus.rb +14 -0
- data/lib/alchemy/solidus/{alchemy_user_decorator.rb → alchemy_user_extension.rb} +1 -2
- data/lib/alchemy/solidus/engine.rb +13 -3
- data/lib/alchemy/solidus/{spree_user_decorator.rb → spree_user_extension.rb} +1 -2
- data/lib/alchemy/solidus/use_solidus_layout.rb +5 -0
- data/lib/alchemy/solidus/version.rb +1 -1
- metadata +9 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 89fc2d82897ec63ccd01a0b9739985407a869999
|
4
|
+
data.tar.gz: 5d448d85de69dc282a0838c5b267a74d9a5a3e0a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 816557248ccabb25bb7c28186a6f8a71a64361573319f671d751aa520606b747c2ba93a600943c8b28de6b2796ccc1d4920ae6021f10c2a80cb55fb7e41e3f96
|
7
|
+
data.tar.gz: c707e4f69c3da52fac89f21d17ab3d6ec52c7df27ff5765f3dada0df0419ad83c93fcc559f3283b07adbb129d2d6e5ab581593f0e5bcae7aec92d76d4f3b72ee
|
data/README.md
CHANGED
@@ -50,19 +50,17 @@ To use Solidus Auth Devise, instruct Alchemy to use the `Spree::User` class:
|
|
50
50
|
|
51
51
|
```ruby
|
52
52
|
# config/initializers/alchemy.rb
|
53
|
-
|
54
|
-
# Tell Alchemy to use the Spree::User class
|
55
53
|
Alchemy.user_class_name = 'Spree::User'
|
56
54
|
Alchemy.current_user_method = :spree_current_user
|
55
|
+
```
|
57
56
|
|
58
|
-
|
59
|
-
|
57
|
+
If you put Spree in it's own routing namespace (see below) you will want to
|
58
|
+
let Alchemy know these paths:
|
60
59
|
|
61
|
-
|
62
|
-
# alchemy
|
63
|
-
Alchemy
|
64
|
-
Alchemy
|
65
|
-
Alchemy::BaseController.send :include, Spree::Core::ControllerHelpers::Store
|
60
|
+
```ruby
|
61
|
+
# config/initializers/alchemy.rb
|
62
|
+
Alchemy.login_path = '/store/login'
|
63
|
+
Alchemy.logout_path = '/store/logout'
|
66
64
|
```
|
67
65
|
|
68
66
|
#### 2. Option: Use [Alchemy Devise](https://github.com/AlchemyCMS/alchemy-devise)
|
@@ -105,7 +103,6 @@ Now you'll need to instruct Solidus to use the Alchemy User class:
|
|
105
103
|
# config/initializers/spree.rb
|
106
104
|
...
|
107
105
|
Spree.user_class = "Alchemy::User"
|
108
|
-
require 'alchemy/solidus/alchemy_user_decorator'
|
109
106
|
...
|
110
107
|
```
|
111
108
|
|
@@ -148,28 +145,68 @@ $ bundle exec rake alchemy:install
|
|
148
145
|
|
149
146
|
and follow the on screen instructions.
|
150
147
|
|
148
|
+
### Render Alchemy Content in Solidus Layout
|
149
|
+
|
150
|
+
If you plan to render the Alchemy site in the Solidus layout add the following
|
151
|
+
to your initializer:
|
152
|
+
|
153
|
+
```ruby
|
154
|
+
# config/initializers/alchemy.rb
|
155
|
+
require 'alchemy/solidus/use_solidus_layout'
|
156
|
+
```
|
157
|
+
|
151
158
|
### Render Alchemy Content in Solidus views
|
152
159
|
|
153
|
-
If you plan to render Alchemy content in your Solidus views (ie. a global header
|
160
|
+
If you plan to render Alchemy content in your Solidus views (ie. a global header
|
161
|
+
or footer section), you need to include the Alchemy view helpers and language
|
162
|
+
store in your Solidus controllers with the following addition to your
|
163
|
+
initializer:
|
154
164
|
|
155
165
|
```ruby
|
156
|
-
# config/initializers/
|
157
|
-
|
158
|
-
Spree::BaseController.class_eval do
|
159
|
-
include Alchemy::ControllerActions
|
160
|
-
end
|
166
|
+
# config/initializers/alchemy.rb
|
167
|
+
require 'alchemy/solidus/alchemy_in_solidus'
|
161
168
|
```
|
162
169
|
|
163
|
-
|
170
|
+
## Routing
|
164
171
|
|
165
|
-
|
172
|
+
For routing you have a few options.
|
173
|
+
|
174
|
+
### Place both engines in their own namespace:
|
166
175
|
|
167
176
|
```ruby
|
168
|
-
# config/
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
177
|
+
# config/routes.rb
|
178
|
+
mount Spree::Core::Engine => '/store'
|
179
|
+
mount Alchemy::Engine => '/pages'
|
180
|
+
```
|
181
|
+
|
182
|
+
### Put Solidus at the root level and Alchemy in its own namespace:
|
183
|
+
|
184
|
+
```ruby
|
185
|
+
# config/routes.rb
|
186
|
+
mount Alchemy::Engine => '/pages'
|
187
|
+
mount Spree::Core::Engine => '/'
|
188
|
+
```
|
189
|
+
|
190
|
+
### Put Alchemy at the root level and Solidus in its own namespace:
|
191
|
+
|
192
|
+
```ruby
|
193
|
+
# config/routes.rb
|
194
|
+
mount Spree::Core::Engine => '/store'
|
195
|
+
mount Alchemy::Engine => '/'
|
196
|
+
```
|
197
|
+
|
198
|
+
### Put both engines in the root level
|
199
|
+
|
200
|
+
```ruby
|
201
|
+
# config/routes.rb
|
202
|
+
|
203
|
+
# Make Alchemy's root page have higher priority than Spree's root page
|
204
|
+
root to: 'alchemy/pages#show'
|
205
|
+
|
206
|
+
mount Spree::Core::Engine => '/'
|
207
|
+
|
208
|
+
# Must be last so it's catch-all route can render undefined paths
|
209
|
+
mount Alchemy::Engine => '/'
|
173
210
|
```
|
174
211
|
|
175
212
|
## Usage
|
Binary file
|
@@ -0,0 +1,14 @@
|
|
1
|
+
##
|
2
|
+
# If there is the Devise Constant loaded, we can assume that we use it as the authentication method
|
3
|
+
# then we set the ParentController of device as the Spree::BaseController
|
4
|
+
# https://github.com/AlchemyCMS/alchemy-solidus/issues/10
|
5
|
+
if Object.const_defined?("Devise")
|
6
|
+
Devise.setup do |config|
|
7
|
+
config.parent_controller = "Spree::BaseController"
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
# Allow Alchemy content within Solidus views
|
12
|
+
Spree::BaseController.send :include, Alchemy::ControllerActions
|
13
|
+
Spree::UserSessionsController.send :include, Alchemy::ControllerActions if defined? Spree::UserSessionsController
|
14
|
+
Spree::BaseController.send :include, Alchemy::ConfigurationMethods
|
@@ -1,13 +1,23 @@
|
|
1
|
+
require 'alchemy/solidus/alchemy_user_extension'
|
2
|
+
require 'alchemy/solidus/spree_user_extension'
|
3
|
+
|
1
4
|
module Alchemy
|
2
5
|
module Solidus
|
3
6
|
class Engine < ::Rails::Engine
|
4
7
|
engine_name 'alchemy_solidus'
|
5
8
|
|
6
|
-
|
7
|
-
|
9
|
+
initializer 'alchemy_solidus.assets' do |app|
|
10
|
+
app.config.assets.precompile += [
|
11
|
+
'alchemy/solidus/alchemy_module_icon.png'
|
12
|
+
]
|
8
13
|
end
|
9
14
|
|
10
|
-
config.to_prepare
|
15
|
+
config.to_prepare do
|
16
|
+
Alchemy.register_ability ::Spree::Ability
|
17
|
+
::Spree::Ability.register_ability ::Alchemy::Permissions
|
18
|
+
Spree::User.include Spree::AlchemyUserExtension if Alchemy.user_class_name == 'Spree::User'
|
19
|
+
Alchemy::User.include Alchemy::SpreeUserExtension if Alchemy.user_class_name == 'Alchemy::User'
|
20
|
+
end
|
11
21
|
end
|
12
22
|
end
|
13
23
|
end
|
@@ -0,0 +1,5 @@
|
|
1
|
+
# Include this to make Alchemy render within the Solidus layout
|
2
|
+
Alchemy::BaseHelper.send :include, Spree::BaseHelper
|
3
|
+
Alchemy::BaseHelper.send :include, Spree::StoreHelper
|
4
|
+
Alchemy::BaseController.send :include, Spree::Core::ControllerHelpers::Common
|
5
|
+
Alchemy::BaseController.send :include, Spree::Core::ControllerHelpers::Store
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alchemy-solidus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas von Deyen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-12-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: alchemy_cms
|
@@ -75,12 +75,16 @@ files:
|
|
75
75
|
- app/views/alchemy/essences/_essence_spree_taxon_editor.html.erb
|
76
76
|
- app/views/alchemy/essences/_essence_spree_taxon_view.html.erb
|
77
77
|
- config/initializers/alchemy.rb
|
78
|
+
- config/locales/alchemy_solidus_en.yml
|
79
|
+
- config/locales/alchemy_solidus_it.yml
|
78
80
|
- db/migrate/20120229160509_create_alchemy_essence_spree_products.rb
|
79
81
|
- db/migrate/20131030140218_create_alchemy_essence_spree_taxons.rb
|
80
82
|
- lib/alchemy-solidus.rb
|
81
|
-
- lib/alchemy/solidus/
|
83
|
+
- lib/alchemy/solidus/alchemy_in_solidus.rb
|
84
|
+
- lib/alchemy/solidus/alchemy_user_extension.rb
|
82
85
|
- lib/alchemy/solidus/engine.rb
|
83
|
-
- lib/alchemy/solidus/
|
86
|
+
- lib/alchemy/solidus/spree_user_extension.rb
|
87
|
+
- lib/alchemy/solidus/use_solidus_layout.rb
|
84
88
|
- lib/alchemy/solidus/version.rb
|
85
89
|
homepage: https://github.com/AlchemyCMS/alchemy-solidus
|
86
90
|
licenses:
|
@@ -102,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
102
106
|
version: '0'
|
103
107
|
requirements: []
|
104
108
|
rubyforge_project:
|
105
|
-
rubygems_version: 2.
|
109
|
+
rubygems_version: 2.6.13
|
106
110
|
signing_key:
|
107
111
|
specification_version: 4
|
108
112
|
summary: The World's Most Flexible E-Commerce Platform meets The World's Most Flexible
|