diff options
author | Nikita Verkhovin <vernik91@gmail.com> | 2014-11-08 16:54:08 +0600 |
---|---|---|
committer | Nikita Verkhovin <vernik91@gmail.com> | 2014-11-08 16:54:08 +0600 |
commit | 2148e1997ace8bb5efab214c07492ed5a372dd31 (patch) | |
tree | 4a1a3dde2803990f4779cd55c85e4ac1f49285dc | |
parent | 36f9224e4a79b49d0958476395d1472ba9b52a2a (diff) | |
download | gitlab-ce-2148e1997ace8bb5efab214c07492ed5a372dd31.tar.gz |
Add issue edited timestamp
-rw-r--r-- | app/helpers/issues_helper.rb | 13 | ||||
-rw-r--r-- | app/views/projects/issues/show.html.haml | 2 |
2 files changed, 14 insertions, 1 deletions
diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index 7671033b539..d513e0ba58e 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -62,6 +62,19 @@ module IssuesHelper '' end + def issue_timestamp(issue) + # Shows the created at time and the updated at time if different + ts = "#{time_ago_with_tooltip(issue.created_at, 'bottom', 'note_created_ago')}" + if issue.updated_at != issue.created_at + ts << capture_haml do + haml_tag :small do + haml_concat " (Edited #{time_ago_with_tooltip(issue.updated_at, 'bottom', 'issue_edited_ago')})" + end + end + end + ts.html_safe + end + # Checks if issues_tracker setting exists in gitlab.yml def external_issues_tracker_enabled? Gitlab.config.issues_tracker && Gitlab.config.issues_tracker.values.any? diff --git a/app/views/projects/issues/show.html.haml b/app/views/projects/issues/show.html.haml index 71eb0d5c866..aad58e48f6c 100644 --- a/app/views/projects/issues/show.html.haml +++ b/app/views/projects/issues/show.html.haml @@ -39,7 +39,7 @@ Open .creator - Created by #{link_to_member(@project, @issue.author)} #{time_ago_with_tooltip(@issue.created_at)} + Created by #{link_to_member(@project, @issue.author)} #{issue_timestamp(@issue)} %h4.title = gfm escape_once(@issue.title) |