summaryrefslogtreecommitdiff
path: root/app/helpers/application_helper.rb
diff options
context:
space:
mode:
authorblackst0ne <blackst0ne.ru@gmail.com>2017-05-03 16:32:21 +1100
committerblackst0ne <blackst0ne.ru@gmail.com>2017-05-04 12:58:41 +1100
commit7ad5a1b371f5d319369a6b9d6609c40dea6292c2 (patch)
tree2df1a0335961fde770dd4e8594a60d8d6841123f /app/helpers/application_helper.rb
parentb82870afc0031cb830976fb36cd1237c6059397f (diff)
downloadgitlab-ce-7ad5a1b371f5d319369a6b9d6609c40dea6292c2.tar.gz
Add last_edited_at and last_edited_by attributes
Diffstat (limited to 'app/helpers/application_helper.rb')
-rw-r--r--app/helpers/application_helper.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index b9d375d9b64..0ff6ab48808 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -181,15 +181,15 @@ module ApplicationHelper
end
def edited_time_ago_with_tooltip(object, placement: 'top', html_class: 'time_ago', include_author: false)
- return if object.updated_at == object.created_at
+ return if object.last_edited_at == object.created_at || object.last_edited_at.blank?
- content_tag :small, class: "edited-text" do
- output = content_tag(:span, "Edited ")
- output << time_ago_with_tooltip(object.updated_at, placement: placement, html_class: html_class)
+ 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)
- if include_author && object.updated_by
- output << content_tag(:span, " by ")
- output << link_to_member(object.project, object.updated_by, avatar: false, author_class: nil)
+ if include_author && object.last_edited_by
+ output << content_tag(:span, ' by ')
+ output << link_to_member(object.project, object.last_edited_by, avatar: false, author_class: nil)
end
output