caboose-cms 0.5.117 → 0.5.118
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/app/controllers/caboose/vendors_controller.rb +5 -0
- data/config/routes.rb +1 -0
- data/lib/caboose/version.rb +1 -1
- metadata +1 -2
- data/app/controllers/caboose/#vendors_controller.rb# +0 -114
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MWY1OGNhMWUyYzlmZjhhNDQxMjllYjk4OWZlNzQ2NjZhY2I2NjQ5Mg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NjRlYTdlZTA3YWExZGQ3OGJlYzIwYTAwNzZiMDg0NmUxZjg2ZDNkZg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YWM5MGI1ZGM5MzM4Y2JjZTNkYmEwYTU1MzFmODAwNzdkOGFjOWI2YWFjZTRk
|
10
|
+
NmQyOTIwMzQzNWEwMDFlYzI3NjU0OTEzOTM2NDNmNGFjODU5YzNlOWM2N2Nm
|
11
|
+
MTE3ZjNhMTAxNzQ4ZTE3YzMxOGFhYTk5OGJjNjdhODhiYjI1Mzc=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MzhmZDM1MDExOTkxMWE4NThiZTg0NmY3Y2ZlN2FlZWQ5ZmE0MDczMWQ4YjVj
|
14
|
+
NjhjNmY0ODQyYzZjMTZlOGQzZGQzMjYwZjBhZWJhY2Y3YzRlNjM5MTc0ZDNk
|
15
|
+
NzA2NTQ0NDY2Y2YwY2RlMjk2ZmY0ZTdmNmU1NzJkNDVhZmUzNmI=
|
@@ -91,6 +91,11 @@ module Caboose
|
|
91
91
|
render :json => resp
|
92
92
|
end
|
93
93
|
|
94
|
+
# GET /admin/vendors/options
|
95
|
+
def options
|
96
|
+
render :json => Vendor.where(:site_id => @site.id).reorder(:name).all.collect{ |v| { :value => v.id, :text => v.name }}
|
97
|
+
end
|
98
|
+
|
94
99
|
# GET /admin/vendors/status-options
|
95
100
|
def status_options
|
96
101
|
render :json => [
|
data/config/routes.rb
CHANGED
@@ -536,6 +536,7 @@ Caboose::Engine.routes.draw do
|
|
536
536
|
# Vendors
|
537
537
|
#=============================================================================
|
538
538
|
|
539
|
+
get '/admin/vendors/options' => 'vendors#options'
|
539
540
|
get '/admin/vendors/status-options' => 'vendors#status_options'
|
540
541
|
get '/admin/vendors/new' => 'vendors#admin_new'
|
541
542
|
get '/admin/vendors/:id' => 'vendors#admin_edit'
|
data/lib/caboose/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: caboose-cms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.118
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- William Barry
|
@@ -489,7 +489,6 @@ files:
|
|
489
489
|
- app/assets/templates/caboose/product/images.jst.ejs
|
490
490
|
- app/assets/templates/caboose/product/images_old.jst.ejs
|
491
491
|
- app/assets/templates/caboose/product/options.jst.ejs
|
492
|
-
- app/controllers/caboose/#vendors_controller.rb#
|
493
492
|
- app/controllers/caboose/ab_options_controller.rb
|
494
493
|
- app/controllers/caboose/ab_variants_controller.rb
|
495
494
|
- app/controllers/caboose/admin_controller.rb
|
@@ -1,114 +0,0 @@
|
|
1
|
-
module Caboose
|
2
|
-
class VendorsController < Caboose::ApplicationController
|
3
|
-
|
4
|
-
# GET /admin/vendors
|
5
|
-
def admin_index
|
6
|
-
return if !user_is_allowed('vendors', 'view')
|
7
|
-
|
8
|
-
@pager = Caboose::Pager.new(params, {
|
9
|
-
'site_id' => @site.id,
|
10
|
-
'name_like' => ''
|
11
|
-
}, {
|
12
|
-
'model' => 'Caboose::Vendor',
|
13
|
-
'sort' => 'name',
|
14
|
-
'desc' => false,
|
15
|
-
'base_url' => '/admin/vendors',
|
16
|
-
'items_per_page' => 25,
|
17
|
-
'use_url_params' => false
|
18
|
-
});
|
19
|
-
|
20
|
-
@vendors = @pager.items
|
21
|
-
|
22
|
-
render :layout => 'caboose/admin'
|
23
|
-
end
|
24
|
-
|
25
|
-
# GET /admin/vendors/:id
|
26
|
-
def admin_edit
|
27
|
-
return if !user_is_allowed('vendors', 'edit')
|
28
|
-
@vendor = Vendor.find(params[:id])
|
29
|
-
render :layout => 'caboose/admin'
|
30
|
-
end
|
31
|
-
|
32
|
-
# PUT /admin/vendors/:id/update
|
33
|
-
def admin_update
|
34
|
-
return if !user_is_allowed('vendors', 'edit')
|
35
|
-
vendor = Vendor.find(params[:id])
|
36
|
-
|
37
|
-
params.each do |name, value|
|
38
|
-
case name
|
39
|
-
when 'site_id' then vendor.site_id = value
|
40
|
-
when 'name' then vendor.name = value
|
41
|
-
when 'status' then vendor.status = value
|
42
|
-
when 'featured' then vendor.featured = value
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
render :json => { :success => vendor.save }
|
47
|
-
end
|
48
|
-
|
49
|
-
# POST /admin/vendors/:id/update/image
|
50
|
-
def admin_update_image
|
51
|
-
return if !user_is_allowed('vendors', 'edit')
|
52
|
-
|
53
|
-
vendor = Vendor.find(params[:id])
|
54
|
-
vendor.image = params[:image]
|
55
|
-
vendor.save
|
56
|
-
|
57
|
-
resp = StdClass.new
|
58
|
-
resp.attributes = { :image => { :value => vendor.image.url(:thumb) }}
|
59
|
-
resp.success = vendor.save
|
60
|
-
end
|
61
|
-
|
62
|
-
# GET /admin/vendors/new
|
63
|
-
def admin_new
|
64
|
-
return if !user_is_allowed('vendors', 'add')
|
65
|
-
render :layout => 'caboose/admin'
|
66
|
-
end
|
67
|
-
|
68
|
-
# POST /admin/vendors
|
69
|
-
def admin_add
|
70
|
-
return if !user_is_allowed('vendors', 'add')
|
71
|
-
|
72
|
-
render :json => { :success => false, :message => 'Must define a name' } and return if params[:name].nil? || params[:name].empty?
|
73
|
-
|
74
|
-
vendor = Vendor.new(
|
75
|
-
:site_id => @site.id,
|
76
|
-
:name => params[:name],
|
77
|
-
:status => 'Active'
|
78
|
-
)
|
79
|
-
render :json => { :success => vendor.save, :redirect => "/admin/vendors/#{vendor.id}" }
|
80
|
-
end
|
81
|
-
|
82
|
-
# DELETE /admin/vendors/:id
|
83
|
-
def admin_delete
|
84
|
-
return if !user_is_allowed('vendors', 'delete')
|
85
|
-
v = Vendor.find(params[:id])
|
86
|
-
v.destroy
|
87
|
-
|
88
|
-
resp = StdClass.new({
|
89
|
-
'redirect' => '/admin/vendors'
|
90
|
-
})
|
91
|
-
render :json => resp
|
92
|
-
end
|
93
|
-
|
94
|
-
# GET /admin/vendors/options
|
95
|
-
def options
|
96
|
-
render :json => Vendor.where(:site_id => @site.id).reorder(:name).all.collect
|
97
|
-
{ :text => 'Active' , :value => 'Active' },
|
98
|
-
{ :text => 'Inactive' , :value => 'Inactive' },
|
99
|
-
{ :text => 'Deleted' , :value => 'Deleted' }
|
100
|
-
]
|
101
|
-
end
|
102
|
-
|
103
|
-
# GET /admin/vendors/status-options
|
104
|
-
def status_options
|
105
|
-
render :json => [
|
106
|
-
{ :text => 'Active' , :value => 'Active' },
|
107
|
-
{ :text => 'Inactive' , :value => 'Inactive' },
|
108
|
-
{ :text => 'Deleted' , :value => 'Deleted' }
|
109
|
-
]
|
110
|
-
end
|
111
|
-
|
112
|
-
end
|
113
|
-
end
|
114
|
-
|