2011-10-08 21:36:38 +00:00
|
|
|
require "base64"
|
|
|
|
|
2013-06-23 16:47:22 +00:00
|
|
|
class Projects::CommitsController < Projects::ApplicationController
|
2012-09-20 19:32:00 +00:00
|
|
|
include ExtractsPath
|
|
|
|
|
2015-04-16 12:03:37 +00:00
|
|
|
before_action :require_non_empty_project
|
|
|
|
before_action :assign_ref_vars
|
|
|
|
before_action :authorize_download_code!
|
2011-10-08 21:36:38 +00:00
|
|
|
|
2012-09-20 19:32:00 +00:00
|
|
|
def show
|
2013-01-03 19:09:18 +00:00
|
|
|
@repo = @project.repository
|
2012-02-12 21:52:27 +00:00
|
|
|
@limit, @offset = (params[:limit] || 40), (params[:offset] || 0)
|
2012-05-21 20:17:41 +00:00
|
|
|
|
2013-01-03 19:09:18 +00:00
|
|
|
@commits = @repo.commits(@ref, @path, @limit, @offset)
|
2014-06-10 06:50:27 +00:00
|
|
|
@note_counts = Note.where(commit_id: @commits.map(&:id)).
|
2015-02-06 04:29:41 +00:00
|
|
|
group(:commit_id).count
|
2011-10-08 21:36:38 +00:00
|
|
|
|
|
|
|
respond_to do |format|
|
2014-10-07 16:52:16 +00:00
|
|
|
format.html
|
2013-11-28 09:38:20 +00:00
|
|
|
format.json { pager_json("projects/commits/_commits", @commits.size) }
|
2012-08-10 22:07:50 +00:00
|
|
|
format.atom { render layout: false }
|
2011-10-08 21:36:38 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|