2 include ActionView::Helpers::TranslationHelper
4 def note_description(author, description, first_comment)
5 if !author.nil? && author.status == "deleted"
6 RichText.new("text", t("notes.show.description_when_author_is_deleted"))
7 elsif first_comment&.event != "opened"
8 RichText.new("text", t("notes.show.description_when_there_is_no_opening_comment"))
14 def note_event(event, at, by)
16 t("notes.show.event_#{event}_by_anonymous_html",
17 :time_ago => friendly_date_ago(at))
19 t("notes.show.event_#{event}_by_html",
20 :time_ago => friendly_date_ago(at),
21 :user => note_author(by))
25 def note_author(author, link_options = {})
28 elsif author.status == "deleted"
29 t("users.no_such_user.deleted")
31 link_to h(author.display_name), link_options.merge(:controller => "/users", :action => "show", :display_name => author.display_name),
32 :class => "mw-100 d-inline-block align-bottom text-truncate text-wrap", :dir => "auto"