summaryrefslogtreecommitdiff
path: root/app/helpers
diff options
context:
space:
mode:
authorLuke "Jared" Bennett <lbennett@gitlab.com>2017-05-18 13:24:34 +0100
committerLuke "Jared" Bennett <lbennett@gitlab.com>2017-05-31 11:35:05 +0100
commit07c984d81cd7985d4ab7597cbb21b5f623b438e9 (patch)
tree8296ba468bad7e2d62f8d82d6dcbfac5fa5a659e /app/helpers
parent228926daee799c95e752a3c284c860e5bc60e528 (diff)
downloadgitlab-ce-07c984d81cd7985d4ab7597cbb21b5f623b438e9.tar.gz
Port fix-realtime-edited-text-for-issues 9-2-stable fix to master.
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/application_helper.rb2
-rw-r--r--app/helpers/editable_helper.rb13
2 files changed, 14 insertions, 1 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index e5e64650708..e87d8dc21cc 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -181,7 +181,7 @@ module ApplicationHelper
end
def edited_time_ago_with_tooltip(object, placement: 'top', html_class: 'time_ago', exclude_author: false)
- return if object.last_edited_at == object.created_at || object.last_edited_at.blank?
+ return unless object.is_edited?
content_tag :small, class: 'edited-text' do
output = content_tag(:span, 'Edited ')
diff --git a/app/helpers/editable_helper.rb b/app/helpers/editable_helper.rb
new file mode 100644
index 00000000000..e3ad62e8c18
--- /dev/null
+++ b/app/helpers/editable_helper.rb
@@ -0,0 +1,13 @@
+module EditableHelper
+ def updated_at_by(editable)
+ return nil unless editable.is_edited?
+
+ {
+ updated_at: editable.updated_at,
+ updated_by: {
+ name: editable.last_edited_by.name,
+ path: user_path(editable.last_edited_by)
+ }
+ }
+ end
+end