2012-09-27 20:59:42 +02:00
|
|
|
class CompareController < ProjectResourceController
|
2012-09-20 21:20:48 +02:00
|
|
|
# Authorize
|
|
|
|
before_filter :authorize_read_project!
|
|
|
|
before_filter :authorize_code_access!
|
|
|
|
before_filter :require_non_empty_project
|
|
|
|
|
2012-09-26 05:10:50 +02:00
|
|
|
def index
|
|
|
|
end
|
|
|
|
|
2012-09-20 21:20:48 +02:00
|
|
|
def show
|
|
|
|
result = Commit.compare(project, params[:from], params[:to])
|
|
|
|
|
|
|
|
@commits = result[:commits]
|
|
|
|
@commit = result[:commit]
|
|
|
|
@diffs = result[:diffs]
|
|
|
|
@refs_are_same = result[:same]
|
|
|
|
@line_notes = []
|
|
|
|
end
|
2012-09-26 05:10:50 +02:00
|
|
|
|
|
|
|
def create
|
|
|
|
redirect_to project_compare_path(@project, params[:from], params[:to])
|
|
|
|
end
|
2012-09-20 21:20:48 +02:00
|
|
|
end
|