|
|
|
@@ -11,7 +11,7 @@ class ProjectsController < ApplicationController |
|
|
|
menu = [] |
|
|
|
|
|
|
|
menu.append(menu_hash_by_name("home")) |
|
|
|
menu.append(menu_hash_by_name("code")) |
|
|
|
menu.append(menu_hash_by_name("code")) if @project.has_menu_permission("code") |
|
|
|
menu.append(menu_hash_by_name("issues")) if @project.has_menu_permission("issues") |
|
|
|
menu.append(menu_hash_by_name("pulls")) if @project.has_menu_permission("pulls") |
|
|
|
menu.append(menu_hash_by_name("devops")) if @project.has_menu_permission("devops") |
|
|
|
@@ -66,7 +66,10 @@ class ProjectsController < ApplicationController |
|
|
|
end |
|
|
|
|
|
|
|
def branches |
|
|
|
@branches = @project.forge? ? Gitea::Repository::Branches::ListService.new(@owner, @project.identifier).call : [] |
|
|
|
return @branches = [] unless @project.forge? |
|
|
|
|
|
|
|
result = Gitea::Repository::Branches::ListService.call(@owner, @project.identifier) |
|
|
|
@branches = result.is_a?(Hash) && result.key?(:status) ? [] : result |
|
|
|
end |
|
|
|
|
|
|
|
def group_type_list |
|
|
|
@@ -93,7 +96,7 @@ class ProjectsController < ApplicationController |
|
|
|
ActiveRecord::Base.transaction do |
|
|
|
# Projects::CreateForm.new(project_params).validate! |
|
|
|
private = params[:private] || false |
|
|
|
|
|
|
|
|
|
|
|
new_project_params = project_params.except(:private).merge(is_public: !private) |
|
|
|
@project.update_attributes!(new_project_params) |
|
|
|
gitea_params = { |
|
|
|
|