alchemy-solidus 2.3.1 → 2.3.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 56e237798bb907edb0bbd9c5d87e5182e7fa0a6718b7e6a2ac1fd586376c3e92
4
- data.tar.gz: a296960bee111d7deee009f6e9308a0127e1f97d48d31a68aa58f99f199870d7
3
+ metadata.gz: de5c64f8172aa48e4baf9a5f2d98b575a15d67f1cbee342e696602ad5e622d2e
4
+ data.tar.gz: 90da86131495bac7078a39f3854dbc2cc37f290f2cb462e5bc58048ca364f7ea
5
5
  SHA512:
6
- metadata.gz: 638f43f7eb3d9e296bb87be5cc51fa8a2c39b34158b55faaf5882fe3f5e608ea45f3b4bdadb52c04f9867a692921c2a25d35642a049d91653742d5e8ebe5d71e
7
- data.tar.gz: '092e59c407377ba9f1ed9a18946fd4a5d5a5f48c6ac9b0f0edf4f31a20349a23ee68478c1d1393f457fd5cdca3352fa8c5f9b2a2b09303ae902d794d83c5d613'
6
+ metadata.gz: ebf23bca2c312fcb51bfa7ed97edd560bc1543c8b7b9f1a0df477daa418741453021f30df69b29b9b18048de697035925b07dfe8d7a7f601c94d3303bba4e8fc
7
+ data.tar.gz: ee0997b1e2b7d43f032f5f5f12c637a2df0b2ce07afd2ac1363fdca6407862659d97bac6289373278ead07ebc621b9746920cae396a0b7638843be955403da31
@@ -0,0 +1,29 @@
1
+ # In versions of Solidus prior to 2.8, we override this class to
2
+ # add the match_path option to the initializer. (Version 2.8 has
3
+ # this option already.) This option is used in the tabs partial
4
+ # to configure the paths for which a given tab is active.
5
+ #
6
+ if Spree.solidus_gem_version < Gem::Version.new('2.8')
7
+ Spree::BackendConfiguration::MenuItem.class_eval do
8
+ attr_reader :match_path
9
+
10
+ def initialize(
11
+ sections,
12
+ icon,
13
+ condition: nil,
14
+ label: nil,
15
+ partial: nil,
16
+ url: nil,
17
+ match_path: nil
18
+ )
19
+
20
+ @condition = condition || -> { true }
21
+ @sections = sections
22
+ @icon = icon
23
+ @label = label || sections.first
24
+ @partial = partial
25
+ @url = url
26
+ @match_path = match_path
27
+ end
28
+ end
29
+ end
@@ -44,6 +44,15 @@ module Alchemy
44
44
  end
45
45
  end
46
46
  end
47
+
48
+ # In versions of Solidus prior to 2.8, we override the tabs partial
49
+ # to pass a match_path value to each tab. (Version 2.8 is already
50
+ # passing this option.) This option is used to configure the paths
51
+ # for which a given tab is active.
52
+ #
53
+ if Spree.solidus_gem_version < Gem::Version.new('2.8')
54
+ paths['app/views'] << 'lib/views'
55
+ end
47
56
  end
48
57
  end
49
58
  end
@@ -1,5 +1,5 @@
1
1
  module Alchemy
2
2
  module Solidus
3
- VERSION = "2.3.1"
3
+ VERSION = "2.3.2"
4
4
  end
5
5
  end
@@ -67,7 +67,8 @@ module Alchemy
67
67
  \ label: :cms,
68
68
  \ condition: -> { can?(:index, :alchemy_admin_dashboard) },
69
69
  \ partial: 'spree/admin/shared/alchemy_sub_menu',
70
- \ url: '/admin/pages'
70
+ \ url: '/admin/pages',
71
+ \ match_path: '/pages'
71
72
  \ )
72
73
  ADMIN_TAB
73
74
  end
@@ -0,0 +1,15 @@
1
+ <% Spree::Backend::Config.menu_items.each do |menu_item| %>
2
+ <% if instance_exec(&menu_item.condition) %>
3
+ <%=
4
+ tab(
5
+ *menu_item.sections,
6
+ icon: menu_item.icon,
7
+ label: menu_item.label,
8
+ url: menu_item.url.is_a?(Symbol) ? spree.public_send(menu_item.url) : menu_item.url,
9
+ match_path: menu_item.match_path
10
+ ) do
11
+ %>
12
+ <%- render partial: menu_item.partial if menu_item.partial %>
13
+ <%- end %>
14
+ <% end %>
15
+ <% end %>
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: 2.3.1
4
+ version: 2.3.2
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: 2019-05-15 00:00:00.000000000 Z
11
+ date: 2019-08-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: alchemy_cms
@@ -175,6 +175,7 @@ files:
175
175
  - app/views/alchemy/essences/_essence_spree_taxon_view.html.erb
176
176
  - app/views/spree/admin/shared/_alchemy_sub_menu.html.erb
177
177
  - config/initializers/alchemy.rb
178
+ - config/initializers/solidus.rb
178
179
  - config/locales/alchemy_solidus_en.yml
179
180
  - config/locales/alchemy_solidus_it.yml
180
181
  - config/locales/en.yml
@@ -192,6 +193,7 @@ files:
192
193
  - lib/alchemy/solidus/version.rb
193
194
  - lib/generators/alchemy/solidus/install/install_generator.rb
194
195
  - lib/generators/alchemy/solidus/install/templates/alchemy.rb.tt
196
+ - lib/views/spree/admin/shared/_tabs.html.erb
195
197
  homepage: https://github.com/AlchemyCMS/alchemy-solidus
196
198
  licenses:
197
199
  - BSD New