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 +8 -8
- data/app/assets/javascripts/caboose/admin_page_edit_content.js +21 -4
- data/app/controllers/caboose/images_controller.rb +21 -29
- data/app/views/caboose/blocks/_layout_left_sidebar_content.html.erb +1 -1
- data/app/views/caboose/blocks/admin_edit.html.erb +4 -5
- data/app/views/caboose/images/admin_new.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
|
+
YjFkNDIxYjhkZGIxNmQ5MTMxNjhkNWE4Y2E5YzU1ZjQ4OTIzOWRjZg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MTA1MWI4N2QwYmI4NDVkODUzMDVjZjVlYTYwMWViNDNjNmY5NGVlMw==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NjM5N2RjZjI5MWQ0YzljYjlkMmYxMzYwNWYwZDVhZGM2NjJhNjk4MDQxNzQy
|
10
|
+
OWY5MTQ4ZjQzZjg5NjlhNzY3NzZmMTQ1NGU2MzE3NWQ5MWQyYWM3Y2RkZGM2
|
11
|
+
MGQ2OTkyNDE4MmI0YmE1NWUzYjViNzNmNzljYjAzY2Q1MmYxZGY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
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
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
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 =>
|
291
|
-
:key =>
|
292
|
-
:
|
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
|
-
|
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
|
@@ -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
|
-
|
48
|
-
|
49
|
-
|
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..."); },
|
data/lib/caboose/version.rb
CHANGED