课堂的路由更改

courseware
cxt 5 years ago
parent a73d6d186f
commit d413a2c1f7

@ -19,7 +19,7 @@ $(document).on('turbolinks:load', function() {
var json = {}; var json = {};
json[s_name] = s_value; json[s_name] = s_value;
$.ajax({ $.ajax({
url: "/admins/courses/" + s_id, url: "/admins/classrooms/" + s_id,
type: "PUT", type: "PUT",
dataType:'script', dataType:'script',
data: json data: json

@ -36,10 +36,13 @@ class CourseSecondCategoriesController < ApplicationController
# 更新相应对象的子目录id # 更新相应对象的子目录id
if @course_module.module_type == "shixun_homework" if @course_module.module_type == "shixun_homework"
@category.homework_commons.update_all(course_second_category_id: 0) @category.homework_commons.update_all(course_second_category_id: 0)
@right_url = "/courses/#{@course.id}/shixun_homeworks/#{@course_module.id}" @right_url = "/classrooms/#{@course.id}/shixun_homeworks/#{@course_module.id}"
elsif @course_module.module_type == "attachment" elsif @course_module.module_type == "attachment"
Attachment.where(course_second_category_id: @category.id).update_all(course_second_category_id: 0) Attachment.where(course_second_category_id: @category.id).update_all(course_second_category_id: 0)
@right_url = "/courses/#{@course.id}/files/#{@course_module.id}" @right_url = "/classrooms/#{@course.id}/files/#{@course_module.id}"
elsif @course_module.module_type == "video"
@course.course_videos.where(course_second_category_id: @category.id).update_all(course_second_category_id: 0)
@right_url = "/classrooms/#{@course.id}/course_videos"
end end
@category.destroy @category.destroy

@ -46,13 +46,13 @@ class StudentWork < ApplicationRecord
# 匿评次数 # 匿评次数
def student_comment_num def student_comment_num
homework_common.homework_detail_manual.comment_status > 2 && work_status > 0 ? self.student_works_scores.select{|score| score.reviewer_role == 3}.group_by(&:user_id).count : 0 homework_common.homework_detail_manual.comment_status > 2 && work_status > 0 ? self.student_works_scores.select{|score| score.reviewer_role == 3}.group_by(&:user_id).size : 0
end end
# 学生评阅作品数 # 学生评阅作品数
def user_comment_num def user_comment_num
if homework_common.homework_detail_manual.comment_status > 2 && work_status > 0 if homework_common.homework_detail_manual.comment_status > 2 && work_status > 0
count = homework_common.student_works_scores.select{|score| score.reviewer_role == 3 && score.user_id == user_id}.group_by(&:student_work_id).count count = homework_common.student_works_scores.select{|score| score.reviewer_role == 3 && score.user_id == user_id}.group_by(&:student_work_id).size
else else
count = 0 count = 0
end end

@ -1,7 +1,7 @@
<td><%= list_index_no((params[:page] || 1).to_i, no) %></td> <td><%= list_index_no((params[:page] || 1).to_i, no) %></td>
<td><%= course.id %></td> <td><%= course.id %></td>
<td class="text-left"> <td class="text-left">
<%= link_to(course.name, "/courses/#{course.id}", target: '_blank') %> <%= link_to(course.name, "/classrooms/#{course.id}", target: '_blank') %>
</td> </td>
<td><%= course.course_members_count %></td> <td><%= course.course_members_count %></td>
<td><%= get_attachment_count(course, 0) %></td> <td><%= get_attachment_count(course, 0) %></td>

@ -17,7 +17,7 @@
<% if @courses.present? %> <% if @courses.present? %>
<% @courses.each do |course| %> <% @courses.each do |course| %>
<tr> <tr>
<td class="text-left"><a href="/courses/<%= course.id %>/students" target="_blank" class="d-inline-block text-truncate" style="max-width: 220px"><%= course.name %></a></td> <td class="text-left"><a href="/classrooms/<%= course.id %>/students" target="_blank" class="d-inline-block text-truncate" style="max-width: 220px"><%= course.name %></a></td>
<% teacher_names = course.teacher_users.map(&:real_name).join('、') %> <% teacher_names = course.teacher_users.map(&:real_name).join('、') %>
<td class="text-left"> <td class="text-left">
<span class="d-inline-block text-truncate" style="max-width: 150px" data-toggle="tooltip" title="<%= teacher_names %>"> <span class="d-inline-block text-truncate" style="max-width: 150px" data-toggle="tooltip" title="<%= teacher_names %>">

@ -1,3 +1,3 @@
json.status 0 json.status 0
json.message "删除成功" json.message "删除成功"
json.right_url "/courses/#{@course.id}/students" json.right_url "/classrooms/#{@course.id}/students"

@ -21,7 +21,7 @@ json.course_modules @course_modules.each do |mod|
json.position board.position json.position board.position
json.category_count board.messages_count json.category_count board.messages_count
json.category_type "messages" json.category_type "messages"
json.second_category_url "/courses/#{@course.id}/boards/#{board.id}" json.second_category_url "/classrooms/#{@course.id}/boards/#{board.id}"
end end
end end
else else

@ -4,11 +4,11 @@ json.top do
json.course_url "/courses" json.course_url "/courses"
json.competitions_url "#{@old_domain}/competitions" json.competitions_url "#{@old_domain}/competitions"
json.topic_url "/forums" json.topic_url "/forums"
json.new_course_url "/courses/new" json.new_course_url "/classrooms/new"
json.new_shixun_url "/shixuns/new" json.new_shixun_url "/shixuns/new"
json.new_shixun_path_url "/paths/new" json.new_shixun_path_url "/paths/new"
json.new_project_url "#{@old_domain}/projects/new" json.new_project_url "#{@old_domain}/projects/new"
json.join_course_url "/courses/join_course_multi_role" json.join_course_url "/classrooms/join_course_multi_role"
json.join_project_url "#{@old_domain}/applied_project/applied_project_info" json.join_project_url "#{@old_domain}/applied_project/applied_project_info"
json.message_url "#{@user_url}/user_tidings" json.message_url "#{@user_url}/user_tidings"
json.new_message @new_message json.new_message @new_message

Loading…
Cancel
Save