Commit c58edd7c authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

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
parents 95e8f979 2148e199
...@@ -62,6 +62,19 @@ module IssuesHelper ...@@ -62,6 +62,19 @@ module IssuesHelper
'' ''
end 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 # Checks if issues_tracker setting exists in gitlab.yml
def external_issues_tracker_enabled? def external_issues_tracker_enabled?
Gitlab.config.issues_tracker && Gitlab.config.issues_tracker.values.any? Gitlab.config.issues_tracker && Gitlab.config.issues_tracker.values.any?
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
Open Open
.creator .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 %h4.title
= gfm escape_once(@issue.title) = gfm escape_once(@issue.title)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment