X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/9c04912f1deb7b114c61e838a6e4a4b7775167d8..b10e0c46de55a97f8d44953a178ff41af07c8221:/app/helpers/application_helper.rb diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index c78c3ea46..79c6e6134 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -5,7 +5,7 @@ module ApplicationHelper if text.html_safe? Rinku.auto_link(text, :urls, tag_builder.tag_options(:rel => "nofollow")).html_safe else - Rinku.auto_link(text, :urls, tag_builder.tag_options(:rel => "nofollow")) + Rinku.auto_link(ERB::Util.h(text), :urls, tag_builder.tag_options(:rel => "nofollow")).html_safe end end @@ -49,6 +49,10 @@ module ApplicationHelper content_tag(:span, time_ago_in_words(date), :title => l(date, :format => :friendly)) end + def friendly_date_ago(date) + content_tag(:span, time_ago_in_words(date, :scope => :'datetime.distance_in_words_ago'), :title => l(date, :format => :friendly)) + end + def body_class if content_for? :body_class content_for :body_class