2013-06-23 12:47:22 -04:00
|
|
|
class Projects::GraphsController < Projects::ApplicationController
|
2013-05-09 01:00:56 -04:00
|
|
|
# Authorize
|
|
|
|
before_filter :authorize_read_project!
|
|
|
|
before_filter :authorize_code_access!
|
|
|
|
before_filter :require_non_empty_project
|
2013-06-05 08:50:11 -04:00
|
|
|
|
2013-05-09 01:00:56 -04:00
|
|
|
def show
|
2013-06-05 08:50:11 -04:00
|
|
|
respond_to do |format|
|
|
|
|
format.html
|
|
|
|
format.js do
|
2013-06-25 06:55:03 -04:00
|
|
|
fetch_graph
|
2013-06-05 08:50:11 -04:00
|
|
|
end
|
|
|
|
end
|
2013-05-09 01:00:56 -04:00
|
|
|
end
|
2013-06-25 06:55:03 -04:00
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def fetch_graph
|
|
|
|
@log = @project.repository.graph_log.to_json
|
|
|
|
@success = true
|
|
|
|
rescue => ex
|
|
|
|
@log = []
|
|
|
|
@success = false
|
|
|
|
end
|
2013-06-05 08:50:11 -04:00
|
|
|
end
|