alchemy-solidus 2.3.2 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +74 -36
- data/Rakefile +1 -1
- data/config/initializers/alchemy.rb +3 -1
- data/lib/alchemy/solidus/engine.rb +0 -6
- data/lib/alchemy/solidus/version.rb +1 -1
- data/lib/generators/alchemy/solidus/install/templates/alchemy.rb.tt +3 -1
- metadata +23 -12
- data/app/assets/images/alchemy/solidus/alchemy_module_icon.png +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b6e92c70519b42d1b2ddd77907a413ee2ac8657b8bf180987d28c9beb12b93d9
|
4
|
+
data.tar.gz: 8dc7e00168b554f7efb2fbe01e884f269a7112d6feeaa7a63aa62c614271cf1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45edca46563a2713b35b39ddd58e743909b0a72219532087264b6d4eb66aebe1199bd466d5d0833b80a04265106ebfcdc866510ecedc25f272f5a54c25701740
|
7
|
+
data.tar.gz: 78f94fce34c3689cd843da7a451bbe34e83100bd31c1f85b1f3ea0c761dba578b6b292cd340622917a08d39a8c8e74fed755a9a51ce278f7d1976c30a831dc70
|
data/README.md
CHANGED
@@ -1,57 +1,69 @@
|
|
1
1
|
[](https://travis-ci.org/AlchemyCMS/alchemy-solidus)
|
2
2
|
|
3
|
-
#
|
3
|
+
# Alchemy-Solidus
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
This gem is a [AlchemyCMS](https://github.com/AlchemyCMS/alchemy_cms) and [Solidus](https://github.com/solidusio/solidus) connector.
|
8
|
-
|
9
|
-
### For now it does this:
|
5
|
+
This is a [AlchemyCMS](https://alchemy-cms.com) and [Solidus](https://solidus.io) integration gem.
|
10
6
|
|
11
7
|
1. It provides tabs in Alchemy and Solidus menus to easily switch between both backends
|
12
8
|
2. It offers two new Essences for Alchemy called `EssenceSpreeProduct` and `EssenceSpreeTaxon` that you can use to place Spree products and/or Taxons on your pages.
|
13
9
|
3. Shares admin sessions and user abilities between Alchemy and Solidus.
|
14
10
|
|
15
|
-
|
11
|
+
## Compatibility
|
12
|
+
|
13
|
+
### Solidus
|
16
14
|
|
17
|
-
|
15
|
+
This version runs with Solidus 2.6 and above.
|
18
16
|
|
19
|
-
|
17
|
+
- For a Solidus < 2.6 compatible version please use the `2.3-stable` branch or `2.3.2` gem version.
|
18
|
+
- For a Solidus 1.x compatible version please use the `1.0-stable` branch or `1.1.0` gem version.
|
20
19
|
|
21
|
-
|
20
|
+
### Alchemy
|
22
21
|
|
23
|
-
This version runs with Alchemy 4.
|
22
|
+
This version runs with Alchemy 4.1 and above.
|
23
|
+
|
24
|
+
- For a Alchemy 4.0 compatible version please use the `2.3-stable` branch or `2.3.2` gem version.
|
25
|
+
- For a Alchemy 3.x compatible version please use the `1.0-stable` branch or `1.1.0` gem version.
|
24
26
|
|
25
27
|
## Installation
|
26
28
|
|
27
|
-
Add this line to your
|
29
|
+
Add this line to your applications `Gemfile`:
|
28
30
|
|
29
31
|
```ruby
|
30
|
-
gem 'alchemy-solidus',
|
32
|
+
gem 'alchemy-solidus', '~> 2.4.0'
|
31
33
|
```
|
32
34
|
|
33
35
|
Install the gem with:
|
34
36
|
|
35
|
-
```
|
37
|
+
```bash
|
36
38
|
$ bundle install
|
37
39
|
```
|
38
40
|
|
39
41
|
## Automated setup
|
40
42
|
|
41
|
-
We ship a Rails generator that helps you to install this gem into your existing
|
43
|
+
We ship a Rails generator that helps you to install this gem into your existing application.
|
42
44
|
|
43
|
-
```
|
45
|
+
```bash
|
44
46
|
$ bin/rails g alchemy:solidus:install
|
45
47
|
```
|
46
48
|
|
47
|
-
There are several options available, please check them
|
49
|
+
There are several options available, please check them with
|
48
50
|
|
49
|
-
```
|
51
|
+
```bash
|
50
52
|
$ bin/rails g alchemy:solidus:install --help
|
51
53
|
```
|
52
54
|
|
55
|
+
## Upgrading
|
56
|
+
|
57
|
+
To upgrade update the Gemfile and run the install generator again
|
58
|
+
|
59
|
+
```bash
|
60
|
+
$ bin/rails g alchemy:solidus:install
|
61
|
+
```
|
62
|
+
|
53
63
|
## Manual setup
|
54
64
|
|
65
|
+
If you want to have full control over the integration you can also set this up manually.
|
66
|
+
|
55
67
|
### Authentication system installation
|
56
68
|
|
57
69
|
Both Alchemy and Solidus come without an authentication system in place. You will need to choose an authentication system yourself. There are 3 available options. Whichever you choose, you need to instruct Solidus & Alchemy about your choice of authentication system.
|
@@ -96,7 +108,7 @@ gem 'alchemy-devise', '~> 4.1'
|
|
96
108
|
|
97
109
|
and install it:
|
98
110
|
|
99
|
-
```
|
111
|
+
```bash
|
100
112
|
$ bundle install
|
101
113
|
$ bundle exec rails g alchemy:devise:install
|
102
114
|
```
|
@@ -105,13 +117,13 @@ Run the Solidus installer:
|
|
105
117
|
|
106
118
|
*NOTE*: Skip this if you already have a running Solidus installation.
|
107
119
|
|
108
|
-
```
|
120
|
+
```bash
|
109
121
|
$ bundle exec rails g spree:install
|
110
122
|
```
|
111
123
|
|
112
124
|
Then run the solidus custom user generator:
|
113
125
|
|
114
|
-
```
|
126
|
+
```bash
|
115
127
|
$ bundle exec rails g spree:custom_user Alchemy::User
|
116
128
|
```
|
117
129
|
|
@@ -143,21 +155,21 @@ and tell Solidus about Alchemy's path helpers:
|
|
143
155
|
...
|
144
156
|
```
|
145
157
|
|
146
|
-
#### 3. Option: Build
|
158
|
+
#### 3. Option: Build your own authentication
|
147
159
|
|
148
|
-
Please follow the [
|
160
|
+
Please follow the [Solidus custom authentication](https://guides.solidus.io/developers/users/custom-authentication.html) and the [Alchemy custom authentication](https://guides.alchemy-cms.com/custom_authentication.html) guides in order to integrate your custom user with Solidus and Alchemy.
|
149
161
|
|
150
|
-
|
162
|
+
### In either case
|
151
163
|
|
152
164
|
Install the migrations
|
153
165
|
|
154
|
-
```
|
166
|
+
```bash
|
155
167
|
$ bundle exec rake alchemy_solidus:install:migrations
|
156
168
|
```
|
157
169
|
|
158
170
|
Run the installer of Alchemy
|
159
171
|
|
160
|
-
```
|
172
|
+
```bash
|
161
173
|
$ bundle exec rake alchemy:install
|
162
174
|
```
|
163
175
|
|
@@ -185,11 +197,11 @@ initializer:
|
|
185
197
|
require 'alchemy/solidus/alchemy_in_solidus'
|
186
198
|
```
|
187
199
|
|
188
|
-
|
200
|
+
### Routing
|
189
201
|
|
190
202
|
For routing you have a few options.
|
191
203
|
|
192
|
-
|
204
|
+
#### Place both engines in their own namespace:
|
193
205
|
|
194
206
|
```ruby
|
195
207
|
# config/routes.rb
|
@@ -197,7 +209,7 @@ mount Spree::Core::Engine => '/store'
|
|
197
209
|
mount Alchemy::Engine => '/pages'
|
198
210
|
```
|
199
211
|
|
200
|
-
|
212
|
+
#### Put Solidus at the root level and Alchemy in its own namespace:
|
201
213
|
|
202
214
|
```ruby
|
203
215
|
# config/routes.rb
|
@@ -205,7 +217,7 @@ mount Alchemy::Engine => '/pages'
|
|
205
217
|
mount Spree::Core::Engine => '/'
|
206
218
|
```
|
207
219
|
|
208
|
-
|
220
|
+
#### Put Alchemy at the root level and Solidus in its own namespace:
|
209
221
|
|
210
222
|
```ruby
|
211
223
|
# config/routes.rb
|
@@ -213,7 +225,7 @@ mount Spree::Core::Engine => '/store'
|
|
213
225
|
mount Alchemy::Engine => '/'
|
214
226
|
```
|
215
227
|
|
216
|
-
|
228
|
+
#### Put both engines in the root level
|
217
229
|
|
218
230
|
```ruby
|
219
231
|
# config/routes.rb
|
@@ -229,6 +241,8 @@ mount Alchemy::Engine => '/'
|
|
229
241
|
|
230
242
|
## Usage
|
231
243
|
|
244
|
+
Please make yourself familiar with AlchemyCMS by [reading the guidelines](https://guides.alchemy-cms.com)
|
245
|
+
|
232
246
|
### Create a new Element for Alchemy
|
233
247
|
|
234
248
|
```yaml
|
@@ -260,14 +274,38 @@ $ rails g alchemy:elements --skip
|
|
260
274
|
elements: [product_category]
|
261
275
|
```
|
262
276
|
|
263
|
-
###
|
277
|
+
### Access the Solidus product or taxon in your element views
|
278
|
+
|
279
|
+
You can mix Alchemy and Solidus content in the same view.
|
264
280
|
|
265
281
|
```erb
|
266
|
-
|
267
|
-
|
282
|
+
<!-- app/views/alchemy/elements/_product_view.html.erb -->
|
283
|
+
<% cache element do %>
|
284
|
+
<%= element_view_for element do |el| %>
|
285
|
+
<% product = el.ingredient(:spree_product) %>
|
286
|
+
<h1><%= product.name %></h1>
|
287
|
+
<p><%= product.description %></p>
|
288
|
+
<%= el.render :text %>
|
289
|
+
<%= el.render :image %>
|
290
|
+
<% end %>
|
291
|
+
<% end %>
|
292
|
+
```
|
268
293
|
|
269
|
-
|
270
|
-
|
294
|
+
Or for a list of taxon products
|
295
|
+
|
296
|
+
```erb
|
297
|
+
<!-- app/views/alchemy/elements/_product_category_view.html.erb -->
|
298
|
+
<% cache element do %>
|
299
|
+
<%= element_view_for element do |el| %>
|
300
|
+
<h2><%= el.render :headline %></h2>
|
301
|
+
<%= el.render :description %>
|
302
|
+
|
303
|
+
<% taxon = el.ingredient(:spree_taxon) %>
|
304
|
+
<% taxon.products.each do |product| %>
|
305
|
+
<%= link_to product.name, spree.product_path(product) %>
|
306
|
+
<% end %>
|
307
|
+
<% end %>
|
308
|
+
<% end %>
|
271
309
|
```
|
272
310
|
|
273
311
|
Alchemy :heart: Solidus!
|
data/Rakefile
CHANGED
@@ -21,7 +21,7 @@ task :test_setup do
|
|
21
21
|
export RAILS_ENV=test && \
|
22
22
|
bin/rake db:environment:set db:drop && \
|
23
23
|
bin/rails g spree:install --force --quiet --auto-accept --no-seed --no-sample && \
|
24
|
-
bin/rails g alchemy:solidus:install --auto-accept
|
24
|
+
bin/rails g alchemy:solidus:install --auto-accept --force
|
25
25
|
SETUP
|
26
26
|
exit($?.exitstatus) unless $?.success?
|
27
27
|
end
|
@@ -5,7 +5,9 @@ alchemy_module = {
|
|
5
5
|
controller: 'spree/admin/orders',
|
6
6
|
action: 'index',
|
7
7
|
name: 'Store',
|
8
|
-
|
8
|
+
inline_image: '<svg version="1.1" width="24px" height="24px" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" style="vertical-align: middle">
|
9
|
+
<path d="M 6.687 21.839 L 17.314 21.839 L 17.314 2.162 L 6.687 2.162 Z M 19.476 24 L 4.525 24 L 4.525 0 L 19.476 0 Z M 13.89 17 C 13.307 16.662 13.078 16.287 13.05 15.313 L 13.05 8.574 C 13.05 6.554 12.05 5.814 9.911 4.794 L 8.99 6.434 L 10.111 7.074 C 10.693 7.412 10.923 7.786 10.951 8.761 L 10.951 15.5 C 10.951 17.52 11.951 18.26 14.09 19.279 L 15.01 17.64 Z" fill="currentColor"/>
|
10
|
+
</svg>',
|
9
11
|
data: { turbolinks: false },
|
10
12
|
sub_navigation: [
|
11
13
|
{
|
@@ -8,12 +8,6 @@ module Alchemy
|
|
8
8
|
class Engine < ::Rails::Engine
|
9
9
|
engine_name 'alchemy_solidus'
|
10
10
|
|
11
|
-
initializer 'alchemy_solidus.assets' do |app|
|
12
|
-
app.config.assets.precompile += [
|
13
|
-
'alchemy/solidus/alchemy_module_icon.png'
|
14
|
-
]
|
15
|
-
end
|
16
|
-
|
17
11
|
config.to_prepare do
|
18
12
|
Alchemy.register_ability ::Spree::Ability
|
19
13
|
::Spree::Ability.register_ability ::Alchemy::Permissions
|
@@ -5,7 +5,9 @@ Alchemy::Modules.register_module({
|
|
5
5
|
controller: 'spree/admin/orders',
|
6
6
|
action: 'index',
|
7
7
|
name: 'Store',
|
8
|
-
|
8
|
+
inline_image: '<svg version="1.1" width="24px" height="24px" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" style="vertical-align: middle">
|
9
|
+
<path d="M 6.687 21.839 L 17.314 21.839 L 17.314 2.162 L 6.687 2.162 Z M 19.476 24 L 4.525 24 L 4.525 0 L 19.476 0 Z M 13.89 17 C 13.307 16.662 13.078 16.287 13.05 15.313 L 13.05 8.574 C 13.05 6.554 12.05 5.814 9.911 4.794 L 8.99 6.434 L 10.111 7.074 C 10.693 7.412 10.923 7.786 10.951 8.761 L 10.951 15.5 C 10.951 17.52 11.951 18.26 14.09 19.279 L 15.01 17.64 Z" fill="currentColor"/>
|
10
|
+
</svg>',
|
9
11
|
data: { turbolinks: false },
|
10
12
|
sub_navigation: [
|
11
13
|
{
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alchemy-solidus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas von Deyen
|
@@ -16,7 +16,7 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 4.
|
19
|
+
version: 4.1.0
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: '5.0'
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 4.
|
29
|
+
version: 4.1.0
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: '5.0'
|
@@ -34,30 +34,42 @@ dependencies:
|
|
34
34
|
name: solidus_core
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
|
-
- - "
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: 2.6.0
|
40
|
+
- - "<"
|
38
41
|
- !ruby/object:Gem::Version
|
39
|
-
version: '
|
42
|
+
version: '3.0'
|
40
43
|
type: :runtime
|
41
44
|
prerelease: false
|
42
45
|
version_requirements: !ruby/object:Gem::Requirement
|
43
46
|
requirements:
|
44
|
-
- - "
|
47
|
+
- - ">="
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: 2.6.0
|
50
|
+
- - "<"
|
45
51
|
- !ruby/object:Gem::Version
|
46
|
-
version: '
|
52
|
+
version: '3.0'
|
47
53
|
- !ruby/object:Gem::Dependency
|
48
54
|
name: solidus_backend
|
49
55
|
requirement: !ruby/object:Gem::Requirement
|
50
56
|
requirements:
|
51
|
-
- - "
|
57
|
+
- - ">="
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: 2.6.0
|
60
|
+
- - "<"
|
52
61
|
- !ruby/object:Gem::Version
|
53
|
-
version: '
|
62
|
+
version: '3.0'
|
54
63
|
type: :runtime
|
55
64
|
prerelease: false
|
56
65
|
version_requirements: !ruby/object:Gem::Requirement
|
57
66
|
requirements:
|
58
|
-
- - "
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: 2.6.0
|
70
|
+
- - "<"
|
59
71
|
- !ruby/object:Gem::Version
|
60
|
-
version: '
|
72
|
+
version: '3.0'
|
61
73
|
- !ruby/object:Gem::Dependency
|
62
74
|
name: solidus_support
|
63
75
|
requirement: !ruby/object:Gem::Requirement
|
@@ -166,7 +178,6 @@ files:
|
|
166
178
|
- LICENSE
|
167
179
|
- README.md
|
168
180
|
- Rakefile
|
169
|
-
- app/assets/images/alchemy/solidus/alchemy_module_icon.png
|
170
181
|
- app/models/alchemy/essence_spree_product.rb
|
171
182
|
- app/models/alchemy/essence_spree_taxon.rb
|
172
183
|
- app/views/alchemy/essences/_essence_spree_product_editor.html.erb
|
Binary file
|