@import In Published View

In the Stylesheet Tweaks, the owner of a Web can specify an @import rule
to pull in CSS styles form an external file. This worked in the "show"
view, but was broken in the "published" view.

Fixed.

Also, update a functional test to match Revision 313.
This commit is contained in:
Jacques Distler 2008-12-22 12:19:18 -06:00
parent 0c681c7775
commit 1192f70f44
3 changed files with 4 additions and 6 deletions

View file

@ -22,11 +22,9 @@
} }
<%= File.read(RAILS_ROOT + '/public/stylesheets/instiki.css') if @inline_style %> <%= File.read(RAILS_ROOT + '/public/stylesheets/instiki.css') if @inline_style %>
</style> </style>
<%= stylesheet_link_tag 'instiki' unless @inline_style %> <%= stylesheet_link_tag 'instiki' unless @inline_style %>
<style type="text/css"><%= @style_additions %></style>
<style type="text/css"><!--/*--><![CDATA[/*><!--*/ <style type="text/css"><!--/*--><![CDATA[/*><!--*/
<%= @style_additions %>
<%= @web ? @web.additional_style : '' %> <%= @web ? @web.additional_style : '' %>
/*]]>*/--></style> /*]]>*/--></style>
<%= javascript_include_tag :defaults %> <%= javascript_include_tag :defaults %>

View file

@ -2,7 +2,7 @@
@title = @page.plain_name @title = @page.plain_name
@hide_navigation = false @hide_navigation = false
@style_additions = ".newWikiWord { background-color: white; font-style: italic; }" @style_additions = ".newWikiWord { background-color: white; font-style: italic; }"
@inline_style = true @inline_style = false
@show_footer = true @show_footer = true
-%> -%>

View file

@ -97,7 +97,7 @@ class AdminControllerTest < Test::Unit::TestCase
process 'create_web', 'system_password' => 'wrong', 'name' => 'Wiki Two', 'address' => 'wiki2' process 'create_web', 'system_password' => 'wrong', 'name' => 'Wiki Two', 'address' => 'wiki2'
assert_redirected_to :web => nil, :action => 'index' assert_redirected_to :web => nil, :action => 'create_web'
assert_nil @wiki.webs['wiki2'] assert_nil @wiki.webs['wiki2']
end end