summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-11-12 11:02:25 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-11-12 11:02:25 +0000
commitc58edd7c708c39a6e7c60bd96c7f97ced370f304 (patch)
tree20001199b9e5849b5263ad0bd4560a57ad1ffa91
parent95e8f9797a5027cc6ad1276055271ac29a4e8c62 (diff)
parent2148e1997ace8bb5efab214c07492ed5a372dd31 (diff)
downloadgitlab-ce-c58edd7c708c39a6e7c60bd96c7f97ced370f304.tar.gz
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
-rw-r--r--app/helpers/issues_helper.rb13
-rw-r--r--app/views/projects/issues/show.html.haml2
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)