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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
94690bd2
Commit
94690bd2
authored
Nov 13, 2011
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Graph: base implementation
parent
6b66a766
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
48 additions
and
25 deletions
+48
-25
app/assets/stylesheets/projects.css.scss
app/assets/stylesheets/projects.css.scss
+10
-1
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+1
-3
app/views/layouts/project.html.haml
app/views/layouts/project.html.haml
+1
-1
app/views/projects/graph.html.haml
app/views/projects/graph.html.haml
+9
-0
lib/assets/javascripts/branch-graph.js
lib/assets/javascripts/branch-graph.js
+27
-20
No files found.
app/assets/stylesheets/projects.css.scss
View file @
94690bd2
...
@@ -468,4 +468,13 @@ body.project-page table .commit {
...
@@ -468,4 +468,13 @@ body.project-page table .commit {
/** UI autocomplete **/
/** UI autocomplete **/
.ui-autocomplete
{
@include
round-borders-all
(
5px
);
}
.ui-autocomplete
{
@include
round-borders-all
(
5px
);
}
.ui-menu-item
{
cursor
:
pointer
}
.ui-menu-item
{
cursor
:
pointer
}
#holder
{
border
:
solid
1px
#999
;
cursor
:
move
;
height
:
70%
;
overflow
:
scroll
;
position
:
absolute
;
width
:
auto
;
margin
:
6ex
3ex
0ex
0ex
;
}
app/controllers/projects_controller.rb
View file @
94690bd2
...
@@ -150,11 +150,9 @@ class ProjectsController < ApplicationController
...
@@ -150,11 +150,9 @@ class ProjectsController < ApplicationController
h
[
:id
]
=
c
.
sha
h
[
:id
]
=
c
.
sha
h
[
:date
]
=
c
.
date
h
[
:date
]
=
c
.
date
h
[
:message
]
=
c
.
message
.
force_encoding
(
"UTF-8"
)
h
[
:message
]
=
c
.
message
.
force_encoding
(
"UTF-8"
)
h
[
:
email
]
=
c
.
author
.
email
h
[
:
login
]
=
c
.
author
.
email
h
h
end
.
to_json
end
.
to_json
render
:text
=>
@commits_json
end
end
def
blob
def
blob
...
...
app/views/layouts/project.html.haml
View file @
94690bd2
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
=
link_to
"History"
,
project_path
(
@project
),
:class
=>
current_page?
(
:controller
=>
"projects"
,
:action
=>
"show"
,
:id
=>
@project
)
?
"current"
:
nil
=
link_to
"History"
,
project_path
(
@project
),
:class
=>
current_page?
(
:controller
=>
"projects"
,
:action
=>
"show"
,
:id
=>
@project
)
?
"current"
:
nil
=
link_to
"Tree"
,
tree_project_path
(
@project
),
:class
=>
current_page?
(
:controller
=>
"projects"
,
:action
=>
"tree"
,
:id
=>
@project
)
?
"current"
:
nil
=
link_to
"Tree"
,
tree_project_path
(
@project
),
:class
=>
current_page?
(
:controller
=>
"projects"
,
:action
=>
"tree"
,
:id
=>
@project
)
?
"current"
:
nil
=
link_to
"Commits"
,
project_commits_path
(
@project
),
:class
=>
current_page?
(
:controller
=>
"commits"
,
:action
=>
"index"
,
:project_id
=>
@project
)
?
"current"
:
nil
=
link_to
"Commits"
,
project_commits_path
(
@project
),
:class
=>
current_page?
(
:controller
=>
"commits"
,
:action
=>
"index"
,
:project_id
=>
@project
)
?
"current"
:
nil
=
link_to
"Network graph"
,
graph_project_path
(
@project
),
:class
=>
current_page?
(
:controller
=>
"projects"
,
:action
=>
"graph"
,
:
project_
id
=>
@project
)
?
"current"
:
nil
=
link_to
"Network graph"
,
graph_project_path
(
@project
),
:class
=>
current_page?
(
:controller
=>
"projects"
,
:action
=>
"graph"
,
:id
=>
@project
)
?
"current"
:
nil
=
link_to
team_project_path
(
@project
),
:class
=>
(
current_page?
(
:controller
=>
"projects"
,
:action
=>
"team"
,
:id
=>
@project
)
||
controller
.
controller_name
==
"team_members"
)
?
"current"
:
nil
do
=
link_to
team_project_path
(
@project
),
:class
=>
(
current_page?
(
:controller
=>
"projects"
,
:action
=>
"team"
,
:id
=>
@project
)
||
controller
.
controller_name
==
"team_members"
)
?
"current"
:
nil
do
Team
Team
-
if
@project
.
users_projects
.
count
>
0
-
if
@project
.
users_projects
.
count
>
0
...
...
app/views/projects/graph.html.haml
0 → 100644
View file @
94690bd2
#holder
.graph
:javascript
var
chunk1
=
{
commits
:
#{
@commits_json
}
};
var
days
=
#{
@days_json
}
;
initGraph
();
$
(
function
(){
branchGraph
(
$
(
"
#holder
"
)[
0
]);
});
lib/assets/javascripts/branch-graph.js
View file @
94690bd2
var
commits
=
chunk1
.
commits
,
var
commits
=
{}
,
comms
=
{},
comms
=
{},
pixelsX
=
[],
pixelsX
=
[],
pixelsY
=
[],
pixelsY
=
[],
mmax
=
Math
.
max
,
mmax
=
Math
.
max
,
mtime
=
0
,
mtime
=
0
,
mspace
=
0
,
mspace
=
0
,
parents
=
{};
parents
=
{},
for
(
var
i
=
0
,
ii
=
commits
.
length
;
i
<
ii
;
i
++
)
{
ii
=
0
,
for
(
var
j
=
0
,
jj
=
commits
[
i
].
parents
.
length
;
j
<
jj
;
j
++
)
{
colors
=
[
"
#000
"
];
parents
[
commits
[
i
].
parents
[
j
][
0
]]
=
true
;
}
function
initGraph
(){
mtime
=
Math
.
max
(
mtime
,
commits
[
i
].
time
);
commits
=
chunk1
.
commits
;
mspace
=
Math
.
max
(
mspace
,
commits
[
i
].
space
);
ii
=
commits
.
length
;
}
for
(
var
i
=
0
;
i
<
ii
;
i
++
)
{
mtime
=
mtime
+
4
;
for
(
var
j
=
0
,
jj
=
commits
[
i
].
parents
.
length
;
j
<
jj
;
j
++
)
{
mspace
=
mspace
+
10
;
parents
[
commits
[
i
].
parents
[
j
][
0
]]
=
true
;
for
(
i
=
0
;
i
<
ii
;
i
++
)
{
}
if
(
commits
[
i
].
id
in
parents
)
{
mtime
=
Math
.
max
(
mtime
,
commits
[
i
].
time
);
commits
[
i
].
isParent
=
true
;
mspace
=
Math
.
max
(
mspace
,
commits
[
i
].
space
);
}
}
comms
[
commits
[
i
].
id
]
=
commits
[
i
];
mtime
=
mtime
+
4
;
}
mspace
=
mspace
+
10
;
var
colors
=
[
"
#000
"
];
for
(
i
=
0
;
i
<
ii
;
i
++
)
{
for
(
var
k
=
0
;
k
<
mspace
;
k
++
)
{
if
(
commits
[
i
].
id
in
parents
)
{
colors
.
push
(
Raphael
.
getColor
());
commits
[
i
].
isParent
=
true
;
}
comms
[
commits
[
i
].
id
]
=
commits
[
i
];
}
for
(
var
k
=
0
;
k
<
mspace
;
k
++
)
{
colors
.
push
(
Raphael
.
getColor
());
}
}
}
function
branchGraph
(
holder
)
{
function
branchGraph
(
holder
)
{
var
ch
=
mspace
*
20
+
20
,
cw
=
mtime
*
20
+
20
,
var
ch
=
mspace
*
20
+
20
,
cw
=
mtime
*
20
+
20
,
r
=
Raphael
(
"
holder
"
,
cw
,
ch
),
r
=
Raphael
(
"
holder
"
,
cw
,
ch
),
...
...
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