e563e948bb
Conflicts: app/controllers/commits_controller.rb app/controllers/refs_controller.rb
34 lines
630 B
Ruby
34 lines
630 B
Ruby
class RepositoriesController < ProjectController
|
|
# Authorize
|
|
before_filter :authorize_read_project!
|
|
before_filter :authorize_code_access!
|
|
before_filter :require_non_empty_project
|
|
|
|
def show
|
|
@activities = @project.commits_with_refs(20)
|
|
end
|
|
|
|
def branches
|
|
@branches = @project.branches
|
|
end
|
|
|
|
def tags
|
|
@tags = @project.tags
|
|
end
|
|
|
|
def archive
|
|
unless can?(current_user, :download_code, @project)
|
|
render_404 and return
|
|
end
|
|
|
|
|
|
file_path = @project.archive_repo(params[:ref])
|
|
|
|
if file_path
|
|
# Send file to user
|
|
send_file file_path
|
|
else
|
|
render_404
|
|
end
|
|
end
|
|
end
|