X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/dbd88d893f3c3fce9cafd666b94396988646d81f..8dc8479e12b50878ca6b476a4dd72fe1da1f24ad:/app/helpers/application_helper.rb diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index c5b08e515..a330eb5f9 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -3,9 +3,9 @@ module ApplicationHelper def linkify(text) if text.html_safe? - Rinku.auto_link(text, :urls, tag_options(:rel => "nofollow")).html_safe + Rinku.auto_link(text, :urls, tag_builder.tag_options(:rel => "nofollow")).html_safe else - Rinku.auto_link(text, :urls, tag_options(:rel => "nofollow")) + Rinku.auto_link(text, :urls, tag_builder.tag_options(:rel => "nofollow")) end end @@ -21,12 +21,12 @@ module ApplicationHelper css = "" css << ".hidden { display: none !important }" - css << ".hide_unless_logged_in { display: none !important }" unless @user - css << ".hide_if_logged_in { display: none !important }" if @user - css << ".hide_if_user_#{@user.id} { display: none !important }" if @user - css << ".show_if_user_#{@user.id} { display: inline !important }" if @user - css << ".hide_unless_administrator { display: none !important }" unless @user && @user.administrator? - css << ".hide_unless_moderator { display: none !important }" unless @user && @user.moderator? + css << ".hide_unless_logged_in { display: none !important }" unless current_user + css << ".hide_if_logged_in { display: none !important }" if current_user + css << ".hide_if_user_#{current_user.id} { display: none !important }" if current_user + css << ".show_if_user_#{current_user.id} { display: inline !important }" if current_user + css << ".hide_unless_administrator { display: none !important }" unless current_user && current_user.administrator? + css << ".hide_unless_moderator { display: none !important }" unless current_user && current_user.moderator? content_tag(:style, css, :type => "text/css") end @@ -107,11 +107,11 @@ module ApplicationHelper :preferred_editor => preferred_editor } - if @user - data[:user] = @user.id.to_json + if current_user + data[:user] = current_user.id.to_json - unless @user.home_lon.nil? || @user.home_lat.nil? - data[:user_home] = { :lat => @user.home_lat, :lon => @user.home_lon } + unless current_user.home_lon.nil? || current_user.home_lat.nil? + data[:user_home] = { :lat => current_user.home_lat, :lon => current_user.home_lon } end end