超管页面的项目列表

dev_forge
cxt 5 years ago
parent 99eaa92635
commit 22848d5728

@ -37,14 +37,6 @@ class Admins::CoursesController < Admins::BaseController
end
end
def homepage_show
end
def email_notify
end
private
def find_course

@ -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

@ -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>

@ -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>

@ -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>

Loading…
Cancel
Save