caboose-cms 0.5.201 → 0.5.202

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +8 -8
  2. data/app/assets/javascripts/caboose/admin_block_edit.js +20 -10
  3. data/app/assets/javascripts/caboose/admin_post_edit_content.js +313 -0
  4. data/app/assets/stylesheets/caboose/admin_post_edit_content.css +46 -0
  5. data/app/controllers/caboose/admin_controller.rb +4 -4
  6. data/app/controllers/caboose/application_controller.rb +35 -0
  7. data/app/controllers/caboose/blocks_controller.rb +120 -78
  8. data/app/controllers/caboose/checkout_controller.rb +6 -0
  9. data/app/controllers/caboose/posts_controller.rb +87 -21
  10. data/app/controllers/caboose/sites_controller.rb +13 -1
  11. data/app/models/caboose/block.rb +14 -4
  12. data/app/models/caboose/caboose_plugin.rb +4 -0
  13. data/app/models/caboose/core_plugin.rb +1 -1
  14. data/app/models/caboose/post.rb +51 -7
  15. data/app/models/caboose/schema.rb +10 -3
  16. data/app/models/caboose/site.rb +5 -0
  17. data/app/views/caboose/admin/index.html.erb +43 -30
  18. data/app/views/caboose/application/show.html.erb +1 -1
  19. data/app/views/caboose/blocks/_layout_basic.html.erb +1 -1
  20. data/app/views/caboose/blocks/_layout_basic_content.html.erb +1 -1
  21. data/app/views/caboose/blocks/_layout_post.html.erb +28 -0
  22. data/app/views/caboose/blocks/_layout_post_content.html.erb +10 -0
  23. data/app/views/caboose/blocks/_layout_post_footer.html.erb +3 -0
  24. data/app/views/caboose/blocks/_layout_post_header.html.erb +3 -0
  25. data/app/views/caboose/blocks/_post.html.erb +30 -0
  26. data/app/views/caboose/blocks/admin_edit.html.erb +6 -7
  27. data/app/views/caboose/blocks/admin_new.html.erb +4 -3
  28. data/app/views/caboose/posts/_admin_header.html.erb +1 -0
  29. data/app/views/caboose/posts/admin_edit_content.html.erb +14 -21
  30. data/app/views/caboose/posts/admin_edit_content_old.html.erb +32 -0
  31. data/app/views/caboose/posts/admin_edit_general.html.erb +25 -12
  32. data/app/views/caboose/posts/admin_edit_layout.html.erb +48 -0
  33. data/app/views/caboose/posts/admin_edit_preview.html.erb +27 -0
  34. data/app/views/caboose/posts/show.html.erb +16 -0
  35. data/app/views/caboose/sites/admin_edit.html.erb +7 -5
  36. data/app/views/caboose/social/admin_edit.html.erb +1 -1
  37. data/app/views/layouts/caboose/application.html.erb +12 -6
  38. data/config/routes.rb +299 -278
  39. data/lib/caboose/version.rb +1 -1
  40. data/lib/tasks/caboose.rake +15 -1
  41. metadata +13 -2
@@ -1,2 +1,2 @@
1
- <% content_for :page_title do %><%= @page.title %><% end %>
1
+ <% content_for :page_title do %><%= @page.title %><% end %>
2
2
  <% content_for :page_content do %><%= @page.content %><% end %>
@@ -9,7 +9,7 @@ page = block.page
9
9
  <head>
10
10
  <meta charset="utf-8" />
11
11
  <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1" />
12
- <title><%= raw page.head_title %></title>
12
+ <title><%= raw (page ? page.head_title : block.post.title) %></title>
13
13
  <meta name="description" content="" />
14
14
  <meta name="viewport" content="width=device-width" />
15
15
  <%= raw css %>
@@ -6,4 +6,4 @@
6
6
  <% block.children.each do |b| %><%= raw block.render(b, local_assigns) %><% end %>
7
7
  <% end %>
8
8
  </div>
9
- </div>
9
+ </div>
@@ -0,0 +1,28 @@
1
+ <!DOCTYPE html>
2
+ <!--[if lt IE 7]><html class="no-js ie lt-ie9 lt-ie8 lt-ie7" lang="en"><![endif]-->
3
+ <!--[if IE 7]><html class="no-js ie ie7 lt-ie9 lt-ie8" lang="en"><![endif]-->
4
+ <!--[if IE 8]><html class="no-js ie ie8 lt-ie9" lang="en"><![endif]-->
5
+ <!--[if IE 9]><html class="no-js ie ie9" lang="en"><![endif]-->
6
+ <!--[if !IE]><!--> <html class="no-js" lang="en"><!--<![endif]-->
7
+ <head>
8
+ <meta charset="utf-8" />
9
+ <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1" />
10
+ <title><%= raw block.post.title %></title>
11
+ <meta name="description" content="" />
12
+ <meta name="viewport" content="width=device-width" />
13
+ <%= raw css %>
14
+ <%= stylesheet_link_tag 'print', :media => 'print' %>
15
+ <%= raw csrf_meta_tags %>
16
+ </head>
17
+ <body>
18
+ <div class="container" id='block_<%= block.id %>'>
19
+ <!--[if lt IE 7]>
20
+ <p class="chromeframe">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">activate Google Chrome Frame</a> to improve your experience.</p>
21
+ <![endif]-->
22
+ <%= raw block.render('header' , local_assigns) %>
23
+ <%= raw block.render('content', local_assigns) %>
24
+ <%= raw block.render('footer' , local_assigns) %>
25
+ </div>
26
+ <%= raw js %>
27
+ </body>
28
+ </html>
@@ -0,0 +1,10 @@
1
+ <div class="content_wrapper" id='block_<%= block.id %>'>
2
+ <div class="content_body">
3
+ <% if post.body %>
4
+ <h1><%= raw post.title %></h1>
5
+ <%= raw post.body %>
6
+ <% else %>
7
+ <% block.children.each do |b| %><%= raw block.render(b, local_assigns) %><% end %>
8
+ <% end %>
9
+ </div>
10
+ </div>
@@ -0,0 +1,3 @@
1
+ <div class="footer" id='block_<%= block.id %>'>
2
+ <p>Please edit /app/views/caboose/blocks/_layout_post_footer.html.erb</p>
3
+ </div>
@@ -0,0 +1,3 @@
1
+ <div class="header" id='block_<%= block.id %>'>
2
+ <p>Please edit /app/views/caboose/blocks/_layout_post_header.html.erb</p>
3
+ </div>
@@ -0,0 +1,30 @@
1
+ <div class="post-details-wrapper">
2
+ <div class="constrain">
3
+ <% if post.image && !post.image.url.blank? && !post.image.url.include?('placehold') %>
4
+ <img src="<%= post.image.url(:large) %>" class="post-image">
5
+ <% end %>
6
+ <div class="post-text">
7
+ <h2 class="post-title"><%= post.title %></h2>
8
+ <h6 class="post-date"><%= post.created_at.in_time_zone(logged_in_user.timezone).strftime("%B %-d, %Y, %l:%M%P") %></h6>
9
+ <div class='share-icons clearfix'>
10
+ <!-- Twitter -->
11
+ <div class="twitter-share-button-wrapper"><a href="https://twitter.com/share" class="twitter-share-button"
12
+ data-text="<%= post.title %>"
13
+ data-count="none"
14
+ data-lang="en">Tweet</a></div>
15
+ <!-- Facebook -->
16
+ <div class="fb-share-button"
17
+ data-type="button"></div>
18
+ </div>
19
+ <hr />
20
+ <div class="post-body richtext">
21
+ <%== post.body %>
22
+ </div>
23
+ </div>
24
+ </div>
25
+ </div>
26
+
27
+ <% content_for :caboose_js do %>
28
+ <script id='facebook-jssdk' src='//connect.facebook.net/en_US/sdk.js#xfbml=1&appId=759174044117392&version=v2.0'></script>
29
+ <script id='twitter-wjs' src='https://platform.twitter.com/widgets.js'></script>
30
+ <% end %>
@@ -1,4 +1,6 @@
1
1
  <%
2
+ base_url = @block.page_id ? "/admin/pages/#{@block.page_id}/blocks" : "/admin/posts/#{@block.post_id}/blocks"
3
+
2
4
  update_on_close = false
3
5
  @block.block_type.children.each do |bt|
4
6
  update_on_close = true if bt.field_type == 'image' || bt.field_type == 'file'
@@ -6,17 +8,14 @@ end
6
8
 
7
9
  crumbs = []
8
10
  b = @block
9
- while b
10
- href = b.id == @block.id ? "#" : "/admin/pages/#{b.page_id}/blocks/#{b.id}/edit"
11
- #onclick = b.id == @block.id ? " onclick=\"$('#advanced').slideToggle(100, function() { modal.autosize(); });\"" : ''
11
+ while b
12
+ href = b.id == @block.id ? "#" : "#{base_url}/#{b.id}/edit"
12
13
  text = b.name ? "#{b.block_type.description} (#{b.name})" : b.block_type.description
13
- #crumbs << "<a href=\"#{href}\"#{onclick}>#{text}</a>"
14
14
  crumbs << "<a href=\"#{href}\">#{text}</a>"
15
15
  b = b.parent
16
16
  end
17
17
 
18
18
  %>
19
- <!--<h2 style='margin-top: 0; padding-top: 0;'>Edit <%= @block.name ? @block.name : @block.block_type.description %></h2>-->
20
19
  <h2 style='margin-top: 0; padding-top: 0;'><%= raw crumbs.reverse.join(' > ') %></h2>
21
20
 
22
21
  <% if @block.block_type.use_render_function_for_layout %>
@@ -77,7 +76,7 @@ end
77
76
  <p>This block doesn't have any content yet.</p>
78
77
  <% end %>
79
78
  <% if @block.block_type.allow_child_blocks %>
80
- <a href='/admin/pages/<%= @block.page_id %>/blocks/<%= @block.id %>/new'>Add a child block!</a>
79
+ <a href='<%= raw base_url %>/<%= @block.id %>/new'>Add a child block!</a>
81
80
  <% end %>
82
81
  <% end %>
83
82
  <div id='message'></div>
@@ -88,7 +87,7 @@ end
88
87
  <% end %>
89
88
  <input type='button' value='Move Up' onclick="controller.move_up();" />
90
89
  <input type='button' value='Move Down' onclick="controller.move_down();" />
91
- <input type='button' value='Advanced' onclick="window.location='/admin/pages/<%= @block.page_id %>/blocks/<%= @block.id %>/advanced';" />
90
+ <input type='button' value='Advanced' onclick="window.location='<%= raw base_url %>/<%= @block.id %>/advanced';" />
92
91
  </p>
93
92
 
94
93
  <% content_for :caboose_css do %>
@@ -1,9 +1,10 @@
1
1
  <%
2
+ base_url = @block.page_id ? "/admin/pages/#{@block.page_id}/blocks" : "/admin/posts/#{@block.post_id}/blocks"
2
3
 
3
4
  crumbs = []
4
5
  b = @block
5
6
  while b
6
- href = b.id == @block.id ? "#" : "/admin/pages/#{b.page_id}/blocks/#{b.id}/edit"
7
+ href = b.id == @block.id ? "#" : "#{base_url}/#{b.id}/edit"
7
8
  onclick = b.id == @block.id ? " onclick=\"$('#block_#{@block.id}_block_type_id_container').slideToggle(100, function() { modal.autosize(); });\"" : ''
8
9
  text = b.name ? "#{b.block_type.description} (#{b.name})" : b.block_type.description
9
10
  crumbs << "<a href=\"#{href}\"#{onclick}>#{text}</a>"
@@ -16,7 +17,7 @@ b = @block
16
17
  <h2 style='margin-top: 0; padding-top: 0;'><%= raw crumbs.reverse.join(' > ') %></h2>
17
18
  <h1>New Block</h1>
18
19
  -->
19
- <form action='/admin/pages/<%= b.page_id %>/blocks/<%= b.id %>' method='post' id='new_block_form' onsubmit="return false;">
20
+ <form action='<%= raw base_url %>/<%= b.id %>' method='post' id='new_block_form' onsubmit="return false;">
20
21
  <input type='hidden' name='authenticity_token' value='<%= form_authenticity_token %>' />
21
22
  <input type='hidden' name='block_type_id' id='block_type_id' value='' />
22
23
  <% if @before_id %><input type='hidden' name='before_id' value='<%= @before_id %>' /><% end %>
@@ -85,7 +86,7 @@ function add_child_block(block_type_id)
85
86
  modal.autosize("<p class='loading'>Adding block...</p>");
86
87
  $('#block_type_id').val(block_type_id);
87
88
  $.ajax({
88
- url: '/admin/pages/<%= b.page_id %>/blocks/<%= b.id %>',
89
+ url: '<%= raw base_url %>/<%= b.id %>',
89
90
  type: 'post',
90
91
  data: $('#new_block_form').serialize(),
91
92
  success: function(resp) {
@@ -9,6 +9,7 @@
9
9
  <%
10
10
  tabs = {
11
11
  "/admin/posts/#{@post.id}/edit" => 'General',
12
+ "/admin/posts/#{@post.id}/preview" => 'Preview',
12
13
  "/admin/posts/#{@post.id}/content" => 'Content',
13
14
  "/admin/posts/#{@post.id}/categories" => 'Categories',
14
15
  "/admin/posts/#{@post.id}/delete" => 'Delete Post'
@@ -1,32 +1,25 @@
1
1
 
2
- <%= render :partial => 'caboose/posts/admin_header' %>
3
-
4
- <p><div id='post_<%= @post.id %>_body' ></div></p>
5
-
6
- <%= render :partial => 'caboose/posts/admin_footer' %>
2
+ <% content_for :caboose_css do %>
3
+ <%= stylesheet_link_tag 'jquery-ui' %>
4
+ <%= stylesheet_link_tag 'caboose/admin_post_edit_content' %>
5
+ <% end %>
7
6
 
8
7
  <% content_for :caboose_js do %>
9
- <%= javascript_include_tag "caboose/model/all" %>
8
+ <%= javascript_include_tag 'jquery-ui' %>
9
+ <%= javascript_include_tag 'caboose/admin_post_edit_content' %>
10
10
  <script type='text/javascript'>
11
11
 
12
+ var controller = false;
12
13
  $(document).ready(function() {
13
- m = new ModelBinder({
14
- name: 'Post',
15
- id: <%= @post.id %>,
16
- update_url: '/admin/posts/<%= @post.id %>',
17
- authenticity_token: '<%= form_authenticity_token %>',
18
- attributes: [
19
- { name: 'body', nice_name: 'Body', type: 'richtext', value: <%= raw Caboose.json(@post.body) %>, width: 600, height: 400 }
20
- ]
21
- });
22
- });
14
+ controller = new PostContentController(<%= @post.id %>);
23
15
 
24
- var modal = false;
25
- $(window).load(function() {
26
- modal = new CabooseModal(800);
16
+ $('body').append($('<div/>')
17
+ .attr('id', 'tiny_header')
18
+ .append($('<a/>').attr('href', '/admin/posts').html("< Back"))
19
+ .append($('<a/>').attr('href', '/admin/posts/<%= @post.id %>/layout').html("Post Layout"))
20
+ .append($('<a/>').attr('href', '/admin/posts/<%= @post.id %>').html("Post Settings"))
21
+ );
27
22
  });
28
23
 
29
24
  </script>
30
- <script src="//tinymce.cachefly.net/4.0/tinymce.min.js"></script>
31
- <%= raw caboose_tinymce %>
32
25
  <% end %>
@@ -0,0 +1,32 @@
1
+
2
+ <%= render :partial => 'caboose/posts/admin_header' %>
3
+
4
+ <p><div id='post_<%= @post.id %>_body' ></div></p>
5
+
6
+ <%= render :partial => 'caboose/posts/admin_footer' %>
7
+
8
+ <% content_for :caboose_js do %>
9
+ <%= javascript_include_tag "caboose/model/all" %>
10
+ <script type='text/javascript'>
11
+
12
+ $(document).ready(function() {
13
+ m = new ModelBinder({
14
+ name: 'Post',
15
+ id: <%= @post.id %>,
16
+ update_url: '/admin/posts/<%= @post.id %>',
17
+ authenticity_token: '<%= form_authenticity_token %>',
18
+ attributes: [
19
+ { name: 'body', nice_name: 'Body', type: 'richtext', value: <%= raw Caboose.json(@post.body) %>, width: 600, height: 400 }
20
+ ]
21
+ });
22
+ });
23
+
24
+ var modal = false;
25
+ $(window).load(function() {
26
+ modal = new CabooseModal(800);
27
+ });
28
+
29
+ </script>
30
+ <script src="//tinymce.cachefly.net/4.0/tinymce.min.js"></script>
31
+ <%= raw caboose_tinymce %>
32
+ <% end %>
@@ -1,9 +1,13 @@
1
1
 
2
2
  <%= render :partial => 'caboose/posts/admin_header' %>
3
3
 
4
- <p><div id='post_<%= @post.id %>_published' ></div></p>
5
- <p><div id='post_<%= @post.id %>_title' ></div></p>
6
- <p><div id='post_<%= @post.id %>_image' ></div></p>
4
+ <p>URI: <span id='uri'><a href="<%= raw @post.uri %>"><%= raw @post.uri %></a></span></p>
5
+ <p><div id='post_<%= @post.id %>_slug' ></div></p>
6
+ <p><div id='post_<%= @post.id %>_title' ></div></p>
7
+ <p><div id='post_<%= @post.id %>_subtitle' ></div></p>
8
+ <p><div id='post_<%= @post.id %>_author' ></div></p>
9
+ <p><div id='post_<%= @post.id %>_published' ></div></p>
10
+ <p><div id='post_<%= @post.id %>_image' ></div></p>
7
11
 
8
12
  <%= render :partial => 'caboose/posts/admin_footer' %>
9
13
 
@@ -18,19 +22,28 @@ $(document).ready(function() {
18
22
  update_url: '/admin/posts/<%= @post.id %>',
19
23
  authenticity_token: '<%= form_authenticity_token %>',
20
24
  attributes: [
21
- { name: 'published' , nice_name: 'Published' , type: 'checkbox' , value: <%= raw @post.published ? true : false %>, width: 600 },
22
- { name: 'title' , nice_name: 'Title' , type: 'text' , value: <%= raw Caboose.json(@post.title) %>, width: 600 },
23
- { name: 'image' , nice_name: 'Image' , type: 'image' , value: <%= raw Caboose.json(@post.image.url(:thumb)) %>, width: 600, update_url: '/admin/posts/<%= @post.id %>/image' }
25
+ { name: 'slug' , nice_name: 'Slug' , type: 'text' , value: <%= raw Caboose.json(@post.slug ) %>, width: 600, after_update: function() { refresh_uri(); } },
26
+ { name: 'title' , nice_name: 'Title' , type: 'text' , value: <%= raw Caboose.json(@post.title ) %>, width: 600, after_update: function() { refresh_uri(); } },
27
+ { name: 'subtitle' , nice_name: 'Subtitle' , type: 'text' , value: <%= raw Caboose.json(@post.subtitle ) %>, width: 600 },
28
+ { name: 'author' , nice_name: 'Author' , type: 'text' , value: <%= raw Caboose.json(@post.author ) %>, width: 600 },
29
+ { name: 'published' , nice_name: 'Published' , type: 'checkbox' , value: <%= raw @post.published ? true : false %>, width: 600 },
30
+ { name: 'image' , nice_name: 'Image' , type: 'image' , value: <%= raw Caboose.json(@post.image.url(:thumb)) %>, width: 600, update_url: '/admin/posts/<%= @post.id %>/image' }
24
31
  ]
25
32
  });
26
33
  });
27
34
 
28
- var modal = false;
29
- $(window).load(function() {
30
- modal = new CabooseModal(800);
31
- });
35
+ function refresh_uri()
36
+ {
37
+ $.ajax({
38
+ url: '/admin/posts/<%= @post.id %>/json',
39
+ type: 'get',
40
+ success: function(post) {
41
+ $('#uri').empty().append($('<a/>').attr('href', post.uri).html(post.uri));
42
+ }
43
+ });
44
+ }
32
45
 
33
46
  </script>
34
- <%= tinymce_assets %>
35
- <%= tinymce :caboose, 'width' => '575px', 'height' => '240px' %>
47
+ <script src="//tinymce.cachefly.net/4.0/tinymce.min.js"></script>
48
+ <%= raw caboose_tinymce %>
36
49
  <% end %>
@@ -0,0 +1,48 @@
1
+
2
+ <%= render :partial => 'caboose/posts/admin_header' %>
3
+
4
+ <h2>Update Post Layout</h2>
5
+
6
+ <form action='/admin/posts/<%= @post.id %>' method='put' id='layout_form'>
7
+ <input type='hidden' name='authenticity_token' value='<%= form_authenticity_token %>' />
8
+ <p><select name='block_type_id'>
9
+ <option value=''>-- Select a layout --</option>
10
+ <% cat_ids = Caboose::BlockTypeCategory.layouts.collect{ |cat| cat.id } %>
11
+ <% Caboose::BlockType.includes(:block_type_site_memberships).where("block_type_category_id in (?) and block_type_site_memberships.site_id = ?", cat_ids, @site.id).reorder(:description).all.each do |bt| %>
12
+ <option value="<%= bt.id %>"><%= bt.description %></option>
13
+ <% end %>
14
+ </select></p>
15
+ <div id='message'></div>
16
+ <p>
17
+ <input type='button' value='< Back' onclick="window.location='/admin/posts/<%= @post.id %>';" />
18
+ <input type='submit' value='Update Post Layout' />
19
+ </p>
20
+ </form>
21
+
22
+ <%= render :partial => 'caboose/posts/admin_footer' %>
23
+ <% content_for :caboose_js do %>
24
+ <script type='text/javascript'>
25
+
26
+ $(document).ready(function() {
27
+ $('#layout_form').submit(function() {
28
+ update_post_layout(<%= @post.id %>);
29
+ return false;
30
+ });
31
+ });
32
+
33
+ function update_post_layout(post_id)
34
+ {
35
+ $('#message').html("<p class='loading'>Updating layout...</p>");
36
+ $.ajax({
37
+ url: '/admin/posts/' + post_id + '/layout',
38
+ type: 'put',
39
+ data: $('#layout_form').serialize(),
40
+ success: function(resp) {
41
+ if (resp.error) $('#message').html("<p class='note error'>" + resp.error + "</p>");
42
+ if (resp.redirect) window.location = resp.redirect
43
+ }
44
+ });
45
+ }
46
+
47
+ </script>
48
+ <% end %>
@@ -0,0 +1,27 @@
1
+
2
+ <%= render :partial => 'caboose/posts/admin_header' %>
3
+
4
+ <p><div id='post_<%= @post.id %>_preview' ></div></p>
5
+
6
+ <%= render :partial => 'caboose/posts/admin_footer' %>
7
+
8
+ <% content_for :caboose_js do %>
9
+ <%= javascript_include_tag "caboose/model/all" %>
10
+ <script type='text/javascript'>
11
+
12
+ $(document).ready(function() {
13
+ m = new ModelBinder({
14
+ name: 'Post',
15
+ id: <%= @post.id %>,
16
+ update_url: '/admin/posts/<%= @post.id %>',
17
+ authenticity_token: '<%= form_authenticity_token %>',
18
+ attributes: [
19
+ { name: 'preview' , nice_name: 'Preview' , type: 'richtext' , value: <%= raw Caboose.json(@post.preview ) %>, width: 600, height: 400 }
20
+ ]
21
+ });
22
+ });
23
+
24
+ </script>
25
+ <script src="//tinymce.cachefly.net/4.0/tinymce.min.js"></script>
26
+ <%= raw caboose_tinymce %>
27
+ <% end %>
@@ -0,0 +1,16 @@
1
+
2
+ <% if params[:edit] %>
3
+ <% content_for :caboose_js do %>
4
+ <%= javascript_include_tag "caboose/admin" %>
5
+ <%= javascript_include_tag "caboose/model/all" %>
6
+ <%= javascript_include_tag 'caboose/admin_post_edit_content' %>
7
+ <script type='text/javascript'>
8
+
9
+ var controller = false;
10
+ $(document).ready(function() {
11
+ controller = new PostContentController(<%= @post.id %>);
12
+ });
13
+
14
+ </script>
15
+ <% end %>
16
+ <% end %>
@@ -7,11 +7,12 @@ user_ids = [] if user_ids.nil?
7
7
  %>
8
8
  <%= render :partial => 'caboose/sites/admin_header' %>
9
9
 
10
- <p><div id='site_<%= @site.id %>_logo' ></div></p>
11
- <p><div id='site_<%= @site.id %>_name' ></div></p>
12
- <p><div id='site_<%= @site.id %>_description' ></div></p>
10
+ <p><div id='site_<%= @site.id %>_logo' ></div></p>
11
+ <p><div id='site_<%= @site.id %>_name' ></div></p>
12
+ <p><div id='site_<%= @site.id %>_description' ></div></p>
13
13
  <p><div id='site_<%= @site.id %>_under_construction_html' ></div></p>
14
- <p><div id='site_<%= @site.id %>_use_store' ></div></p>
14
+ <p><div id='site_<%= @site.id %>_use_store' ></div></p>
15
+ <p><div id='site_<%= @site.id %>_default_layout_id' ></div></p>
15
16
 
16
17
  <h2>Domains</h2>
17
18
  <p><a href='#' onclick="add_domain(<%= @site.id %>);">New Domain</a></p>
@@ -71,7 +72,8 @@ $(document).ready(function() {
71
72
  { name: 'name' , nice_name: 'Name' , type: 'text' , value: <%= raw Caboose.json(@site.name) %>, width: 400 },
72
73
  { name: 'description' , nice_name: 'Description' , type: 'textarea' , value: <%= raw Caboose.json(@site.description) %>, width: 600, height: 75 },
73
74
  { name: 'under_construction_html' , nice_name: 'Under Construction HTML' , type: 'textarea' , value: <%= raw Caboose.json(@site.under_construction_html) %>, width: 600, height: 75 },
74
- { name: 'use_store' , nice_name: 'Enable Store' , type: 'checkbox' , value: <%= raw Caboose.json(@site.use_store ? true : false) %>, width: 400 }
75
+ { name: 'use_store' , nice_name: 'Enable Store' , type: 'checkbox' , value: <%= raw Caboose.json(@site.use_store ? true : false) %>, width: 400 },
76
+ { name: 'default_layout_id' , nice_name: 'Default Layout' , type: 'select' , value: <%= raw Caboose.json(@site.default_layout_id) %>, width: 600, options_url: "/admin/sites/<%= @site.id %>/default-layout-options" }
75
77
  ]
76
78
  });
77
79
  });
@@ -32,7 +32,7 @@ $(document).ready(function() {
32
32
  { name: 'facebook_page_id' , nice_name: 'Facebook Page ID' , type: 'text', value: <%= raw Caboose.json(sc.facebook_page_id) %>, width: 500 },
33
33
  { name: 'twitter_username' , nice_name: 'Twitter Username' , type: 'text', value: <%= raw Caboose.json(sc.twitter_username) %>, width: 500 },
34
34
  { name: 'instagram_username' , nice_name: 'Instagram Username' , type: 'text', value: <%= raw Caboose.json(sc.instagram_username) %>, width: 500 },
35
- { name: 'youtube_url' , nice_name: 'YouTube URL' , type: 'text', value: <%= raw Caboose.json(sc.youtube_url) %>, width: 500 },
35
+ { name: 'youtube_url' , nice_name: 'YouTube Username/Channel ID' , type: 'text', value: <%= raw Caboose.json(sc.youtube_url) %>, width: 500 },
36
36
  { name: 'pinterest_url' , nice_name: 'Pinterest URL' , type: 'text', value: <%= raw Caboose.json(sc.pinterest_url) %>, width: 500 },
37
37
  { name: 'vimeo_url' , nice_name: 'Vimeo URL' , type: 'text', value: <%= raw Caboose.json(sc.vimeo_url) %>, width: 500 },
38
38
  { name: 'rss_url' , nice_name: 'RSS Feed URL' , type: 'text', value: <%= raw Caboose.json(sc.rss_url) %>, width: 500 },