diff options
author | Seb Bacon <seb.bacon@gmail.com> | 2011-02-25 17:27:14 +0000 |
---|---|---|
committer | Seb Bacon <seb.bacon@gmail.com> | 2011-03-10 10:56:15 +0000 |
commit | bad54dec3d0f153e22bf94bded4be6cf98be3a9c (patch) | |
tree | 61ea3280f278cff65d0f39afa3ccca04a7f7d163 | |
parent | 75c6cde4d869c190fc10ce36ec96f818efb1970f (diff) |
add a "custom_css" template, so we can easily overlay it from plugins
-rw-r--r-- | app/controllers/general_controller.rb | 6 | ||||
-rw-r--r-- | app/views/general/custom_css.rhtml | 1 | ||||
-rw-r--r-- | app/views/layouts/default.rhtml | 3 | ||||
-rw-r--r-- | config/routes.rb | 2 |
4 files changed, 10 insertions, 2 deletions
diff --git a/app/controllers/general_controller.rb b/app/controllers/general_controller.rb index df46c4ae8..cf28208a0 100644 --- a/app/controllers/general_controller.rb +++ b/app/controllers/general_controller.rb @@ -153,5 +153,11 @@ class GeneralController < ApplicationController render :text => "awake\n" end + def custom_css + @locale = self.locale_from_params() + render(:layout => false, :content_type => 'text/css') + end + + end diff --git a/app/views/general/custom_css.rhtml b/app/views/general/custom_css.rhtml new file mode 100644 index 000000000..0def82ed0 --- /dev/null +++ b/app/views/general/custom_css.rhtml @@ -0,0 +1 @@ +// this should be overridden in a local "theme" plugin diff --git a/app/views/layouts/default.rhtml b/app/views/layouts/default.rhtml index 92a0ce11f..be302103a 100644 --- a/app/views/layouts/default.rhtml +++ b/app/views/layouts/default.rhtml @@ -24,10 +24,11 @@ <!--[if LT IE 7]> <style type="text/css">@import url("/stylesheets/ie6.css");</style> <![endif]--> - <%= stylesheet_link_tag 'main-custom', :title => "Main", :rel => "stylesheet" %> <!--[if LT IE 7]> <style type="text/css">@import url("/stylesheets/ie6-custom.css");</style> <![endif]--> + <%= stylesheet_link_tag 'main-custom', :title => "Main", :rel => "stylesheet" %> + <link href="http://127.0.0.1:3000/custom.css" media="screen" rel="stylesheet" type="text/css"> <% if @feed_autodetect %> <% for feed in @feed_autodetect %> diff --git a/config/routes.rb b/config/routes.rb index d0e102070..7af41ac92 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -17,7 +17,7 @@ ActionController::Routing::Routes.draw do |map| map.with_options :controller => 'general' do |general| general.frontpage '/', :action => 'frontpage' general.blog '/blog', :action => 'blog' - + general.custom_css '/custom.css', :action => 'custom_css' general.search_redirect '/search', :action => 'search_redirect' # XXX combined is the search query, and then if sorted a "/newest" at the end. # Couldn't find a way to do this in routes which also picked up multiple other slashes |