caboose-cms 0.9.229 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (187) hide show
  1. checksums.yaml +5 -5
  2. data/app/assets/javascripts/caboose/admin.js +1 -1
  3. data/app/assets/javascripts/caboose/admin/application.js +20 -0
  4. data/app/assets/javascripts/caboose/admin_main.js +13 -3
  5. data/app/assets/javascripts/caboose/admin_media_index.js +158 -161
  6. data/app/assets/javascripts/caboose/application.js +7 -8
  7. data/app/assets/javascripts/caboose/block_content_controller_dragdrop.js +4 -60
  8. data/app/assets/javascripts/caboose/block_modal_controllers/block_dd_modal_controller.js +2 -3
  9. data/app/assets/javascripts/caboose/block_modal_controllers/media_modal_controller.js +6 -17
  10. data/app/assets/javascripts/caboose/model/all.js +1 -5
  11. data/app/assets/stylesheets/caboose/admin/_config.scss +102 -0
  12. data/app/assets/stylesheets/caboose/admin/application.css +11 -0
  13. data/app/assets/stylesheets/caboose/admin/component.css +183 -0
  14. data/app/assets/stylesheets/caboose/admin/froala.min.css +91 -0
  15. data/app/assets/stylesheets/caboose/admin/ie.scss +67 -0
  16. data/app/assets/stylesheets/caboose/admin/integrations/main.scss +6 -0
  17. data/app/assets/stylesheets/caboose/admin/integrations/shopify.scss +128 -0
  18. data/app/assets/stylesheets/caboose/admin/jquery-ui-subnav-theme.min.css +5 -0
  19. data/app/assets/stylesheets/caboose/admin/layout.scss +150 -0
  20. data/app/assets/stylesheets/caboose/admin/main.scss +34 -0
  21. data/app/assets/stylesheets/caboose/admin/modules/body.scss +176 -0
  22. data/app/assets/stylesheets/caboose/admin/modules/buttons.scss +120 -0
  23. data/app/assets/stylesheets/caboose/admin/modules/countdown.css +21 -0
  24. data/app/assets/stylesheets/caboose/admin/modules/crumbtrail.scss +80 -0
  25. data/app/assets/stylesheets/caboose/admin/modules/data_table.scss +92 -0
  26. data/app/assets/stylesheets/caboose/admin/modules/footer.scss +62 -0
  27. data/app/assets/stylesheets/caboose/admin/modules/forms.scss +72 -0
  28. data/app/assets/stylesheets/caboose/admin/modules/functions.scss +31 -0
  29. data/app/assets/stylesheets/caboose/admin/modules/grid.scss +108 -0
  30. data/app/assets/stylesheets/caboose/admin/modules/header.scss +77 -0
  31. data/app/assets/stylesheets/caboose/admin/modules/headings.scss +38 -0
  32. data/app/assets/stylesheets/caboose/admin/modules/main_nav.scss +73 -0
  33. data/app/assets/stylesheets/caboose/admin/modules/message_boxes.scss +55 -0
  34. data/app/assets/stylesheets/caboose/admin/modules/model_binder.scss +189 -0
  35. data/app/assets/stylesheets/caboose/admin/modules/navigation.scss +261 -0
  36. data/app/assets/stylesheets/caboose/admin/modules/order_bumps.scss +57 -0
  37. data/app/assets/stylesheets/caboose/admin/modules/pager.scss +34 -0
  38. data/app/assets/stylesheets/caboose/admin/modules/product_images.scss +21 -0
  39. data/app/assets/stylesheets/caboose/admin/modules/products.css +86 -0
  40. data/app/assets/stylesheets/caboose/admin/modules/search.scss +49 -0
  41. data/app/assets/stylesheets/caboose/admin/modules/selects.scss +12 -0
  42. data/app/assets/stylesheets/caboose/admin/modules/subnav_tabs.scss +34 -0
  43. data/app/assets/stylesheets/caboose/admin/modules/tabs.scss +140 -0
  44. data/app/assets/stylesheets/caboose/admin/page_edit/block_anchors.scss +48 -0
  45. data/app/assets/stylesheets/caboose/admin/page_edit/block_overlays.scss +182 -0
  46. data/app/assets/stylesheets/caboose/admin/page_edit/device_selector.scss +65 -0
  47. data/app/assets/stylesheets/caboose/admin/page_edit/froala.scss +81 -0
  48. data/app/assets/stylesheets/caboose/admin/page_edit/group_overlay.scss +115 -0
  49. data/app/assets/stylesheets/caboose/admin/page_edit/layout.scss +128 -0
  50. data/app/assets/stylesheets/caboose/admin/page_edit/main.scss +18 -0
  51. data/app/assets/stylesheets/caboose/admin/page_edit/modal.scss +11 -0
  52. data/app/assets/stylesheets/caboose/admin/page_edit/preview.scss +25 -0
  53. data/app/assets/stylesheets/caboose/admin/page_edit/publish.scss +25 -0
  54. data/app/assets/stylesheets/caboose/admin/page_edit/revisions.scss +58 -0
  55. data/app/assets/stylesheets/caboose/admin/page_edit/subnav.scss +273 -0
  56. data/app/assets/stylesheets/caboose/admin/page_edit/top_nav.scss +109 -0
  57. data/app/assets/stylesheets/caboose/admin/pages/assets_index.css +48 -0
  58. data/app/assets/stylesheets/caboose/admin/pages/block_edit_image.css.scss +386 -0
  59. data/app/assets/stylesheets/caboose/admin/pages/media_index.css.scss +300 -0
  60. data/app/assets/stylesheets/caboose/admin/pages/new_block.css +9 -0
  61. data/app/assets/stylesheets/caboose/admin/pages/page_edit.scss +960 -0
  62. data/app/assets/stylesheets/caboose/admin/pages/page_edit_content.scss +103 -0
  63. data/app/assets/stylesheets/caboose/admin/pages/pages_index.scss +79 -0
  64. data/app/assets/stylesheets/caboose/admin/pages/post_edit_content.css +46 -0
  65. data/app/assets/stylesheets/caboose/admin/print.css +3 -0
  66. data/app/assets/stylesheets/caboose/admin/slack.scss +51 -0
  67. data/app/assets/stylesheets/caboose/admin_block_edit_image.css.scss +1 -2
  68. data/app/assets/stylesheets/caboose/admin_edit_page_content_dragdrop.scss +15 -71
  69. data/app/assets/stylesheets/caboose/admin_main.css.scss +29 -25
  70. data/app/assets/stylesheets/caboose/admin_media_index.css.scss +5 -26
  71. data/app/assets/stylesheets/caboose/application.css +5 -11
  72. data/app/assets/stylesheets/caboose/login.scss +0 -1
  73. data/app/assets/stylesheets/caboose/modal_main.css +19 -21
  74. data/app/assets/stylesheets/caboose/model_binder.css +4 -13
  75. data/app/assets/stylesheets/caboose/page_bar_generator.css +1 -2
  76. data/app/controllers/caboose/admin_controller.rb +4 -3
  77. data/app/controllers/caboose/application_controller.rb +19 -16
  78. data/app/controllers/caboose/assets_controller.rb +65 -0
  79. data/app/controllers/caboose/block_types_controller.rb +6 -8
  80. data/app/controllers/caboose/cart_controller.rb +2 -2
  81. data/app/controllers/caboose/fonts_controller.rb +2 -139
  82. data/app/controllers/caboose/invoices_controller.rb +4 -5
  83. data/app/controllers/caboose/login_logs_controller.rb +7 -5
  84. data/app/controllers/caboose/media_categories_controller.rb +2 -16
  85. data/app/controllers/caboose/media_controller.rb +11 -14
  86. data/app/controllers/caboose/pages_controller.rb +42 -104
  87. data/app/controllers/caboose/posts_controller.rb +7 -53
  88. data/app/controllers/caboose/products_controller.rb +1 -1
  89. data/app/controllers/caboose/sites_controller.rb +6 -25
  90. data/app/controllers/caboose/sns_controller.rb +3 -3
  91. data/app/controllers/caboose/themes_controller.rb +0 -30
  92. data/app/controllers/caboose/users_controller.rb +10 -17
  93. data/app/controllers/caboose/variants_controller.rb +9 -9
  94. data/app/models/caboose/ab_variant.rb +1 -1
  95. data/app/models/caboose/asset.rb +23 -0
  96. data/app/models/caboose/asset_manager.rb +92 -0
  97. data/app/models/caboose/asset_manifest.rb +91 -0
  98. data/app/models/caboose/block.rb +24 -100
  99. data/app/models/caboose/block_cache.rb +105 -0
  100. data/app/models/caboose/block_cache_file.rb +22 -0
  101. data/app/models/caboose/block_cache_image.rb +53 -0
  102. data/app/models/caboose/block_type.rb +3 -4
  103. data/app/models/caboose/block_type_category.rb +2 -2
  104. data/app/models/caboose/block_type_parser.rb +1 -1
  105. data/app/models/caboose/block_type_source.rb +2 -2
  106. data/app/models/caboose/calendar_event_group.rb +2 -2
  107. data/app/models/caboose/category.rb +2 -2
  108. data/app/models/caboose/comment_routes.rb +8 -7
  109. data/app/models/caboose/core_plugin.rb +3 -4
  110. data/app/models/caboose/export.rb +1 -1
  111. data/app/models/caboose/font.rb +2 -7
  112. data/app/models/caboose/font_variant.rb +0 -12
  113. data/app/models/caboose/invoice.rb +14 -14
  114. data/app/models/caboose/line_item.rb +4 -4
  115. data/app/models/caboose/media.rb +4 -15
  116. data/app/models/caboose/media_category.rb +7 -5
  117. data/app/models/caboose/modification.rb +2 -2
  118. data/app/models/caboose/page.rb +54 -325
  119. data/app/models/caboose/page_bar_generator.rb +10 -20
  120. data/app/models/caboose/page_cache.rb +12 -0
  121. data/app/models/caboose/page_cacher.rb +137 -0
  122. data/app/models/caboose/post.rb +8 -108
  123. data/app/models/caboose/product.rb +5 -5
  124. data/app/models/caboose/product_image.rb +1 -1
  125. data/app/models/caboose/role.rb +2 -2
  126. data/app/models/caboose/schema.rb +72 -73
  127. data/app/models/caboose/site.rb +1 -203
  128. data/app/models/caboose/theme.rb +5 -70
  129. data/app/views/caboose/admin/_content.html.erb +44 -0
  130. data/app/views/caboose/admin/_fonts.html.erb +47 -0
  131. data/app/views/caboose/admin/_footer.html.erb +1 -0
  132. data/app/views/caboose/admin/_header.html.erb +12 -0
  133. data/app/views/caboose/admin/_icons.html.erb +6 -0
  134. data/app/views/caboose/admin/_mobile_navigation.html.erb +22 -0
  135. data/app/views/caboose/admin/_post.html.erb +74 -0
  136. data/app/views/caboose/admin/index.html.erb +33 -36
  137. data/app/views/caboose/block_types/admin_edit.html.erb +8 -6
  138. data/app/views/caboose/blocks/_file.html.erb +2 -2
  139. data/app/views/caboose/blocks/_ga.html.erb +2 -1
  140. data/app/views/caboose/blocks/_image.html.erb +0 -4
  141. data/app/views/caboose/blocks/_render_function.html.erb +4 -9
  142. data/app/views/caboose/fonts/admin_index.html.erb +10 -55
  143. data/app/views/caboose/invoices_mailer/customer_status_updated.html.erb +14 -5
  144. data/app/views/caboose/login_logs/admin_index_for_user.html.erb +1 -1
  145. data/app/views/caboose/media/admin_index.html.erb +24 -14
  146. data/app/views/caboose/my_account/index.html.erb +0 -1
  147. data/app/views/caboose/pages/_admin_header.html.erb +0 -5
  148. data/app/views/caboose/pages/admin_edit_content.html.erb +2 -6
  149. data/app/views/caboose/pages/admin_edit_general.html.erb +4 -32
  150. data/app/views/caboose/pages/admin_new_old.html.erb +46 -0
  151. data/app/views/caboose/pages/test.html.erb +64 -0
  152. data/app/views/caboose/posts/_admin_header.html.erb +0 -5
  153. data/app/views/caboose/posts/admin_delete_form.html.erb +1 -1
  154. data/app/views/caboose/posts/admin_edit_content.html.erb +2 -6
  155. data/app/views/caboose/products/admin_group_variants.html.erb +1 -1
  156. data/app/views/caboose/products/admin_sort.html copy.erb +1 -1
  157. data/app/views/caboose/sites/admin_edit.html.erb +0 -21
  158. data/app/views/caboose/themes/admin_edit.html.erb +3 -7
  159. data/app/views/caboose/users/_admin_header.html.erb +0 -4
  160. data/app/views/caboose/users/admin_edit_roles.html.erb +0 -1
  161. data/app/views/caboose/variants/admin_group.html.erb +1 -1
  162. data/app/views/layouts/caboose/admin.html.erb +2 -9
  163. data/app/views/layouts/caboose/application.html.erb +92 -62
  164. data/config/routes.rb +1 -4
  165. data/lib/caboose/version.rb +1 -1
  166. data/lib/tasks/caboose.rake +14 -3
  167. metadata +238 -57
  168. data/app/controllers/caboose/change_logs_controller.rb +0 -13
  169. data/app/models/caboose/change_log.rb +0 -97
  170. data/app/views/caboose/blocks/_cached_block.html.erb +0 -28
  171. data/app/views/caboose/change_logs/admin_index.html.erb +0 -65
  172. data/app/views/caboose/fonts/admin_family_edit.html.erb +0 -63
  173. data/app/views/caboose/fonts/admin_family_index.html.erb +0 -42
  174. data/app/views/caboose/fonts/admin_variant_edit.html.erb +0 -84
  175. data/app/views/caboose/pages/admin_change_logs.html.erb +0 -56
  176. data/app/views/caboose/pages/compiled_asset.css.erb +0 -0
  177. data/app/views/caboose/pages/compiled_asset.js.erb +0 -0
  178. data/app/views/caboose/posts/admin_change_logs.html.erb +0 -56
  179. data/app/views/caboose/sites/compiled_asset.css.erb +0 -0
  180. data/app/views/caboose/sites/compiled_asset.js.erb +0 -0
  181. data/app/views/caboose/themes/admin_error_log.html.erb +0 -9
  182. data/app/views/caboose/themes/admin_js.html.erb +0 -131
  183. data/app/views/caboose/users/admin_change_logs.html.erb +0 -63
  184. data/app/views/layouts/caboose/css.css.erb +0 -44
  185. data/app/views/layouts/caboose/footer_css.css.erb +0 -41
  186. data/app/views/layouts/caboose/footer_js.js.erb +0 -31
  187. data/app/views/layouts/caboose/js.js.erb +0 -34
@@ -0,0 +1,6 @@
1
+ <link rel="apple-touch-icon" sizes="180x180" href="<%= cloudfront_asset_path 'admin/images/icons/apple-touch-icon.png' %>">
2
+ <link rel="icon" type="image/png" sizes="32x32" href="<%= cloudfront_asset_path 'admin/images/icons/favicon-32x32.png' %>" >
3
+ <link rel="icon" type="image/png" sizes="16x16" href="<%= cloudfront_asset_path 'admin/images/icons/favicon-16x16.png' %>" >
4
+ <link rel="manifest" href="<%= cloudfront_asset_path 'admin/images/icons/manifest.json' %>">
5
+ <link rel="mask-icon" href="<%= cloudfront_asset_path 'admin/images/icons/safari-pinned-tab.svg' %>" color="#2475A5">
6
+ <meta name="theme-color" content="#2475A5">
@@ -0,0 +1,22 @@
1
+ <div class="delay-show">
2
+ <div id="mmenu">
3
+ <ul>
4
+ <li class='home'><a href="/" title="Home"><span class='icon'></span><span class='text'>Home</span></a></li>
5
+ <% @nav = Caboose.plugin_hook('admin_nav', [], @user, @page, @site) %>
6
+ <% @nav.each do |item| %>
7
+ <% href = item['href'] || '#' %>
8
+ <li class="<%= item['id'] %><% if @request.fullpath.starts_with?(href) %> selected <% end %>">
9
+ <a href='<%= href %>'><span class='icon'></span><span class='text'><%= item['text'] %></span></a>
10
+ <% if item['children'] && item['children'].count > 0 %>
11
+ <ul class="submenu">
12
+ <% item['children'].each do |item2| %>
13
+ <% href2 = item2['href'] || '#' %>
14
+ <li><a href='<%= href2 %>'><span><%= item2['text'] %></span></a></li>
15
+ <% end %>
16
+ </ul>
17
+ <% end %>
18
+ </li>
19
+ <% end %>
20
+ </ul>
21
+ </div>
22
+ </div>
@@ -0,0 +1,74 @@
1
+ <div class="post-details-wrapper" id="block_<%= block.id %>">
2
+ <div class="constrain">
3
+ <div class="grid-row">
4
+ <div class="unit3of4 main-post-content">
5
+ <% if post.image && !post.image.url.blank? && !post.image.url.include?('placehold') %>
6
+ <div class="post-image-banner" style="background-image:url(<%= post.image.url(:huge) %>);"></div>
7
+ <% end %>
8
+ <div class="post-text">
9
+ <div class="grid-row">
10
+ <div class="unit1of2 left">
11
+ <h2 class="post-title"><%= post.title %></h2>
12
+ <% if !post.subtitle.blank? %><h3 class="post-subtitle"><%= post.subtitle %></h3><% end %>
13
+ </div>
14
+ <div class="unit1of2 right">
15
+ <% if !post.author.blank? %><h4 class="post-author">by <%= post.author %></h4><% end %>
16
+ <h6 class="post-date"><%= post.created_at.in_time_zone(logged_in_user.timezone).strftime("%B %-d, %Y, %l:%M%P") %></h6>
17
+ </div>
18
+ </div>
19
+ <div class='share-icons clearfix'>
20
+ <div class="share-buttons">
21
+ <% url = "http://" + site.primary_domain.domain + post.uri %>
22
+ <a href="https://www.facebook.com/sharer/sharer.php?u=<%= url %>" target="_blank" title="Share on Facebook" class="holder" id="facebook" onclick="window.open(this.href, 'mywin',
23
+ 'left=20,top=20,width=500,height=500,toolbar=1,resizable=0'); return false;"><span class="icon-facebook white"></span></a>
24
+ <a href="https://twitter.com/home?status=<%= post.title + ' @ ' + url %>" title="Share on Twitter" target="_blank" class="holder" id="twitter" onclick="window.open(this.href, 'mywin',
25
+ 'left=20,top=20,width=500,height=500,toolbar=1,resizable=0'); return false;"><span class="icon-twitter white"></span></a>
26
+ <a href="https://plus.google.com/share?url=<%= url %>" title="Share on Google +" target="_blank" class="holder" id="google-plus" onclick="window.open(this.href, 'mywin',
27
+ 'left=20,top=20,width=500,height=500,toolbar=1,resizable=0'); return false;"><span class="icon-google-plus white"></span></a>
28
+ <a href="mailto:?subject=<%= post.title %>&amp;body=<%= url %>" title="Share by Email" class="holder" id="email"><span class="icon-mail white"></span></a>
29
+ </div>
30
+ </div>
31
+ <div class="post-body richtext">
32
+ <% if block.children.count == 0 && editing %>
33
+ <p style="padding:8px;border:1px dashed gray;text-align:center;cursor:pointer;">This post has no content yet. To add content, click here and then "Add a child block!"</p>
34
+ <% end %>
35
+ <% block.children.each do |b| %>
36
+ <%= raw block.render(b, local_assigns) %>
37
+ <% end %>
38
+ </div>
39
+ </div>
40
+ </div>
41
+ <div class="unit1of4 sidebar">
42
+ <% news = Caboose::Post.where(:site_id => site.id, :published => true).where("id != ?",post.id).order("created_at DESC").take(5) %>
43
+ <% if news.count > 0 %>
44
+ <section class="recent-news-wrapper">
45
+ <h2 class="recent-news-title">More News</h2>
46
+ <ul class="recent-news-list">
47
+ <% news.each do |n| %>
48
+ <% cats = n.post_categories.collect { |c| c.name } %>
49
+ <li class="clearfix news-item">
50
+ <div class="left">
51
+ <% if cats.length > 0 %><h6 class="news-category"><%= cats.join(", ") %></h6><% end %>
52
+ <a href="<%= n.uri %>" class="news-title"><%= n.title %></a>
53
+ <h6 class="news-date"><%= (n.created_at - 6.hours).strftime("%B %-d, %Y") %></h6>
54
+ </div>
55
+ <div class="right">
56
+ <% if n.image && !n.image.url.blank? && !n.image.url.include?('placehold') %>
57
+ <a href="<%= n.uri %>" class="image-holder" style="background-image:url(<%= n.image.url(:thumb) %>);"></a>
58
+ <% end %>
59
+ </div>
60
+ </li>
61
+ <% end %>
62
+ </ul>
63
+ </section>
64
+ <% else %>
65
+ <section class="recent-news-wrapper none">
66
+ <h2 class="recent-news-title">More News</h2>
67
+ <p>Sorry, no news yet.<br />
68
+ Check back later!</p>
69
+ </section>
70
+ <% end %>
71
+ </div>
72
+ </div>
73
+ </div>
74
+ </div>
@@ -7,41 +7,36 @@ width = 200
7
7
  %>
8
8
 
9
9
  <h1>Admin</h1>
10
- <div class="admin-index-menu" id="admin-list">
11
-
12
- <div class="admin-intro">
13
- <h4>Welcome to Caboose</h4>
14
- <p>For assistance, please email <a href="mailto:support@nine.is">support@nine.is</a>.</p>
15
- </div>
16
- <ul>
17
- <% i = 0 %>
18
- <% @nav.each do |item| %>
19
- <% id = item['id'].nil? ? i.to_s : item['id'] %>
20
- <% href = item['href'].nil? ? '#' : item['href'] %>
21
- <% modal = item['modal'].nil? ? false : item['modal'] %>
22
- <li id='nav_item_<%= id %>'>
23
- <% if href != "#" %><a href='<%= href %>'<%= raw (modal ? " rel='modal'" : "") %>><% end %>
24
- <span class='icon'></span><span class='text'><%= item['text'] %></span>
25
- <% if href != "#" %></a><% end %>
26
- <% if (!item['children'].nil? && item['children'].count > 0) %>
27
- <ul>
28
- <% item['children'].each do |item2| %>
29
- <% next if item2['text'].blank? %>
30
- <% modal = item2['modal'].nil? ? false : item2['modal'] %>
31
- <% icon = item2['text'].parameterize %>
32
- <% icon = 'rets' if item['text'] == 'RETS' %>
33
- <% icon = 'store' if item['text'] == 'Store' %>
34
- <% icon = item2['icon'] if item2['icon'] %>
35
- <li><a href='<%= item2['href'] %>'<%= raw (modal ? " rel='modal'" : "") %>>
36
- <span class="icon3-<%= icon %>"></span>
37
- <span class="text"><%= item2['text'] %></span></a></li>
38
- <% end %>
39
- </ul>
10
+ <div class="admin-index-menu" id="admin-list">
11
+ <ul>
12
+ <% i = 0 %>
13
+ <% @nav.each do |item| %>
14
+ <% id = item['id'].nil? ? i.to_s : item['id'] %>
15
+ <% href = item['href'].nil? ? '#' : item['href'] %>
16
+ <% modal = item['modal'].nil? ? false : item['modal'] %>
17
+ <li id='nav_item_<%= id %>'>
18
+ <% if href != "#" %><a href='<%= href %>'<%= raw (modal ? " rel='modal'" : "") %>><% end %>
19
+ <span class='icon'></span><span class='text'><%= item['text'] %></span>
20
+ <% if href != "#" %></a><% end %>
21
+ <% if (!item['children'].nil? && item['children'].count > 0) %>
22
+ <ul>
23
+ <% item['children'].each do |item2| %>
24
+ <% next if item2['text'].blank? %>
25
+ <% modal = item2['modal'].nil? ? false : item2['modal'] %>
26
+ <% icon = item2['text'].parameterize %>
27
+ <% icon = 'rets' if item['text'] == 'RETS' %>
28
+ <% icon = 'store' if item['text'] == 'Store' %>
29
+ <% icon = item2['icon'] if item2['icon'] %>
30
+ <li><a href='<%= item2['href'] %>'<%= raw (modal ? " rel='modal'" : "") %>>
31
+ <span class="icon3-<%= icon %>"></span>
32
+ <span class="text"><%= item2['text'] %></span></a></li>
33
+ <% end %>
34
+ </ul>
35
+ <% end %>
36
+ </li>
37
+ <% i + 1 %>
40
38
  <% end %>
41
- </li>
42
- <% i + 1 %>
43
- <% end %>
44
- </ul>
39
+ </ul>
45
40
  </div>
46
41
 
47
42
  <%= content_for :caboose_js do %>
@@ -49,10 +44,12 @@ width = 200
49
44
  <script type='text/javascript'>
50
45
  var modal = false;
51
46
  var station = false;
52
- $(document).ready(function() {
47
+ $(document).ready(function() {
48
+ add_to_crumbtrail('/admin', 'Admin');
53
49
  modal = new CabooseModal(<%= width %>);
54
- station = new CabooseStation(modal<%= raw @tab ? ", '#{@tab}'" : '' %>);
50
+ station = new CabooseStation(modal<%= raw @tab ? ", '#{@tab}'" : '' %>);
55
51
  });
52
+
56
53
  </script>
57
54
  <% end %>
58
55
  <% content_for :caboose_css do %>
@@ -16,6 +16,8 @@ bt = @block_type
16
16
 
17
17
  <h2>Children</h2>
18
18
  <div id='block_types'></div>
19
+
20
+
19
21
 
20
22
  <h2>Advanced</h2>
21
23
  <p><div id='blocktype_<%= bt.id %>_block_type_category_id' ></div></p>
@@ -28,16 +30,17 @@ bt = @block_type
28
30
  <p><div id='blocktype_<%= bt.id %>_options' ></div></p>
29
31
  <!-- <p><div id='blocktype_<%= bt.id %>_is_global' ></div></p> -->
30
32
  <p><div id='blocktype_<%= bt.id %>_use_render_function' ></div></p>
31
- <!-- <p><div id='blocktype_<%= bt.id %>_use_render_function_for_layout' ></div></p> -->
33
+ <p><div id='blocktype_<%= bt.id %>_use_render_function_for_layout' ></div></p>
32
34
  <p><div id='blocktype_<%= bt.id %>_use_js_for_modal' ></div></p>
33
35
  <p><div id='blocktype_<%= bt.id %>_allow_child_blocks' ></div></p>
34
- <p><div id='blocktype_<%= bt.id %>_is_dynamic' ></div></p>
35
36
  <p><div id='blocktype_<%= bt.id %>_default_child_block_type_id' ></div></p>
36
37
  <!-- <p><div id='blocktype_<%= bt.id %>_default_constrain' ></div></p>
37
38
  <p><div id='blocktype_<%= bt.id %>_default_full_width' ></div></p> -->
38
39
  <p><div id='blocktype_<%= bt.id %>_default_included' ></div></p>
40
+ <p>
39
41
 
40
- <!-- <p><div id='blocktype_<%= bt.id %>_options_function' ></div></p> -->
42
+ </p>
43
+ <p><div id='blocktype_<%= bt.id %>_options_function' ></div></p>
41
44
 
42
45
  <div id='message'></div>
43
46
 
@@ -99,7 +102,7 @@ $(document).ready(function() {
99
102
  { name: 'block_type_category_id' , sort: 'block_type_category_id' , show: false , bulk_edit: false, nice_name: 'Category' , type: 'select' , value: function(bt) { return bt.block_type_category_id; }, width: 400, options_url: '/admin/block-type-categories/tree-options' },
100
103
  // { name: 'is_global' , sort: 'is_global' , show: false , bulk_edit: false, nice_name: 'Global' , type: 'checkbox' , value: function(bt) { return bt.is_global; }, text: function(bt) { return bt.is_global ? 'Yes' : 'No' }, width: 400 },
101
104
  { name: 'use_render_function' , sort: 'use_render_function' , show: true , bulk_edit: false, nice_name: 'Use Render Function' , type: 'checkbox' , value: function(bt) { return bt.use_render_function; }, text: function(bt) { return bt.use_render_function ? 'Yes' : 'No' }, width: 400 },
102
- // { name: 'use_render_function_for_layout' , sort: 'use_render_function_for_layout' , show: true , bulk_edit: false, nice_name: 'Use Render Function for Modal' , type: 'checkbox' , value: function(bt) { return bt.use_render_function_for_layout; }, text: function(bt) { return bt.use_render_function_for_layout ? 'Yes' : 'No' }, width: 400 },
105
+ { name: 'use_render_function_for_layout' , sort: 'use_render_function_for_layout' , show: true , bulk_edit: false, nice_name: 'Use Render Function for Modal' , type: 'checkbox' , value: function(bt) { return bt.use_render_function_for_layout; }, text: function(bt) { return bt.use_render_function_for_layout ? 'Yes' : 'No' }, width: 400 },
103
106
  { name: 'use_js_for_modal' , sort: 'use_js_for_modal' , show: true , bulk_edit: false, nice_name: 'Use JS for Modal' , type: 'checkbox' , value: function(bt) { return bt.use_js_for_modal; }, text: function(bt) { return bt.use_js_for_modal ? 'Yes' : 'No' }, width: 400 },
104
107
  { name: 'allow_child_blocks' , sort: 'allow_child_blocks' , show: true , bulk_edit: false, nice_name: 'Allow Child Blocks' , type: 'checkbox' , value: function(bt) { return bt.allow_child_blocks; }, text: function(bt) { return bt.allow_child_blocks ? 'Yes' : 'No' }, width: 400 },
105
108
  { name: 'default_child_block_type_id' , sort: 'default_child_block_type_id' , show: false , bulk_edit: false, nice_name: 'Default Child Block Type ID' , type: 'text' , value: function(bt) { return bt.default_child_block_type_id; }, width: 400 },
@@ -134,7 +137,6 @@ $(document).ready(function() {
134
137
  { name: 'use_render_function_for_layout' , nice_name: 'Use Render Function for Modal' , type: 'checkbox' , value: <%= bt.use_render_function_for_layout ? 'true' : 'false' %>, width: 400 },
135
138
  { name: 'use_js_for_modal' , nice_name: 'Use JS for Modal' , type: 'checkbox' , value: <%= bt.use_js_for_modal ? 'true' : 'false' %>, width: 400 },
136
139
  { name: 'allow_child_blocks' , nice_name: 'Allow Child Blocks' , type: 'checkbox' , value: <%= bt.allow_child_blocks ? 'true' : 'false' %>, width: 400 },
137
- { name: 'is_dynamic' , nice_name: 'Dynamic Block' , type: 'checkbox' , value: <%= bt.is_dynamic ? 'true' : 'false' %>, width: 400 },
138
140
  { name: 'default_child_block_type_id' , nice_name: 'Default Child Block Type ID' , type: 'text' , value: <%= raw Caboose.json(bt.default_child_block_type_id) %>, width: 400 },
139
141
  { name: 'field_type' , nice_name: 'Field type' , type: 'select' , value: <%= raw Caboose.json(bt.field_type) %>, text: <%= raw Caboose.json(bt.field_type) %>, width: 400, options_url: '/admin/block-types/field-type-options' },
140
142
  { name: 'default' , nice_name: 'Default value' , type: 'text' , value: <%= raw Caboose.json(bt.default) %>, width: 400 },
@@ -142,7 +144,7 @@ $(document).ready(function() {
142
144
  { name: 'height' , nice_name: 'Height' , type: 'text' , value: <%= raw Caboose.json(bt.height) %>, width: 400 },
143
145
  { name: 'fixed_placeholder' , nice_name: 'Fixed placeholder' , type: 'checkbox' , value: <%= raw Caboose.json(bt.fixed_placeholder) %>, width: 400 },
144
146
  { name: 'options_url' , nice_name: 'Options URL' , type: 'text' , value: <%= raw Caboose.json(bt.options_url) %>, width: 400 },
145
- // { name: 'options_function' , nice_name: 'Options Function' , type: 'textarea' , value: <%= raw Caboose.json(bt.options_function) %>, width: 400, height: 100 },
147
+ { name: 'options_function' , nice_name: 'Options Function' , type: 'textarea' , value: <%= raw Caboose.json(bt.options_function) %>, width: 400, height: 100 },
146
148
  { name: 'options' , nice_name: 'Options' , type: 'textarea' , value: <%= raw Caboose.json(bt.options) %>, width: 400, height: 100 },
147
149
  { name: 'default_included' , sort: 'default_included' , nice_name: 'Include on New Sites' , type: 'checkbox' , value: <%= bt.default_included ? 'true' : 'false' %> , width: 400 }
148
150
  ]
@@ -12,9 +12,9 @@ end
12
12
 
13
13
  if editing
14
14
  if url.nil? || url.starts_with?('http://placehold.it') || url.include?('missing')
15
- %><div id='block_<%= block.id %>' class='file-select'><p>Click to select file for <%= block.block_type.description %>.</p></div><%
15
+ %><div id='block_<%= block.id %>'><p>Click to select a file.</p></div><%
16
16
  else
17
- %><div id='block_<%= block.id %>' class='file-select'><p><%= block.block_type.description %> file:<br /><span><%= name %></span></p></div><%
17
+ %><div id='block_<%= block.id %>'><p><span><%= name %></span></p></div><%
18
18
  end
19
19
  elsif url
20
20
  %><div id='block_<%= block.id %>'><p><a href="<%= raw file.url %>">Download File</a></p></div><%
@@ -1,5 +1,6 @@
1
1
  <% sc = site.social_config %>
2
- <% if sc.auto_ga_js && !sc.google_analytics_id.blank? && !editing && Rails.env.production? %>
2
+
3
+ <% if sc.auto_ga_js && !sc.google_analytics_id.blank? %>
3
4
  <script async src="https://www.googletagmanager.com/gtag/js?id=<%== sc.google_analytics_id %>"></script>
4
5
  <script>
5
6
  window.dataLayer = window.dataLayer || [];
@@ -1,15 +1,12 @@
1
1
  <%
2
2
  url = nil
3
- mc = "Media"
4
3
  if block.media
5
4
  url = block.media.image.url(:tiny)
6
- mc = block.media.media_category ? block.media.media_category.name : mc
7
5
  elsif block.image
8
6
  url = block.image.url(:tiny)
9
7
  end
10
8
  if editing && url.include?('placehold') %>
11
9
  <div class="img-wrap" style="position:relative;display:inline-block;">
12
- <% if block.media %><span>Media > <%= mc %> > <%= block.media.original_name %></span><% end %>
13
10
  <div class="img-holder" style="background-image:url(https://cabooseit.s3.amazonaws.com/assets/caboose/grid.png);background-size:15px;display:inline-block;position:relative;" id='block_<%= block.id %>'>
14
11
  <img src='https://cabooseit.s3.amazonaws.com/assets/select_image.png' width="150" style="max-width:100%;display:block;" />
15
12
  <span style="opacity:0;" class="select">Select an Image</span>
@@ -17,7 +14,6 @@ if editing && url.include?('placehold') %>
17
14
  </div>
18
15
  <% elsif editing %>
19
16
  <div class="img-wrap" style="position:relative;display:inline-block;">
20
- <% if block.media %><span>Media > <%= mc %> > <%= block.media.original_name %></span><% end %>
21
17
  <div class="img-holder" style="background-image:url(https://cabooseit.s3.amazonaws.com/assets/caboose/grid.png);background-size:15px;display:inline-block;position:relative;" id='block_<%= block.id %>'>
22
18
  <img src='<%== url %>' width="200" style="max-width:100%;display:block;" />
23
19
  <span style="opacity:0;" class="select">Select an Image</span>
@@ -1,10 +1,9 @@
1
- <% is_cache = defined?(is_cache) ? is_cache : false %>
2
1
  <%== ERB.new(render_function).result(self.instance_eval { binding }) %>
2
+
3
3
  <% if caboose_js && caboose_js.length > 1 %>
4
4
  <% caboose_js.to_a.each_with_index do |js, ind| %>
5
5
  <% next if ind == 0 %>
6
- <% js_yield = is_cache ? "js_#{block.id}".to_sym : :js %>
7
- <% content_for js_yield do %>
6
+ <% content_for :js do %>
8
7
  <% begin %>
9
8
  <% erb = ERB.new(js).result(self.instance_eval { binding }) %>
10
9
  <%== erb %>
@@ -17,8 +16,7 @@
17
16
  <% if caboose_css && caboose_css.length > 1 %>
18
17
  <% caboose_css.to_a.each_with_index do |css, ind| %>
19
18
  <% next if ind == 0 %>
20
- <% css_yield = is_cache ? "css_#{block.id}".to_sym : :css %>
21
- <% content_for css_yield do %>
19
+ <% content_for :css do %>
22
20
  <% begin %>
23
21
  <% erb = ERB.new(css).result(self.instance_eval { binding }) %>
24
22
  <%== erb %>
@@ -27,7 +25,4 @@
27
25
  <% end %>
28
26
  <% end %>
29
27
  <% end %>
30
- <% end %>
31
- <% block.cached_js = yield( "js_#{block.id}".to_sym ) if is_cache %>
32
- <% block.cached_css = yield( "css_#{block.id}".to_sym ) if is_cache %>
33
- <% block.save if is_cache %>
28
+ <% end %>
@@ -1,5 +1,3 @@
1
- <h1>Fonts</h1>
2
-
3
1
  <% if @site.use_fonts %>
4
2
 
5
3
  <div class="constrain clearfix">
@@ -68,23 +66,12 @@
68
66
  </div>
69
67
  <div class="unit1of3">
70
68
  <a href="#" class="set-font caboose-btn" id="3" data-name="button-font">Set as Button Font</a>
71
- <% if @site.theme %>
72
- <br />
73
- <a href="#" class="set-font caboose-btn" id="7" data-name="custom1-font">Set as Custom1 Font</a>
74
- <a href="#" class="set-font caboose-btn" id="8" data-name="custom2-font">Set as Custom2 Font</a>
75
- <a href="#" class="set-font caboose-btn" id="9" data-name="custom3-font">Set as Custom3 Font</a>
76
- <% end %>
77
69
  </div>
78
70
  </div>
79
71
  <div class="final-box">
80
72
  <h2 id="font1-preview">Your Selected Fonts - <span class="family"><%= @hf.family %></span> <span class="variant"><%= @hf.variant %></span></h2>
81
73
  <p id="font2-preview"><span class="family"><%= @bf.family %></span> <span class="variant"><%= @bf.variant %></span> - Lorem ipsum dolor sit amet, consectetur <strong id="font4-preview">this is bold text</strong>. Dicta, at voluptates assumenda hic <span class="bold-italic" id="font6-preview">this is bold italic text</span> soluta. Beatae illo explicabo, atque deserunt, <em id="font5-preview">this is italic text</em> magni necessitatibus, a eveniet hic. Culpa debitis corporis saepe eum alias eius cum eaque ipsam ducimus sunt, nobis ab quia vitae hic laudantium unde pariatur sapiente numquam.</p>
82
- <a id="font3-preview" class="caboose-btn" href="#" style="margin:20px 0;"><span class="family"><%= @btn.family %></span> <span class="variant"><%= @btn.variant %></span></a>
83
- <% if @site.theme %>
84
- <p id="font7-preview">This is the Custom1 Font you have selected. <span class="ff">font-family: "custom1-font";</span></p>
85
- <p id="font8-preview">This is the Custom2 Font you have selected. <span class="ff">font-family: "custom2-font";</span></p>
86
- <p style="margin-bottom:0;" id="font9-preview">This is the Custom3 Font you have selected. <span class="ff">font-family: "custom3-font";</span></p>
87
- <% end %>
74
+ <a id="font3-preview" class="caboose-btn" href="#" style="margin-top:20px;"><span class="family"><%= @btn.family %></span> <span class="variant"><%= @btn.variant %></span></a>
88
75
  </div>
89
76
  </div>
90
77
 
@@ -97,9 +84,6 @@
97
84
 
98
85
  <% content_for :caboose_css do %>
99
86
  <style>
100
- .ff {
101
- font-family:monospace;font-size:13px;display:inline-block;color:gray;float: right;
102
- }
103
87
  #font-form {
104
88
  margin-top: 20px;
105
89
  }
@@ -224,18 +208,6 @@
224
208
  font-family: "button-font";
225
209
  src: url('<%= @btn.url %>') format('truetype');
226
210
  }
227
- @font-face {
228
- font-family: "custom1-font";
229
- src: url('<%= @custom1.url %>') format('truetype');
230
- }
231
- @font-face {
232
- font-family: "custom2-font";
233
- src: url('<%= @custom2.url %>') format('truetype');
234
- }
235
- @font-face {
236
- font-family: "custom3-font";
237
- src: url('<%= @custom3.url %>') format('truetype');
238
- }
239
211
  #font1-preview {
240
212
  font-family: "heading-font";
241
213
  font-style: normal;
@@ -251,21 +223,6 @@
251
223
  font-style: normal;
252
224
  font-weight: normal;
253
225
  }
254
- #font7-preview {
255
- font-family: "custom1-font";
256
- font-style: normal;
257
- font-weight: normal;
258
- }
259
- #font8-preview {
260
- font-family: "custom2-font";
261
- font-style: normal;
262
- font-weight: normal;
263
- }
264
- #font9-preview {
265
- font-family: "custom3-font";
266
- font-style: normal;
267
- font-weight: normal;
268
- }
269
226
  .clearfix::after {
270
227
  content: ".";
271
228
  visibility: hidden;
@@ -352,7 +309,7 @@
352
309
  var variant;
353
310
  for (i = min; i < max; i++) {
354
311
  font = window.google_fonts[i];
355
- variant = font ? font.variants[0] : null;
312
+ variant = font.variants[0];
356
313
  load_css(i, variant);
357
314
  var index = (i % 10) + 1;
358
315
  // console.log("family: " + font.family, ", index: " + index);
@@ -388,8 +345,8 @@
388
345
  var cssId = font_id + "_" + variant;
389
346
  if (!document.getElementById(cssId)) {
390
347
  // console.dir(font);
391
- var weight = variant ? variant.replace("italic","").replace("regular","normal") : "N/A";
392
- var style = variant ? (variant.indexOf("italic") >= 0 ? "italic" : "normal") : "N/A";
348
+ var weight = variant.replace("italic","").replace("regular","normal");
349
+ var style = variant.indexOf("italic") >= 0 ? "italic" : "normal";
393
350
  weight = weight == "" ? "normal" : weight;
394
351
  var css = document.createTextNode("@font-face {font-family:'" + font.family + "';src:url('" + font.files[variant] + "') format('truetype');font-weight:" + weight + ";font-style:" + style + ";}");
395
352
  var style = document.createElement('style');
@@ -426,13 +383,13 @@
426
383
  // console.dir(font);
427
384
  $(".font-preview").css("font-family",font.family);
428
385
  $(".font-preview .family").text(font.family);
429
- if ( variant && variant.indexOf("italic") >= 0 ) {
386
+ if ( variant.indexOf("italic") >= 0 ) {
430
387
  $(".font-preview").css("font-style","italic");
431
388
  }
432
389
  else {
433
390
  $(".font-preview").css("font-style","normal");
434
391
  }
435
- var weight = variant ? variant.match(/\d+/) : 400;
392
+ var weight = variant.match(/\d+/);
436
393
  if ( weight && weight != "" ) {
437
394
  $(".font-preview").css("font-weight",weight);
438
395
  }
@@ -449,7 +406,6 @@
449
406
  data: {
450
407
  family: family,
451
408
  variant: variant,
452
- // variant_id: variant_id,
453
409
  url: url,
454
410
  name: name
455
411
  },
@@ -467,20 +423,19 @@
467
423
  $(document).ready(function() {
468
424
 
469
425
  $.ajax({
470
- url: 'https://www.googleapis.com/webfonts/v1/webfonts?sort=popularity&key=AIzaSyAv6j9aPfc18FwIoTixYhvq1kr8vWT7H2g',
426
+ url: 'https://www.googleapis.com/webfonts/v1/webfonts?sort=popularity&key=AIzaSyAjSs-Jq6hpuT35RG9wD6LuqaDFzYDCOPk',
471
427
  type: 'get',
472
428
  success: function(resp) {
473
429
  if ( resp.items ) {
474
- // console.dir(resp.items);
430
+ // console.dir(resp.items);
475
431
  <% fonts = Caboose::FontFamily.all %>
476
432
  <% fonts.each do |f| %>
477
- <% next if f.font_variants.count == 0 %>
478
- <% variants = f.font_variants.where("weight is not null").order(:sort_order).all %>
433
+ <% variants = f.font_variants.order(:sort_order).all %>
479
434
  resp.items.unshift({
480
435
  category: "sans-serif",
481
436
  family: "<%= f.name %>",
482
437
  files: { <% variants.each do |v| %>
483
- <%= v.style ? (v.weight == 'regular' && v.style == 'italic' ? 'italic' : (v.style + v.weight)) : v.weight %>: "<%= v.ttf_file && !v.ttf_file.url.include?('missing') ? v.ttf_file.url : v.ttf_url %>",
438
+ <%= v.style ? (v.weight == 'regular' && v.style == 'italic' ? 'italic' : (v.style + v.weight)) : v.weight %>: "<%= v.ttf_url %>",
484
439
  <% end %> },
485
440
  variants: [ <% variants.each_with_index do |v,i| %>
486
441
  "<%= v.style ? (v.weight == 'regular' && v.style == 'italic' ? 'italic' : (v.style + v.weight)) : v.weight %>",