1 # frozen_string_literal: true
 
   4   include ActionView::Helpers::TranslationHelper
 
   6   def note_description(author, description, first_comment)
 
   7     if !author.nil? && author.status == "deleted"
 
   8       RichText.new("text", t("notes.show.description_when_author_is_deleted"))
 
   9     elsif first_comment&.event != "opened"
 
  10       RichText.new("text", t("notes.show.description_when_there_is_no_opening_comment"))
 
  16   def note_event(event, at, by)
 
  18       t("notes.show.event_#{event}_by_anonymous_html",
 
  19         :time_ago => friendly_date_ago(at))
 
  21       t("notes.show.event_#{event}_by_html",
 
  22         :time_ago => friendly_date_ago(at),
 
  23         :user => note_author(by))
 
  27   def note_author(author, link_options = {})
 
  30     elsif author.status == "deleted"
 
  31       t("users.no_such_user.deleted")
 
  33       link_to h(author.display_name), link_options.merge(:controller => "/users", :action => "show", :display_name => author.display_name),
 
  34               :class => "mw-100 d-inline-block align-bottom text-truncate text-wrap", :dir => "auto"