Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kazuhiko Shiozaki
gitlab-ce
Commits
9a7e2399
Commit
9a7e2399
authored
Dec 30, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use jquery timeago plugin
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
e2dbe0fa
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
5 deletions
+6
-5
app/assets/javascripts/main.js.coffee
app/assets/javascripts/main.js.coffee
+1
-0
app/helpers/application_helper.rb
app/helpers/application_helper.rb
+4
-4
app/views/events/_event.html.haml
app/views/events/_event.html.haml
+1
-1
No files found.
app/assets/javascripts/main.js.coffee
View file @
9a7e2399
...
@@ -81,6 +81,7 @@ $ ->
...
@@ -81,6 +81,7 @@ $ ->
$
(
@
).
parents
(
'form'
).
submit
()
$
(
@
).
parents
(
'form'
).
submit
()
$
(
"abbr.timeago"
).
timeago
()
$
(
"abbr.timeago"
).
timeago
()
$
(
'.js-timeago'
).
timeago
()
# Flash
# Flash
if
(
flash
=
$
(
".flash-container"
)).
length
>
0
if
(
flash
=
$
(
".flash-container"
)).
length
>
0
...
...
app/helpers/application_helper.rb
View file @
9a7e2399
...
@@ -72,7 +72,7 @@ module ApplicationHelper
...
@@ -72,7 +72,7 @@ module ApplicationHelper
def
last_commit
(
project
)
def
last_commit
(
project
)
if
project
.
repo_exists?
if
project
.
repo_exists?
time_ago_with_tooltip
(
project
.
repository
.
commit
.
committed_date
)
+
" ago"
time_ago_with_tooltip
(
project
.
repository
.
commit
.
committed_date
)
else
else
"Never"
"Never"
end
end
...
@@ -210,11 +210,11 @@ module ApplicationHelper
...
@@ -210,11 +210,11 @@ module ApplicationHelper
def
time_ago_with_tooltip
(
date
,
placement
=
'top'
,
html_class
=
'time_ago'
)
def
time_ago_with_tooltip
(
date
,
placement
=
'top'
,
html_class
=
'time_ago'
)
capture_haml
do
capture_haml
do
haml_tag
:time
,
time_ago_in_words
(
date
)
,
haml_tag
:time
,
date
.
to_s
,
class:
html_class
,
datetime:
date
,
title:
date
.
stamp
(
"Aug 21, 2011 9:23pm"
),
class:
html_class
,
datetime:
date
.
getutc
.
iso8601
,
title:
date
.
stamp
(
"Aug 21, 2011 9:23pm"
),
data:
{
toggle:
'tooltip'
,
placement:
placement
}
data:
{
toggle:
'tooltip'
,
placement:
placement
}
haml_tag
:script
,
"$('."
+
html_class
+
"').tooltip()"
haml_tag
:script
,
"$('."
+
html_class
+
"').t
imeago().t
ooltip()"
end
.
html_safe
end
.
html_safe
end
end
end
end
app/views/events/_event.html.haml
View file @
9a7e2399
-
if
event
.
proper?
-
if
event
.
proper?
.event-item
{
class:
"#{event.body? ? "
event
-
block
" : "
event
-
inline
" }"
}
.event-item
{
class:
"#{event.body? ? "
event
-
block
" : "
event
-
inline
" }"
}
%span
.cgray.pull-right
%span
.cgray.pull-right
#{
time_ago_with_tooltip
(
event
.
created_at
)
}
ago
#{
time_ago_with_tooltip
(
event
.
created_at
)
}
=
cache
event
do
=
cache
event
do
=
image_tag
avatar_icon
(
event
.
author_email
,
24
),
class:
"avatar s24"
,
alt
:''
=
image_tag
avatar_icon
(
event
.
author_email
,
24
),
class:
"avatar s24"
,
alt
:''
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment