X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/81a6c7b7bebb06c2e9711451e6795f65b34d59ca..3a654c89197b40f4a623c0dd33b87b415623d97d:/app/helpers/application_helper.rb?ds=inline diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 59ba7d171..ec6c455b3 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -133,6 +133,22 @@ module ApplicationHelper content_tag(:span, time_ago_in_words(date), :title => l(date, :format => :friendly)) end + def note_author(object, link_options = {}) + if object.author.nil? + h(object.author_name) + else + link_to h(object.author_name), link_options.merge({:controller => "user", :action => "view", :display_name => object.author_name}) + end + end + + def with_format(format, &block) + old_format = @template_format + @template_format = format + result = block.call + @template_format = old_format + return result + end + private def javascript_strings_for_key(key)