Extract head/body content from layout to allow better integration into app-defined layouts.
Doug Puchalski
committed Apr 26, 2011
commit 3cc3140d82ab0d643f9d314f4b1d4671bfbc3c2f
Showing 3
changed files with
34 additions
and 32 deletions
app/views/layouts/_cms_admin_body.html.erb
+26
-0
| @@ | @@ -0,0 +1,26 @@ |
| + | <div class='body_wrapper'> |
| + | <div class='left_column'> |
| + | <div class='left_column_content'> |
| + | <% unless ComfortableMexicanSofa.config.auto_manage_sites %> |
| + | <%= active_link_to 'Sites', cms_admin_sites_path %> |
| + | <% end %> |
| + | <%= active_link_to 'Layouts', cms_admin_layouts_path %> |
| + | <%= active_link_to 'Pages', cms_admin_pages_path %> |
| + | <%= active_link_to 'Snippets', cms_admin_snippets_path %> |
| + | <%= cms_hook :navigation %> |
| + | </div> |
| + | </div> |
| + | <div class='right_column'> |
| + | <div class='right_column_content'> |
| + | <%= yield :right_column %> |
| + | </div> |
| + | </div> |
| + | <div class='center_column'> |
| + | <% flash.each do |type, message| %> |
| + | <div class='flash <%= type %>'><%= message %></div> |
| + | <% end %> |
| + | <div class='center_column_content'> |
| + | <%= yield %> |
| + | </div> |
| + | </div> |
| + | </div> |
app/views/layouts/_cms_admin_head.html.erb
+6
-0
| @@ | @@ -0,0 +1,6 @@ |
| + | <meta http-equiv="Content-type" content="text/html; charset=utf-8"> |
| + | <title><%= ComfortableMexicanSofa.config.cms_title %></title> |
| + | <%= csrf_meta_tag %> |
| + | <%= stylesheet_link_tag :cms, :cache => ('_cms' if ComfortableMexicanSofa.config.enable_caching) %> |
| + | <%= javascript_include_tag :cms, :cache => ('_cms' if ComfortableMexicanSofa.config.enable_caching) %> |
| + | <%= javascript_include_tag :tiny_mce %> |
app/views/layouts/cms_admin.html.erb
+2
-32
| @@ | @@ -1,41 +1,11 @@ |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| - | <meta http-equiv="Content-type" content="text/html; charset=utf-8"> |
| - | <title><%= ComfortableMexicanSofa.config.cms_title %></title> |
| - | <%= csrf_meta_tag %> |
| - | <%= stylesheet_link_tag :cms, :cache => ('_cms' if ComfortableMexicanSofa.config.enable_caching) %> |
| - | <%= javascript_include_tag :cms, :cache => ('_cms' if ComfortableMexicanSofa.config.enable_caching) %> |
| - | <%= javascript_include_tag :tiny_mce %> |
| + | <%= render :partial => 'layouts/cms_admin_head' %> |
| <%= yield :head %> | |
| <%= cms_hook :html_head %> | |
| </head> | |
| <body class='c_<%= params[:controller].idify %> a_<%= params[:action].idify %>'> | |
| - | <div class='body_wrapper'> |
| - | <div class='left_column'> |
| - | <div class='left_column_content'> |
| - | <% unless ComfortableMexicanSofa.config.auto_manage_sites %> |
| - | <%= active_link_to 'Sites', cms_admin_sites_path %> |
| - | <% end %> |
| - | <%= active_link_to 'Layouts', cms_admin_layouts_path %> |
| - | <%= active_link_to 'Pages', cms_admin_pages_path %> |
| - | <%= active_link_to 'Snippets', cms_admin_snippets_path %> |
| - | <%= cms_hook :navigation %> |
| - | </div> |
| - | </div> |
| - | <div class='right_column'> |
| - | <div class='right_column_content'> |
| - | <%= yield :right_column %> |
| - | </div> |
| - | </div> |
| - | <div class='center_column'> |
| - | <% flash.each do |type, message| %> |
| - | <div class='flash <%= type %>'><%= message %></div> |
| - | <% end %> |
| - | <div class='center_column_content'> |
| - | <%= yield %> |
| - | </div> |
| - | </div> |
| - | </div> |
| + | <%= render :partial => 'layouts/cms_admin_body' %> |
| </body> | |
| </html> | |
| \ No newline at end of file | |