diff --git a/app/controllers/admins/courses_controller.rb b/app/controllers/admins/courses_controller.rb index 19363057d..80f48fab2 100644 --- a/app/controllers/admins/courses_controller.rb +++ b/app/controllers/admins/courses_controller.rb @@ -37,14 +37,6 @@ class Admins::CoursesController < Admins::BaseController end end - def homepage_show - - end - - def email_notify - - end - private def find_course diff --git a/app/controllers/admins/projects_controller.rb b/app/controllers/admins/projects_controller.rb index f2f2aaa9d..53d94fd9b 100644 --- a/app/controllers/admins/projects_controller.rb +++ b/app/controllers/admins/projects_controller.rb @@ -9,37 +9,17 @@ class Admins::ProjectsController < Admins::BaseController end def destroy - if @course.is_delete == 0 - @course.delete! - Tiding.create!(user_id: current_user.id, trigger_user_id: current_user.id, container_id: @course.id, - container_type: 'DeleteCourse', tiding_type: 'System', belong_container: @course, extra: @course.name) + project = Project.find_by!(id: params[:id]) + ActiveRecord::Base.transaction do + g = Gitlab.client + g.delete_project(project.gpid) + # 删除Trustie版本库记录 + repoisitory = Repository.where(project_id: project.id, type: "Repository::Gitlab").first + repoisitory.destroy! + Tiding.where(container_id: project.id, container_type: ["JoinProject", "DealProject", "ReporterJoinProject", "ManagerJoinProject"]).destroy_all + project.destroy! + render_delete_success end end - def update - if @course.update_attributes(setting_params) - render_ok - else - redirect_to admins_courses_path - flash[:danger] = "更新失败" - end - end - - def homepage_show - - end - - def email_notify - - end - - private - - def find_course - @course = Course.find_by!(id: params[:id]) - end - - def setting_params - params.permit(:homepage_show, :email_notify) - end end \ No newline at end of file diff --git a/app/views/admins/laboratory_subjects/shared/_add_laboratory_subject_modal.html.erb b/app/views/admins/laboratory_subjects/shared/_add_laboratory_subject_modal.html.erb index a6fb89186..63ab3fdf1 100644 --- a/app/views/admins/laboratory_subjects/shared/_add_laboratory_subject_modal.html.erb +++ b/app/views/admins/laboratory_subjects/shared/_add_laboratory_subject_modal.html.erb @@ -21,7 +21,7 @@
diff --git a/app/views/admins/projects/shared/_list.html.erb b/app/views/admins/projects/shared/_list.html.erb index e80f5551e..8a84a72d0 100644 --- a/app/views/admins/projects/shared/_list.html.erb +++ b/app/views/admins/projects/shared/_list.html.erb @@ -6,12 +6,12 @@