Commit 8924daedfb8f3cc48966dc06354f9c0064fa3cc2
1 parent
78ad0c16
Exists in
staging
and in
42 other branches
Look for .html.erb instead of .rhtml
Showing
4 changed files
with
11 additions
and
19 deletions
Show diff stats
app/controllers/admin/users_controller.rb
@@ -16,7 +16,7 @@ class UsersController < AdminController | @@ -16,7 +16,7 @@ class UsersController < AdminController | ||
16 | end | 16 | end |
17 | format.csv do | 17 | format.csv do |
18 | @users = User.find(:all, :conditions => {:environment_id => environment.id}, :include => [:person]) | 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 | end | 20 | end |
21 | end | 21 | end |
22 | end | 22 | end |
app/controllers/application_controller.rb
@@ -128,7 +128,7 @@ class ApplicationController < ActionController::Base | @@ -128,7 +128,7 @@ class ApplicationController < ActionController::Base | ||
128 | def render_not_found(path = nil) | 128 | def render_not_found(path = nil) |
129 | @no_design_blocks = true | 129 | @no_design_blocks = true |
130 | @path ||= request.path | 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 | end | 132 | end |
133 | alias :render_404 :render_not_found | 133 | alias :render_404 :render_not_found |
134 | 134 | ||
@@ -136,7 +136,7 @@ class ApplicationController < ActionController::Base | @@ -136,7 +136,7 @@ class ApplicationController < ActionController::Base | ||
136 | @no_design_blocks = true | 136 | @no_design_blocks = true |
137 | @message = message | 137 | @message = message |
138 | @title = title | 138 | @title = title |
139 | - render :template => 'shared/access_denied.rhtml', :status => 403 | 139 | + render :template => 'shared/access_denied.html.erb', :status => 403 |
140 | end | 140 | end |
141 | 141 | ||
142 | def load_category | 142 | def load_category |
app/helpers/application_helper.rb
@@ -265,8 +265,6 @@ module ApplicationHelper | @@ -265,8 +265,6 @@ module ApplicationHelper | ||
265 | concat(content_tag('div', capture(&block) + tag('br', :style => 'clear: left;'), { :class => 'button-bar' }.merge(options))) | 265 | concat(content_tag('div', capture(&block) + tag('br', :style => 'clear: left;'), { :class => 'button-bar' }.merge(options))) |
266 | end | 266 | end |
267 | 267 | ||
268 | - VIEW_EXTENSIONS = %w[.rhtml .html.erb] | ||
269 | - | ||
270 | def partial_for_class_in_view_path(klass, view_path, suffix = nil) | 268 | def partial_for_class_in_view_path(klass, view_path, suffix = nil) |
271 | return nil if klass.nil? | 269 | return nil if klass.nil? |
272 | name = [klass.name.underscore, suffix].compact.map(&:to_s).join('_') | 270 | name = [klass.name.underscore, suffix].compact.map(&:to_s).join('_') |
@@ -279,10 +277,8 @@ module ApplicationHelper | @@ -279,10 +277,8 @@ module ApplicationHelper | ||
279 | search_name = "_" + search_name | 277 | search_name = "_" + search_name |
280 | end | 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 | partial_for_class_in_view_path(klass.superclass, view_path, suffix) | 283 | partial_for_class_in_view_path(klass.superclass, view_path, suffix) |
288 | end | 284 | end |
@@ -302,9 +298,7 @@ module ApplicationHelper | @@ -302,9 +298,7 @@ module ApplicationHelper | ||
302 | raise ArgumentError, 'No profile actions view for this class.' if klass.nil? | 298 | raise ArgumentError, 'No profile actions view for this class.' if klass.nil? |
303 | 299 | ||
304 | name = klass.name.underscore | 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 | view_for_profile_actions(klass.superclass) | 303 | view_for_profile_actions(klass.superclass) |
310 | end | 304 | end |
@@ -393,12 +387,10 @@ module ApplicationHelper | @@ -393,12 +387,10 @@ module ApplicationHelper | ||
393 | end | 387 | end |
394 | 388 | ||
395 | def theme_include(template) | 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 | end | 393 | end |
401 | - end | ||
402 | nil | 394 | nil |
403 | end | 395 | end |
404 | 396 | ||
@@ -1125,7 +1117,7 @@ module ApplicationHelper | @@ -1125,7 +1117,7 @@ module ApplicationHelper | ||
1125 | def render_environment_features(folder) | 1117 | def render_environment_features(folder) |
1126 | result = '' | 1118 | result = '' |
1127 | environment.enabled_features.keys.each do |feature| | 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 | if File.exists?(file) | 1121 | if File.exists?(file) |
1130 | result << render(:file => file, :use_full_path => false) | 1122 | result << render(:file => file, :use_full_path => false) |
1131 | end | 1123 | end |
app/views/layouts/application.html.erb
@@ -116,7 +116,7 @@ | @@ -116,7 +116,7 @@ | ||
116 | </div><!-- id="footer" --> | 116 | </div><!-- id="footer" --> |
117 | 117 | ||
118 | <%# if you need to add HTML stuff to the layout, include it in | 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 | <%= noosfero_layout_features %> | 120 | <%= noosfero_layout_features %> |
121 | </body> | 121 | </body> |
122 | </html> | 122 | </html> |