From 8924daedfb8f3cc48966dc06354f9c0064fa3cc2 Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Tue, 25 Dec 2012 23:03:59 -0300 Subject: [PATCH] Look for .html.erb instead of .rhtml --- app/controllers/admin/users_controller.rb | 2 +- app/controllers/application_controller.rb | 4 ++-- app/helpers/application_helper.rb | 22 +++++++--------------- app/views/layouts/application.html.erb | 2 +- 4 files changed, 11 insertions(+), 19 deletions(-) diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb index 489ca10..19579e2 100644 --- a/app/controllers/admin/users_controller.rb +++ b/app/controllers/admin/users_controller.rb @@ -16,7 +16,7 @@ class UsersController < AdminController end format.csv do @users = User.find(:all, :conditions => {:environment_id => environment.id}, :include => [:person]) - render :template => "users/index_csv.rhtml", :content_type => 'text/csv', :layout => false + render :template => "users/index_csv.html.erb", :content_type => 'text/csv', :layout => false end end end diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index d972521..06fddc6 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -128,7 +128,7 @@ class ApplicationController < ActionController::Base def render_not_found(path = nil) @no_design_blocks = true @path ||= request.path - render :template => 'shared/not_found.rhtml', :status => 404, :layout => get_layout + render :template => 'shared/not_found.html.erb', :status => 404, :layout => get_layout end alias :render_404 :render_not_found @@ -136,7 +136,7 @@ class ApplicationController < ActionController::Base @no_design_blocks = true @message = message @title = title - render :template => 'shared/access_denied.rhtml', :status => 403 + render :template => 'shared/access_denied.html.erb', :status => 403 end def load_category diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 04dda8d..0302fd9 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -265,8 +265,6 @@ module ApplicationHelper concat(content_tag('div', capture(&block) + tag('br', :style => 'clear: left;'), { :class => 'button-bar' }.merge(options))) end - VIEW_EXTENSIONS = %w[.rhtml .html.erb] - def partial_for_class_in_view_path(klass, view_path, suffix = nil) return nil if klass.nil? name = [klass.name.underscore, suffix].compact.map(&:to_s).join('_') @@ -279,10 +277,8 @@ module ApplicationHelper search_name = "_" + search_name end - VIEW_EXTENSIONS.each do |ext| - path = defined?(params) && params[:controller] ? File.join(view_path, params[:controller], search_name+ext) : File.join(view_path, search_name+ext) - return name if File.exists?(File.join(path)) - end + path = defined?(params) && params[:controller] ? File.join(view_path, params[:controller], search_name + '.html.erb') : File.join(view_path, search_name + '.html.erb') + return name if File.exists?(File.join(path)) partial_for_class_in_view_path(klass.superclass, view_path, suffix) end @@ -302,9 +298,7 @@ module ApplicationHelper raise ArgumentError, 'No profile actions view for this class.' if klass.nil? name = klass.name.underscore - VIEW_EXTENSIONS.each do |ext| - return "blocks/profile_info_actions/"+name+ext if File.exists?(File.join(Rails.root, 'app', 'views', 'blocks', 'profile_info_actions', name+ext)) - end + return "blocks/profile_info_actions/" + name + '.html.erb' if File.exists?(File.join(Rails.root, 'app', 'views', 'blocks', 'profile_info_actions', name + '.html.erb')) view_for_profile_actions(klass.superclass) end @@ -393,12 +387,10 @@ module ApplicationHelper end def theme_include(template) - ['.rhtml', '.html.erb'].each do |ext| - file = (Rails.root + '/public' + theme_path + '/' + template + ext) - if File.exists?(file) - return render :file => file, :use_full_path => false + file = (Rails.root + '/public' + theme_path + '/' + template + '.html.erb') + if File.exists?(file) + return render :file => file, :use_full_path => false end - end nil end @@ -1125,7 +1117,7 @@ module ApplicationHelper def render_environment_features(folder) result = '' environment.enabled_features.keys.each do |feature| - file = File.join(controller.view_paths.last, 'shared', folder.to_s, "#{feature}.rhtml") + file = File.join(Rails.root, 'app/views/shared', folder.to_s, "#{feature}.html.erb") if File.exists?(file) result << render(:file => file, :use_full_path => false) end diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 6f34e78..a9eb739 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -116,7 +116,7 @@ <%# if you need to add HTML stuff to the layout, include it in - app/views/shared/noosfero_layout_features.rhtml! %> + app/views/shared/noosfero_layout_features.html.erb! %> <%= noosfero_layout_features %> -- libgit2 0.21.2