Merge pull request #3914 from asphxia/3149-timeago-show-timestamp

Hovering a Timeago-String should show the Timestamp
This commit is contained in:
Jonne Haß 2013-01-31 08:54:03 -08:00
commit dc8a0eb94b
5 changed files with 8 additions and 3 deletions

View file

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

View file

@ -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();
});

View file

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

View file

@ -32,7 +32,7 @@
<span class="details grey">
-
<a href="/posts/{{id}}">
<time class="timeago" datetime="{{created_at}}" />
<time class="timeago" data-original-title="{{{localTime created_at}}}" datetime="{{created_at}}" />
</a>
{{#if interactions.reshares_count}}

View file

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