<% if @page && @page.title != 'Access Denied' %> <% content_for :js do %> <%= javascript_include_tag "caboose/application" %> <%= javascript_include_tag @site.name == 'application' ? 'application' : "#{@site.name}/js/application" %> <% Caboose::javascripts.each do |js| %><%= javascript_include_tag(js) %><% end %> <% @page.linked_resources_map[:js].each do |r| %><%= javascript_include_tag r %><% end %> <% if @page.custom_js && @page.custom_js.strip.length > 0 %><% end %> <%= yield :caboose_js %> <% end %> <% content_for :css do %> <%= stylesheet_link_tag 'caboose/application' %> <%= stylesheet_link_tag @site.name == 'application' ? 'application' : "#{@site.name}/css/application" %> <% Caboose::stylesheets.each do |css| %><%= stylesheet_link_tag(css) %><% end %> <% @page.linked_resources_map[:css].each do |r| %><%= stylesheet_link_tag r %><% end %> <% if @page.custom_css && @page.custom_css.strip.length > 0 %><% end %> <%= yield :caboose_css %> <% end %> <% b = @page.block if b.nil? bt = Caboose::BlockType.where(:name => 'layout_basic').first Caboose::Block.create(:page_id => @page.id, :block_type_id => bt.id) b = @page.block b.create_children end #b.log_helper str = b.render(b, { :page => @page, :view => self, :controller_view_content => yield, :modal => false, :empty_text => defined?(@editing) && @editing ? (defined?(@empty_text) ? @empty_text : 'Empty, click to edit') : "", :editing => defined?(@editing) ? @editing : false, :css => '|CABOOSE_CSS|', :js => '|CABOOSE_JAVASCRIPT|', :csrf_meta_tags => '|CABOOSE_CSRF|', :csrf_meta_tags2 => '|CABOOSE_CSRF|', :logged_in_user => @logged_in_user, :site => @site }) protocol = request.protocol css = yield(:css) css.gsub!("<%= raw str %><% #b = @page.block # #raw b.render(b, { # :controller_view_content => yield, # :modal => false, # :empty_text => '', # :editing => defined?(@editing) ? @editing : false, # :css => yield(:css), # :js => yield(:js), # :csrf_meta_tags => csrf_meta_tags # }) end %>