enjoy_cms_catalog 0.3.4 → 0.3.5

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
  SHA1:
3
- metadata.gz: b1e8327ef229c0b25ddea63ef933783c1d10648c
4
- data.tar.gz: 47d6cb35664902671b67c71efe2350a85de68766
3
+ metadata.gz: 76ed535e18dd2cc2e1c8df32149a0f5a1c9d651f
4
+ data.tar.gz: 2e677aeed56f706021b71b11e2279e2a9c028fe4
5
5
  SHA512:
6
- metadata.gz: b9d8811cb17691cf9fdf50c1833e17eab32439ee4cb4812aa8999cc71df9053ab6685a449b70d301f9f3d3677d882453ac595c537cf1a8dd18649db9e646342d
7
- data.tar.gz: b07fec3e354c84e7e29671c14cf0d875a390ca82cf25aa0a6c8a7fdb6771605d6bdfc577dc60709e402305f24a61d2e830e04120cc06891e1f05ccd15e67fbba
6
+ metadata.gz: deb8f237ccc72b51a138bf8b6eef8b1ef9d6b2c93b91d5a39fa8850c5b28d1869b7e3eed3d6ba2b2492c03db7fcbca14b5b722fb438d7ea50f6c5670bd3ba93a
7
+ data.tar.gz: dfc7da876f99f2a6f3d6c8d32fc762d137783141693e7888505ec867cacdb8da35adf60114f5dd5231f548432b7363d1014fcc59c9417112c44da5a85ce32db6
@@ -8,7 +8,7 @@
8
8
 
9
9
  .ic_block
10
10
 
11
- = link_to enjoy_cms_catalog.item_category_path(ic), title: ic.name do
11
+ = link_to ic, title: ic.name do
12
12
 
13
13
  .ic_img_block
14
14
 
@@ -22,7 +22,7 @@
22
22
 
23
23
  .ic_block
24
24
 
25
- = link_to enjoy_cms_catalog.item_category_path(icc), title: icc.name do
25
+ = link_to icc, title: icc.name do
26
26
 
27
27
  .ic_img_block
28
28
 
@@ -52,7 +52,7 @@
52
52
 
53
53
 
54
54
  .item_block
55
- = link_to enjoy_cms_catalog.item_path(i), title: i.name do
55
+ = link_to i, title: i.name do
56
56
  .i_block
57
57
 
58
58
 
@@ -5,7 +5,7 @@
5
5
  - unless @items.blank?
6
6
  - @items.each do |i|
7
7
  .item_block
8
- = link_to enjoy_cms_catalog.item_path(i), title: i.name do
8
+ = link_to i, title: i.name do
9
9
  .i_block
10
10
 
11
11
 
@@ -9,7 +9,7 @@
9
9
 
10
10
 
11
11
  .item_block
12
- = link_to enjoy_cms_catalog.item_path(@item), title: @item.name do
12
+ = link_to @item, title: @item.name do
13
13
  .i_block
14
14
 
15
15
 
@@ -34,5 +34,5 @@ Gem::Specification.new do |spec|
34
34
  spec.add_dependency 'money-rails'
35
35
  spec.add_dependency 'mongoid_money_field'
36
36
 
37
- spec.add_dependency 'enjoy_cms', "~> 0.3.4"
37
+ spec.add_dependency 'enjoy_cms', "~> 0.3.5"
38
38
  end
@@ -22,8 +22,6 @@ module Enjoy
22
22
 
23
23
  attr_accessor :item_category_images_image_styles
24
24
 
25
- attr_accessor :routes_config
26
-
27
25
  def initialize
28
26
  @item_image_styles = {}
29
27
  @item_per_page = 10
@@ -34,12 +32,6 @@ module Enjoy
34
32
  @item_category_per_page = 10
35
33
 
36
34
  @item_category_images_image_styles = {}
37
-
38
- @routes_config = {
39
- use_items_path: true,
40
- use_item_categories_path: true,
41
- use_catalog_path: true
42
- }
43
35
  end
44
36
  end
45
37
  end
@@ -1,7 +1,7 @@
1
1
  module Enjoy
2
2
  module Catalog
3
3
  class Engine < ::Rails::Engine
4
- isolate_namespace Enjoy::Catalog
4
+ # isolate_namespace Enjoy::Catalog
5
5
  end
6
6
  end
7
7
  end
@@ -15,7 +15,7 @@ module Enjoy::Catalog
15
15
  included do
16
16
  manual_slug :name
17
17
 
18
- enjoy_connectable_field :connected_pages, routes_namespace: :enjoy_cms_catalog
18
+ enjoy_connectable_field :connected_pages
19
19
  end
20
20
  end
21
21
  end
@@ -15,7 +15,7 @@ module Enjoy::Catalog
15
15
  included do
16
16
  manual_slug :name
17
17
 
18
- enjoy_connectable_field :connected_pages, routes_namespace: :enjoy_cms_catalog
18
+ enjoy_connectable_field :connected_pages
19
19
  end
20
20
 
21
21
  def item_class
@@ -0,0 +1,34 @@
1
+ module ActionDispatch::Routing
2
+ class Mapper
3
+
4
+ def enjoy_cms_catalog_routes(config = {})
5
+ routes_config = {
6
+ use_items_path: true,
7
+ use_item_categories_path: true,
8
+ use_catalog_path: true
9
+ }
10
+ routes_config.merge!(config)
11
+
12
+ scope module: 'enjoy' do
13
+ scope module: 'catalog' do
14
+ if routes_config[:use_items_path]
15
+ resources :items, only: [:show], as: :enjoy_catalog_items do
16
+ get '(/page/:page)', action: :index, on: :collection, as: ""
17
+ end
18
+ end
19
+
20
+ if routes_config[:use_item_categories_path]
21
+ resources :item_categories, only: [:index, :show], as: :enjoy_catalog_item_categories do
22
+ get 'items(/page/:page)', action: :items, on: :member, as: :items
23
+ end
24
+ end
25
+ if routes_config[:use_catalog_path]
26
+ get 'catalog' => 'item_categories#index', as: :enjoy_catalog
27
+ end
28
+ end
29
+ end
30
+
31
+ end
32
+
33
+ end
34
+ end
@@ -1,5 +1,5 @@
1
1
  module Enjoy
2
2
  module Catalog
3
- VERSION = "0.3.4"
3
+ VERSION = "0.3.5"
4
4
  end
5
5
  end
@@ -1,8 +1,11 @@
1
1
  require "enjoy/catalog/version"
2
2
 
3
+ require 'enjoy/catalog/routes'
4
+
3
5
  require 'money-rails'
4
6
 
5
- require 'enjoy_cms_mongoid'
7
+ require 'enjoy_cms'
8
+
6
9
  require 'rails_admin_sort_embedded'
7
10
  require 'rails_admin_jcrop'
8
11
 
@@ -9,10 +9,4 @@ Enjoy::Catalog.configure do |config|
9
9
  # config.item_category_per_page = 10
10
10
  #
11
11
  # config.item_category_images_image_styles = {}
12
- #
13
- # config.routes_config = {
14
- # use_items_path: true,
15
- # use_item_categories_path: true,
16
- # use_catalog_path: true
17
- # }
18
12
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enjoy_cms_catalog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Kiseliev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-04 00:00:00.000000000 Z
11
+ date: 2016-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 0.3.4
75
+ version: 0.3.5
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 0.3.4
82
+ version: 0.3.5
83
83
  description: Items catalog with EnjoyCMS support.
84
84
  email:
85
85
  - dev@enjoycreate.ru
@@ -115,7 +115,6 @@ files:
115
115
  - bin/console
116
116
  - bin/setup
117
117
  - config/initializers/rails_admin.rb
118
- - config/routes.rb
119
118
  - enjoy_cms_catalog.gemspec
120
119
  - lib/enjoy/catalog/admin.rb
121
120
  - lib/enjoy/catalog/admin/item.rb
@@ -134,6 +133,7 @@ files:
134
133
  - lib/enjoy/catalog/models/mongoid/item_category.rb
135
134
  - lib/enjoy/catalog/models/mongoid/item_category_image.rb
136
135
  - lib/enjoy/catalog/models/mongoid/item_image.rb
136
+ - lib/enjoy/catalog/routes.rb
137
137
  - lib/enjoy/catalog/version.rb
138
138
  - lib/enjoy_cms_catalog.rb
139
139
  - lib/generators/enjoy/catalog/all_generator.rb
data/config/routes.rb DELETED
@@ -1,18 +0,0 @@
1
- Enjoy::Catalog::Engine.routes.draw do
2
- routes_config = Enjoy::Catalog.configuration.routes_config
3
-
4
- if !routes_config or routes_config[:use_items_path]
5
- resources :items, only: [:show] do
6
- get '(/page/:page)', action: :index, on: :collection, as: ""
7
- end
8
- end
9
-
10
- if !routes_config or routes_config[:use_item_categories_path]
11
- resources :item_categories, only: [:index, :show] do
12
- get 'items(/page/:page)', action: :items, on: :member, as: :items
13
- end
14
- end
15
- if !routes_config or routes_config[:use_catalog_path]
16
- get 'catalog' => 'item_categories#index', as: :catalog
17
- end
18
- end