caboose-cms 0.5.12 → 0.5.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/app/assets/javascripts/caboose/model/index_table.js +35 -2
- data/app/controllers/caboose/block_types_controller.rb +1 -1
- data/app/controllers/caboose/cart_controller.rb +1 -2
- data/app/controllers/caboose/pages_controller.rb +3 -3
- data/app/views/caboose/block_types/admin_index.html.erb +1 -1
- data/lib/caboose/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MzhiMDY0ZDQ3NGY0NzdjNzgwZTk0OTBiZmYwOGE3MGRkNTMwNDQ5NA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MzI3NTQ1NjJkMGY5ZTFmZTc5MTE1MGZjZDZmNjM0YWE3N2Q3MzY4NQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YTI1MDI3MDA3M2QzYTViMGJjNGNiNzUzYTk2ODk2YTU1MjQwMmZjYTNiOWIz
|
10
|
+
MmQ3ZTk1NTczYjdkMDliMWFmNjdhMTc2NThkYjNmZDEyODQ4ZDNkZGY4YWI0
|
11
|
+
NWIwMGFlZjQ1ZDY2MmQ3NWFjYWE3MzcwMzliYzBiMjA0OWQ1MjI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ODk0ZWNmN2VkOWY5ZmU3MWExMTIwY2I0MTYzYzMyNTQ5YmM4ZDNhODA0ZWJk
|
14
|
+
NDIyMWQyMTNiMDc0NDhmNzc0ZGI1ZTA1NGQ0ODZlNWRlZTUwZmIzOTU3ZGRl
|
15
|
+
NWJmZjVhNzg2ZmY5ZDRjM2Q0N2ViMzRjZWE2NDE0YzZhN2YzZTM=
|
@@ -105,7 +105,9 @@ IndexTable.prototype = {
|
|
105
105
|
$.each(this.fields, function(i, f) {
|
106
106
|
if (f.editable == null) f.editable = true;
|
107
107
|
});
|
108
|
-
|
108
|
+
this.init_local_storage();
|
109
|
+
this.get_visible_columns();
|
110
|
+
|
109
111
|
$(window).on('hashchange', function() { that.refresh(); });
|
110
112
|
this.refresh();
|
111
113
|
},
|
@@ -414,7 +416,8 @@ IndexTable.prototype = {
|
|
414
416
|
f.show = checked;
|
415
417
|
that.print();
|
416
418
|
}
|
417
|
-
});
|
419
|
+
});
|
420
|
+
that.set_visible_column(field_name, checked);
|
418
421
|
});
|
419
422
|
if (field.show)
|
420
423
|
input.prop('checked', 'true');
|
@@ -426,6 +429,36 @@ IndexTable.prototype = {
|
|
426
429
|
});
|
427
430
|
return div;
|
428
431
|
},
|
432
|
+
|
433
|
+
init_local_storage: function()
|
434
|
+
{
|
435
|
+
if (!localStorage) return;
|
436
|
+
var that = this;
|
437
|
+
|
438
|
+
var cols = localStorage.getItem(this.container + '_cols');
|
439
|
+
if (!cols)
|
440
|
+
{
|
441
|
+
cols = {};
|
442
|
+
$.each(this.fields, function(i, f) { cols[f.name] = f.show; });
|
443
|
+
localStorage.setItem(this.container + '_cols', JSON.stringify(cols));
|
444
|
+
}
|
445
|
+
},
|
446
|
+
|
447
|
+
get_visible_columns: function()
|
448
|
+
{
|
449
|
+
if (!localStorage) return;
|
450
|
+
var cols = JSON.parse(localStorage.getItem(this.container + '_cols'));
|
451
|
+
$.each(this.fields, function(i, f) { f.show = cols[f.name]; });
|
452
|
+
},
|
453
|
+
|
454
|
+
set_visible_column: function(col, checked)
|
455
|
+
{
|
456
|
+
if (!localStorage) return;
|
457
|
+
var that = this;
|
458
|
+
var cols = JSON.parse(localStorage.getItem(this.container + '_cols'));
|
459
|
+
cols[col] = checked;
|
460
|
+
localStorage.setItem(this.container + '_cols', JSON.stringify(cols));
|
461
|
+
},
|
429
462
|
|
430
463
|
bulk_edit: function()
|
431
464
|
{
|
@@ -41,7 +41,7 @@ module Caboose
|
|
41
41
|
def admin_json_single
|
42
42
|
return if !user_is_allowed('pages', 'view')
|
43
43
|
block_type = BlockType.find(params[:id])
|
44
|
-
render :json => block_type
|
44
|
+
render :json => block_type.as_json(:include => :sites)
|
45
45
|
end
|
46
46
|
|
47
47
|
# GET /admin/block-types/new
|
@@ -140,7 +140,7 @@ module Caboose
|
|
140
140
|
# GET /admin/pages/new
|
141
141
|
def admin_new
|
142
142
|
return unless user_is_allowed('pages', 'add')
|
143
|
-
@parent_id = params[:parent_id] ? params[:parent_id] : 1
|
143
|
+
@parent_id = params[:parent_id] ? params[:parent_id] : Page.where(:site_id => @site.id, :parent_id => -1).first.id
|
144
144
|
@parent = Page.find(@parent_id)
|
145
145
|
render :layout => 'caboose/admin'
|
146
146
|
end
|
@@ -283,7 +283,7 @@ module Caboose
|
|
283
283
|
end
|
284
284
|
|
285
285
|
parent = Caboose::Page.find(parent_id)
|
286
|
-
page = Caboose::Page.new
|
286
|
+
page = Caboose::Page.new
|
287
287
|
|
288
288
|
if parent.nil?
|
289
289
|
d = Domain.where(:domain => request.host_with_port).first.site_id
|
@@ -317,7 +317,7 @@ module Caboose
|
|
317
317
|
Caboose::Page.update_authorized_for_action(page.id, 'edit', editors)
|
318
318
|
|
319
319
|
# Send back the response
|
320
|
-
resp.redirect = "/admin/pages/#{page.id}
|
320
|
+
resp.redirect = "/admin/pages/#{page.id}"
|
321
321
|
render json: resp
|
322
322
|
end
|
323
323
|
|
@@ -22,7 +22,7 @@ $(document).ready(function() {
|
|
22
22
|
{ name: 'name' , sort: 'name' , show: true , bulk_edit: false, nice_name: 'Name' , type: 'text' , value: function(bt) { return bt.name; }, width: 400 },
|
23
23
|
{ name: 'description' , sort: 'description' , show: false , bulk_edit: false, nice_name: 'Description' , type: 'text' , value: function(bt) { return bt.description; }, width: 400 },
|
24
24
|
{ name: 'field_type' , sort: 'field_type' , show: true , bulk_edit: false, nice_name: 'Field type' , type: 'select' , value: function(bt) { return bt.field_type; }, width: 400, options_url: '/admin/block-types/field-type-options' },
|
25
|
-
{ name: 'site_id' , sort: 'site_id' , show: false , bulk_edit: false, nice_name: 'Site' , type: 'checkbox-multiple' , value: function(bt) { return bt.sites ? bt.sites.map(function(s) { return s.id }) : []; }, text: function(bt) { return bt.sites ? bt.sites.map(function(s) { return s.description }).join(', ') : ''; }, width: 400, height: 200, options_url: '/admin/block-types/site-options' },
|
25
|
+
{ name: 'site_id' , sort: 'site_id' , show: false , bulk_edit: false, nice_name: 'Site' , type: 'checkbox-multiple' , value: function(bt) { return bt.sites ? bt.sites.map(function(s) { return s.id }) : []; }, text: function(bt) { return bt.sites ? bt.sites.map(function(s) { return s.description && s.description.length > 0 ? s.description : s.name }).join(', ') : ''; }, width: 400, height: 200, options_url: '/admin/block-types/site-options' },
|
26
26
|
{ name: 'parent_id' , sort: 'parent_id' , show: false , bulk_edit: false, nice_name: 'Parent' , type: 'select' , value: function(bt) { return bt.parent_id; }, width: 400, options_url: '/admin/block-types/tree-options' },
|
27
27
|
{ name: 'block_type_category_id' , sort: 'block_type_category_id' , show: false , bulk_edit: false, nice_name: 'Category' , type: 'select' , value: function(bt) { return bt.block_type_category_id; }, width: 400, options_url: '/admin/block-type-categories/tree-options' },
|
28
28
|
{ name: 'is_global' , sort: 'is_global' , show: false , bulk_edit: false, nice_name: 'Global' , type: 'checkbox' , value: function(bt) { return bt.is_global ? 'Yes' : 'No'; }, width: 20 },
|
data/lib/caboose/version.rb
CHANGED