mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-13 08:15:55 +08:00
fix: merge from develop
This commit is contained in:
@@ -3,7 +3,7 @@ class IssuesController < ApplicationController
|
||||
before_action :load_project
|
||||
before_action :set_user
|
||||
before_action :check_issue_permission
|
||||
before_action :operate_issue_permission, only:[:create, :update, :destroy, :clean, :series_update]
|
||||
before_action :operate_issue_permission, only:[:create, :update, :destroy, :clean, :series_update, :copy]
|
||||
before_action :check_project_public, only: [:index ,:show, :copy, :index_chosen, :close_issue]
|
||||
|
||||
before_action :set_issue, only: [:edit, :update, :destroy, :show, :copy, :close_issue, :lock_issue]
|
||||
@@ -231,7 +231,7 @@ class IssuesController < ApplicationController
|
||||
end
|
||||
|
||||
def show
|
||||
@user_permission = current_user.present? && current_user.logged? && (!@issue.is_lock || @project.member?(current_user) || current_user.admin? || @issue.user == current_user)
|
||||
@user_permission = current_user.present? && current_user.logged? && (@project.member?(current_user) || current_user.admin? || @issue.user == current_user)
|
||||
@issue_attachments = @issue.attachments
|
||||
@issue_user = @issue.user
|
||||
@issue_assign_to = @issue.get_assign_user
|
||||
@@ -316,6 +316,7 @@ class IssuesController < ApplicationController
|
||||
|
||||
def copy
|
||||
@new_issue = @issue.dup
|
||||
@new_issue.author_id = current_user.id
|
||||
if @new_issue.save
|
||||
issue_tags = @issue.issue_tags.pluck(:id)
|
||||
if issue_tags.present?
|
||||
@@ -416,7 +417,7 @@ class IssuesController < ApplicationController
|
||||
def operate_issue_permission
|
||||
return render_forbidden("您没有权限进行此操作.") unless current_user.admin? || @project.member?(current_user)
|
||||
end
|
||||
|
||||
|
||||
def export_issues(issues)
|
||||
@table_columns = %w(ID 类型 标题 描述 状态 指派给 优先级 标签 发布人 创建时间 里程碑 开始时间 截止时间 完成度 分类 金额 属于)
|
||||
@export_issues = []
|
||||
|
||||
@@ -116,10 +116,11 @@ class ProjectsController < ApplicationController
|
||||
|
||||
Projects::UpdateForm.new(validate_params).validate!
|
||||
|
||||
private = params[:private] || false
|
||||
private = @project.forked_from_project.present? ? !@project.forked_from_project.is_public : params[:private] || false
|
||||
|
||||
new_project_params = project_params.except(:private).merge(is_public: !private)
|
||||
@project.update_attributes!(new_project_params)
|
||||
@project.forked_projects.update_all(is_public: @project.is_public)
|
||||
gitea_params = {
|
||||
private: private,
|
||||
default_branch: @project.default_branch,
|
||||
@@ -144,6 +145,7 @@ class ProjectsController < ApplicationController
|
||||
ActiveRecord::Base.transaction do
|
||||
Gitea::Repository::DeleteService.new(@project.owner, @project.identifier).call
|
||||
@project.destroy!
|
||||
@project.forked_projects.update_all(forked_from_project_id: nil)
|
||||
render_ok
|
||||
end
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user