X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/1f7dd79daf44de5f8f8b6c246a269e44bb258175..78631eb0cc05881452aa71ddfa628573abe5e098:/app/helpers/application_helper.rb diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 49608c4a0..b91710b9c 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -26,6 +26,7 @@ module ApplicationHelper 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 and @user.administrator?; + css << ".hide_unless_moderator { display: none !important }" unless @user and @user.moderator?; return content_tag(:style, css, :type => "text/css") end @@ -95,4 +96,8 @@ module ApplicationHelper I18n.t("html.dir") end end + + def friendly_date(date) + content_tag(:span, time_ago_in_words(date), :title => l(date, :format => :friendly)) + end end