Skip to content
Browse files

Getting rid of url_for's :escape option.

  • Loading branch information...
1 parent 656d1b3 commit ff4a589ab4819601b6bdac64a9d64f88c8bf97aa @baldowl committed
View
4 lib/auto_admin_django_theme.rb
@@ -96,7 +96,7 @@ def static_text_without_theme(field, options = {})
v = @object.send(field)
if v == true || v == false
v = v ? 'Yes' : 'No'
- helpers.send(:image_tag, helpers.send(:url_for, :escape => false, :action => :asset, :path => "images/auto_admin/icon-#{v.downcase}.gif" ), :alt => v, :title => v)
+ helpers.send(:image_tag, helpers.send(:url_for, :action => :asset, :path => %W(images auto_admin icon-#{v.downcase}.gif)), :alt => v, :title => v)
else
super
end
@@ -130,7 +130,7 @@ def delete_button options={}
<<-foo
<a href="#" onclick="this.getElementsByTagName('input')[0].value = 'DELETE'; this.parentNode.parentNode.style.display = 'none'; return false;">
<input type="hidden" value="" name="#{@object_name}[delete]" />
- #{helpers.send(:image_tag, helpers.send(:url_for, :escape => false, :action => :asset, :path => "images/auto_admin/icon_deletelink.gif" ), :alt => ' [X]', :title => 'Delete')}
+ #{helpers.send(:image_tag, helpers.send(:url_for, :action => :asset, :path => %w(images auto_admin icon_deletelink.gif)), :alt => ' [X]', :title => 'Delete')}
</a>
foo
end
View
2 lib/auto_admin_helper.rb
@@ -47,7 +47,7 @@ def value_html_for object, field, explicit_none=false, return_klass=false
cell_content = case column && column.type
when :boolean
value = value ? 'Yes' : 'No'
- image_tag url_for( :escape => false, :action => :asset, :path => "images/auto_admin/icon-#{value.downcase}.gif" ), :alt => value, :title => value
+ image_tag url_for(:action => :asset, :path => %W(images auto_admin icon-#{value.downcase}.gif)), :alt => value, :title => value
else
h value
end
View
4 themes/django/public/stylesheets/auto_admin.css
@@ -1,5 +1,5 @@
-@import url(stylesheets/auto_admin_global.css);
-@import url(stylesheets/auto_admin_changelists.css);
+@import url(auto_admin_global.css);
+@import url(auto_admin_changelists.css);
#branding h1 a { color: #f4f379 !important; }
th.boolean, td.boolean { text-align: center; }
View
2 themes/django/views/layouts/layout.html.erb
@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-us" xml:lang="en-us">
<head>
<title><%=h @title ? "#{@title} | " : '' %><%=h site.name %></title>
- <%= tag("link", { "rel" => "Stylesheet", "type" => "text/css", "media" => "screen", "href" => url_for( :action => 'asset', :path => 'stylesheets/auto_admin.css', :escape => false ) } ) %>
+ <%= tag("link", { "rel" => "Stylesheet", "type" => "text/css", "media" => "screen", "href" => url_for( :action => 'asset', :path => %w(stylesheets auto_admin.css)) } ) %>
<%= javascript_include_tag :defaults %>
<%= tag("meta", { "http-equiv" => "refresh", "content" => @auto_admin_refresh_time } ) if @auto_admin_refresh_time %>
</head>
View
2 themes/django/views/list.html.erb
@@ -9,7 +9,7 @@
<% if model.searchable? %>
<div id="toolbar"><form id="changelist-search" action="" method="get">
- <label><%= image_tag url_for( :action => 'asset', :path => 'images/auto_admin/icon_searchbox.png', :escape => false ), :alt => 'Search for:', :title => 'Search' %></label>
+ <label><%= image_tag url_for( :action => 'asset', :path => %w(images auto_admin icon_searchbox.png)), :alt => 'Search for:', :title => 'Search' %></label>
<%= text_field_tag :search, params[:search], :id => 'searchbar', :size => 40 %>
<%= submit_tag 'Go', :name => nil %>
<%= current_list_page_as_fields :search %>

0 comments on commit ff4a589

Please sign in to comment.
Something went wrong with that request. Please try again.