caboose-cms 0.4.51 → 0.4.52

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
- NjdhZjM5NjQ5NTc1OTQzZmI4YzIxNDM4Mzg5YmZhY2Q4MTAxYzY5Mg==
4
+ YjFkNDIxYjhkZGIxNmQ5MTMxNjhkNWE4Y2E5YzU1ZjQ4OTIzOWRjZg==
5
5
  data.tar.gz: !binary |-
6
- NzFmZDFjYzlhMmRmOTAzNWI0NjQzYWYxZTc1ZjNjMmU4YzkyYTZiZg==
6
+ MTA1MWI4N2QwYmI4NDVkODUzMDVjZjVlYTYwMWViNDNjNmY5NGVlMw==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- OWI3OTdlMTU1YzViOWVlYzRmNjcwM2NiODJkMTA5N2M3N2U0NDg4MDM4MmU3
10
- YzI2ZWE1OTRjYzVhYzA3NjE4NTlkMjliODZjZTQ3MTMyNDE4MTg0NDFmN2Q3
11
- ZTIxNzViOTNkMTRhZjA0NTJmZDk2MzUyYjdmMWEzODdmYmRkZTI=
9
+ NjM5N2RjZjI5MWQ0YzljYjlkMmYxMzYwNWYwZDVhZGM2NjJhNjk4MDQxNzQy
10
+ OWY5MTQ4ZjQzZjg5NjlhNzY3NzZmMTQ1NGU2MzE3NWQ5MWQyYWM3Y2RkZGM2
11
+ MGQ2OTkyNDE4MmI0YmE1NWUzYjViNzNmNzljYjAzY2Q1MmYxZGY=
12
12
  data.tar.gz: !binary |-
13
- OGJjZWNiMjZhY2FjZWVhMmY2ZGFlYjlhNTk4MWY3NTg5NTczZjExMDM4MWU1
14
- ZDVjNjUxYTY4ODJjNTM4OGFkNzM5MzRmOTM0Mzg3ZGJjMmFjOGNiNjBjZGQ0
15
- MDljZTVmMjk4MGUwYjUzYzYxNzE3NTUyNjdlNjNlMDQ3NjJmNTk=
13
+ YTNlZWM3MTg3MmRlZDIyOTM0ZGExZjYzNWQyY2U0ZjBhNmZjZjM3MjRiOGI0
14
+ MjczMTJhODIzZDNlMjhlM2Y1YzMxYTNkMWEwZjFkODUzOGUzM2VhY2ZmOGZl
15
+ ZTY0NmY1NzlmZjUyMDkzMTc3NTg4NDZiZTBlNGU0YTRlOTI1YjY=
@@ -127,13 +127,13 @@ PageContentController.prototype = {
127
127
  success: function(blocks) {
128
128
  $(blocks).each(function(i,b) {
129
129
  that.set_clickable_helper(b, false, false);
130
- });
130
+ });
131
131
  }
132
132
  });
133
133
  },
134
134
 
135
135
  set_clickable_helper: function(b, parent_id, parent_allows_child_blocks)
136
- {
136
+ {
137
137
  var that = this;
138
138
 
139
139
  $('#block_' + b.id)
@@ -171,8 +171,25 @@ PageContentController.prototype = {
171
171
  if (b2.block_type_id = 34)
172
172
  show_mouseover = false;
173
173
  that.set_clickable_helper(b2, b.id, b.allow_child_blocks);
174
- });
175
- }
174
+ });
175
+ }
176
+ if (b.allow_child_blocks)
177
+ {
178
+ $('#block_' + b.id).after($('<div/>')
179
+ .addClass('new_block_link')
180
+ .append($('<div/>').addClass('line'))
181
+ .append($('<a/>')
182
+ .attr('href', '#')
183
+ .html("New Block")
184
+ .click(function(e) {
185
+ e.preventDefault(); e.stopPropagation();
186
+ caboose_modal_url('/admin/pages/' + that.page_id + '/blocks/' + b.id + '/new?after_id=' + b.id);
187
+ })
188
+ )
189
+ .mouseover(function(e) { $(this).addClass('new_block_link_over'); e.stopPropagation(); })
190
+ .mouseout(function(e) { $(this).removeClass('new_block_link_over'); e.stopPropagation(); })
191
+ );
192
+ }
176
193
  if (show_mouseover)
177
194
  {
178
195
  $('#block_' + b.id).mouseover(function(el) { $('#block_' + b.id).addClass( 'block_over'); });
@@ -272,43 +272,35 @@ module Caboose
272
272
  # #}
273
273
  #
274
274
  #end
275
-
275
+
276
+ # GET /admin/images/sign-s3
276
277
  def admin_sign_s3
277
- @document = Document.create(params[:doc])
278
278
 
279
- policy = {"expiration" => 10.seconds.from_now.utc.xmlschema,
280
- "conditions" => [
281
- {"bucket" => 'cabooseit'},
282
- {"acl" => "public-read"},
283
- {"success_action_status" => "200"}
279
+ config = YAML.load(File.read(Rails.root.join('config', 'aws.yml')))[Rails.env]
280
+ access_key = config['access_key_id']
281
+ secret_key = config['secret_access_key']
282
+ bucket = config['bucket']
283
+
284
+ policy = {
285
+ "expiration" => 10.seconds.from_now.utc.xmlschema,
286
+ "conditions" => [
287
+ { "bucket" => 'cabooseit' },
288
+ { "acl" => "public-read" },
289
+ { "success_action_status" => "200" }
284
290
  ]
285
291
  }
286
- policy = Base64.encode64(policy.to_json).gsub(/\n/,'')
292
+ policy = Base64.encode64(policy.to_json).gsub(/\n/,'')
293
+ signature = Base64.encode64(OpenSSL::HMAC.digest(OpenSSL::Digest::Digest.new('sha1'), secret_key, policy)).gsub("\n","")
287
294
 
288
295
  render :json => {
289
296
  :policy => policy,
290
- :signature => s3_upload_signature,
291
- :key => @document.s3_key,
292
- :success_action_redirect => document_upload_success_document_url(@document)
293
- }
294
- end
295
-
296
- def s3_upload_policy_document
297
- ret = {"expiration" => 10.seconds.from_now.utc.xmlschema,
298
- "conditions" => [
299
- {"bucket" => 'cabooseit'},
300
- {"acl" => "public-read"},
301
- {"success_action_status" => "200"}
302
- ]
297
+ :signature => signature,
298
+ :key => 'media-images/test.jpg',
299
+ :success_action_status => '200'
300
+ #:success_action_redirect => document_upload_success_document_url(@document)
303
301
  }
304
- return Base64.encode64(ret.to_json).gsub(/\n/,'')
305
- end
306
-
307
- # sign our request by Base64 encoding the policy document.
308
- def s3_upload_signature
309
- signature = Base64.encode64(OpenSSL::HMAC.digest(OpenSSL::Digest::Digest.new('sha1'),
310
- YOUR_SECRET_KEY, s3_upload_policy_document)).gsub("\n","")
311
- end
302
+
303
+ end
312
304
 
313
305
  end
314
306
  end
@@ -2,6 +2,6 @@
2
2
  <div class="content_body">
3
3
  <% if editing %><div class='sortable'><% end %>
4
4
  <% block.children.each do |b| %><%= raw block.render(b, local_assigns) %><% end %>
5
- <% if editing %></div><% end %>
5
+ <% if editing %></div><% end %>
6
6
  </div>
7
7
  </div>
@@ -43,11 +43,10 @@ end
43
43
  <% end %>
44
44
  <% end %>
45
45
  <% else %>
46
- <p>This block doesn't have any content yet.
47
- <% if @block.block_type.allow_child_blocks %>
48
- <a href='/admin/pages/<%= @block.page_id %>/blocks/<%= @block.id %>/new'>Add a child block!</a>
49
- <% end %>
50
- </p>
46
+ <p>This block doesn't have any content yet.</p>
47
+ <% end %>
48
+ <% if @block.block_type.allow_child_blocks %>
49
+ <a href='/admin/pages/<%= @block.page_id %>/blocks/<%= @block.id %>/new'>Add a child block!</a>
51
50
  <% end %>
52
51
  <% end %>
53
52
  <div id='message'></div>
@@ -49,7 +49,7 @@ $(document).ready(function() {
49
49
  //form.attr('action', pp.url);
50
50
  }
51
51
  });
52
- data.submit();
52
+ //data.submit();
53
53
  },
54
54
  progressall: function (e, data) { $('#bar').css('width', parseInt(data.loaded / data.total * 100, 10) + '%') },
55
55
  start: function (e) { $('#bar').css('background', 'green').css('display', 'block').css('width', '0%').text("Loading..."); },
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.4.51'
2
+ VERSION = '0.4.52'
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.51
4
+ version: 0.4.52
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry