Sha256: 8b8213dfa9940f3d387ba2b7865cc8171e186974c8232b2fba704a4f41425d41

Contents?: true

Size: 1.86 KB

Versions: 18

Compression:

Stored size: 1.86 KB

Contents

<% if !@page.nil? && @page.title != 'Access Denied' %>
<% content_for :js do %>
<%= javascript_include_tag "caboose/application" %>
<script>window.loggedIn = <%= logged_in?.to_json %></script>
<% Caboose::javascripts.each do |js| %><%= javascript_include_tag(js) %><% end %>
<% @page.linked_resources_map[:js].each do |r| %><%= javascript_include_tag r %><% end %>
<%= yield :caboose_js %>
<% end %>  
<% content_for :css do %>
<%= stylesheet_link_tag('caboose/application') %>
<% Caboose::stylesheets.each do |css| %><%= stylesheet_link_tag(css) %><% end %>
<% @page.linked_resources_map[:css].each do |r| %><%= stylesheet_link_tag r %><% 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, {     
    :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
  })       
  str.gsub!('|CABOOSE_CSS|'        , yield(:css))
  str.gsub!('|CABOOSE_JAVASCRIPT|' , yield(:js))  
  str.gsub!('|CABOOSE_CSRF|'       , csrf_meta_tags)  
  
  %><%= 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
%>

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
caboose-cms-0.4.72 app/views/layouts/caboose/application.html.erb
caboose-cms-0.4.71 app/views/layouts/caboose/application.html.erb
caboose-cms-0.4.70 app/views/layouts/caboose/application.html.erb
caboose-cms-0.4.69 app/views/layouts/caboose/application.html.erb
caboose-cms-0.4.68 app/views/layouts/caboose/application.html.erb
caboose-cms-0.4.67 app/views/layouts/caboose/application.html.erb
caboose-cms-0.4.66 app/views/layouts/caboose/application.html.erb
caboose-cms-0.4.65 app/views/layouts/caboose/application.html.erb
caboose-cms-0.4.64 app/views/layouts/caboose/application.html.erb
caboose-cms-0.4.63 app/views/layouts/caboose/application.html.erb
caboose-cms-0.4.62 app/views/layouts/caboose/application.html.erb
caboose-cms-0.4.61 app/views/layouts/caboose/application.html.erb
caboose-cms-0.4.60 app/views/layouts/caboose/application.html.erb
caboose-cms-0.4.59 app/views/layouts/caboose/application.html.erb
caboose-cms-0.4.58 app/views/layouts/caboose/application.html.erb
caboose-cms-0.4.57 app/views/layouts/caboose/application.html.erb
caboose-cms-0.4.56 app/views/layouts/caboose/application.html.erb
caboose-cms-0.4.55 app/views/layouts/caboose/application.html.erb