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
Léo-Paul Géneau
gitlab-ce
Commits
4b2ecbc4
Commit
4b2ecbc4
authored
Dec 07, 2012
by
Koen Punt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated branch-graph, abstracted some code in seperate functions
Removed unused Raphael.fn.popup
parent
e1282d50
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
149 additions
and
160 deletions
+149
-160
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+7
-13
app/views/projects/graph.html.haml
app/views/projects/graph.html.haml
+4
-1
lib/gitlab/graph/json_builder.rb
lib/gitlab/graph/json_builder.rb
+2
-2
vendor/assets/javascripts/branch-graph.js
vendor/assets/javascripts/branch-graph.js
+136
-144
No files found.
app/controllers/projects_controller.rb
View file @
4b2ecbc4
...
@@ -54,12 +54,12 @@ class ProjectsController < ProjectResourceController
...
@@ -54,12 +54,12 @@ class ProjectsController < ProjectResourceController
respond_to
do
|
format
|
respond_to
do
|
format
|
format
.
html
do
format
.
html
do
unless
@project
.
empty_repo?
unless
@project
.
empty_repo?
@last_push
=
current_user
.
recent_push
(
@project
.
id
)
@last_push
=
current_user
.
recent_push
(
@project
.
id
)
render
:show
render
:show
else
else
render
"projects/empty"
render
"projects/empty"
end
end
end
end
format
.
js
format
.
js
end
end
...
@@ -83,19 +83,13 @@ class ProjectsController < ProjectResourceController
...
@@ -83,19 +83,13 @@ class ProjectsController < ProjectResourceController
end
end
def
graph
def
graph
respond_to
do
|
format
|
respond_to
do
|
format
|
format
.
html
format
.
html
format
.
json
do
format
.
json
do
graph
=
Gitlab
::
Graph
::
JsonBuilder
.
new
(
project
)
graph
=
Gitlab
::
Graph
::
JsonBuilder
.
new
(
project
)
#@days_json, @commits_json = graph.days_json, graph.commits_json
render
:json
=>
graph
.
to_json
render
:text
=>
graph
.
to_json
end
end
end
end
end
end
def
destroy
def
destroy
...
...
app/views/projects/graph.html.haml
View file @
4b2ecbc4
...
@@ -9,5 +9,8 @@
...
@@ -9,5 +9,8 @@
:javascript
:javascript
var
branch_graph
;
var
branch_graph
;
$
(
function
(){
$
(
function
(){
branch_graph
=
new
BranchGraph
(
$
(
"
#holder
"
),
'
#{
url_for
:controller
=>
'projects'
,
:action
=>
'graph'
}
'
);
branch_graph
=
new
BranchGraph
(
$
(
"
#holder
"
),
{
url
:
'
#{
url_for
controller:
'projects'
,
action:
'graph'
,
format: :json
}
'
,
commit_url
:
'
#{
url_for
controller:
'projects'
,
action:
'show'
}
/commits/%s
'
});
});
});
lib/gitlab/graph/json_builder.rb
View file @
4b2ecbc4
...
@@ -18,11 +18,11 @@ module Gitlab
...
@@ -18,11 +18,11 @@ module Gitlab
@days
=
index_commits
@days
=
index_commits
end
end
def
to_json
def
to_json
(
*
args
)
{
{
days:
@days
.
compact
.
map
{
|
d
|
[
d
.
day
,
d
.
strftime
(
"%b"
)]
},
days:
@days
.
compact
.
map
{
|
d
|
[
d
.
day
,
d
.
strftime
(
"%b"
)]
},
commits:
@commits
.
map
(
&
:to_graph_hash
)
commits:
@commits
.
map
(
&
:to_graph_hash
)
}.
to_json
}.
to_json
(
*
args
)
end
end
protected
protected
...
...
vendor/assets/javascripts/branch-graph.js
View file @
4b2ecbc4
This diff is collapsed.
Click to expand it.
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