enjoy_cms_catalog 0.3.4 → 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/views/enjoy/catalog/item_categories/index.html.slim +1 -1
- data/app/views/enjoy/catalog/item_categories/show.html.slim +2 -2
- data/app/views/enjoy/catalog/items/index.html.slim +1 -1
- data/app/views/enjoy/catalog/items/show.html.slim +1 -1
- data/enjoy_cms_catalog.gemspec +1 -1
- data/lib/enjoy/catalog/configuration.rb +0 -8
- data/lib/enjoy/catalog/engine.rb +1 -1
- data/lib/enjoy/catalog/models/item.rb +1 -1
- data/lib/enjoy/catalog/models/item_category.rb +1 -1
- data/lib/enjoy/catalog/routes.rb +34 -0
- data/lib/enjoy/catalog/version.rb +1 -1
- data/lib/enjoy_cms_catalog.rb +4 -1
- data/lib/generators/enjoy/catalog/config/templates/enjoy_catalog.erb +0 -6
- metadata +5 -5
- data/config/routes.rb +0 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 76ed535e18dd2cc2e1c8df32149a0f5a1c9d651f
|
4
|
+
data.tar.gz: 2e677aeed56f706021b71b11e2279e2a9c028fe4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: deb8f237ccc72b51a138bf8b6eef8b1ef9d6b2c93b91d5a39fa8850c5b28d1869b7e3eed3d6ba2b2492c03db7fcbca14b5b722fb438d7ea50f6c5670bd3ba93a
|
7
|
+
data.tar.gz: dfc7da876f99f2a6f3d6c8d32fc762d137783141693e7888505ec867cacdb8da35adf60114f5dd5231f548432b7363d1014fcc59c9417112c44da5a85ce32db6
|
@@ -22,7 +22,7 @@
|
|
22
22
|
|
23
23
|
.ic_block
|
24
24
|
|
25
|
-
= link_to
|
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
|
55
|
+
= link_to i, title: i.name do
|
56
56
|
.i_block
|
57
57
|
|
58
58
|
|
data/enjoy_cms_catalog.gemspec
CHANGED
@@ -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
|
data/lib/enjoy/catalog/engine.rb
CHANGED
@@ -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
|
data/lib/enjoy_cms_catalog.rb
CHANGED
@@ -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
|
+
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-
|
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.
|
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.
|
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
|