caboose-cms 0.9.133 → 0.9.134

Sign up to get free protection for your applications and to get access to all the features.
Files changed (26) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/caboose/admin_block_edit.js +1 -1
  3. data/app/assets/javascripts/caboose/block_content_controller.js +11 -3
  4. data/app/assets/javascripts/caboose/block_content_controller_dragdrop.js +126 -6
  5. data/app/assets/javascripts/caboose/block_modal_controllers/block_dd_modal_controller.js +5 -5
  6. data/app/assets/javascripts/caboose/block_modal_controllers/block_modal_controller.js +9 -4
  7. data/app/assets/javascripts/caboose/model/attribute.js +1 -1
  8. data/app/assets/javascripts/caboose/model/model_binder.js +3 -1
  9. data/app/assets/stylesheets/caboose/admin_edit_page_content.scss +69 -14
  10. data/app/assets/stylesheets/caboose/admin_edit_page_content_dragdrop.scss +101 -11
  11. data/app/controllers/caboose/application_controller.rb +1 -1
  12. data/app/controllers/caboose/blocks_controller.rb +209 -74
  13. data/app/controllers/caboose/pages_controller.rb +34 -0
  14. data/app/controllers/caboose/posts_controller.rb +27 -0
  15. data/app/models/caboose/block.rb +134 -30
  16. data/app/models/caboose/page.rb +42 -1
  17. data/app/models/caboose/post.rb +42 -1
  18. data/app/models/caboose/schema.rb +10 -3
  19. data/app/views/caboose/admin/index.html.erb +0 -1
  20. data/app/views/caboose/pages/admin_edit_content.html.erb +19 -2
  21. data/app/views/caboose/pages/admin_preview.html.erb +1 -0
  22. data/app/views/caboose/posts/admin_edit_content.html.erb +18 -3
  23. data/app/views/caboose/posts/admin_preview_post.html.erb +1 -0
  24. data/app/views/layouts/caboose/admin.html.erb +1 -1
  25. data/lib/caboose/version.rb +1 -1
  26. metadata +3 -1
@@ -170,7 +170,12 @@ class Caboose::Schema < Caboose::Utilities::Schema
170
170
  [ :file , :attachment ],
171
171
  [ :file_upload_name , :string ],
172
172
  [ :image , :attachment ],
173
- [ :image_upload_name , :string ]
173
+ [ :image_upload_name , :string ],
174
+ [ :status, :string ],
175
+ [ :new_parent_id, :integer ],
176
+ [ :new_sort_order, :integer ],
177
+ [ :new_value, :text ],
178
+ [ :new_media_id , :integer ]
174
179
  ],
175
180
  Caboose::BlockType => [
176
181
  [ :parent_id , :integer ],
@@ -520,7 +525,8 @@ class Caboose::Schema < Caboose::Utilities::Schema
520
525
  [ :meta_robots , :string , { :default => 'index, follow' }],
521
526
  [ :canonical_url , :string ],
522
527
  [ :fb_description , :string , { :limit => 300 }],
523
- [ :gp_description , :string , { :limit => 300 }]
528
+ [ :gp_description , :string , { :limit => 300 }],
529
+ [ :status, :string ]
524
530
  ],
525
531
  Caboose::PageCache => [
526
532
  [ :page_id , :integer ],
@@ -579,7 +585,8 @@ class Caboose::Schema < Caboose::Utilities::Schema
579
585
  [ :updated_at , :datetime ],
580
586
  [ :image , :attachment ],
581
587
  [ :slug , :string ],
582
- [ :uri , :string ]
588
+ [ :uri , :string ],
589
+ [ :status , :string ]
583
590
  ],
584
591
  Caboose::PostCategory => [
585
592
  [ :site_id , :integer ],
@@ -2,7 +2,6 @@
2
2
  @nav = Caboose.plugin_hook('admin_nav', [], @logged_in_user, @page, @site)
3
3
  return_url = session[:caboose_station_return_url].nil? ? '/' : session[:caboose_station_return_url]
4
4
  return_url = '/' if return_url.starts_with?('/admin/') || return_url == '/admin'
5
-
6
5
  width = 200
7
6
  @nav.each {|item| width = 400 if item['id'] == @tab } if @tab
8
7
  %>
@@ -9,7 +9,6 @@
9
9
  <%= stylesheet_link_tag "caboose/modal_inline" %>
10
10
  <%= stylesheet_link_tag "caboose/icomoon_fonts" %>
11
11
  <% end %>
12
-
13
12
  <% content_for :caboose_js do %>
14
13
  <%= javascript_include_tag 'jquery-ui' %>
15
14
  <%= javascript_include_tag 'caboose/model/all' %>
@@ -20,12 +19,19 @@
20
19
  <% if @site && @site.use_dragdrop %>
21
20
  <%= javascript_include_tag 'caboose/block_content_controller_dragdrop' %>
22
21
  <%= javascript_include_tag "caboose/block_modal_controllers/block_dd_modal_controller" %>
22
+ <script>window.CKEDITOR_BASEPATH = '//d9hjv462jiw15.cloudfront.net/ckeditor/';</script>
23
+ <%= javascript_include_tag "//d9hjv462jiw15.cloudfront.net/ckeditor/ckeditor.js" %>
23
24
  <% else %>
24
25
  <%= javascript_include_tag 'caboose/block_content_controller' %>
25
26
  <%= javascript_include_tag "caboose/block_modal_controllers/block_modal_controller" %>
26
27
  <% end %>
27
28
  <script type='text/javascript'>
28
29
 
30
+ function hide_caboose_notice() {
31
+ $("#caboose-notice").hide();
32
+ document.cookie = "caboose_page_publish=true; expires=Thu, 18 Dec 2030 12:00:00 UTC; path=/";
33
+ }
34
+
29
35
  var controller = false;
30
36
  $(document).ready(function() {
31
37
  controller = new BlockContentController({
@@ -39,13 +45,24 @@ $(document).ready(function() {
39
45
  });
40
46
 
41
47
  $('body').append($('<div/>')
42
- .attr('id', 'tiny_header')
48
+ .attr('id', 'tiny_header')<% if @page.is_published %>.addClass('published')<% else %>.addClass('unpublished')<% end %>
49
+ .append("<span id='m-pub'>published</span>")
50
+ .append("<span id='m-unpub'>unpublished changes</span>")
43
51
  .append($('<a/>').attr('href', '/admin/pages').html("< Back"))
52
+ .append($('<a/>').attr('href', '/admin/pages/<%= @page.id %>/revert').html("Revert"))
53
+ .append($('<a/>').attr('href', '/admin/pages/<%= @page.id %>/preview').attr('target','_blank').html("Preview"))
54
+ .append($('<a/>').attr('href', '/admin/pages/<%= @page.id %>/publish').html("Publish"))
55
+ <% if @page.page_custom_field_values.count > 0 %>
44
56
  .append($('<a/>').attr('href', '#').html('Custom Fields').click(function(e) { e.preventDefault(); caboose_modal_url('/admin/pages/<%= @page.id %>/custom-fields'); }))
57
+ <% end %>
45
58
  .append($('<a/>').attr('href', '/admin/pages/<%= @page.id %>').html("Page Settings"))
46
59
  .append($('<a/>').attr('href', '/<%= @page.uri %>').attr('target','_blank').text("View Page"))
47
60
  );
48
61
 
62
+ <% if cookies[:caboose_page_publish].blank? %>
63
+ $('body').append($('<div/>').attr('id','caboose-notice').html("<a href='#' onclick='hide_caboose_notice();return false;'>x</a><p>NEW: Changes aren't saved until you click Publish. Click Preview to preview the edited page, or Revert to discard your changes.</p>"));
64
+ <% end %>
65
+
49
66
  <% if @site && @site.use_dragdrop %>
50
67
  var html = "<%== (render :partial => 'caboose/pages/new_block_header').gsub( / *\n+/, '' ) %> ";
51
68
  $('body').append($('<div/>')
@@ -9,7 +9,6 @@
9
9
  <%= stylesheet_link_tag "caboose/modal_inline" %>
10
10
  <%= stylesheet_link_tag "caboose/icomoon_fonts" %>
11
11
  <% end %>
12
-
13
12
  <% content_for :caboose_js do %>
14
13
  <%= javascript_include_tag 'jquery-ui' %>
15
14
  <%= javascript_include_tag 'caboose/model/all' %>
@@ -20,12 +19,19 @@
20
19
  <% if @site && @site.use_dragdrop %>
21
20
  <%= javascript_include_tag 'caboose/block_content_controller_dragdrop' %>
22
21
  <%= javascript_include_tag "caboose/block_modal_controllers/block_dd_modal_controller" %>
22
+ <script>window.CKEDITOR_BASEPATH = '//d9hjv462jiw15.cloudfront.net/ckeditor/';</script>
23
+ <%= javascript_include_tag "//d9hjv462jiw15.cloudfront.net/ckeditor/ckeditor.js" %>
23
24
  <% else %>
24
25
  <%= javascript_include_tag 'caboose/block_content_controller' %>
25
26
  <%= javascript_include_tag "caboose/block_modal_controllers/block_modal_controller" %>
26
27
  <% end %>
27
28
  <script type='text/javascript'>
28
29
 
30
+ function hide_caboose_notice() {
31
+ $("#caboose-notice").hide();
32
+ document.cookie = "caboose_post_publish=true; expires=Thu, 18 Dec 2030 12:00:00 UTC; path=/";
33
+ }
34
+
29
35
  var controller = false;
30
36
  $(document).ready(function() {
31
37
  controller = new BlockContentController({
@@ -39,12 +45,21 @@ $(document).ready(function() {
39
45
  });
40
46
 
41
47
  $('body').append($('<div/>')
42
- .attr('id', 'tiny_header')
48
+ .attr('id', 'tiny_header')<% if @post.is_published %>.addClass('published')<% else %>.addClass('unpublished')<% end %>
49
+ .append("<span id='m-pub'>published</span>")
50
+ .append("<span id='m-unpub'>unpublished changes</span>")
43
51
  .append($('<a/>').attr('href', '/admin/posts').html("< Back"))
52
+ .append($('<a/>').attr('href', '/admin/posts/<%= @post.id %>/revert').html("Revert"))
53
+ .append($('<a/>').attr('href', '/admin/posts/<%= @post.id %>/preview-post').attr('target','_blank').html("Preview"))
54
+ .append($('<a/>').attr('href', '/admin/posts/<%= @post.id %>/publish').html("Publish"))
44
55
  .append($('<a/>').attr('href', '/admin/posts/<%= @post.id %>').html("Post Settings"))
45
- .append($('<a/>').attr('href', '<%= @post.uri %>').attr('target','_blank').html("View Post"))
56
+ .append($('<a/>').attr('href', '<%= @post.uri %>').attr('target','_blank').text("View Post"))
46
57
  );
47
58
 
59
+ <% if cookies[:caboose_post_publish].blank? %>
60
+ $('body').append($('<div/>').attr('id','caboose-notice').html("<a href='#' onclick='hide_caboose_notice();return false;'>x</a><p>NEW: Changes aren't saved until you click Publish. Click Preview to preview the edited post, or Revert to discard your changes.</p>"));
61
+ <% end %>
62
+
48
63
  <% if @site && @site.use_dragdrop %>
49
64
  var html = "<%== (render :partial => 'caboose/pages/new_block_header').gsub( / *\n+/, '' ) %> ";
50
65
  $('body').append($('<div/>')
@@ -38,7 +38,7 @@ if protocol == 'https://'
38
38
  js.gsub!("<script src=\"http://", "<script src=\"https://")
39
39
  js.gsub!("<script src='http://" , "<script src='https://")
40
40
  end
41
-
41
+ @nav = Caboose.plugin_hook('admin_nav', [], @logged_in_user, @page, @site)
42
42
  %><!DOCTYPE html>
43
43
  <html class="no-js" lang="en">
44
44
  <head>
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.9.133'
2
+ VERSION = '0.9.134'
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.9.133
4
+ version: 0.9.134
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry
@@ -1072,6 +1072,7 @@ files:
1072
1072
  - app/views/caboose/pages/admin_edit_seo.html.erb
1073
1073
  - app/views/caboose/pages/admin_index.html.erb
1074
1074
  - app/views/caboose/pages/admin_new.html.erb
1075
+ - app/views/caboose/pages/admin_preview.html.erb
1075
1076
  - app/views/caboose/pages/admin_sitemap.html.erb
1076
1077
  - app/views/caboose/pages/show.html.erb
1077
1078
  - app/views/caboose/pages/test.html.erb
@@ -1096,6 +1097,7 @@ files:
1096
1097
  - app/views/caboose/posts/admin_edit_preview.html.erb
1097
1098
  - app/views/caboose/posts/admin_index.html.erb
1098
1099
  - app/views/caboose/posts/admin_new.html.erb
1100
+ - app/views/caboose/posts/admin_preview_post.html.erb
1099
1101
  - app/views/caboose/posts/detail.html.erb
1100
1102
  - app/views/caboose/posts/index.html.erb
1101
1103
  - app/views/caboose/posts/show.html.erb