新增:创建项目auto_init参数

This commit is contained in:
2024-01-31 16:47:00 +08:00
parent d0bc8e4378
commit 447429a663
6 changed files with 15 additions and 8 deletions

View File

@@ -283,7 +283,7 @@ class ProjectsController < ApplicationController
private
def project_params
params.permit(:user_id, :name, :description, :repository_name, :website, :lesson_url, :default_branch, :identifier,
:project_category_id, :project_language_id, :license_id, :ignore_id, :private)
:project_category_id, :project_language_id, :license_id, :ignore_id, :private, :auto_init)
end
def mirror_params

View File

@@ -60,8 +60,9 @@ class RepositoriesController < ApplicationController
@entries = Gitea::Repository::Entries::ListService.new(@owner, @project.identifier, ref: @ref).call
@entries = @entries.present? ? @entries.sort_by{ |hash| hash['type'] } : []
@path = GiteaService.gitea_config[:domain]+"/#{@project.owner.login}/#{@project.identifier}/raw/branch/#{@ref}/"
@repo_detail = $gitea_client.get_repos_by_owner_repo(@owner.login, @project.identifier)
return render_not_found if @entries.blank? && !@repo_detail["empty"]
end
return render_not_found if @entries.blank?
end
def top_counts