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 @@ </div> <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button> - <button type="button" class="btn btn-primary submit-btn">确认</button> + <a href="javascript:void(0)" class="btn btn-primary submit-btn" data-disable-with = '导入中...'>确认</a> </div> </div> </div> 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 @@ <th width="6%">公开</th> <th width="5%">issue</th> <th width="5%">资源</th> - <th width="5%">版本库</th> - <th width="5%">PullRequest</th> - <th width="5%">里程碑</th> + <th width="6%">版本库</th> + <th width="8%">PullRequest</th> + <th width="6%">里程碑</th> <th width="10%">成员</th> <th width="10%">管理员</th> - <th width="20%"><%= sort_tag('创建时间', name: 'created_at', path: admins_projects_path) %></th> + <th width="15%"><%= sort_tag('创建时间', name: 'created_at', path: admins_projects_path) %></th> <th width="10%">操作</th> </tr> </thead> diff --git a/app/views/admins/shared/_sidebar.html.erb b/app/views/admins/shared/_sidebar.html.erb index 6681d82b2..4e6639393 100644 --- a/app/views/admins/shared/_sidebar.html.erb +++ b/app/views/admins/shared/_sidebar.html.erb @@ -39,9 +39,9 @@ <li> <%= sidebar_item_group('#course-submenu', '课堂管理', icon: 'book') do %> <li><%= sidebar_item(admins_course_lists_path, '课程列表', icon: 'list', controller: 'admins-course_lists') %></li> - <li><%= sidebar_item(admins_courses_path, '课堂列表', icon: 'list', controller: 'admins-courses') %></li> + <li><%= sidebar_item(admins_courses_path, '课堂列表', icon: 'clone', controller: 'admins-courses') %></li> <!-- <li><%#= sidebar_item(admins_mirror_repositories_path, '镜像管理', icon: 'cubes', controller: 'admins-mirror_repositories') %></li>--> - <li><%= sidebar_item(admins_projects_path, '项目列表', icon: 'server', controller: 'admins-projects') %></li> + <li><%= sidebar_item(admins_projects_path, '项目列表', icon: 'database', controller: 'admins-projects') %></li> <% end %> </li>