caboose-cms 0.5.206 → 0.5.207

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,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- N2M0YTMyOGU2NDBhZDA1NTMxNGI3MmM0MDBmNzkxY2VlZThlYTZhMg==
4
+ ZDE5MGUxOTBmNjdmM2Y3NmY1YTg1Nzc4NDVlZjNjYWM3YjU2NDY4NQ==
5
5
  data.tar.gz: !binary |-
6
- YjE3ZDBhZjlkOTQxZjBlZDAxNWExYTM2M2MzOTFlMTkwYzM2OTlkMw==
6
+ NDBiNmZlNzMxYjk2ZjJiMmY2NTBkMzY3OGE2ZGE0ZWNkNDQwYzUzYg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- M2MwNmI0Zjg1ZjFjMWUyYTlmY2JlMjhjZWFiYzViNGNkYzAzZGVjMTYxZmQx
10
- MDY1ZTBmNWRiMWIyYjU2ZjZiYzY4M2M0YWRkMGZiZmE1ZGJiNzUyYzdjODQ3
11
- ODYyZmIxZGFiZDg5MWE0YjJjYzg0ODQwMGY5MjljZjY4NTM2NDU=
9
+ NWUwZTE2MzZhNzhlZWE0OGU4NWYwYzliMDI4NzZmNGQ3OTMxZTk4ZDEwMWIx
10
+ ZjMzOWUxYTVmMzUwZWY0NDcxODc3OGFkY2I0YzhkYWE2NDQ2OWFhMDQyMDkz
11
+ ZmRlMmYzNzI1MGVlNTQ1NzhhZTFiYjNkMGFjZTUyMzZhNWY2ODI=
12
12
  data.tar.gz: !binary |-
13
- N2YyZDU1MTVlZGU1MWRmZThjYTI5OWZlODcyOGZkNGZkMDM4NzgyNTRjNzQy
14
- NDM4MDcyMTdjMzZiYjI0OThlYWY4MzdhYzMzNWUwMDA3ODYyMzc4NDQ5MWU0
15
- Yjg4ODA5MDFlYzBhYWMyNTA3Yzk1ZDM2ZmQ1NDVlZGMzNmQwNmE=
13
+ MWYzYzdiZTdhNjBlZjM5NDc5Yjc0MTBhOTZlOTgyNjhlZjA0M2FkMTJmZjIx
14
+ NDg0MjBlMjQ2NDNlOTBjMGE3YjdhNWMzNGVjYmEyZTljNjViYzQ1MDIzYzI0
15
+ ZjY1MmUwZjRkOWI0N2MxZDFkMzYxMTY4MTE5YzYyNTc5NGE4ZTM=
@@ -0,0 +1,372 @@
1
+ html { width: 100%; }
2
+
3
+ @font-face {
4
+ font-family: 'Avenir';
5
+ src: url('//d1ygukj37mahb2.cloudfront.net/assets/avenir-medium.eot');
6
+ src: url('//d1ygukj37mahb2.cloudfront.net/assets/avenir-medium.eot') format('embedded-opentype'),
7
+ url('//d1ygukj37mahb2.cloudfront.net/assets/avenir-medium.woff') format('woff'),
8
+ url('//d1ygukj37mahb2.cloudfront.net/assets/avenir-medium.ttf') format('truetype'),
9
+ url('//d1ygukj37mahb2.cloudfront.net/assets/avenir-medium.svg') format('svg');
10
+ font-weight: normal;
11
+ font-style: normal;
12
+ }
13
+
14
+ body {
15
+ background: #111111;
16
+ margin: 0;
17
+ padding: 0;
18
+ color: #fff;
19
+ width: 100%;
20
+ font-family: "Avenir", Arial;
21
+ }
22
+
23
+ #modal_wrapper {
24
+ width: 100%;
25
+ position: relative;
26
+ }
27
+
28
+ #modal_content {
29
+ width: 100%;
30
+ max-width: 100%;
31
+ padding: 0;
32
+ }
33
+
34
+ #modal_content h1 {
35
+ margin: 0 0 12px 0;
36
+ padding: 0;
37
+ font-weight: normal;
38
+ background: #111111;
39
+ }
40
+
41
+ #modal_content a {
42
+ color: #ccc;
43
+ text-decoration: none;
44
+ border-bottom: #999 1px dotted;
45
+ }
46
+
47
+ #modal_content p.loading {
48
+ background-image: url('/assets/caboose/loading_white_on_black.gif');
49
+ background-position: 0 center;
50
+ background-repeat: no-repeat;
51
+ color: #ccc;
52
+ font-weight: normal;
53
+ font-size: 16pt;
54
+ padding: 10px 10px 10px 40px;
55
+ }
56
+
57
+ #modal_content div.yesnobox {
58
+ position: absolute;
59
+ top: 0;
60
+ left: 0;
61
+ z-index: 22;
62
+ background-color: rgba(0, 0, 0, 0.9);
63
+ font-size: 20px;
64
+ text-align: center;
65
+ }
66
+
67
+ #modal_content div.yesnobox div {
68
+ padding: 20px;
69
+ }
70
+
71
+ #modal_content div.yesnobox input {
72
+ width: auto;
73
+ }
74
+
75
+ div.model_attribute_text {
76
+ color: #000;
77
+ }
78
+
79
+ #modal_content div.top_right_controls {
80
+ position: absolute;
81
+ top: 0;
82
+ right: 0;
83
+ }
84
+
85
+ #modal_content div.top_right_controls a {
86
+ display: inline-block;
87
+ margin: 0;
88
+ padding: 4px 8px;
89
+ }
90
+
91
+ input, select, textarea {
92
+ font-family: "Avenir", Arial;
93
+ border: 2px solid #ccc;
94
+ background: #000;
95
+ color: #fff;
96
+ /*
97
+ -moz-border-radius: 2px;
98
+ -webkit-border-radius: 2px;
99
+ border-radius: 2px; */
100
+ padding: 4px 8px;
101
+ height: 34px;
102
+ font-size: 20px;
103
+ z-index: 20;
104
+ }
105
+
106
+ input.dirty,
107
+ textarea.dirty {
108
+ background: #fff799;
109
+ color: #000;
110
+ }
111
+
112
+ select {
113
+ padding: 0;
114
+ height: 44px;
115
+ }
116
+
117
+ option {
118
+
119
+ }
120
+
121
+ select.fake {
122
+ background: transparent;
123
+ position: absolute;
124
+ top: 0;
125
+ left: 0;
126
+ color: transparent;
127
+ }
128
+
129
+ select.fake option {
130
+ background: #fff;
131
+ color: #000;
132
+ }
133
+
134
+ #modal_content .bound_input_check a,
135
+ #modal_content .bound_input_cancel a {
136
+ border: 1px solid #ccc;
137
+ -moz-border-radius: 2px;
138
+ -webkit-border-radius: 2px;
139
+ border-radius: 2px;
140
+
141
+ font-size: 28px;
142
+ text-align: center;
143
+ background: #00cc00;
144
+ color: #fff;
145
+
146
+ display: block;
147
+ padding: 4px 0;
148
+ height: 34px;
149
+ }
150
+
151
+ #modal_content .bound_input_check a.loading {
152
+ background-image: url(/assets/caboose/loading_green.gif);
153
+ background-color: #00cc00;
154
+ background-repeat: no-repeat;
155
+ background-position: 6px 5px;
156
+ color: rgba(255, 255, 255, 0.0);
157
+ }
158
+
159
+ #modal_content .bound_textarea_controls a {
160
+ display: inline-block;
161
+ margin: 3px 0 0 1px;
162
+ padding: 8px 0 6px 0;
163
+ background: #ccc;
164
+ color: #000;
165
+ text-align: center;
166
+ border: #666 1px solid;
167
+ }
168
+
169
+ #modal_content .bound_textarea_controls a.save { width: 60px; }
170
+ #modal_content .bound_textarea_controls a.discard { width: 80px; }
171
+
172
+ #modal_content .note,
173
+ #modal_content .error {
174
+ margin: 0;
175
+ }
176
+
177
+ #modal_content .placeholder {
178
+ display: block;
179
+ margin: 0;
180
+ padding: 0 5px 0 0;
181
+ height: 34px;
182
+
183
+ position: absolute;
184
+ top: 12px;
185
+ left: 10px;
186
+ z-index: 19;
187
+ }
188
+
189
+ #modal_content .placeholder span {
190
+ display: block;
191
+ font-size: 20px;
192
+ color: #757575;
193
+ }
194
+
195
+ #modal_content input[type='checkbox'] {
196
+ /*position: absolute;*/
197
+ top: 4px;
198
+ left: 0;
199
+ z-index: 19;
200
+
201
+ margin: 0;
202
+ padding: 0;
203
+ width: 20px;
204
+ }
205
+
206
+ #modal_content .search_form {
207
+ position: absolute;
208
+ top: 0;
209
+ right: 0;
210
+ }
211
+
212
+ #modal_content table.data {
213
+ border-collapse: collapse;
214
+ }
215
+
216
+ #modal_content table.data th {
217
+ background: #000;
218
+ border: #333 1px solid;
219
+ color: #efefef;
220
+ margin: 0;
221
+ padding: 0;
222
+ }
223
+
224
+ #modal_content table.data th a {
225
+ display: block;
226
+ text-decoration: none;
227
+ border: none;
228
+ color: #fff;
229
+ padding: 8px 12px;
230
+ }
231
+
232
+ #modal_content table.data th a:hover {
233
+ color: #fff;
234
+ background: #333;
235
+ }
236
+
237
+ #modal_content table.data td {
238
+ background: #111111;
239
+ border: #333 1px solid;
240
+ color: #fff;
241
+ margin: 0;
242
+ padding: 8px 12px;
243
+ }
244
+
245
+ #modal_content table.data tr:nth-child(even) td {
246
+ background-color: #000;
247
+ }
248
+
249
+
250
+ #modal_content table.data tr:nth-child(odd) td {
251
+ background-color: transparent;
252
+ }
253
+
254
+ #modal_content table.data tr:hover td,
255
+ #modal_content table.data tr:nth-child(even):hover td,
256
+ #modal_content table.data tr:nth-child(odd):hover td {
257
+ background: #333;
258
+ color: #fff;
259
+ }
260
+
261
+ /*******************************************************************************
262
+ Modeljs
263
+ *******************************************************************************/
264
+
265
+ #modal_content div.model_attribute_text {
266
+ color: #fff;
267
+ }
268
+
269
+ #modal_content .model_attribute {
270
+ background: none repeat scroll 0 0 transparent;
271
+ display: block;
272
+ padding: 2px 4px;
273
+ text-decoration: none;
274
+ }
275
+
276
+ #modal_content .clear {
277
+ clear: both;
278
+ line-height: 0;
279
+ }
280
+
281
+ /*******************************************************************************
282
+ Message boxes
283
+ *******************************************************************************/
284
+
285
+ #modal_content .note {
286
+ padding: 20px;
287
+ background: #fef49c;
288
+ color: #000000;
289
+ font-weight: bold;
290
+ font-size: 1.4em;
291
+ }
292
+
293
+ #modal_content .note_small {
294
+ display: block;
295
+ padding: 4px 10px;
296
+ background: #fef49c;
297
+ color: #000000;
298
+ font-size: 1em;
299
+ }
300
+
301
+ #modal_content .error {
302
+ background: #9c171b;
303
+ color: #ffffff;
304
+ }
305
+
306
+ #modal_content .error a {
307
+ color: #fff;
308
+ }
309
+
310
+ #modal_content .error a:hover {
311
+ color: #000;
312
+ }
313
+
314
+ #modal_content .success {
315
+ background: #009900;
316
+ color: #ffffff;
317
+ }
318
+
319
+ #modal_content .success a {
320
+ color: #ffffff;
321
+ }
322
+
323
+ #cboxTopLeft,
324
+ #cboxTopRight,
325
+ #cboxBottomLeft,
326
+ #cboxBottomRight,
327
+ #cboxMiddleLeft,
328
+ #cboxMiddleRight,
329
+ #cboxTopCenter,
330
+ #cboxBottomCenter,
331
+ #cboxClose { background: #111 !important; }
332
+
333
+ /*******************************************************************************
334
+ Page Bar Generator
335
+ *******************************************************************************/
336
+
337
+ .page_links {
338
+
339
+ }
340
+
341
+ .page_links a {
342
+ display: inline-block;
343
+ margin: 0 2px;
344
+ padding: 5px 8px 3px 8px;
345
+
346
+ border: #505050 1px solid;
347
+ background: #000;
348
+ color: #505050;
349
+ text-decoration: none;
350
+ }
351
+
352
+ .page_links a:hover {
353
+ background: #505050;
354
+ color: #fff;
355
+ }
356
+
357
+ .page_links .middle_links a {
358
+
359
+ }
360
+
361
+ .page_links span.current_page {
362
+ display: inline-block;
363
+ padding: 5px 8px 3px 8px;
364
+
365
+ border: #ccc 1px solid;
366
+ background: #ccc;
367
+ color: #000;
368
+ text-decoration: none;
369
+ }
370
+
371
+ #search_form input[type='text'] { height: 20px; padding: 6px 12px; }
372
+ #search_form input[type='submit'] { height: 35px; padding: 0 12px; }
@@ -0,0 +1,48 @@
1
+ module Caboose
2
+ class FontsController < ApplicationController
3
+ layout 'caboose/admin'
4
+
5
+ # GET /admin/fonts
6
+ def admin_index
7
+ @hf = Font.where(:site_id => @site.id, :name => "heading-font").last
8
+ if !@hf then @hf = Font.create(:site_id => @site.id, :name => "heading-font", :family => "Open Sans", :variant => "600", :url => "http://fonts.gstatic.com/s/opensans/v13/MTP_ySUJH_bn48VBG8sNSi3USBnSvpkopQaUR-2r7iU.ttf") end
9
+ @bf = Font.where(:site_id => @site.id, :name => "body-font").last
10
+ if !@bf then @bf = Font.create(:site_id => @site.id, :name => "body-font", :family => "Open Sans", :variant => "regular", :url => "http://fonts.gstatic.com/s/opensans/v13/IgZJs4-7SA1XX_edsoXWog.ttf") end
11
+ @bfb = Font.where(:site_id => @site.id, :name => "body-font-bold").last
12
+ if !@bfb then @bfb = Font.create(:site_id => @site.id, :name => "body-font-bold", :family => "Open Sans", :variant => "600", :url => "http://fonts.gstatic.com/s/opensans/v13/MTP_ySUJH_bn48VBG8sNSi3USBnSvpkopQaUR-2r7iU.ttf") end
13
+ @bfi = Font.where(:site_id => @site.id, :name => "body-font-italic").last
14
+ if !@bfi then @bfi = Font.create(:site_id => @site.id, :name => "body-font-italic", :family => "Open Sans", :variant => "italic", :url => "http://fonts.gstatic.com/s/opensans/v13/O4NhV7_qs9r9seTo7fnsVKCWcynf_cDxXwCLxiixG1c.ttf") end
15
+ @bfbi = Font.where(:site_id => @site.id, :name => "body-font-bold-italic").last
16
+ if !@bfbi then @bfbi = Font.create(:site_id => @site.id, :name => "body-font-bold-italic", :family => "Open Sans", :variant => "600italic", :url => "http://fonts.gstatic.com/s/opensans/v13/PRmiXeptR36kaC0GEAetxpZ7xm-Bj30Bj2KNdXDzSZg.ttf") end
17
+ @btn = Font.where(:site_id => @site.id, :name => "button-font").last
18
+ if !@btn then @btn = Font.create(:site_id => @site.id, :name => "button-font", :family => "Open Sans", :variant => "regular", :url => "http://fonts.gstatic.com/s/opensans/v13/IgZJs4-7SA1XX_edsoXWog.ttf") end
19
+ end
20
+
21
+ # PUT /admin/fonts
22
+ def admin_update
23
+ resp = StdClass.new
24
+ family = params[:family]
25
+ name = params[:name]
26
+ url = params[:url]
27
+ variant = params[:variant]
28
+
29
+ if !family.blank? && !name.blank? && !url.blank? && !variant.blank?
30
+ font = Font.where(:site_id => @site.id, :name => name).last
31
+ if font
32
+ font.family = family
33
+ font.url = url
34
+ font.variant = variant
35
+ font.save
36
+ resp.success = "Font saved!"
37
+ else
38
+ resp.error = "Font doesn't exist yet"
39
+ end
40
+ else
41
+ resp.error = "Error saving font"
42
+ end
43
+ render :json => resp
44
+
45
+ end
46
+
47
+ end
48
+ end
@@ -0,0 +1,108 @@
1
+ module Caboose
2
+ class ModificationValueInputFieldsController < Caboose::ApplicationController
3
+
4
+ # GET /admin/products/:product_id/modifications/:mod_id/values/:mod_value_id/input-fields/json
5
+ def admin_json
6
+ return if !user_is_allowed('products', 'view')
7
+
8
+ mv = ModificationValue.find(params[:mod_value_id])
9
+ render :json => mv.input_fields
10
+ end
11
+
12
+ # GET /admin/products/:product_id/modifications/:mod_id/values/:mod_value_id/input-fields/:id/json
13
+ def admin_json_single
14
+ ip = ModificationValueInputField.find(params[:id])
15
+ render :json => ip
16
+ end
17
+
18
+ # GET /admin/products/:product_id/modifications/:mod_id/values/:mod_value_id/input-fields/:id
19
+ def admin_edit
20
+ return if !user_is_allowed('products', 'edit')
21
+ @product = Product.find(params[:product_id])
22
+ @modification = Modification.find(params[:mod_id])
23
+ @modification_value_input_field = ModificationValueInputField.find(params[:id])
24
+ render :layout => 'caboose/modal'
25
+ end
26
+
27
+ # PUT /admin/products/:product_id/modifications/:mod_id/values/:mod_value_id/input-fields/:id
28
+ def admin_update
29
+ return if !user_is_allowed('products', 'edit')
30
+
31
+ resp = Caboose::StdClass.new
32
+ ip = ModificationValueInputField.find(params[:id])
33
+
34
+ save = true
35
+ params.each do |name,value|
36
+ case name
37
+ when 'sort_order' then ip.sort_order = value
38
+ when 'name' then ip.name = value
39
+ when 'description' then ip.description = value
40
+ when 'field_type' then ip.field_type = value
41
+ when 'default_value' then ip.default_value = value
42
+ when 'width' then ip.width = value
43
+ when 'height' then ip.height = value
44
+ when 'options' then ip.options = value
45
+ when 'options_url' then ip.options_url = value
46
+ end
47
+ end
48
+ resp.success = save && ip.save
49
+ render :json => resp
50
+ end
51
+
52
+ # POST /admin/products/:product_id/modifications/:mod_id/values/:mod_value_id/input-fields
53
+ def admin_add
54
+ return if !user_is_allowed('products', 'add')
55
+
56
+ resp = Caboose::StdClass.new
57
+ name = params[:name]
58
+
59
+ if name.length == 0
60
+ resp.error = "The name cannot be empty."
61
+ elsif ModificationValueInputField.where(:modification_value_id => params[:mod_value_id], :name => name).exists?
62
+ resp.error = "An input field with that name already exists for this modification value."
63
+ else
64
+ last_ip = ModificationValueInputField.where(:modification_value_id => params[:mod_value_id]).reorder("sort_order desc").limit(1).first
65
+ sort_order = last_ip ? last_ip.sort_order + 1 : 0
66
+ ip = ModificationValueInputField.new(:modification_value_id => params[:mod_value_id], :name => name, :sort_order => sort_order)
67
+ ip.save
68
+ resp.success = true
69
+ end
70
+ render :json => resp
71
+ end
72
+
73
+ # DELETE /admin/products/:product_id/modifications/:mod_id/values/:mod_value_id/input-fields/:id
74
+ def admin_delete
75
+ return if !user_is_allowed('products', 'delete')
76
+ ip = ModificationValueInputField.find(params[:id]).destroy
77
+ render :json => Caboose::StdClass.new({
78
+ :success => true
79
+ })
80
+ end
81
+
82
+ # PUT /admin/products/:product_id/modifications/:mod_id/values/:mod_value_id/input-fields/sort-order
83
+ def admin_update_sort_order
84
+ params[:input_field_ids].each_with_index do |ip_id, i|
85
+ ip = ModificationValueInputField.where(:id => ip_id).first
86
+ ip.sort_order = i
87
+ ip.save
88
+ end
89
+ render :json => { :success => true }
90
+ end
91
+
92
+ # PUT /admin/products/modifications/values/input-fields/field-type-options
93
+ def admin_field_type_options
94
+ render :json => [
95
+ { :value => 'color' , :text => 'Color' },
96
+ { :value => 'checkbox' , :text => 'Checkbox' },
97
+ { :value => 'date' , :text => 'Date' },
98
+ { :value => 'time' , :text => 'Time' },
99
+ { :value => 'date_time' , :text => 'Date/Time' },
100
+ { :value => 'select' , :text => 'Select' },
101
+ { :value => 'text' , :text => 'Text' },
102
+ { :value => 'textarea' , :text => 'Textarea' }
103
+ ]
104
+ end
105
+
106
+ end
107
+ end
108
+