caboose-cms 0.9.60 → 0.9.61
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/caboose/block_content_controller_dragdrop.js +217 -270
- data/app/assets/javascripts/caboose/block_modal_controllers/block_dd_modal_controller.js +538 -0
- data/app/assets/stylesheets/caboose/admin_edit_page_content_dragdrop.scss +13 -1
- data/app/controllers/caboose/blocks_controller.rb +27 -2
- data/app/models/caboose/block.rb +1 -1
- data/app/views/caboose/pages/admin_edit_content.html.erb +8 -8
- data/app/views/caboose/posts/admin_edit_content.html.erb +9 -8
- data/lib/caboose/version.rb +1 -1
- metadata +3 -2
@@ -219,7 +219,7 @@ body > .container, body > .mm-page > .container {
|
|
219
219
|
}
|
220
220
|
}
|
221
221
|
|
222
|
-
.block_over { background: #e3e3e3; }
|
222
|
+
// .block_over { background: #e3e3e3; }
|
223
223
|
.select_handle { display: none; }
|
224
224
|
// .move_up_handle { display: none; }
|
225
225
|
// .move_down_handle { display: none; }
|
@@ -239,6 +239,18 @@ body > .container, body > .mm-page > .container {
|
|
239
239
|
.block_over > .delete_handle span { position: absolute; top: 0; right: 0px; width: 18px; height: 18px; background-color: #fff; border: #ccc 1px solid; }
|
240
240
|
.block_over > .duplicate_handle span { position: absolute; top: 0; right: 36px; width: 18px; height: 18px; background-color: #fff; border: #ccc 1px solid; }
|
241
241
|
|
242
|
+
.flex-grid-unit.block_over > .delete_handle span { top: -10px; right: auto; left: 26px; background-color: #f1e9e9; }
|
243
|
+
.flex-grid-unit.block_over > .duplicate_handle span { top: -10px; right: auto; left: -10px; background-color: #f1e9e9; }
|
244
|
+
.flex-grid-unit.block_over > .select_handle span { top: -10px; right: auto; left: 8px; background-color: #f1e9e9; }
|
245
|
+
.flex-grid-unit.block_over > .drag_handle span { display: none; }
|
246
|
+
|
247
|
+
.unslider-block-wrapper > .delete_handle,
|
248
|
+
.unslider-block-wrapper > .drag_handle,
|
249
|
+
.unslider-block-wrapper > .select_handle,
|
250
|
+
.unslider-block-wrapper > .duplicate_handle {
|
251
|
+
z-index: 20;
|
252
|
+
}
|
253
|
+
|
242
254
|
.selected { background: #fff799 !important;
|
243
255
|
img {
|
244
256
|
opacity: 0.6;
|
@@ -395,6 +395,7 @@ module Caboose
|
|
395
395
|
#resp.block = b
|
396
396
|
resp.success = true
|
397
397
|
resp.new_id = b.id
|
398
|
+
resp.parent_id = b.parent_id
|
398
399
|
resp.redirect = params[:page_id] ? "/admin/pages/#{b.page_id}/blocks/#{b.id}" : "/admin/posts/#{b.post_id}/blocks/#{b.id}"
|
399
400
|
render :json => resp
|
400
401
|
end
|
@@ -541,8 +542,32 @@ module Caboose
|
|
541
542
|
return unless user_is_allowed('pages', 'edit')
|
542
543
|
resp = StdClass.new
|
543
544
|
b = Block.find(params[:id])
|
544
|
-
b.duplicate_block(@site.id, params[:page_id], params[:post_id], b.block_type_id, b.parent_id)
|
545
|
-
|
545
|
+
resp.new_id = b.duplicate_block(@site.id, params[:page_id], params[:post_id], b.block_type_id, b.parent_id)
|
546
|
+
render :json => resp
|
547
|
+
end
|
548
|
+
|
549
|
+
# @route GET /admin/pages/:page_id/blocks/:id/api-info
|
550
|
+
# @route GET /admin/posts/:post_id/blocks/:id/api-info
|
551
|
+
def admin_block_info
|
552
|
+
return unless user_is_allowed('pages', 'edit')
|
553
|
+
resp = StdClass.new
|
554
|
+
b = Block.find(params[:id])
|
555
|
+
bt = b.block_type if b
|
556
|
+
resp.block_name = b.name
|
557
|
+
resp.bt_name = bt.name
|
558
|
+
resp.use_js_for_modal = bt.use_js_for_modal
|
559
|
+
resp.field_type = bt.field_type
|
560
|
+
render :json => resp
|
561
|
+
end
|
562
|
+
|
563
|
+
# @route GET /admin/pages/:page_id/blocks/:id/parent-block
|
564
|
+
# @route GET /admin/posts/:post_id/blocks/:id/parent-block
|
565
|
+
def admin_parent_block
|
566
|
+
return unless user_is_allowed('pages', 'edit')
|
567
|
+
resp = StdClass.new
|
568
|
+
b = Block.find(params[:id])
|
569
|
+
resp.parent_id = b.parent_id if b && b.parent && b.parent.name.blank?
|
570
|
+
resp.grandparent_id = b.parent.parent_id if b && b.parent && b.parent.parent && b.parent.parent.name.blank?
|
546
571
|
render :json => resp
|
547
572
|
end
|
548
573
|
|
data/app/models/caboose/block.rb
CHANGED
@@ -1,7 +1,3 @@
|
|
1
|
-
<%
|
2
|
-
# app/views/caboose/pages/admin_edit_content.html.erb
|
3
|
-
%>
|
4
|
-
|
5
1
|
<% content_for :caboose_css do %>
|
6
2
|
<%= stylesheet_link_tag 'jquery-ui' %>
|
7
3
|
<%= stylesheet_link_tag 'caboose/admin_block_edit_image' %>
|
@@ -20,14 +16,15 @@
|
|
20
16
|
<%= javascript_include_tag 'caboose/model/all' %>
|
21
17
|
<%= javascript_include_tag 'caboose/jquery-ui.drag-multiple.min.js' %>
|
22
18
|
<%= javascript_include_tag "caboose/clipboard" %>
|
19
|
+
<%= javascript_include_tag "caboose/class" %>
|
20
|
+
<%= javascript_include_tag "caboose/modal_controller" %>
|
23
21
|
<% if @site && @site.use_dragdrop %>
|
24
22
|
<%= javascript_include_tag 'caboose/block_content_controller_dragdrop' %>
|
23
|
+
<%= javascript_include_tag "caboose/block_modal_controllers/block_dd_modal_controller" %>
|
25
24
|
<% else %>
|
26
25
|
<%= javascript_include_tag 'caboose/block_content_controller' %>
|
27
|
-
<% end %>
|
28
|
-
<%= javascript_include_tag "caboose/class" %>
|
29
|
-
<%= javascript_include_tag "caboose/modal_controller" %>
|
30
26
|
<%= javascript_include_tag "caboose/block_modal_controllers/block_modal_controller" %>
|
27
|
+
<% end %>
|
31
28
|
<script type='text/javascript'>
|
32
29
|
|
33
30
|
var controller = false;
|
@@ -35,14 +32,17 @@ $(document).ready(function() {
|
|
35
32
|
controller = new BlockContentController({
|
36
33
|
page_id: <%= @page.id %>,
|
37
34
|
assets_path: <%= raw Caboose.json(asset_path('loading.gif').gsub('loading.gif', '')) %>,
|
35
|
+
<% if @site && @site.use_dragdrop %>
|
36
|
+
included_assets: ['caboose/block_modal_controllers/block_dd_modal_controller.js']
|
37
|
+
<% else %>
|
38
38
|
included_assets: ['caboose/block_modal_controllers/block_modal_controller.js']
|
39
|
+
<% end %>
|
39
40
|
});
|
40
41
|
|
41
42
|
$('body').append($('<div/>')
|
42
43
|
.attr('id', 'tiny_header')
|
43
44
|
.append($('<a/>').attr('href', '/admin/pages').html("< Back"))
|
44
45
|
.append($('<a/>').attr('href', '#').html('Custom Fields').click(function(e) { e.preventDefault(); caboose_modal_url('/admin/pages/<%= @page.id %>/custom-fields'); }))
|
45
|
-
// .append($('<a/>').attr('href', '/admin/pages/<%= @page.id %>/layout').html("Layout"))
|
46
46
|
.append($('<a/>').attr('href', '/admin/pages/<%= @page.id %>').html("Page Settings"))
|
47
47
|
.append($('<a/>').attr('href', '/<%= @page.uri %>').attr('target','_blank').text("View Page"))
|
48
48
|
);
|
@@ -1,7 +1,3 @@
|
|
1
|
-
<%
|
2
|
-
# app/views/caboose/posts/admin_edit_content.html.erb
|
3
|
-
%>
|
4
|
-
|
5
1
|
<% content_for :caboose_css do %>
|
6
2
|
<%= stylesheet_link_tag 'jquery-ui' %>
|
7
3
|
<%= stylesheet_link_tag 'caboose/admin_block_edit_image' %>
|
@@ -19,14 +15,15 @@
|
|
19
15
|
<%= javascript_include_tag 'caboose/model/all' %>
|
20
16
|
<%= javascript_include_tag 'caboose/jquery-ui.drag-multiple.min.js' %>
|
21
17
|
<%= javascript_include_tag "caboose/clipboard" %>
|
18
|
+
<%= javascript_include_tag "caboose/class" %>
|
19
|
+
<%= javascript_include_tag "caboose/modal_controller" %>
|
22
20
|
<% if @site && @site.use_dragdrop %>
|
23
21
|
<%= javascript_include_tag 'caboose/block_content_controller_dragdrop' %>
|
22
|
+
<%= javascript_include_tag "caboose/block_modal_controllers/block_dd_modal_controller" %>
|
24
23
|
<% else %>
|
25
24
|
<%= javascript_include_tag 'caboose/block_content_controller' %>
|
26
|
-
<% end %>
|
27
|
-
<%= javascript_include_tag "caboose/class" %>
|
28
|
-
<%= javascript_include_tag "caboose/modal_controller" %>
|
29
25
|
<%= javascript_include_tag "caboose/block_modal_controllers/block_modal_controller" %>
|
26
|
+
<% end %>
|
30
27
|
<script type='text/javascript'>
|
31
28
|
|
32
29
|
var controller = false;
|
@@ -34,7 +31,11 @@ $(document).ready(function() {
|
|
34
31
|
controller = new BlockContentController({
|
35
32
|
post_id: <%= @post.id %>,
|
36
33
|
assets_path: <%= raw Caboose.json(asset_path('loading.gif').gsub('loading.gif', '')) %>,
|
37
|
-
|
34
|
+
<% if @site && @site.use_dragdrop %>
|
35
|
+
included_assets: ['caboose/block_modal_controllers/block_dd_modal_controller.js']
|
36
|
+
<% else %>
|
37
|
+
included_assets: ['caboose/block_modal_controllers/block_modal_controller.js']
|
38
|
+
<% end %>
|
38
39
|
});
|
39
40
|
|
40
41
|
$('body').append($('<div/>')
|
data/lib/caboose/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: caboose-cms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.61
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- William Barry
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pg
|
@@ -542,6 +542,7 @@ files:
|
|
542
542
|
- app/assets/javascripts/caboose/block_content_controller.js
|
543
543
|
- app/assets/javascripts/caboose/block_content_controller_dragdrop.js
|
544
544
|
- app/assets/javascripts/caboose/block_media_controller.js
|
545
|
+
- app/assets/javascripts/caboose/block_modal_controllers/block_dd_modal_controller.js
|
545
546
|
- app/assets/javascripts/caboose/block_modal_controllers/block_modal_controller.js
|
546
547
|
- app/assets/javascripts/caboose/block_modal_controllers/button_modal_controller.js
|
547
548
|
- app/assets/javascripts/caboose/block_modal_controllers/media_modal_controller.js
|