Commit 8924daedfb8f3cc48966dc06354f9c0064fa3cc2

Authored by Antonio Terceiro
1 parent 78ad0c16

Look for .html.erb instead of .rhtml

app/controllers/admin/users_controller.rb
... ... @@ -16,7 +16,7 @@ class UsersController < AdminController
16 16 end
17 17 format.csv do
18 18 @users = User.find(:all, :conditions => {:environment_id => environment.id}, :include => [:person])
19   - render :template => "users/index_csv.rhtml", :content_type => 'text/csv', :layout => false
  19 + render :template => "users/index_csv.html.erb", :content_type => 'text/csv', :layout => false
20 20 end
21 21 end
22 22 end
... ...
app/controllers/application_controller.rb
... ... @@ -128,7 +128,7 @@ class ApplicationController < ActionController::Base
128 128 def render_not_found(path = nil)
129 129 @no_design_blocks = true
130 130 @path ||= request.path
131   - render :template => 'shared/not_found.rhtml', :status => 404, :layout => get_layout
  131 + render :template => 'shared/not_found.html.erb', :status => 404, :layout => get_layout
132 132 end
133 133 alias :render_404 :render_not_found
134 134  
... ... @@ -136,7 +136,7 @@ class ApplicationController < ActionController::Base
136 136 @no_design_blocks = true
137 137 @message = message
138 138 @title = title
139   - render :template => 'shared/access_denied.rhtml', :status => 403
  139 + render :template => 'shared/access_denied.html.erb', :status => 403
140 140 end
141 141  
142 142 def load_category
... ...
app/helpers/application_helper.rb
... ... @@ -265,8 +265,6 @@ module ApplicationHelper
265 265 concat(content_tag('div', capture(&block) + tag('br', :style => 'clear: left;'), { :class => 'button-bar' }.merge(options)))
266 266 end
267 267  
268   - VIEW_EXTENSIONS = %w[.rhtml .html.erb]
269   -
270 268 def partial_for_class_in_view_path(klass, view_path, suffix = nil)
271 269 return nil if klass.nil?
272 270 name = [klass.name.underscore, suffix].compact.map(&:to_s).join('_')
... ... @@ -279,10 +277,8 @@ module ApplicationHelper
279 277 search_name = "_" + search_name
280 278 end
281 279  
282   - VIEW_EXTENSIONS.each do |ext|
283   - path = defined?(params) && params[:controller] ? File.join(view_path, params[:controller], search_name+ext) : File.join(view_path, search_name+ext)
284   - return name if File.exists?(File.join(path))
285   - end
  280 + path = defined?(params) && params[:controller] ? File.join(view_path, params[:controller], search_name + '.html.erb') : File.join(view_path, search_name + '.html.erb')
  281 + return name if File.exists?(File.join(path))
286 282  
287 283 partial_for_class_in_view_path(klass.superclass, view_path, suffix)
288 284 end
... ... @@ -302,9 +298,7 @@ module ApplicationHelper
302 298 raise ArgumentError, 'No profile actions view for this class.' if klass.nil?
303 299  
304 300 name = klass.name.underscore
305   - VIEW_EXTENSIONS.each do |ext|
306   - return "blocks/profile_info_actions/"+name+ext if File.exists?(File.join(Rails.root, 'app', 'views', 'blocks', 'profile_info_actions', name+ext))
307   - end
  301 + return "blocks/profile_info_actions/" + name + '.html.erb' if File.exists?(File.join(Rails.root, 'app', 'views', 'blocks', 'profile_info_actions', name + '.html.erb'))
308 302  
309 303 view_for_profile_actions(klass.superclass)
310 304 end
... ... @@ -393,12 +387,10 @@ module ApplicationHelper
393 387 end
394 388  
395 389 def theme_include(template)
396   - ['.rhtml', '.html.erb'].each do |ext|
397   - file = (Rails.root + '/public' + theme_path + '/' + template + ext)
398   - if File.exists?(file)
399   - return render :file => file, :use_full_path => false
  390 + file = (Rails.root + '/public' + theme_path + '/' + template + '.html.erb')
  391 + if File.exists?(file)
  392 + return render :file => file, :use_full_path => false
400 393 end
401   - end
402 394 nil
403 395 end
404 396  
... ... @@ -1125,7 +1117,7 @@ module ApplicationHelper
1125 1117 def render_environment_features(folder)
1126 1118 result = ''
1127 1119 environment.enabled_features.keys.each do |feature|
1128   - file = File.join(controller.view_paths.last, 'shared', folder.to_s, "#{feature}.rhtml")
  1120 + file = File.join(Rails.root, 'app/views/shared', folder.to_s, "#{feature}.html.erb")
1129 1121 if File.exists?(file)
1130 1122 result << render(:file => file, :use_full_path => false)
1131 1123 end
... ...
app/views/layouts/application.html.erb
... ... @@ -116,7 +116,7 @@
116 116 </div><!-- id="footer" -->
117 117  
118 118 <%# if you need to add HTML stuff to the layout, include it in
119   - app/views/shared/noosfero_layout_features.rhtml! %>
  119 + app/views/shared/noosfero_layout_features.html.erb! %>
120 120 <%= noosfero_layout_features %>
121 121 </body>
122 122 </html>
... ...