Merge branch 'gh-issue-1509' of https://github.com/koenpunt/gitlabhq into koenpunt-gh-issue-1509
Conflicts: vendor/assets/javascripts/branch-graph.js
This commit is contained in:
commit
a47032bc29
8 changed files with 276 additions and 201 deletions
BIN
app/assets/images/ajax_loader_gray.gif
Normal file
BIN
app/assets/images/ajax_loader_gray.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.2 KiB |
|
@ -18,10 +18,3 @@ $ ->
|
|||
# Ref switcher
|
||||
$('.project-refs-select').on 'change', ->
|
||||
$(@).parents('form').submit()
|
||||
|
||||
class @GraphNav
|
||||
@init: ->
|
||||
$('.graph svg').css 'position', 'relative'
|
||||
$('body').bind 'keyup', (e) ->
|
||||
$('.graph svg').animate(left: '+=400') if e.keyCode is 37 # left
|
||||
$('.graph svg').animate(left: '-=400') if e.keyCode is 39 # right
|
||||
|
|
|
@ -57,6 +57,9 @@ table a code {
|
|||
background: url(ajax_loader.gif) no-repeat center center;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
&.loading-gray {
|
||||
background: url(ajax_loader_gray.gif) no-repeat center center;
|
||||
}
|
||||
}
|
||||
|
||||
/** FLASH message **/
|
||||
|
|
|
@ -58,12 +58,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
|
||||
|
@ -87,9 +87,13 @@ class ProjectsController < ProjectResourceController
|
|||
end
|
||||
|
||||
def graph
|
||||
graph = Gitlab::Graph::JsonBuilder.new(project)
|
||||
|
||||
@days_json, @commits_json = graph.days_json, graph.commits_json
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.json do
|
||||
graph = Gitlab::Graph::JsonBuilder.new(project)
|
||||
render :json => graph.to_json
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def destroy
|
||||
|
|
|
@ -2,13 +2,15 @@
|
|||
%br
|
||||
.graph_holder
|
||||
%h4
|
||||
%small You can move around the graph by using arrow keys.
|
||||
%small You can move around the graph by using the arrow keys.
|
||||
#holder.graph
|
||||
.loading.loading-gray
|
||||
|
||||
:javascript
|
||||
var chunk1={commits:#{@commits_json}};
|
||||
var days=#{@days_json};
|
||||
initGraph();
|
||||
var branch_graph;
|
||||
$(function(){
|
||||
branchGraph($("#holder")[0]);
|
||||
GraphNav.init();
|
||||
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