debian-mirror-gitlab/app/controllers/projects/commits_controller.rb

25 lines
686 B
Ruby
Raw Normal View History

2014-09-02 18:07:02 +05:30
require "base64"
class Projects::CommitsController < Projects::ApplicationController
include ExtractsPath
2015-09-11 14:41:01 +05:30
before_action :require_non_empty_project
before_action :assign_ref_vars
before_action :authorize_download_code!
2014-09-02 18:07:02 +05:30
def show
@repo = @project.repository
@limit, @offset = (params[:limit] || 40), (params[:offset] || 0)
@commits = @repo.commits(@ref, @path, @limit, @offset)
2015-11-26 14:37:03 +05:30
@note_counts = project.notes.where(commit_id: @commits.map(&:id)).
2015-04-26 12:48:37 +05:30
group(:commit_id).count
2014-09-02 18:07:02 +05:30
respond_to do |format|
2015-04-26 12:48:37 +05:30
format.html
2014-09-02 18:07:02 +05:30
format.json { pager_json("projects/commits/_commits", @commits.size) }
format.atom { render layout: false }
end
end
end