Commit 9a7e2399dd766bae96ed15b6e6d4c69374d310fe
1 parent
e2dbe0fa
Exists in
spb-stable
and in
3 other branches
Use jquery timeago plugin
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Showing
3 changed files
with
6 additions
and
5 deletions
Show diff stats
app/assets/javascripts/main.js.coffee
app/helpers/application_helper.rb
... | ... | @@ -72,7 +72,7 @@ module ApplicationHelper |
72 | 72 | |
73 | 73 | def last_commit(project) |
74 | 74 | if project.repo_exists? |
75 | - time_ago_with_tooltip(project.repository.commit.committed_date) + " ago" | |
75 | + time_ago_with_tooltip(project.repository.commit.committed_date) | |
76 | 76 | else |
77 | 77 | "Never" |
78 | 78 | end |
... | ... | @@ -210,11 +210,11 @@ module ApplicationHelper |
210 | 210 | |
211 | 211 | def time_ago_with_tooltip(date, placement = 'top', html_class = 'time_ago') |
212 | 212 | capture_haml do |
213 | - haml_tag :time, time_ago_in_words(date), | |
214 | - class: html_class, datetime: date, title: date.stamp("Aug 21, 2011 9:23pm"), | |
213 | + haml_tag :time, date.to_s, | |
214 | + class: html_class, datetime: date.getutc.iso8601, title: date.stamp("Aug 21, 2011 9:23pm"), | |
215 | 215 | data: { toggle: 'tooltip', placement: placement } |
216 | 216 | |
217 | - haml_tag :script, "$('." + html_class + "').tooltip()" | |
217 | + haml_tag :script, "$('." + html_class + "').timeago().tooltip()" | |
218 | 218 | end.html_safe |
219 | 219 | end |
220 | 220 | end | ... | ... |
app/views/events/_event.html.haml
1 | 1 | - if event.proper? |
2 | 2 | .event-item{class: "#{event.body? ? "event-block" : "event-inline" }"} |
3 | 3 | %span.cgray.pull-right |
4 | - #{time_ago_with_tooltip(event.created_at)} ago | |
4 | + #{time_ago_with_tooltip(event.created_at)} | |
5 | 5 | |
6 | 6 | = cache event do |
7 | 7 | = image_tag avatar_icon(event.author_email, 24), class: "avatar s24", alt:'' | ... | ... |