Skip to content

Commit

Permalink
Removed hardcoded references to formatting and theme and home CSS fil…
Browse files Browse the repository at this point in the history
…es and moved formatting and theme to asset pipeline and home to home.html.erb using content_for.

Fixes #1456
  • Loading branch information
parndt committed Mar 18, 2012
1 parent 152f94c commit 6017ce4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
3 changes: 1 addition & 2 deletions core/app/views/refinery/_head.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
<%= csrf_meta_tags if Refinery::Core.authenticity_token_on_frontend -%>
<%= yield :meta %>
<%= stylesheet_link_tag "application", "formatting", "theme" %>
<%= stylesheet_link_tag "home" if home_page? %>
<%= stylesheet_link_tag "application" %>
<%= yield :stylesheets %>
<%= render '/refinery/google_analytics' %>
Expand Down
11 changes: 11 additions & 0 deletions core/lib/generators/refinery/cms/cms_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ def generate

append_gitignore!

append_asset_pipeline!

forced_overwriting?

copy_files!
Expand All @@ -47,6 +49,15 @@ def generate

protected

def append_asset_pipeline!
application_css = 'app/assets/stylesheets/application.css'
if destination_path.join(application_css).file?
insert_into_file application_css, %q{*= require formatting
*= require theme
}, :before => "*= require_self"
end
end

def append_gemfile!
gsub_file 'Gemfile', %q{gem 'sqlite3'}, %q{group :development, :test do
gem 'sqlite3'
Expand Down
1 change: 1 addition & 0 deletions pages/app/views/refinery/pages/home.html.erb
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
<% content_for :stylesheets, stylesheet_link_tag('home') %>

This comment has been minimized.

Copy link
@simi

simi Mar 26, 2012

Member

This is killing me. You can style your home by some id or class. We need to get rid of all content_for :assets.

This comment has been minimized.

Copy link
@parndt

parndt Mar 26, 2012

Author Member

@simi I know, but this is the first step. You're welcome to patch it the rest of the way!

<%= render '/refinery/content_page' %>

0 comments on commit 6017ce4

Please sign in to comment.