Updated branch-graph, abstracted some code in seperate functions
Removed unused Raphael.fn.popup
This commit is contained in:
parent
e1282d507f
commit
4b2ecbc420
4 changed files with 150 additions and 161 deletions
|
@ -54,12 +54,12 @@ class ProjectsController < ProjectResourceController
|
|||
|
||||
respond_to do |format|
|
||||
format.html do
|
||||
unless @project.empty_repo?
|
||||
@last_push = current_user.recent_push(@project.id)
|
||||
render :show
|
||||
else
|
||||
render "projects/empty"
|
||||
end
|
||||
unless @project.empty_repo?
|
||||
@last_push = current_user.recent_push(@project.id)
|
||||
render :show
|
||||
else
|
||||
render "projects/empty"
|
||||
end
|
||||
end
|
||||
format.js
|
||||
end
|
||||
|
@ -83,19 +83,13 @@ class ProjectsController < ProjectResourceController
|
|||
end
|
||||
|
||||
def graph
|
||||
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.json do
|
||||
graph = Gitlab::Graph::JsonBuilder.new(project)
|
||||
#@days_json, @commits_json = graph.days_json, graph.commits_json
|
||||
render :text => graph.to_json
|
||||
render :json => graph.to_json
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
||||
def destroy
|
||||
|
|
|
@ -9,5 +9,8 @@
|
|||
:javascript
|
||||
var branch_graph;
|
||||
$(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'
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue