diff --git a/Changelog.md b/Changelog.md index 55c78aee4..fce438cf0 100644 --- a/Changelog.md +++ b/Changelog.md @@ -51,6 +51,7 @@ * Excesive padding with "user-controls" in single post view. [#3861](https://github.com/diaspora/diaspora/issues/3861) * Resize full scaled image to a specific width. [#3818](https://github.com/diaspora/diaspora/issues/3818) * Fix translation issue in contacts_helper [#3937](https://github.com/diaspora/diaspora/pull/3937) +* Show timestamp hovering a timeago string (stream) [#3149](https://github.com/diaspora/diaspora/issues/3149) ## Gem Updates diff --git a/app/assets/javascripts/app/helpers/handlebars-helpers.js b/app/assets/javascripts/app/helpers/handlebars-helpers.js index c7c40a6de..a289b5a64 100644 --- a/app/assets/javascripts/app/helpers/handlebars-helpers.js +++ b/app/assets/javascripts/app/helpers/handlebars-helpers.js @@ -40,3 +40,7 @@ Handlebars.registerHelper('personImage', function(person, size, imageClass) { 'title': _.escape(person.name) }); }); + +Handlebars.registerHelper('localTime', function(timestamp) { + return new Date(timestamp).toLocaleString(); +}); \ No newline at end of file diff --git a/app/assets/javascripts/app/views/stream_post_views.js b/app/assets/javascripts/app/views/stream_post_views.js index 539b481dc..89ddf9927 100644 --- a/app/assets/javascripts/app/views/stream_post_views.js +++ b/app/assets/javascripts/app/views/stream_post_views.js @@ -20,7 +20,7 @@ app.views.StreamPost = app.views.Post.extend({ "click .block_user": "blockUser" }, - tooltipSelector : ".delete, .block_user, .post_scope, .ignore", + tooltipSelector : ".timeago, .delete, .block_user, .post_scope, .ignore", initialize : function(){ this.model.bind('remove', this.remove, this); diff --git a/app/assets/templates/stream-element_tpl.jst.hbs b/app/assets/templates/stream-element_tpl.jst.hbs index 4d4aacb11..4826ce5c1 100644 --- a/app/assets/templates/stream-element_tpl.jst.hbs +++ b/app/assets/templates/stream-element_tpl.jst.hbs @@ -32,7 +32,7 @@ - - {{#if interactions.reshares_count}} diff --git a/app/views/messages/_message.haml b/app/views/messages/_message.haml index aeb265a57..f471c3830 100644 --- a/app/views/messages/_message.haml +++ b/app/views/messages/_message.haml @@ -9,7 +9,7 @@ .bd = person_link(message.author, :class => 'author from') %time.timeago{:datetime => message.created_at} - = how_long_ago(message) + = t('ago', :time => time_ago_in_words(message.created_at)) %div{ :class => direction_for(message.text) } = markdownify(message, :oembed => true) \ No newline at end of file