caboose-cms 0.5.194 → 0.5.195
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 +8 -8
- data/app/assets/javascripts/caboose/product.js +3 -1
- data/app/assets/stylesheets/caboose/admin_main.css +56 -0
- data/app/controllers/caboose/sites_controller.rb +22 -0
- data/app/models/caboose/order_pdf.rb +50 -16
- data/app/models/caboose/pending_orders_pdf.rb +28 -10
- data/app/models/caboose/schema.rb +9 -7
- data/app/models/caboose/site.rb +49 -0
- data/app/views/caboose/calendars/admin_edit.html.erb +1 -1
- data/app/views/caboose/calendars/admin_index.html.erb +1 -1
- data/app/views/caboose/orders/admin_index.html.erb +3 -3
- data/app/views/caboose/pages/admin_index.html.erb +1 -1
- data/app/views/caboose/products/_admin_header.html.erb +10 -3
- data/app/views/caboose/sites/_admin_header.html.erb +2 -0
- data/app/views/caboose/sites/admin_edit_css.html.erb +24 -0
- data/app/views/caboose/sites/admin_edit_js.html.erb +24 -0
- data/app/views/layouts/caboose/admin.html.erb +2 -2
- data/app/views/layouts/caboose/application.html.erb +3 -1
- data/config/routes.rb +2 -0
- data/lib/caboose/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MTEwZDI1Njk1NzdlN2EzYmMzZGFhODVmYjZhNjI1ZTU4NTg5NGNhOA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
Y2RhMGVjMDM1MGMyYjFkYzAyMWQ5ZmI2OGE0ZmY3NzYxNjYzN2U4MQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OWY3NTU3OGEyNDgyZjJiZjA4OWZjY2I2NWM4NTI1NzdkMjNiMjcyYzdkZjg5
|
10
|
+
NDMxMzY5MzQ0ZDdlNDc2NzE2NDRhMTc5OTc2OTI2NjFmMGQxZGY3NGUxZTJm
|
11
|
+
NmI2MWJiYzYwN2ZiOGRjNjQ0YmIwN2MwM2RjMDFjNWI2Mzk5NzQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YjU0NWMyMDdmZDdkYzc5MTQ5MWFjMGJiYjgxNTljMmVhOTM4YzMwNDNkYTgw
|
14
|
+
MTgzMGY0YmY3MDc5ZjA3YjlhMzFhZTU5NDIxMGMwODg1MGJkMGMyYjViZjE1
|
15
|
+
YTAyNTZiNzA2ODcwZTc4NzczODc5MDIzMDZhNGI5ZWYzNTc3YjE=
|
@@ -54,7 +54,9 @@ Caboose.Store.Modules.Product = (function() {
|
|
54
54
|
self.initalize_zoom = function(image_url) {
|
55
55
|
var big_image = $("#product-images").children("figure").first();
|
56
56
|
big_image.data("zoom-image",image_url);
|
57
|
-
|
57
|
+
if (typeof elevateZoom !== 'undefined') {
|
58
|
+
big_image.elevateZoom();
|
59
|
+
}
|
58
60
|
}
|
59
61
|
|
60
62
|
self.render_images = function(callback) {
|
@@ -442,3 +442,59 @@ Page Bar Generator
|
|
442
442
|
height: 0;
|
443
443
|
clear: both;
|
444
444
|
}
|
445
|
+
|
446
|
+
.caboose-btn {
|
447
|
+
background: #141516;
|
448
|
+
color: #f7f7f7;
|
449
|
+
text-align: center;
|
450
|
+
padding: 8px 15px 6px 15px;
|
451
|
+
height: auto;
|
452
|
+
display: inline-block;
|
453
|
+
margin: 0 auto;
|
454
|
+
font-size: 15px;
|
455
|
+
line-height: 18px;
|
456
|
+
cursor: pointer;
|
457
|
+
border: 1px solid #fff;
|
458
|
+
-webkit-border-radius: 5px;
|
459
|
+
-moz-border-radius: 5px;
|
460
|
+
border-width: 0;
|
461
|
+
-webkit-appearance: none;
|
462
|
+
border-radius: 5px;
|
463
|
+
text-decoration: none;
|
464
|
+
}
|
465
|
+
|
466
|
+
.caboose-btn-white, input[type="submit"], input[type="button"] {
|
467
|
+
background: #e3e3e3;
|
468
|
+
border: 1px solid #fff;
|
469
|
+
color: #141516;
|
470
|
+
text-align: center;
|
471
|
+
padding: 8px 15px 6px 15px;
|
472
|
+
height: auto;
|
473
|
+
display: inline-block;
|
474
|
+
margin: 0 auto;
|
475
|
+
font-size: 15px;
|
476
|
+
cursor: pointer;
|
477
|
+
-webkit-border-radius: 5px;
|
478
|
+
border-width: 0;
|
479
|
+
-webkit-appearance: none;
|
480
|
+
-moz-border-radius: 5px;
|
481
|
+
border-radius: 5px;
|
482
|
+
line-height: 18px;
|
483
|
+
text-decoration: none;
|
484
|
+
}
|
485
|
+
|
486
|
+
.caboose-btn:focus {
|
487
|
+
outline-width: 0;
|
488
|
+
}
|
489
|
+
|
490
|
+
.caboose-btn-white:focus, input[type="submit"]:focus, input[type="button"]:focus {
|
491
|
+
outline-width: 0;
|
492
|
+
}
|
493
|
+
|
494
|
+
.caboose-btn:hover {
|
495
|
+
background: #4f4448;
|
496
|
+
}
|
497
|
+
|
498
|
+
.caboose-btn-white:hover, input[type="submit"]:hover, input[type="button"]:hover {
|
499
|
+
background: #ccc;
|
500
|
+
}
|
@@ -71,6 +71,26 @@ module Caboose
|
|
71
71
|
@site = Site.find(params[:id])
|
72
72
|
end
|
73
73
|
|
74
|
+
# GET /admin/sites/:id/css
|
75
|
+
def admin_edit_css
|
76
|
+
return if !user_is_allowed('sites', 'edit')
|
77
|
+
if !@site.is_master
|
78
|
+
@error = "You are not allowed to manage sites."
|
79
|
+
render :file => 'caboose/extras/error' and return
|
80
|
+
end
|
81
|
+
@site = Site.find(params[:id])
|
82
|
+
end
|
83
|
+
|
84
|
+
# GET /admin/sites/:id/js
|
85
|
+
def admin_edit_js
|
86
|
+
return if !user_is_allowed('sites', 'edit')
|
87
|
+
if !@site.is_master
|
88
|
+
@error = "You are not allowed to manage sites."
|
89
|
+
render :file => 'caboose/extras/error' and return
|
90
|
+
end
|
91
|
+
@site = Site.find(params[:id])
|
92
|
+
end
|
93
|
+
|
74
94
|
# GET /admin/sites/:id/delete
|
75
95
|
def admin_delete_form
|
76
96
|
return if !user_is_allowed('sites', 'edit')
|
@@ -127,6 +147,8 @@ module Caboose
|
|
127
147
|
when 'under_construction_html' then site.under_construction_html = value
|
128
148
|
when 'use_store' then site.use_store = value
|
129
149
|
when 'use_retargeting' then site.use_retargeting = value
|
150
|
+
when 'custom_css' then site.custom_css = value
|
151
|
+
when 'custom_js' then site.custom_js = value
|
130
152
|
end
|
131
153
|
end
|
132
154
|
|
@@ -47,9 +47,11 @@ module Caboose
|
|
47
47
|
t = AuthorizeNet::Reporting::Transaction.new(sc.pp_username, sc.pp_password)
|
48
48
|
resp = t.get_transaction_details(ot.transaction_id)
|
49
49
|
t2 = resp.transaction
|
50
|
-
|
51
|
-
|
52
|
-
|
50
|
+
if t2
|
51
|
+
self.card_type = t2.payment_method.card_type.upcase
|
52
|
+
self.card_number = t2.payment_method.card_number.gsub('X', '')
|
53
|
+
end
|
54
|
+
|
53
55
|
end
|
54
56
|
|
55
57
|
end
|
@@ -130,7 +132,7 @@ module Caboose
|
|
130
132
|
if li.variant.product.option1 && li.variant.option1 then options += li.variant.product.option1 + ": " + li.variant.option1 + "\n" end
|
131
133
|
if li.variant.product.option2 && li.variant.option2 then options += li.variant.product.option2 + ": " + li.variant.option2 + "\n" end
|
132
134
|
if li.variant.product.option3 && li.variant.option3 then options += li.variant.product.option3 + ": " + li.variant.option3 + "\n" end
|
133
|
-
if li.variant.product.product_images.count > 0
|
135
|
+
if li.variant.product.product_images.count > 0 && li.variant.product.product_images.first.url(:tiny)
|
134
136
|
image = open("#{li.variant.product.product_images.first.url(:tiny)}")
|
135
137
|
else
|
136
138
|
image = ""
|
@@ -140,7 +142,11 @@ module Caboose
|
|
140
142
|
arr << { :content => package + "\n" + carrier + "\n" + service, :width => 115, :rowspan => (index == 0 ? pk.line_items.count : 1) }
|
141
143
|
end
|
142
144
|
|
143
|
-
|
145
|
+
if !image.blank?
|
146
|
+
arr << { :image => image, :fit => [40, 40], :borders => [:top, :bottom, :left], :width => 50 }
|
147
|
+
else
|
148
|
+
arr << { :content => "No Image" }
|
149
|
+
end
|
144
150
|
arr << { :content => "#{li.variant.product.title}\n#{li.variant.sku}", :borders => [:top, :right, :bottom], :width => 100 }
|
145
151
|
arr << { :content => options }
|
146
152
|
arr << { :content => "#{li.quantity}" , :align => :right }
|
@@ -158,7 +164,7 @@ module Caboose
|
|
158
164
|
if li.variant.product.option1 && li.variant.option1 then options += li.variant.product.option1 + ": " + li.variant.option1 + "\n" end
|
159
165
|
if li.variant.product.option2 && li.variant.option2 then options += li.variant.product.option2 + ": " + li.variant.option2 + "\n" end
|
160
166
|
if li.variant.product.option3 && li.variant.option3 then options += li.variant.product.option3 + ": " + li.variant.option3 + "\n" end
|
161
|
-
if li.variant.product.product_images.count > 0
|
167
|
+
if li.variant.product.product_images.count > 0 && li.variant.product.product_images.first.url(:tiny)
|
162
168
|
image = open("#{li.variant.product.product_images.first.url(:tiny)}")
|
163
169
|
else
|
164
170
|
image = ""
|
@@ -167,11 +173,19 @@ module Caboose
|
|
167
173
|
if index == 0
|
168
174
|
arr << { :content => "Unassigned", :width => 115, :rowspan => (index == 0 ? unassigned.count : 1) }
|
169
175
|
end
|
170
|
-
|
176
|
+
if !image.blank?
|
177
|
+
arr << { :image => image, :fit => [40, 40], :borders => [:top, :bottom, :left], :width => 50 }
|
178
|
+
else
|
179
|
+
arr << { :content => "No Image" }
|
180
|
+
end
|
171
181
|
arr << { :content => "#{li.variant.product.title}\n#{li.variant.sku}", :borders => [:top, :right, :bottom], :width => 100 }
|
172
182
|
arr << { :content => options }
|
173
183
|
arr << { :content => "#{li.quantity}" , :align => :right }
|
174
|
-
|
184
|
+
if li.unit_price
|
185
|
+
arr << { :content => "$" + sprintf("%.2f", li.unit_price) , :align => :right }
|
186
|
+
else
|
187
|
+
arr << { :content => "" }
|
188
|
+
end
|
175
189
|
arr << { :content => "$" + sprintf("%.2f", li.subtotal) , :align => :right }
|
176
190
|
tbl << arr
|
177
191
|
end
|
@@ -192,14 +206,34 @@ module Caboose
|
|
192
206
|
tbl2 = []
|
193
207
|
tbl3 = []
|
194
208
|
|
195
|
-
tbl2 << [
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
209
|
+
tbl2 << [
|
210
|
+
{ :content => "Card Type", :width => 127, :border_width => 0 },
|
211
|
+
{ :content => self.card_type.blank? ? "N/A" : self.card_type, :width => 128, :border_width => 0 }
|
212
|
+
]
|
213
|
+
tbl2 << [
|
214
|
+
{ :content => "Transaction ID", :width => 127, :border_width => 0 },
|
215
|
+
{ :content => trans.transaction_id.to_s, :width => 128, :border_width => 0 }
|
216
|
+
]
|
217
|
+
tbl2 << [
|
218
|
+
{ :content => "Gateway Response", :width => 127, :border_width => 0},
|
219
|
+
{ :content => trans.response_code.to_s, :width => 128, :border_width => 0 }
|
220
|
+
]
|
221
|
+
tbl3 << [
|
222
|
+
{ :content => "Card Number", :width => 127, :border_width => 0},
|
223
|
+
{ :content => self.card_number ? ("XXXX XXXX XXXX " + self.card_number) : "N/A", :width => 128, :border_width => 0 }
|
224
|
+
]
|
225
|
+
tbl3 << [
|
226
|
+
{ :content => "Transaction Time", :width => 127, :border_width => 0},
|
227
|
+
{ :content => trans.date_processed.strftime("%d %b %Y %H:%M:%S %p"), :width => 128, :border_width => 0 }
|
228
|
+
]
|
229
|
+
tbl3 << [
|
230
|
+
{ :content => "Payment Process", :width => 127, :border_width => 0},
|
231
|
+
{ :content => trans.success ? "Successful" : "Failed", :width => 128, :border_width => 0 }
|
232
|
+
]
|
233
|
+
tbl << [
|
234
|
+
{ :content => "Authorization Details", :colspan => 2, :font_style => :bold }
|
235
|
+
]
|
236
|
+
|
203
237
|
tbl << [
|
204
238
|
{ :content => tbl2, :width => 255 },
|
205
239
|
{ :content => tbl3, :width => 255 }
|
@@ -44,8 +44,10 @@ module Caboose
|
|
44
44
|
t = AuthorizeNet::Reporting::Transaction.new(sc.pp_username, sc.pp_password)
|
45
45
|
resp = t.get_transaction_details(ot.transaction_id)
|
46
46
|
t2 = resp.transaction
|
47
|
-
|
48
|
-
|
47
|
+
if t2
|
48
|
+
self.card_type = t2.payment_method.card_type.upcase
|
49
|
+
self.card_number = t2.payment_method.card_number.gsub('X', '')
|
50
|
+
end
|
49
51
|
end
|
50
52
|
end
|
51
53
|
|
@@ -133,7 +135,9 @@ module Caboose
|
|
133
135
|
if li.variant.product.option1 && li.variant.option1 then options += li.variant.product.option1 + ": " + li.variant.option1 + "\n" end
|
134
136
|
if li.variant.product.option2 && li.variant.option2 then options += li.variant.product.option2 + ": " + li.variant.option2 + "\n" end
|
135
137
|
if li.variant.product.option3 && li.variant.option3 then options += li.variant.product.option3 + ": " + li.variant.option3 + "\n" end
|
136
|
-
if li.variant.product.product_images.count > 0
|
138
|
+
if li.variant.product.product_images.count > 0 && li.variant.product.product_images.first.url(:tiny)
|
139
|
+
# Caboose.log("image path: #{li.variant.product.product_images.first.url(:tiny)}")
|
140
|
+
# image = ""
|
137
141
|
image = open("#{li.variant.product.product_images.first.url(:tiny)}")
|
138
142
|
else
|
139
143
|
image = ""
|
@@ -143,7 +147,11 @@ module Caboose
|
|
143
147
|
arr << { :content => package + "\n" + carrier + "\n" + service, :width => 115, :rowspan => (index == 0 ? pk.line_items.count : 1) }
|
144
148
|
end
|
145
149
|
|
146
|
-
|
150
|
+
if !image.blank?
|
151
|
+
arr << { :image => image, :fit => [40, 40], :borders => [:top, :bottom, :left], :width => 50 }
|
152
|
+
else
|
153
|
+
arr << { :content => "No Image" }
|
154
|
+
end
|
147
155
|
arr << { :content => "#{li.variant.product.title}\n#{li.variant.sku}", :borders => [:top, :right, :bottom], :width => 100 }
|
148
156
|
arr << { :content => options }
|
149
157
|
arr << { :content => "#{li.quantity}" , :align => :right }
|
@@ -161,7 +169,9 @@ module Caboose
|
|
161
169
|
if li.variant.product.option1 && li.variant.option1 then options += li.variant.product.option1 + ": " + li.variant.option1 + "\n" end
|
162
170
|
if li.variant.product.option2 && li.variant.option2 then options += li.variant.product.option2 + ": " + li.variant.option2 + "\n" end
|
163
171
|
if li.variant.product.option3 && li.variant.option3 then options += li.variant.product.option3 + ": " + li.variant.option3 + "\n" end
|
164
|
-
if li.variant.product.product_images.count > 0
|
172
|
+
if li.variant.product.product_images.count > 0 && li.variant.product.product_images.first.url(:tiny)
|
173
|
+
# Caboose.log("image path: #{li.variant.product.product_images.first.url(:tiny)}")
|
174
|
+
# image = ""
|
165
175
|
image = open("#{li.variant.product.product_images.first.url(:tiny)}")
|
166
176
|
else
|
167
177
|
image = ""
|
@@ -170,15 +180,23 @@ module Caboose
|
|
170
180
|
if index == 0
|
171
181
|
arr << { :content => "Unassigned", :width => 115, :rowspan => (index == 0 ? unassigned.count : 1) }
|
172
182
|
end
|
173
|
-
|
183
|
+
if !image.blank?
|
184
|
+
arr << { :image => image, :fit => [40, 40], :borders => [:top, :bottom, :left], :width => 50 }
|
185
|
+
else
|
186
|
+
arr << { :content => "No Image" }
|
187
|
+
end
|
174
188
|
arr << { :content => "#{li.variant.product.title}\n#{li.variant.sku}", :borders => [:top, :right, :bottom], :width => 100 }
|
175
189
|
arr << { :content => options }
|
176
190
|
arr << { :content => "#{li.quantity}" , :align => :right }
|
177
|
-
|
191
|
+
if li.unit_price
|
192
|
+
arr << { :content => "$" + sprintf("%.2f", li.unit_price) , :align => :right }
|
193
|
+
else
|
194
|
+
arr << { :content => "" }
|
195
|
+
end
|
178
196
|
arr << { :content => "$" + sprintf("%.2f", li.subtotal) , :align => :right }
|
179
197
|
tbl << arr
|
180
198
|
end
|
181
|
-
|
199
|
+
order.calculate
|
182
200
|
tbl << [{ :content => "Subtotal" , :colspan => 6, :align => :right }, { :content => "$" + sprintf("%.2f", order.subtotal ) , :align => :right }]
|
183
201
|
tbl << [{ :content => "Discount" , :colspan => 6, :align => :right }, { :content => "(-) $" + sprintf("%.2f", order.discount ? order.discount : 0.0 ) , :align => :right }]
|
184
202
|
tbl << [{ :content => "Shipping and Handling Charges" , :colspan => 6, :align => :right }, { :content => "(+) $" + sprintf("%.2f", order.shipping_and_handling ) , :align => :right }]
|
@@ -198,7 +216,7 @@ module Caboose
|
|
198
216
|
if trans
|
199
217
|
tbl2 << [
|
200
218
|
{ :content => "Card Type", :width => 127, :border_width => 0 },
|
201
|
-
{ :content => self.card_type, :width => 128, :border_width => 0 }
|
219
|
+
{ :content => self.card_type.blank? ? "N/A" : self.card_type, :width => 128, :border_width => 0 }
|
202
220
|
]
|
203
221
|
tbl2 << [
|
204
222
|
{ :content => "Transaction ID", :width => 127, :border_width => 0 },
|
@@ -210,7 +228,7 @@ module Caboose
|
|
210
228
|
]
|
211
229
|
tbl3 << [
|
212
230
|
{ :content => "Card Number", :width => 127, :border_width => 0},
|
213
|
-
{ :content => "XXXX XXXX XXXX " + self.card_number, :width => 128, :border_width => 0 }
|
231
|
+
{ :content => self.card_number ? ("XXXX XXXX XXXX " + self.card_number) : "N/A", :width => 128, :border_width => 0 }
|
214
232
|
]
|
215
233
|
tbl3 << [
|
216
234
|
{ :content => "Transaction Time", :width => 127, :border_width => 0},
|
@@ -568,14 +568,16 @@ class Caboose::Schema < Caboose::Utilities::Schema
|
|
568
568
|
[ :shipping_method_id , :integer ]
|
569
569
|
],
|
570
570
|
Caboose::Site => [
|
571
|
-
[ :name , :string
|
572
|
-
[ :description , :text
|
573
|
-
[ :under_construction_html , :text
|
574
|
-
[ :use_store , :boolean
|
571
|
+
[ :name , :string ],
|
572
|
+
[ :description , :text ],
|
573
|
+
[ :under_construction_html , :text ],
|
574
|
+
[ :use_store , :boolean , { :default => false }],
|
575
575
|
[ :logo , :attachment ],
|
576
|
-
[ :is_master , :boolean
|
577
|
-
[ :analytics_id , :string
|
578
|
-
[ :use_retargeting , :boolean
|
576
|
+
[ :is_master , :boolean , { :default => false }],
|
577
|
+
[ :analytics_id , :string ],
|
578
|
+
[ :use_retargeting , :boolean , { :default => false }],
|
579
|
+
[ :date_js_updated , :datetime ],
|
580
|
+
[ :date_css_updated , :datetime ]
|
579
581
|
],
|
580
582
|
Caboose::SiteMembership => [
|
581
583
|
[ :site_id , :integer ],
|
data/app/models/caboose/site.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'httparty'
|
1
2
|
|
2
3
|
class Caboose::Site < ActiveRecord::Base
|
3
4
|
self.table_name = "sites"
|
@@ -51,4 +52,52 @@ class Caboose::Site < ActiveRecord::Base
|
|
51
52
|
Caboose::Domain.where(:site_id => self.id, :primary => true).first
|
52
53
|
end
|
53
54
|
|
55
|
+
def custom_js_url
|
56
|
+
url = "http://#{Caboose::cdn_domain}/assets/#{self.name}/js/custom.js"
|
57
|
+
url << "?#{self.date_js_updated.strftime('%Y%m%d%H%M%S')}" if self.date_js_updated
|
58
|
+
return url
|
59
|
+
end
|
60
|
+
|
61
|
+
def custom_css_url
|
62
|
+
url = "http://#{Caboose::cdn_domain}/assets/#{self.name}/css/custom.css"
|
63
|
+
url << "?#{self.date_css_updated.strftime('%Y%m%d%H%M%S')}" if self.date_css_updated
|
64
|
+
return url
|
65
|
+
end
|
66
|
+
|
67
|
+
def custom_js
|
68
|
+
resp = HTTParty.get(self.custom_js_url)
|
69
|
+
if resp.nil? || resp.code.to_i == 403
|
70
|
+
self.custom_js = ""
|
71
|
+
return ""
|
72
|
+
end
|
73
|
+
return resp.body
|
74
|
+
end
|
75
|
+
|
76
|
+
def custom_css
|
77
|
+
resp = HTTParty.get(self.custom_css_url)
|
78
|
+
if resp.nil? || resp.code.to_i == 403
|
79
|
+
self.custom_css = ""
|
80
|
+
return ""
|
81
|
+
end
|
82
|
+
return resp.body
|
83
|
+
end
|
84
|
+
|
85
|
+
def custom_js=(str)
|
86
|
+
config = YAML.load(File.read(Rails.root.join('config', 'aws.yml')))[Rails.env]
|
87
|
+
AWS.config(:access_key_id => config['access_key_id'], :secret_access_key => config['secret_access_key'])
|
88
|
+
bucket = AWS::S3.new.buckets[config['bucket']]
|
89
|
+
bucket.objects["assets/#{self.name}/js/custom.js"].write(str, :acl => 'public-read')
|
90
|
+
self.date_js_updated = DateTime.now.utc
|
91
|
+
self.save
|
92
|
+
end
|
93
|
+
|
94
|
+
def custom_css=(str)
|
95
|
+
config = YAML.load(File.read(Rails.root.join('config', 'aws.yml')))[Rails.env]
|
96
|
+
AWS.config(:access_key_id => config['access_key_id'], :secret_access_key => config['secret_access_key'])
|
97
|
+
bucket = AWS::S3.new.buckets[config['bucket']]
|
98
|
+
bucket.objects["assets/#{self.name}/css/custom.css"].write(str, :acl => 'public-read')
|
99
|
+
self.date_css_updated = DateTime.now.utc
|
100
|
+
self.save
|
101
|
+
end
|
102
|
+
|
54
103
|
end
|
@@ -121,7 +121,7 @@ function delete_calendar(calendar_id, confirm)
|
|
121
121
|
|
122
122
|
#calendar table { border-collapse: collapse; width: 95%; }
|
123
123
|
#calendar th { border: #666 1px solid; background: #666; color: #fff; margin: 0; padding: 4px 8px; }
|
124
|
-
#calendar td { border: #666 1px solid; position: relative; margin: 0; padding: 0; width: 14%; height: 100px; vertical-align: top; }
|
124
|
+
#calendar td { border: #666 1px solid; position: relative; margin: 0; padding: 0; width: 14%; height: 100px; cursor: pointer;vertical-align: top; }
|
125
125
|
#calendar td.blank { background: #efefef; border: #666 1px solid; }
|
126
126
|
#calendar td.over { background: #ffcc99; }
|
127
127
|
#calendar td span.day { display: block; float: left; border-right: #666 1px solid; border-bottom: #666 1px solid; width: 20px; text-align: center; }
|
@@ -5,7 +5,7 @@
|
|
5
5
|
<input type='submit' value='Search' />
|
6
6
|
</form>
|
7
7
|
|
8
|
-
<p><a href='/admin/calendars/new' id='new_calendar'>New Calendar</a></p>
|
8
|
+
<p><a href='/admin/calendars/new' id='new_calendar' class="caboose-btn-white">New Calendar</a></p>
|
9
9
|
|
10
10
|
<form action='/admin/calendars' method='post' id='new_calendar_form'>
|
11
11
|
<input type='hidden' name='authenticity_token' value='<%= form_authenticity_token %>'>
|
@@ -5,9 +5,9 @@
|
|
5
5
|
</style>
|
6
6
|
|
7
7
|
<p>
|
8
|
-
<a href='#' onclick="$('#search_form').toggle(400, function() { modal.autosize(); });">Show/hide search form</a>
|
9
|
-
<a href='/admin/orders/new'>New Manual Order</a>
|
10
|
-
<a href='/admin/orders/print-pending' target='_blank'>Print Pending Orders</a>
|
8
|
+
<a class="caboose-btn" href='#' onclick="$('#search_form').toggle(400, function() { modal.autosize(); });">Show/hide search form</a>
|
9
|
+
<a class="caboose-btn" href='/admin/orders/new'>New Manual Order</a>
|
10
|
+
<a class="caboose-btn" href='/admin/orders/print-pending' target='_blank'>Print Pending Orders</a>
|
11
11
|
</p>
|
12
12
|
<form action='/admin/orders' method='get' id='search_form' style='display: none;'>
|
13
13
|
<p><input type='text' name='id' placeholder='Order ID' value="<%= @pager.params['id'] %>" style='width: 100px;' /></p>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<h1>Pages</h1>
|
2
2
|
|
3
3
|
<% if @domain %>
|
4
|
-
<p><a href='/admin/pages/new'>New Page</a></p>
|
4
|
+
<p><a href='/admin/pages/new' class="caboose-btn-white">New Page</a></p>
|
5
5
|
<%= raw pages_list(@home_page) %>
|
6
6
|
<% else %>
|
7
7
|
<p>It doesn't look like this site is configured for the current domain. Please <a href='/admin/sites'>configure your sites</a>.</p>
|
@@ -1,12 +1,19 @@
|
|
1
1
|
<% content_for :caboose_css do %>
|
2
2
|
<%= stylesheet_link_tag "caboose/admin_products" %>
|
3
|
+
<style>
|
4
|
+
#product-title {
|
5
|
+
font-size: 24px !important;
|
6
|
+
height: auto !important;
|
7
|
+
padding: 10px 2% !important;
|
8
|
+
}
|
9
|
+
</style>
|
3
10
|
<% end %>
|
4
11
|
<% content_for :caboose_js do %>
|
5
12
|
<%= javascript_include_tag "caboose/model/all" %>
|
6
13
|
<%= javascript_include_tag "caboose/admin_products" %>
|
7
14
|
<% end %>
|
8
15
|
|
9
|
-
<h1>Edit Product - <%= @product.title %></h1>
|
16
|
+
<h1 id="product-title">Edit Product - <%= @product.title %></h1>
|
10
17
|
<ul id='tabs'>
|
11
18
|
<%
|
12
19
|
tabs = {
|
@@ -27,6 +34,6 @@ tabs["/admin/products/#{@product.id}/delete" ] = 'Delete Product'
|
|
27
34
|
<% tabs.each do |href,text| %>
|
28
35
|
<li<%= raw request.fullpath == href ? " class='selected'" : '' %>><a href='<%= href %>'><%= raw text %></a></li>
|
29
36
|
<% end %>
|
30
|
-
<li class='back'><input type='button' value='< Back' onclick="window.location='/admin/products';" /></li>
|
37
|
+
<li class='back'><input type='button' class="caboose-btn" value='< Back' onclick="window.location='/admin/products';" /></li>
|
31
38
|
</ul>
|
32
|
-
<div id='content2'>
|
39
|
+
<div id='content2'>
|
@@ -26,6 +26,8 @@
|
|
26
26
|
tabs = {
|
27
27
|
'General' => "/admin/sites/#{@site.id}",
|
28
28
|
'Block Types' => "/admin/sites/#{@site.id}/block-types",
|
29
|
+
'Custom CSS' => "/admin/sites/#{@site.id}/css",
|
30
|
+
'Custom JS' => "/admin/sites/#{@site.id}/js",
|
29
31
|
'Retargeting' => "/admin/sites/#{@site.id}/retargeting",
|
30
32
|
'Delete Site' => "/admin/sites/#{@site.id}/delete"
|
31
33
|
}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
|
2
|
+
<%= render :partial => 'caboose/sites/admin_header' %>
|
3
|
+
|
4
|
+
<p><div id='site_<%= @site.id %>_custom_css' ></div></p>
|
5
|
+
|
6
|
+
<%= render :partial => 'caboose/sites/admin_footer' %>
|
7
|
+
|
8
|
+
<% content_for :caboose_js do %>
|
9
|
+
<script type="text/javascript">
|
10
|
+
|
11
|
+
$(document).ready(function() {
|
12
|
+
new ModelBinder({
|
13
|
+
name: 'Site',
|
14
|
+
id: <%= @site.id %>,
|
15
|
+
update_url: '/admin/sites/<%= @site.id %>',
|
16
|
+
authenticity_token: '<%= form_authenticity_token %>',
|
17
|
+
attributes: [
|
18
|
+
{ name: 'custom_css', nice_name: 'Custom CSS', type: 'textarea' , value: <%= raw Caboose.json(@site.custom_css) %>, width: 600, height: 200 }
|
19
|
+
]
|
20
|
+
});
|
21
|
+
});
|
22
|
+
|
23
|
+
</script>
|
24
|
+
<% end %>
|
@@ -0,0 +1,24 @@
|
|
1
|
+
|
2
|
+
<%= render :partial => 'caboose/sites/admin_header' %>
|
3
|
+
|
4
|
+
<p><div id='site_<%= @site.id %>_custom_js' ></div></p>
|
5
|
+
|
6
|
+
<%= render :partial => 'caboose/sites/admin_footer' %>
|
7
|
+
|
8
|
+
<% content_for :caboose_js do %>
|
9
|
+
<script type="text/javascript">
|
10
|
+
|
11
|
+
$(document).ready(function() {
|
12
|
+
new ModelBinder({
|
13
|
+
name: 'Site',
|
14
|
+
id: <%= @site.id %>,
|
15
|
+
update_url: '/admin/sites/<%= @site.id %>',
|
16
|
+
authenticity_token: '<%= form_authenticity_token %>',
|
17
|
+
attributes: [
|
18
|
+
{ name: 'custom_js', nice_name: 'Custom Javascript', type: 'textarea' , value: <%= raw Caboose.json(@site.custom_js) %>, width: 600, height: 200 }
|
19
|
+
]
|
20
|
+
});
|
21
|
+
});
|
22
|
+
|
23
|
+
</script>
|
24
|
+
<% end %>
|
@@ -15,8 +15,8 @@
|
|
15
15
|
<div id='top_nav'>
|
16
16
|
<div class='caboose_logo'></div>
|
17
17
|
<ul>
|
18
|
-
<li class='back' ><a href='/'><span><< Back to Site</span></a></li>
|
19
|
-
<li class='cpanel' ><a href='/station' id='caboose_station' class='caboose_modal'><span>Menu</span></a></li>
|
18
|
+
<li class='back' ><a href='/' class="caboose-btn"><span><< Back to Site</span></a></li>
|
19
|
+
<li class='cpanel' ><a href='/station' id='caboose_station' class='caboose_modal caboose-btn'><span>Menu</span></a></li>
|
20
20
|
</ul>
|
21
21
|
</div>
|
22
22
|
</div>
|
@@ -5,14 +5,16 @@
|
|
5
5
|
<script>window.loggedIn = <%= logged_in?.to_json %></script>
|
6
6
|
<% Caboose::javascripts.each do |js| %><%= javascript_include_tag(js) %><% end %>
|
7
7
|
<% @page.linked_resources_map[:js].each do |r| %><%= javascript_include_tag r %><% end %>
|
8
|
+
<% if @site.date_js_updated %><script type='text/javascript' src="<%= raw @site.custom_js_url %>"></script><% end %>
|
8
9
|
<% if @page.custom_js && @page.custom_js.strip.length > 0 %><script type='text/javascript'><%= raw @page.custom_js %></script><% end %>
|
9
10
|
<%= yield :caboose_js %>
|
10
|
-
<% end %>
|
11
|
+
<% end %>
|
11
12
|
<% content_for :css do %>
|
12
13
|
<%= stylesheet_link_tag 'caboose/application' %>
|
13
14
|
<%= stylesheet_link_tag @site.name == 'application' ? 'application' : "#{@site.name}/css/application" %>
|
14
15
|
<% Caboose::stylesheets.each do |css| %><%= stylesheet_link_tag(css) %><% end %>
|
15
16
|
<% @page.linked_resources_map[:css].each do |r| %><%= stylesheet_link_tag r %><% end %>
|
17
|
+
<% if @site.date_css_updated %><link rel='stylesheet' type='text/css' url="<%= raw @site.custom_css_url %>" /><% end %>
|
16
18
|
<% if @page.custom_css && @page.custom_css.strip.length > 0 %><style><%= raw @page.custom_css %></style><% end %>
|
17
19
|
<%= yield :caboose_css %>
|
18
20
|
<% end %>
|
data/config/routes.rb
CHANGED
@@ -62,6 +62,8 @@ Caboose::Engine.routes.draw do
|
|
62
62
|
|
63
63
|
get "admin/sites/options" => "sites#options"
|
64
64
|
get "admin/sites/new" => "sites#admin_new"
|
65
|
+
get "admin/sites/:id/css" => "sites#admin_edit_css"
|
66
|
+
get "admin/sites/:id/js" => "sites#admin_edit_js"
|
65
67
|
get "admin/sites/:id/block-types" => "sites#admin_edit_block_types"
|
66
68
|
get "admin/sites/:id/delete" => "sites#admin_delete_form"
|
67
69
|
get "admin/sites/:id" => "sites#admin_edit"
|
data/lib/caboose/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.195
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- William Barry
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pg
|
@@ -873,6 +873,8 @@ files:
|
|
873
873
|
- app/views/caboose/sites/admin_delete_form.html.erb
|
874
874
|
- app/views/caboose/sites/admin_edit.html.erb
|
875
875
|
- app/views/caboose/sites/admin_edit_block_types.html.erb
|
876
|
+
- app/views/caboose/sites/admin_edit_css.html.erb
|
877
|
+
- app/views/caboose/sites/admin_edit_js.html.erb
|
876
878
|
- app/views/caboose/sites/admin_index.html.erb
|
877
879
|
- app/views/caboose/sites/admin_new.html.erb
|
878
880
|
- app/views/caboose/smtp/admin_edit.html.erb
|