Merge branch 'add_issue_edited_timestamp' into 'master'

Add issue edited timestamp

Comments already have this feature.
So, I think, issues should also have it.
![Снимок экрана 2014-11-08 в 17.07.10](https://gitlab.com/uploads/vernik91/gitlab-ce/4e87a15130/%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA_%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0_2014-11-08_%D0%B2_17.07.10.png)

See merge request !235
This commit is contained in:
Dmitriy Zaporozhets 2014-11-12 11:02:25 +00:00
commit c58edd7c70
2 changed files with 14 additions and 1 deletions

View file

@ -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?

View file

@ -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)