diff --git a/app/controllers/challenges_controller.rb b/app/controllers/challenges_controller.rb index b4f4d6683..95dc1b1b0 100644 --- a/app/controllers/challenges_controller.rb +++ b/app/controllers/challenges_controller.rb @@ -109,8 +109,9 @@ class ChallengesController < ApplicationController challenge_num = Challenge.where(:shixun_id => @shixun).count challenge_pos = @challenge.position if challenge_pos < challenge_num - @next_challenge = Challenge.where(:shixun_id => @shixun, :position => challenge_pos+1).first + @next_challenge = Challenge.where(:shixun_id => @shixun, :position => challenge_pos + 1).first end + @prev_challenge = Challenge.where(:shixun_id => @shixun, :position => challenge_pos - 1).first if challenge_pos - 1 > 0 respond_to do |format| format.html format.js @@ -124,6 +125,7 @@ class ChallengesController < ApplicationController if challenge_pos < challenge_num @next_challenge = Challenge.where(:shixun_id => @shixun, :position => challenge_pos+1).first end + @prev_challenge = Challenge.where(:shixun_id => @shixun, :position => challenge_pos - 1).first if challenge_pos - 1 > 0 @tab = params[:tab].blank? ? 1 : params[:tab].to_i @editor = params[:editor] # 编辑模式 end @@ -173,6 +175,8 @@ class ChallengesController < ApplicationController end end end + # 向jenkins端发送请求,构建公共测试用例 + add_shixun_modify_status(@shixun, 1) elsif params[:tab].to_i == 5 @challenge_tags.delete_all unless @challenge_tags.blank? unless params[:knowledge].blank? @@ -181,8 +185,7 @@ class ChallengesController < ApplicationController end end end - # 向jenkins端发送请求,构建公共测试用例 - add_shixun_modify_status(@shixun, 1) + redirect_to edit_shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => params[:tab]) rescue Exception => e flash[:error] = "#{e.message}" diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb index 74a20666d..844325b0a 100644 --- a/app/controllers/managements_controller.rb +++ b/app/controllers/managements_controller.rb @@ -9,47 +9,70 @@ class ManagementsController < ApplicationController # 专业列表 def profession @syllabus=Syllabus.where("0=0") - @menu_type=11 - @sub_type=1 - major_level_option=params[:major_level_option] - discipline_category_option=params[:discipline_category_option] - first_level_discipline_option=params[:first_level_discipline_option] - if major_level_option!='0' - @syllabus=@syllabus.where(:major_level=>major_level_option) - else - @syllabus=@syllabus + @menu_type = 12 + @sub_type = 1 + @sx_order = params[:sx_order].blank? ? "desc" : params[:sx_order] + major_level_option = params[:major_level] if params[:major_level] + discipline_category_option = params[:discipline_category_id] if params[:discipline_category_id] + first_level_discipline_option = params[:first_level_discipline_id] if params[:first_level_discipline_id] + if major_level_option && major_level_option != '0' + @syllabus = @syllabus.where(:major_level=>major_level_option) end - - if discipline_category_option !=nil + if discipline_category_option && discipline_category_option != '0' @syllabus=@syllabus.where(:discipline_category_id=>discipline_category_option) end - - if first_level_discipline_option!=nil + if first_level_discipline_option && first_level_discipline_option != '0' @syllabus=@syllabus.where(:first_level_discipline_id=>first_level_discipline_option) end + @syllabus = @syllabus.order("created_at #{@sx_order}") @syllabus_count = @syllabus.count limit = 20 @is_remote = true @syllabus_pages = Paginator.new @syllabus_count, limit, params['page'] || 1 @offset ||= @syllabus_pages.offset @syllabus = paginateHelper @syllabus, limit - respond_to do |format| format.js format.html end - end # 实训适用课程 def applicable_course - @majorcourse=MajorCourse.where("0=0") + @menu_type = 12 + @sub_type = 2 + @courselist = CourseList.where("0=0") + search=params[:search] + unless search.blank? + @courselist = @courselist.where("name like '%#{search}%'") + end + @courselist = @courselist.reorder("created_at desc") + @courselist_count = @courselist.count + @limit = 4 + @is_remote = true + @page = params['page'] ? params['page'].to_i : 1 + @courselist_pages = Paginator.new @courselist_count, @limit, @page + @offset ||=@courselist_pages.offset + @courselist = paginateHelper @courselist, @limit + respond_to do |format| + format.js + format.html + end +end + # 增加课程 + def add_course + courselist= CourseList.create(:name => params[:course]) + redirect_to applicable_course_managements_path + end + def add_major + @major = Major.where("0=0") end # 单位部门列表 def departments @menu_type = 6 @sub_type = 2 + @sx_order = params[:sx_order].blank? ? "desc" : params[:sx_order] @department =Department.where("0=0") search=params[:search] if search.blank? @@ -57,6 +80,7 @@ class ManagementsController < ApplicationController else @department = @department.where("name like '%#{search}%'") end + @department = @department.reorder("created_at #{@sx_order}") @department_count =@department.count limit = 20 @is_remote = true @@ -67,26 +91,27 @@ class ManagementsController < ApplicationController format.js format.html end - end + # 单位列表 def departments_part @menu_type = 6 @sub_type = 1 @schools = School.where("0=0") + @sx_order = params[:sx_order].blank? ? "desc" : params[:sx_order] search=params[:search] if search.blank? @schools = @schools else @schools = @schools.where("name like '%#{search}%'") end + @schools = @schools.reorder("created_at #{@sx_order}") @schools_count = @schools.count limit = 20 @is_remote = true @schools_pages = Paginator.new @schools_count, limit, params['page'] || 1 @offset ||= @schools_pages.offset @schools= paginateHelper @schools, limit - respond_to do |format| format.js format.html @@ -99,11 +124,13 @@ class ManagementsController < ApplicationController @sub_type = 3 search = params[:search] @apply_status = ApplyAddDepartment.where("0=0") + @sx_order = params[:sx_order].blank? ? "desc" : params[:sx_order] if search.blank? @apply_status = @apply_status.where("0=0") else @apply_status= @apply_status.where("name like '%#{search}%'") end + @apply_status = @apply_status.order("created_at #{@sx_order}") @apply_status_count = @apply_status.count limit = 20 @is_remote = true @@ -121,19 +148,20 @@ class ManagementsController < ApplicationController @menu_type = 10 @sub_type = 4 search = params[:search] + @sx_order = params[:sx_order].blank? ? "desc" : params[:sx_order] @apply_status = ApplyAddSchools.where("0=0") if search.blank? @apply_status = @apply_status.where("0=0") else @apply_status= @apply_status.where("name like '%#{search}%'") end + @apply_status = @apply_status.order("created_at #{@sx_order}") @apply_status_count = @apply_status.count limit = 20 @is_remote = true @apply_status_pages = Paginator.new @apply_status_count, limit, params['page'] || 1 @offset ||= @apply_status_pages.offset @apply_status = paginateHelper @apply_status, limit - respond_to do |format| format.js format.html @@ -145,41 +173,32 @@ class ManagementsController < ApplicationController @menu_type = 2 @sub_type = 1 @syllabus = Syllabus.where("0=0") - @sx_order = params[:sx_order].blank? ? "desc" : params[:sx_order] - unless params[:school_id] || params[:search] || params[:keyword] || params[:status] - user_exs=UserExtensions.where(:user_id=> @syllabus.map(&:user_id)) - @schools = School.where(:id =>user_exs.map(&:school_id)) + major_level_option = params[:major_level] if params[:major_level] + discipline_category_option = params[:discipline_category_id] if params[:discipline_category_id] + first_level_discipline_option = params[:first_level_discipline_id] if params[:first_level_discipline_id] + syllabus_major_option = params[:major_id] if params[:major_id] + keyword = params[:keyword] + search = params[:search] + + if major_level_option && major_level_option != '0' + @syllabus = @syllabus.where(:major_level=>major_level_option) end - major_level_option=params[:major_level_option] - discipline_category_option=params[:discipline_category_option] - first_level_discipline_option=params[:first_level_discipline_option] - syllabus_major_option=params[:syllabus_major_option] - keyword=params[:keyword] - search=params[:search] - if major_level_option!='0' - @syllabus=@syllabus.where(:major_level=>major_level_option) - else - @syllabus=@syllabus - end - - if discipline_category_option !=nil + if discipline_category_option && discipline_category_option != '0' @syllabus=@syllabus.where(:discipline_category_id=>discipline_category_option) end - if first_level_discipline_option!=nil + if first_level_discipline_option && first_level_discipline_option != '0' @syllabus=@syllabus.where(:first_level_discipline_id=>first_level_discipline_option) end - if syllabus_major_option!=nil + if syllabus_major_option && syllabus_major_option != '0' @syllabus=@syllabus.where(:major_id=>syllabus_major_option) end - if params[:school_id] && params[:school_id] != '0' - @syllabus = Syllabus.includes(:user => {:user_extensions => []}).where("user_extensions.school_id = #{params[:school_id]}") - else - @syllabus = @syllabus.where("0=0") + if params[:school_id] && params[:school_id] != '' + @syllabus = @syllabus.includes(:user => {:user_extensions => []}).where("user_extensions.school_id = #{params[:school_id]}") end if search.blank? @@ -189,18 +208,20 @@ class ManagementsController < ApplicationController user_id = User.where("concat(lastname, firstname) like '%#{search}%'") @syllabus = @syllabus.includes(:user).where("concat(users.lastname, users.firstname) like '%#{search}%'") else - @syllabus= @syllabus.where("user_id like '%#{search}%'") + @syllabus= @syllabus.where("title like '%#{search}%'") end end - @syllabus_count = @syllabus.count + + @syllabus = @syllabus.order("syllabuses.created_at #{@sx_order}") + @syllabus_count = @syllabus.count limit = 20 @is_remote = true @syllabus_pages = Paginator.new @syllabus_count, limit, params['page'] || 1 @offset ||= @syllabus_pages.offset @syllabus = paginateHelper @syllabus, limit respond_to do |format| - format.html format.js + format.html end end @@ -210,35 +231,40 @@ class ManagementsController < ApplicationController @sub_type = 2 @sx_order = params[:sx_order].blank? ? "desc" : params[:sx_order] @courses = Course.where("0=0") - # @courses = @courses.select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS updatetime").order("updatetime desc") @timing=Course.where(:is_end=>false).count @end=Course.where(:is_end=>true).count unless params[:school_id] || params[:search] || params[:keyword] || params[:status] user_exs=UserExtensions.where(:school_id=> @courses.map(&:school_id)) @schools = School.where(:id =>user_exs.map(&:school_id)) end - search = params[:search] # 搜索字 - keyword = params[:keyword].blank? ? "u_name" : params[:keyword] # 根据姓名/课程名搜索 + @search = params[:search] # 搜索字 + @keyword = params[:keyword].blank? ? "u_name" : params[:keyword] # 根据姓名/课程名搜索 status = params[:status].to_i + if params[:school_id] && params[:school_id] != '0' - @courses =Course.joins("join users u on courses.tea_id = u.id").joins("join user_extensions ue on u.id = ue.user_id").where("ue.school_id = #{params[:school_id]}").order("created_at #{@sx_order}") - else - @courses = Course.where("0=0").order("created_at #{@sx_order}") + @school_id = params[:school_id] + @courses =Course.joins("join users u on courses.tea_id = u.id").joins("join user_extensions ue on u.id = ue.user_id").where("ue.school_id = #{params[:school_id]}") end + + if params[:homepage_show] + @courses = @courses.where(:homepage_show => params[:homepage_show].to_i) + end + if params[:status] && params[:status]!='' - @courses =@courses.where(:is_end =>status).order("created_at #{@sx_order}") + @status = params[:status] + @courses =@courses.where(:is_end =>status) end - if "u_name" == keyword - if search.blank? - @courses = @courses.order("created_at #{@sx_order}") + if "u_name" == @keyword + if @search.blank? + @courses = @courses else - user_id = User.where("concat(lastname, firstname) like '%#{search}%'") - @courses = @courses.joins("join users u on courses.tea_id = u.id").where("concat(u.lastname, u.firstname) like '%#{search}%'").order("created_at #{@sx_order}") + user_id = User.where("concat(lastname, firstname) like '%#{@search}%'") + @courses = @courses.joins("join users u on courses.tea_id = u.id").where("concat(u.lastname, u.firstname) like '%#{@search}%'") end else - @courses= @courses.where("name like '%#{search}%'").order("created_at #{@sx_order}") + @courses= @courses.where("name like '%#{@search}%'") end - @courses = @courses.select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS updatetime").reorder("updatetime desc") + @courses = @courses.select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS updatetime").reorder("updatetime #{@sx_order}") @courses_count = @courses.count limit = 20 @is_remote = true @@ -251,6 +277,14 @@ class ManagementsController < ApplicationController end end + # 班级首页显示 + def course_homepage_show + if params[:course_id] + course = Course.find params[:course_id] + course.update_attributes(:homepage_show => !course.homepage_show) + end + end + # 课程实训 def class_shixuns @menu_type = 4 @@ -273,13 +307,12 @@ class ManagementsController < ApplicationController @c_shixuns = @c_shixuns else if "u_name" == keyword - user_id = User.where("concat(lastname, firstname) like '%#{search}%'") + # user_id = User.where("concat(lastname, firstname) like '%#{search}%'") @c_shixuns = @c_shixuns.includes(:user).where("concat(users.lastname, users.firstname) like '%#{search}%'") else @c_shixuns= @c_shixuns.where("name like '%#{search}%'") end end - @c_shixuns = @c_shixuns.reorder("created_at desc") unless params[:school_id] || params[:search] || params[:keyword] || params[:status] user_exs = UserExtensions.where(:user_id => @c_shixuns.map(&:user_id)) @schools = School.where(:id => user_exs.map(&:school_id)) @@ -307,20 +340,19 @@ class ManagementsController < ApplicationController @c_shixuns = Subject.where(:status => 2) end if search.blank? - @c_shixuns = @c_shixuns - else - if "u_name" == keyword + + elsif "u_name" == keyword # 如果用户搜索为空,不用遍历user表,直接查找所有实训, 有搜索时才查找user - user_id = User.where("concat(lastname, firstname) like '%#{search}%'") + user_id = User.where("concat(lastname, firstname) like '%#{search}%'") @c_shixuns = @c_shixuns.includes(:user).where("concat(users.lastname, users.firstname) like '%#{search}%'") else @c_shixuns= @c_shixuns.where("name like '%#{search}%'") end - end unless params[:school_id] || params[:search] || params[:keyword] user_exs = UserExtensions.where(:user_id => @c_shixuns.map(&:user_id)) @schools = School.where(:id => user_exs.map(&:school_id)) end + @c_shixuns = @c_shixuns.order("created_at desc") respond_to do |format| format.js format.html @@ -420,6 +452,9 @@ class ManagementsController < ApplicationController else @shixuns = Shixun.where("name like '%#{search}%'").where(:status => 2).order("created_at #{@sx_order}") end + if params[:homepage_show] + @shixuns = @shixuns.where(:homepage_show => params[:homepage_show].to_i) + end @shixuns_count = @shixuns.count limit = 20 @shixuns_pages = Paginator.new @shixuns_count, limit, params['page'] || 1 @@ -430,6 +465,13 @@ class ManagementsController < ApplicationController format.html end end + # 实训首页显示 + def shixun_homepage_show + if params[:shixun_id] + shixun = Shixun.find params[:shixun_id] + shixun.update_attributes(:homepage_show => !shixun.homepage_show) + end + end # 已关闭的实训 def close_shixuns @@ -722,7 +764,7 @@ class ManagementsController < ApplicationController def shixun_authorization @menu_type = 10 - @sub_type == 5 + @sub_type == 5 @type = trial_authorization_status params[:type] @authorizations = ApplyAction.where(:container_type => "ApplyShixun", :status => @type).order("created_at desc") search = params[:search] diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index b542b871e..8eee24a76 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -82,8 +82,9 @@ class ShixunsController < ApplicationController @sort = "asc" search = params[:search] @shixun_all_count = Shixun.all.count - #@shixuns = Shixun.find_by_sql("select * from shixuns where id in (SELECT distinct(shixun_id) FROM `challenges`) and name like '%#{search}%' order by created_at desc") - @shixuns = Shixun.where("name like ? and hidden = 0", "%#{search}%").reorder("created_at desc") + #@shixuns = Shixun.find_by_sql("select * from shixuns where id in (SELECT distinct(shixun_id) FROM `challenges`) and name like '%#{search}%' order by updated_at desc") + #@shixuns = Shixun.where("name like ?", "%#{search}%") + @shixuns = Shixun.where("name like ? and hidden = 0", "%#{search}%") # @shixun_my_score = Game.find_by_sql("select sum(final_score) as score from games where myshixun_id in (select id from myshixuns where status =1 # and user_id=#{User.current.id} and shixun_id in (SELECT id FROM `shixuns` where status > 1))").first.try(:score).to_i @shixuns.each do |shixun| @@ -161,8 +162,8 @@ class ShixunsController < ApplicationController @order = params[:order] || "myshixun_count" bsort = params[:sort] || "desc" @sort = bsort == "desc" ? "asc" : "desc" - if @order == "created_at" - order_str = "#{Shixun.table_name}.created_at #{bsort}" + if @order == "updated_at" + order_str = "#{Shixun.table_name}.updated_at #{bsort}" else order_str = "myshixun_count #{bsort}, #{Shixun.table_name}.updated_at #{bsort}" end @@ -410,7 +411,6 @@ class ShixunsController < ApplicationController def new @shixun = Shixun.new - respond_to do |format| format.html{render :layout => 'base_edu'} format.json @@ -482,7 +482,7 @@ class ShixunsController < ApplicationController end def update - if @shixun.status == 0 + #if @shixun.status == 0 language = @shixun.language @shixun.attributes = params[:shixun] @shixun.language = params[:language] @@ -501,9 +501,9 @@ class ShixunsController < ApplicationController add_shixun_modify_status(@shixun, 1) end end - else - @error = "该实训已申请发布了,暂不能编辑" - end + #else + # @error = "该实训已申请发布了,暂不能编辑" + #end respond_to do |format| format.html{redirect_to settings_shixun_url(@shixun)} format.js diff --git a/app/helpers/managements_helper.rb b/app/helpers/managements_helper.rb index c1dac27f6..490fdab78 100644 --- a/app/helpers/managements_helper.rb +++ b/app/helpers/managements_helper.rb @@ -1,20 +1,33 @@ -module ManagementsHelper - - def trial_authorization_status status - case status - when "0", nil - 0 - when "1" - 1 - when "2" - 2 - else - [1,2] - end - end - - def query_user_status_num status - user = (status == 0) ? user = User.all : User.where(:status => status) - return user.count - end -end +module ManagementsHelper + + def trial_authorization_status status + case status + when "0", nil + 0 + when "1" + 1 + when "2" + 2 + else + [1,2] + end + end + + def query_user_status_num status + user = (status == 0) ? user = User.all : User.where(:status => status) + return user.count + end + + def course_list_major_time id + Major.where(:id => id).first.try(:name) + end + + # params[:id]: course_list_id + def get_course_list_major id + Major.where(:id => MajorCourse.where(:course_list_id => id).map(&:major_id)) + end + + def course_list_count id + Major.where(:id => id).first.try(:name) + end +end diff --git a/app/models/course.rb b/app/models/course.rb index ccb4579a3..7383ace7e 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -24,7 +24,7 @@ class Course < ActiveRecord::Base end end - attr_accessible :code, :extra, :name, :state, :tea_id, :time , :location, :state, :term, :password,:is_public,:description,:class_period, :open_student, :enterprise_name, :is_delete, :syllabus_id, :end_time, :end_term, :choose_group_allow, :is_end + attr_accessible :code, :extra, :name, :state, :tea_id, :time , :location, :state, :term, :password,:is_public,:description,:class_period, :open_student, :enterprise_name, :is_delete, :syllabus_id, :end_time, :end_term, :choose_group_allow, :is_end, :homepage_show #belongs_to :project, :class_name => 'Course', :foreign_key => :extra, primary_key: :identifier belongs_to :teacher, :class_name => 'User', :foreign_key => :tea_id, :dependent => :destroy # 定义一个方法teacher,该方法通过tea_id来调用User表 belongs_to :school, :class_name => 'School', :foreign_key => :school_id #定义一个方法school,该方法通过school_id来调用School表 @@ -105,7 +105,8 @@ class Course < ActiveRecord::Base 'end_term', 'os_allow', 'choose_group_allow', - 'credit' + 'credit', + 'homepage_show' acts_as_customizable diff --git a/app/models/shixun.rb b/app/models/shixun.rb index f5f4f90d2..2a7349077 100644 --- a/app/models/shixun.rb +++ b/app/models/shixun.rb @@ -9,7 +9,7 @@ # class Shixun < ActiveRecord::Base attr_accessible :description, :is_public, :name, :changeset_num, :status, :user_id, :gpid, :language, :identifier, :authentication, - :myshixun_count, :propaedeutics, :trainee, :major_id + :myshixun_count, :propaedeutics, :trainee, :major_id, :homepage_show has_many :users, :through => :shixun_members has_many :shixun_members, :dependent => :destroy diff --git a/app/models/shixun_major_course.rb b/app/models/shixun_major_course.rb index 7d288ecf0..83305a09b 100644 --- a/app/models/shixun_major_course.rb +++ b/app/models/shixun_major_course.rb @@ -1,6 +1,6 @@ -class ShixunMajorCourse < ActiveRecord::Base - belongs_to :shixun - belongs_to :major - belongs_to :course_list - #attr_accessible :course_list -end +class ShixunMajorCourse < ActiveRecord::Base + belongs_to :shixun + belongs_to :major + belongs_to :course_list + #attr_accessible :course_list +end diff --git a/app/views/challenges/_content_list.html.erb b/app/views/challenges/_content_list.html.erb index 91a7e2e31..9d6e1487c 100644 --- a/app/views/challenges/_content_list.html.erb +++ b/app/views/challenges/_content_list.html.erb @@ -36,24 +36,26 @@ <% end %> <% end %> - <% if User.current.manager_of_shixun?(@shixun) && @shixun.status == 0 %> + <% if User.current.manager_of_shixun?(@shixun) %>
- - <% unless challenge.position < 2 %> - + <% if @shixun.status == 0 %> + + <% unless challenge.position < 2 %> + + <% end %> + <% if @shixun.challenges.count != challenge.position %> + + <% end %> <% end %> - <% if @shixun.challenges.count != challenge.position %> - - <% end %> - +
<% end %>- <%= shixun_done(@shixun, challenge.position).to_i %>人 完成挑战 <%= shixun_running(@shixun, challenge.position).to_i %>人 正在挑战 + <%= shixun_done(@shixun, challenge.position).to_i %>人 完成挑战 <%= challenge.score %>经验值 <%= find_game_status challenge.id %>
diff --git a/app/views/challenges/_skill_form.html.erb b/app/views/challenges/_skill_form.html.erb index 57e6122bd..8fe6bb0ae 100644 --- a/app/views/challenges/_skill_form.html.erb +++ b/app/views/challenges/_skill_form.html.erb @@ -18,7 +18,7 @@ +添加 -+
| ID | -班级名称 | -成员 | -资源 | -作业 | -试卷 | -私有 | -模版 | -状态 | -创建者单位 | -创建者 | -创建时间 color-light-green ml5" title="功能完善中,敬请期待"> | -首页显示 | -
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| <%= course.id %> | -<%= link_to course.name, school_on_search_path(course.name) %> | -<%= course.members.count %> | -<%= course.attachments.count %> | -<%= course.homework_commons.count%> | -<%= course.exercises.count %> | -<%= course.is_public.to_i == 1 ? '--' : '√' %> | -- | <%= course.is_end ? "已结束" : "正在进行" %> | -<%= course.teacher.try(:user_extensions).try(:school).try(:name).blank? ? "--" : course.teacher.try(:user_extensions).try(:school) %> | -<%= link_to course.teacher.show_name, user_path(course.teacher) %> | -<%= format_time(course.updatetime) %> | -- - - | -
| ID | +班级名称 | +成员 | +资源 | +作业 | +试卷 | +私有 | +模版 | +状态 | +创建者单位 | +创建者 | +动态时间 color-light-green ml5" title="功能完善中,敬请期待"> | +首页显示 | +
| <%= course.id %> | +<%= link_to course.name, course_path(course.id) %> | +<%= course.members.count %> | +<%= course.attachments.count %> | +<%= course.homework_commons.count%> | +<%= course.exercises.count %> | +<%= course.is_public.to_i == 1 ? '--' : '√' %> | ++ | <%= course.is_end ? "已结束" : "正在进行" %> | +<%= course.teacher.try(:user_extensions).try(:school).try(:name).blank? ? "--" : course.teacher.try(:user_extensions).try(:school) %> | +<%= link_to course.teacher.show_name, user_path(course.teacher) %> | +<%= format_time(course.updatetime) %> | ++ class="ml-3 mr5 magic-checkbox" id="join_course_role_<%= course.id %>"> + + | +
| ID | -实训名称 | +ID | +实训名称 | 顶 | 踩 | 已通关 | -已开启 | -创建者 | +已开启 | +创建者 | 发布时间 color-light-green ml5" title="功能完善中,敬请期待"> | 操作 | +首页显示 | <% @shixuns.each do |shixun| %> @@ -28,6 +29,10 @@<%= link_to "关闭", publish_shixuns_managements_path(:close => shixun.id), :class => "", :remote => true %> | ++ class="ml-3 mr5 magic-checkbox" id="join_course_role_<%= shixun.id %>"> + + | <% end %> @@ -50,5 +55,14 @@ data: {sx_order:sx_order}, dateType: "script" }); + }); + $("input[name='homepage_show']").click(function(){ + var homepage_show_val = $(this).val(); + $.ajax({ + url:"<%= shixun_homepage_show_managements_path %>", + data: {shixun_id: homepage_show_val}, + type: 'post', + dateType: "script" + }); }) \ No newline at end of file diff --git a/app/views/managements/_unit_list.html.erb b/app/views/managements/_unit_list.html.erb index c4d9ac58e..bacf53502 100644 --- a/app/views/managements/_unit_list.html.erb +++ b/app/views/managements/_unit_list.html.erb @@ -6,7 +6,7 @@地区 | 详细地址 | 申请者 | -创建于 | +创建于 color-light-green ml5"> | @@ -70,7 +70,7 @@ <% end %> | - <%= format_date(apply.created_at) %> + <%= format_time(apply.created_at) %> |
<%= link_to( l(:label_approve), { :controller => 'admin', :action => 'approve_applied_schools', :id => apply.id }, :class => "application-default-link" ) %>
@@ -91,13 +91,14 @@
\ No newline at end of file
diff --git a/app/views/managements/_users_authorization_list.html.erb b/app/views/managements/_users_authorization_list.html.erb
index 666f2bdfa..a7618d1be 100644
--- a/app/views/managements/_users_authorization_list.html.erb
+++ b/app/views/managements/_users_authorization_list.html.erb
@@ -2,6 +2,7 @@
| |
+ ID |
真实姓名 |
职业 |
学号 |
@@ -13,13 +14,16 @@
|
- <% @users.each do |user| %>
+ <% @users.each_with_index do |user,index| %>
<% authorization = ApplyAction.where(:user_id => user, :container_type => "TrialAuthorization").last %>
|---|---|---|---|---|
| + | + <%= user.id %> + | <%= link_to user.try(:show_real_name), user_path(user), :class => "edu-txt-w100 task-hide2" %> | diff --git a/app/views/managements/applicable_course.html.erb b/app/views/managements/applicable_course.html.erb index a7c481ab2..abcea4f78 100644 --- a/app/views/managements/applicable_course.html.erb +++ b/app/views/managements/applicable_course.html.erb @@ -3,7 +3,7 @@ 搜索 清除 - 新增实训适用课程 + 新增实训适用课程 <% end %>