caboose-cms 0.4.17 → 0.4.18

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- OWUxNzk3MmI4MzE5ZWUxNTZiM2ZmMDMzYzViNjAzNWU5NDk0YmU0Yg==
4
+ NTc1OTFkZGQzMGQ3YTAyMGRkNGM2NjgzOGJjMDc4ZDZiOWEyZjE2MA==
5
5
  data.tar.gz: !binary |-
6
- NTA2NDcwOWQ2Njc0NzM5Mzg2NjNjZjdjN2ZlMTY0NmY3MGQyZTIxZg==
6
+ NWYwYzBmMzhhZTlkMzcxMzdkMGZjNDM5ZjI2MzdhZTUwNDRjZDMyOA==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- ZDgwYTU1N2M1MzE1NGFiZWZmNTMxNGY3MzQwODY5MGE0NzI1MzI5ODQwNDc5
10
- YjljNzM3Y2JjMTAwMDIwMDBmNTA5ZjA0ZDUzNzdkMzBmNzk4ZWJiYjJjNDRl
11
- M2E3NjZlYjA3NWMyZGM0YWM0MWIxM2IxZWU2MDAxNWI3OTMyMWU=
9
+ NGMxMGFjZjMyNDIwZGE1YWMzNGI3MTNiN2MyOWI2MzkzZTM2MDk4NWEwYWYz
10
+ MWUwZGU1ZGRlZDRiYzY4YzZkYWVhMWU4NjkyYzcyYmYwNjE2OTIyZGYyMjhm
11
+ MjcyNzQ2NTNjNGM4MTI5OTI1YjIyMDg1ZjM4NDk1OWM1MWNiM2I=
12
12
  data.tar.gz: !binary |-
13
- NTA3NzU5MTdjZTc2ZTNkMTgxZGIxZjg0NjhmOGM4NzhjNjdmNThmOWIxYjMw
14
- NzE0ZjRmYmIwZDhhZWI5ZTM2YmFmYjZhOWU4YTgwZDNmYjc4NzNjMjJjZmM4
15
- ZGRhZGQxMWJjN2VmNzFmMGM5MGEzNDViNjkyMWRhZWUwMGNjMjE=
13
+ MjMzODI0Yzc4MTBlODZmMWNkZTNkYTFjODIxNGI5MDc5NjE4MDM0MDUwN2M1
14
+ MWIyZWExZGExOTM5NzllMmM2YWMwNGM5Y2I1MDBkMDIwMjk2YWZhZGEyZDA4
15
+ YzE4YWIyMjIyOTY0NGU4ZDk4NjdjNGViOWJjNzU4YmEwYTFjZmI=
@@ -96,7 +96,7 @@ BoundRichText = BoundControl.extend({
96
96
  },
97
97
 
98
98
  cancel: function() {
99
- if (this.attribute.before_cancel) this.attribute.before_cancel();
99
+ if (this.attribute.before_cancel) this.attribute.before_cancel();
100
100
  this.attribute.value = this.attribute.value_clean;
101
101
  $('#'+this.el).val(this.attribute.value);
102
102
  $('#'+this.el).removeClass('mb_dirty');
@@ -101,18 +101,30 @@ module Caboose
101
101
  def admin_render_second_level
102
102
  return unless user_is_allowed('pages', 'edit')
103
103
  p = Page.find(params[:page_id])
104
+ @p = p
104
105
  blocks = p.block.children.collect do |b|
105
- {
106
+ {
106
107
  :id => b.id,
107
108
  :block_type_id => b.block_type.id,
108
109
  :sort_order => b.sort_order,
109
110
  :html => b.render(b, {
110
- :empty_text => params[:empty_text],
111
- :editing => true
111
+ :view => nil,
112
+ :controller_view_content => nil,
113
+ :modal => false,
114
+ :editing => true,
115
+ :empty_text => params[:empty_text],
116
+ :css => '|CABOOSE_CSS|',
117
+ :js => '|CABOOSE_JAVASCRIPT|',
118
+ :csrf_meta_tags => '|CABOOSE_CSRF|'
112
119
  })
113
120
  }
114
121
  end
115
122
  render :json => blocks
123
+ #render :layout => false
124
+
125
+ #respond_to do |format|
126
+ # format.json
127
+ #end
116
128
  end
117
129
 
118
130
  # GET /admin/pages/:page_id/blocks/:id/edit
@@ -115,6 +115,7 @@ class Caboose::Block < ActiveRecord::Base
115
115
  options2[:block] = block
116
116
 
117
117
  view = options2[:view]
118
+ view = ActionView::Base.new(ActionController::Base.view_paths) if view.nil?
118
119
  if block.block_type.use_render_function && block.block_type.render_function
119
120
  #str = block.render_from_function(options2)
120
121
 
@@ -127,11 +128,10 @@ class Caboose::Block < ActiveRecord::Base
127
128
  str = view.render(:partial => "caboose/blocks/render_function", :locals => options2)
128
129
  else
129
130
  #view = ActionView::Base.new(ActionController::Base.view_paths, options2, )
130
- #view = ActionView::Base.new(options2[:view].view_renderer, {}, options2[:view].controller)
131
- view = options2[:view]
131
+ #view = ActionView::Base.new(options2[:view].view_renderer, {}, options2[:view].controller)
132
132
  begin
133
133
  full_name = block.full_name
134
- full_name = "lksdjflskfjslkfjlskdfjlkjsdf" if full_name.nil? || full_name.length == 0
134
+ full_name = "lksdjflskfjslkfjlskdfjlkjsdf" if full_name.nil? || full_name.length == 0
135
135
  str = view.render(:partial => "caboose/blocks/#{full_name}", :locals => options2)
136
136
  rescue ActionView::MissingTemplate
137
137
  begin
@@ -0,0 +1,16 @@
1
+ <%
2
+ blocks = @p.block.children.collect do |b|
3
+ {
4
+ :id => b.id,
5
+ :block_type_id => b.block_type.id,
6
+ :sort_order => b.sort_order,
7
+ :html => b.render(b, {
8
+ :view => self,
9
+ #:controller_view_content => yield,
10
+ :modal => false,
11
+ :empty_text => @empty_text,
12
+ :editing => true
13
+ })
14
+ }
15
+ end
16
+ %><%= raw blocks.to_json %>
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.4.17'
2
+ VERSION = '0.4.18'
3
3
  end
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.4.17
4
+ version: 0.4.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry
@@ -345,6 +345,7 @@ files:
345
345
  - app/views/caboose/blocks/admin_edit_h6.html.erb
346
346
  - app/views/caboose/blocks/admin_edit_richtext.html.erb
347
347
  - app/views/caboose/blocks/admin_new.html.erb
348
+ - app/views/caboose/blocks/admin_render_second_level.json.erb
348
349
  - app/views/caboose/extras/error.html.erb
349
350
  - app/views/caboose/extras/error404.html.erb
350
351
  - app/views/caboose/login/forgot_password_form.html.erb