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
2a687dd5
Commit
2a687dd5
authored
Feb 28, 2013
by
Sato Hiroyuki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show gravatar icon on tooltip.
parent
00d0e57e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
6 deletions
+12
-6
app/assets/javascripts/branch-graph.js
app/assets/javascripts/branch-graph.js
+4
-3
app/controllers/graph_controller.rb
app/controllers/graph_controller.rb
+4
-0
app/models/graph/commit.rb
app/models/graph/commit.rb
+4
-3
No files found.
app/assets/javascripts/branch-graph.js
View file @
2a687dd5
...
@@ -320,15 +320,16 @@
...
@@ -320,15 +320,16 @@
}(
this
);
}(
this
);
Raphael
.
fn
.
commitTooltip
=
function
(
x
,
y
,
commit
){
Raphael
.
fn
.
commitTooltip
=
function
(
x
,
y
,
commit
){
var
nameText
,
idText
,
messageText
var
icon
,
nameText
,
idText
,
messageText
,
boxWidth
=
300
,
boxWidth
=
300
,
boxHeight
=
200
;
,
boxHeight
=
200
;
nameText
=
this
.
text
(
x
,
y
+
10
,
commit
.
author
.
name
);
icon
=
this
.
image
(
commit
.
author
.
icon
,
x
,
y
,
20
,
20
);
nameText
=
this
.
text
(
x
+
25
,
y
+
10
,
commit
.
author
.
name
);
idText
=
this
.
text
(
x
,
y
+
35
,
commit
.
id
);
idText
=
this
.
text
(
x
,
y
+
35
,
commit
.
id
);
messageText
=
this
.
text
(
x
,
y
+
50
,
commit
.
message
);
messageText
=
this
.
text
(
x
,
y
+
50
,
commit
.
message
);
textSet
=
this
.
set
(
nameText
,
idText
,
messageText
).
attr
({
textSet
=
this
.
set
(
icon
,
nameText
,
idText
,
messageText
).
attr
({
"
text-anchor
"
:
"
start
"
,
"
text-anchor
"
:
"
start
"
,
"
font
"
:
"
12px Monaco, monospace
"
"
font
"
:
"
12px Monaco, monospace
"
});
});
...
...
app/controllers/graph_controller.rb
View file @
2a687dd5
class
GraphController
<
ProjectResourceController
class
GraphController
<
ProjectResourceController
include
ExtractsPath
include
ExtractsPath
include
ApplicationHelper
# Authorize
# Authorize
before_filter
:authorize_read_project!
before_filter
:authorize_read_project!
...
@@ -21,6 +22,9 @@ class GraphController < ProjectResourceController
...
@@ -21,6 +22,9 @@ class GraphController < ProjectResourceController
format
.
html
format
.
html
format
.
json
do
format
.
json
do
graph
=
Graph
::
JsonBuilder
.
new
(
project
,
@ref
,
@commit
)
graph
=
Graph
::
JsonBuilder
.
new
(
project
,
@ref
,
@commit
)
graph
.
commits
.
each
do
|
c
|
c
.
icon
=
gravatar_icon
(
c
.
author
.
email
)
end
render
:json
=>
graph
.
to_json
render
:json
=>
graph
.
to_json
end
end
end
end
...
...
app/models/graph/commit.rb
View file @
2a687dd5
...
@@ -4,7 +4,7 @@ module Graph
...
@@ -4,7 +4,7 @@ module Graph
class
Commit
class
Commit
include
ActionView
::
Helpers
::
TagHelper
include
ActionView
::
Helpers
::
TagHelper
attr_accessor
:time
,
:spaces
,
:refs
,
:parent_spaces
attr_accessor
:time
,
:spaces
,
:refs
,
:parent_spaces
,
:icon
def
initialize
(
commit
)
def
initialize
(
commit
)
@_commit
=
commit
@_commit
=
commit
...
@@ -23,8 +23,9 @@ module Graph
...
@@ -23,8 +23,9 @@ module Graph
[
p
.
id
,
0
,
0
]
[
p
.
id
,
0
,
0
]
end
end
h
[
:author
]
=
{
h
[
:author
]
=
{
name:
author
.
name
,
name:
author
.
name
,
email:
author
.
email
email:
author
.
email
,
icon:
icon
}
}
h
[
:time
]
=
time
h
[
:time
]
=
time
h
[
:space
]
=
spaces
.
first
h
[
:space
]
=
spaces
.
first
...
...
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