diff options
Diffstat (limited to 'app/helpers/application_helper.rb')
-rw-r--r-- | app/helpers/application_helper.rb | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 71f8478544b..7f1c28de8a7 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -191,16 +191,17 @@ module ApplicationHelper } end - def edited_time_ago_with_tooltip(object, placement: 'top', html_class: 'time_ago', exclude_author: false) - return unless object.edited? + def edited_time_ago_with_tooltip(editable_object, placement: 'top', html_class: 'time_ago', exclude_author: false) + return unless editable_object.edited? content_tag :small, class: 'edited-text' do - output = content_tag(:span, 'Edited ') - output << time_ago_with_tooltip(object.last_edited_at, placement: placement, html_class: html_class) + timeago = time_ago_with_tooltip(editable_object.last_edited_at, placement: placement, html_class: html_class) - if !exclude_author && object.last_edited_by - output << content_tag(:span, ' by ') - output << link_to_member(object.project, object.last_edited_by, avatar: false, extra_class: 'gl-hover-text-decoration-underline', author_class: nil) + if !exclude_author && editable_object.last_edited_by + author_link = link_to_member(editable_object.project, editable_object.last_edited_by, avatar: false, extra_class: 'gl-hover-text-decoration-underline', author_class: nil) + output = safe_format(_("Edited %{timeago} by %{author}"), timeago: timeago, author: author_link) + else + output = safe_format(_("Edited %{timeago}"), timeago: timeago) end output |