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
Jérome Perrin
gitlab-ce
Commits
784aa266
Commit
784aa266
authored
Mar 06, 2013
by
Sato Hiroyuki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor: grouping parent and their space by including array.
parent
2f7f46b2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
5 deletions
+7
-5
app/assets/javascripts/branch-graph.js
app/assets/javascripts/branch-graph.js
+1
-1
app/helpers/graph_helper.rb
app/helpers/graph_helper.rb
+5
-0
app/views/graph/show.json.erb
app/views/graph/show.json.erb
+1
-4
No files found.
app/assets/javascripts/branch-graph.js
View file @
784aa266
...
@@ -117,7 +117,7 @@
...
@@ -117,7 +117,7 @@
// Draw lines
// Draw lines
for
(
var
j
=
0
,
jj
=
this
.
commits
[
i
].
parents
.
length
;
j
<
jj
;
j
++
)
{
for
(
var
j
=
0
,
jj
=
this
.
commits
[
i
].
parents
.
length
;
j
<
jj
;
j
++
)
{
c
=
this
.
preparedCommits
[
this
.
commits
[
i
].
parents
[
j
][
0
]];
c
=
this
.
preparedCommits
[
this
.
commits
[
i
].
parents
[
j
][
0
]];
ps
=
this
.
commits
[
i
].
parent
_spaces
[
j
];
ps
=
this
.
commits
[
i
].
parent
s
[
j
][
1
];
if
(
c
)
{
if
(
c
)
{
var
cx
=
offsetX
+
20
*
c
.
time
var
cx
=
offsetX
+
20
*
c
.
time
,
cy
=
offsetY
+
10
*
c
.
space
,
cy
=
offsetY
+
10
*
c
.
space
...
...
app/helpers/graph_helper.rb
View file @
784aa266
...
@@ -2,4 +2,9 @@ module GraphHelper
...
@@ -2,4 +2,9 @@ module GraphHelper
def
join_with_space
(
ary
)
def
join_with_space
(
ary
)
ary
.
collect
{
|
r
|
r
.
name
}.
join
(
" "
)
unless
ary
.
nil?
ary
.
collect
{
|
r
|
r
.
name
}.
join
(
" "
)
unless
ary
.
nil?
end
end
def
parents_zip_spaces
(
parents
,
parent_spaces
)
ids
=
parents
.
map
{
|
p
|
p
.
id
}
ids
.
zip
(
parent_spaces
)
end
end
end
app/views/graph/show.json.erb
View file @
784aa266
...
@@ -5,9 +5,7 @@
...
@@ -5,9 +5,7 @@
days:
@graph
.
days
.
compact
.
map
{
|
d
|
[
d
.
day
,
d
.
strftime
(
"%b"
)]
},
days:
@graph
.
days
.
compact
.
map
{
|
d
|
[
d
.
day
,
d
.
strftime
(
"%b"
)]
},
commits:
@graph
.
commits
.
map
do
|
c
|
commits:
@graph
.
commits
.
map
do
|
c
|
{
{
parents:
c
.
parents
.
collect
do
|
p
|
parents:
parents_zip_spaces
(
c
.
parents
,
c
.
parent_spaces
),
[
p
.
id
,
0
,
0
]
end
,
author:
{
author:
{
name:
c
.
author
.
name
,
name:
c
.
author
.
name
,
email:
c
.
author
.
email
,
email:
c
.
author
.
email
,
...
@@ -15,7 +13,6 @@
...
@@ -15,7 +13,6 @@
},
},
time:
c
.
time
,
time:
c
.
time
,
space:
c
.
spaces
.
first
,
space:
c
.
spaces
.
first
,
parent_spaces:
c
.
parent_spaces
,
refs:
join_with_space
(
c
.
refs
),
refs:
join_with_space
(
c
.
refs
),
id:
c
.
sha
,
id:
c
.
sha
,
date:
c
.
date
,
date:
c
.
date
,
...
...
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