diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index bee294f5c..ddce8496d 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -371,7 +371,7 @@ class AttachmentsController < ApplicationController @attachment = Attachment.find(params[:attachments ].first[1][:attachment_id]) #将需要修改的记录保存到历史记录 @history = AttachmentHistory.new - @history.attributes = @old_attachment.attributes.dup.except("id") + @history.attributes = @old_attachment.attributes.dup.except("id", "resource_bank_id") @history.attachment_id = params[:old_attachment_id] #需要更新版本号,需要拿到原来该文件最大的历史版本号 @old_history = @old_attachment.attachment_histories.reorder('version desc').first diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 389efc638..50a7f4486 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -46,21 +46,22 @@ class CoursesController < ApplicationController syllabus_members = SyllabusMember.where("user_id = #{@user.id}") syllabus_member_ids = syllabus_members.empty? ? "(-1)" : "(" + syllabus_members.map{|syl_mem| syl_mem.syllabus_id}.join(',') + ")" - search = params[:search].nil? ? '' : params[:search] + @search = params[:search].nil? ? '' : params[:search] + @select = params[:select].nil? ? '' : params[:select] # 我发布的课程 - create_syllabuses = Syllabus.where("user_id = #{@user.id} and title like '%#{search}%'").order("created_at desc") + create_syllabuses = Syllabus.where("user_id = #{@user.id} and title like '%#{@search}%'").order("created_at desc") # 我参与的课程 - join_syllabuses = Syllabus.where("(id in #{syllabus_ids} or id in #{syllabus_member_ids}) and user_id != #{@user.id} and title like '%#{search}%'").order("created_at desc") + join_syllabuses = Syllabus.where("(id in #{syllabus_ids} or id in #{syllabus_member_ids}) and user_id != #{@user.id} and title like '%#{@search}%'").order("created_at desc") # 我的所有课程 - all_syllabuses = Syllabus.where("title like '%#{search}%'").order("created_at desc") + all_syllabuses = Syllabus.where("title like '%#{@search}%'").order("created_at desc") @syllabus_count = Syllabus.all.count @join_syllabuses_count = join_syllabuses.count @create_syllabuses_count = create_syllabuses.count # 页面筛选的课程 - if params[:select] == "create" + if @select == "create" @syllabuses = create_syllabuses - elsif params[:select] == "join" + elsif @select == "join" @syllabuses = join_syllabuses else @syllabuses = all_syllabuses diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index 458b5d6dc..b0e6995ec 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -19,37 +19,42 @@ class HomeworkCommonController < ApplicationController #unless params[:page] # update_homework_time(@course.homework_commons) #end - @search = "#{params[:search].to_s.strip.downcase}" + @search = "#{params[:search].to_s.strip.downcase}" if params[:search] @order = params[:order] @new_homework = HomeworkCommon.new @new_homework.homework_detail_manual = HomeworkDetailManual.new @new_homework.course = @course @page = params[:page] ? params[:page].to_i + 1 : 0 @is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) + if @search + @homework_commons = @course.homework_commons.where("name like '%#{@search}%'") + else + @homework_commons = @course.homework_commons + end if @order.blank? if @is_teacher - @homework_commons = @course.homework_commons.where("name like '%#{@search}%'").order("created_at desc") + @homework_commons = @homework_commons.order("created_at desc") else - @homework_commons = @course.homework_commons.where("name like '%#{@search}%' and publish_time <= '#{Time.now}'").order("created_at desc") + @homework_commons = @homework_commons.where("publish_time <= '#{Time.now}'").order("created_at desc") end else case @order when '1' - @homework_commons = @course.homework_commons.includes(:homework_detail_manual).where("name like '%#{@search}%' and homework_detail_manuals.comment_status = #{@order} and end_time > '#{Time.now}'").order("homework_commons.created_at desc") + @homework_commons = @homework_commons.includes(:homework_detail_manual).where("homework_detail_manuals.comment_status = #{@order} and end_time > '#{Time.now}'").order("homework_commons.created_at desc") when '2' - @homework_commons = @course.homework_commons.includes(:homework_detail_manual).where("name like '%#{@search}%' and homework_detail_manuals.comment_status = #{@order} and late_time > '#{Time.now}'").order("homework_commons.created_at desc") + @homework_commons = @homework_commons.includes(:homework_detail_manual).where("homework_detail_manuals.comment_status = #{@order} and late_time > '#{Time.now}'").order("homework_commons.created_at desc") when '3' - @homework_commons = @course.homework_commons.includes(:homework_detail_manual).where("name like '%#{@search}%' and (homework_detail_manuals.comment_status = #{@order} and homework_detail_manuals.evaluation_end > '#{Time.now}') + @homework_commons = @homework_commons.includes(:homework_detail_manual).where("(homework_detail_manuals.comment_status = #{@order} and homework_detail_manuals.evaluation_end > '#{Time.now}') or (homework_detail_manuals.comment_status = 1 and end_time < '#{Time.now}' and allow_late = 0 and anonymous_comment = 0 and homework_detail_manuals.evaluation_start >= '#{Time.now}') or (homework_detail_manuals.comment_status = 2 and late_time < '#{Time.now}' and anonymous_comment = 0 and homework_detail_manuals.evaluation_start >= '#{Time.now}')").order("homework_commons.created_at desc") when '4' - @homework_commons = @course.homework_commons.includes(:homework_detail_manual).where("name like '%#{@search}%' and (homework_detail_manuals.comment_status = #{@order} and homework_detail_manuals.appeal_time > '#{Time.now}')").order("homework_commons.created_at desc") + @homework_commons = @homework_commons.includes(:homework_detail_manual).where("(homework_detail_manuals.comment_status = #{@order} and homework_detail_manuals.appeal_time > '#{Time.now}')").order("homework_commons.created_at desc") when '5' - @homework_commons = @course.homework_commons.includes(:homework_detail_manual).where("name like '%#{@search}%' and (homework_detail_manuals.comment_status = #{@order} and archive_time > '#{Time.now}') + @homework_commons = @homework_commons.includes(:homework_detail_manual).where("(homework_detail_manuals.comment_status = #{@order} and archive_time > '#{Time.now}') or (homework_detail_manuals.comment_status = 1 and end_time < '#{Time.now}' and (anonymous_comment = 1 or (anonymous_comment = 0 and homework_detail_manuals.evaluation_start < '#{Time.now}')) and archive_time >= '#{Time.now}') or (homework_detail_manuals.comment_status = 2 and late_time < '#{Time.now}' and (anonymous_comment = 1 or (anonymous_comment = 0 and homework_detail_manuals.evaluation_start < '#{Time.now}')) and archive_time >= '#{Time.now}')").order("homework_commons.created_at desc") else - @homework_commons = @course.homework_commons.includes(:homework_detail_manual).where("name like '%#{@search}%' and homework_detail_manuals.comment_status = #{@order}").order("homework_commons.created_at desc") + @homework_commons = @homework_commons.includes(:homework_detail_manual).where("homework_detail_manuals.comment_status = #{@order}").order("homework_commons.created_at desc") end end @is_student = User.current.logged? && (User.current.admin? || (User.current.member_of_course?(@course) && !@is_teacher)) diff --git a/app/controllers/my_controller.rb b/app/controllers/my_controller.rb index 8e2e931f1..fe71494ad 100644 --- a/app/controllers/my_controller.rb +++ b/app/controllers/my_controller.rb @@ -150,7 +150,7 @@ class MyController < ApplicationController # 基本资料不完善 @force为false, 完善 @force为true @force = false if params[:tip] - @force = trues + @force = true else user = UserExtensions.where(:user_id => User.current.id).first if user.gender.nil? || user.school_id.nil? || User.current.lastname.nil? @@ -160,6 +160,9 @@ class MyController < ApplicationController end end + # 用户认证 + @auth = @user.authentication ? false : true + @s_message = AppliedMessage.where(:status => 3, :user_id => User.current.id, :viewed => 0, :applied_type => 'ApplyAddSchools').first @d_message = AppliedMessage.where(:status => 3, :user_id => User.current.id, :viewed => 0, :applied_type => 'ApplyAddDepartment').first diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index d8fdb601d..505e73699 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -27,6 +27,10 @@ class ShixunsController < ApplicationController @latest_myshixuns = myshixuns.order("created_at desc").limit(4) end + def autocompletion + + end + def index # @type = params[:type] # @status = params[:status] diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 5136ba806..070107633 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -363,7 +363,7 @@ class StudentWorkController < ApplicationController @homework_commons = @course.homework_commons.where("publish_time <= ?",Time.now).order("created_at desc") @all_homework_commons = @course.homework_commons.order("created_at desc") @is_teacher = User.current.allowed_to?(:as_teacher,@course) || User.current.admin? - @is_evaluation = @homework.homework_detail_manual && @homework.homework_detail_manual.comment_status == 2 && !@is_teacher #是不是匿评 + @is_evaluation = @homework.homework_detail_manual && @homework.homework_detail_manual.comment_status == 3 && !@is_teacher #是不是匿评 @show_all = false # 0表示没有分组的学生,-1表示所有分组的学生 @@ -376,11 +376,11 @@ class StudentWorkController < ApplicationController end #开放作品 || 老师 || 超级管理员 || 禁用匿评&&作业截止&&已提交作品 显示所有列表 - if (@homework.is_open == 1 && @course.is_public == 1) || (@homework.is_open == 1 && @course.is_public == 0 && User.current.member_of_course?(@course)) || @is_teacher || User.current.admin? || (User.current.member_of_course?(@course) && @homework.anonymous_comment == 1 && @homework.end_time < Time.now && !@homework.student_works.where(:user_id => User.current.id).empty?) + if (@homework.is_open == 1 && @course.is_public == 1) || (@homework.is_open == 1 && @course.is_public == 0 && User.current.member_of_course?(@course)) || @is_teacher || User.current.admin? || (User.current.member_of_course?(@course) && @homework.homework_detail_manual.comment_status == 6) @stundet_works = @homework.student_works.select("student_works.*,student_works.work_score as score").joins(:user).where("users.id in #{student_in_group}").order("#{@order} #{@b_sort}") @show_all = true elsif User.current.member_of_course?(@course) - if @homework.homework_detail_manual.comment_status == 1 #学生 && 未开启匿评 只看到自己的 + if @homework.homework_detail_manual.comment_status == 1 || @homework.homework_detail_manual.comment_status == 2 #学生 && 未开启匿评 只看到自己的 if @homework.homework_type == 3 pro = @homework.student_work_projects.where(:user_id => User.current.id).first if pro.nil? @@ -391,7 +391,7 @@ class StudentWorkController < ApplicationController else @stundet_works = @homework.student_works.select("student_works.*,student_works.work_score as score").where(:user_id => User.current.id) end - elsif @homework.homework_detail_manual.comment_status == 2 #学生 && 开启匿评 看到匿评列表 + elsif @homework.homework_detail_manual.comment_status == 3 || @homework.homework_detail_manual.comment_status == 4 #学生 && 开启匿评 看到匿评列表 if @homework.homework_type == 3 pro = @homework.student_work_projects.where(:user_id => User.current.id).first if pro.nil? @@ -403,7 +403,7 @@ class StudentWorkController < ApplicationController my_work = @homework.student_works.where(:user_id => User.current.id) end @stundet_works = my_work + User.current.student_works_evaluation_distributions.map(&:student_work).select { |work| work.homework_common_id == @homework.id} - elsif @homework.homework_detail_manual.comment_status == 3 #学生 && 关闭匿评 未提交作品之前列表为空,提交了作品看到所有的 + elsif @homework.homework_detail_manual.comment_status == 5 #学生 && 关闭匿评 未提交作品之前列表为空,提交了作品看到所有的 if @homework.homework_type == 3 pro = @homework.student_work_projects.where(:user_id => User.current.id).first if pro.nil? @@ -429,11 +429,11 @@ class StudentWorkController < ApplicationController end else - if (@homework.is_open == 1 &&@course.is_public == 1) || (@homework.is_open == 1 && @course.is_public == 0 && User.current.member_of_course?(@course)) || @is_teacher || User.current.admin? || (User.current.member_of_course?(@course) && @homework.anonymous_comment == 1 && @homework.end_time < Time.now && !@homework.student_works.where(:user_id => User.current.id).empty?) + if (@homework.is_open == 1 && @course.is_public == 1) || (@homework.is_open == 1 && @course.is_public == 0 && User.current.member_of_course?(@course)) || @is_teacher || User.current.admin? || (User.current.member_of_course?(@course) && @homework.homework_detail_manual.comment_status == 6) @stundet_works = @homework.student_works.select("student_works.*,student_works.work_score as score").includes(:user => {:user_extensions => []}, :project => {}, :student_works_scores => {}).order("#{@order} #{@b_sort}") @show_all = true elsif User.current.member_of_course?(@course) - if @homework.homework_detail_manual.comment_status == 1 #学生 && 未开启匿评 只看到自己的 + if @homework.homework_detail_manual.comment_status == 1 || @homework.homework_detail_manual.comment_status == 2 #学生 && 未开启匿评 只看到自己的 if @homework.homework_type == 3 pro = @homework.student_work_projects.where(:user_id => User.current.id).first if pro.nil? @@ -444,7 +444,7 @@ class StudentWorkController < ApplicationController else @stundet_works = @homework.student_works.select("student_works.*,student_works.work_score as score").where(:user_id => User.current.id) end - elsif @homework.homework_detail_manual.comment_status == 2 #学生 && 开启匿评 看到匿评列表 + elsif @homework.homework_detail_manual.comment_status == 3 || @homework.homework_detail_manual.comment_status == 4 #学生 && 开启匿评 看到匿评列表 if @homework.homework_type == 3 pro = @homework.student_work_projects.where(:user_id => User.current.id).first if pro.nil? @@ -456,7 +456,7 @@ class StudentWorkController < ApplicationController my_work = @homework.student_works.where(:user_id => User.current.id) end @stundet_works = my_work + User.current.student_works_evaluation_distributions.map(&:student_work).select { |work| work.homework_common_id == @homework.id} - elsif @homework.homework_detail_manual.comment_status == 3 #学生 && 关闭匿评 未提交作品之前列表为空,提交了作品看到所有的 + elsif @homework.homework_detail_manual.comment_status == 5 #学生 && 关闭匿评 未提交作品之前列表为空,提交了作品看到所有的 if @homework.homework_type == 3 pro = @homework.student_work_projects.where(:user_id => User.current.id).first if pro.nil? @@ -509,7 +509,7 @@ class StudentWorkController < ApplicationController format.js format.html { render :layout => 'base_edu'} format.xls { - filename = "#{@course.teacher.lastname.to_s + @course.teacher.firstname}_#{@course.name}_#{@course.time.to_s + @course.term}_#{@homework.name}#{l(:excel_homework_list)}.xls" + filename = "#{@course.teacher.lastname.to_s + @course.teacher.firstname}_#{@course.name}_#{@homework.name}#{l(:excel_homework_list)}.xls" send_data(homework_to_xls(@stundet_works), :type => "text/excel;charset=utf-8; header=present", :filename => filename_for_content_disposition(filename)) } diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 7e90a11d7..54dd8c081 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -2972,16 +2972,15 @@ class UsersController < ApplicationController @user = User.current if !params[:search].nil? search = "%#{params[:search].to_s.strip.downcase}%" - @course = @user.courses.not_deleted.where(" #{Course.table_name}.id = #{params[:search].to_i } or #{Course.table_name}.name like :p",:p=>search) + @course = @user.courses.not_deleted_not_end.where(" #{Course.table_name}.id = #{params[:search].to_i } or #{Course.table_name}.name like :p",:p=>search) else - @course = @user.courses.not_deleted + @course = @user.courses.not_deleted_not_end end @search = params[:search] @type = params[:type] #这里仅仅是传递需要发送的资源id @send_id = params[:send_id] @send_ids = params[:checkbox1] || params[:send_ids] - @hidden_unproject = hidden_unproject_infos respond_to do |format| format.js end @@ -3059,60 +3058,61 @@ class UsersController < ApplicationController else @flag = false end - @order, @b_sort = params[:order] || "created_on", params[:sort] || "asc" - @score = @b_sort == "desc" ? "asc" : "desc" - user_project_ids = User.current.projects.map {|p| p.id} - user_course_ids = User.current.courses.map { |c| c.id} #我的资源库的话,那么应该是我上传的所有资源 加上 我加入的课程的所有资源 - if(params[:type] == "1") # 我的资源 - # 修正:我的资源库的话,那么应该是我上传的所有资源加上,我加入的课程、项目、组织的所有资源 - if params[:status] == "2" - @attachments = get_course_resources(User.current.id, user_course_ids, @order, @score) - elsif params[:status] == "3" - @attachments = get_project_resources(User.current.id, user_project_ids, @order, @score) - elsif params[:status] == "4" - @attachments = get_attch_resources(User.current.id, @order, @score) - elsif params[:status] == "5" - @attachments = get_principal_resources(User.current.id, @order, @score) - else - # 公共资源库:所有公开资源或者我上传的私有资源 - @attachments = get_my_resources(User.current.id, user_course_ids, user_project_ids, @order, @score) - end - elsif (params[:type].blank? || params[:type] == "6") # 公共资源 - if params[:status] == "2" - @attachments = get_course_resources_public( user_course_ids, @order, @score) - elsif params[:status] == "3" - @attachments = get_project_resources_public(user_project_ids, @order, @score) - elsif params[:status] == "4" - @attachments = get_attch_resources_public(@order, @score) - elsif params[:status] == "5" - @attachments = get_principal_resources_public(@order, @score) - else - # 公共资源库:所有公开资源或者我上传的私有资源 - @attachments = get_public_resources(user_course_ids, user_project_ids, params[:order], @score) - end - # elsif params[:type] == "2" - # apply_ids = ApplyResource.where("user_id =? and status =?", params[:id], 2).map { |ar| ar.attachment_id} - # if params[:status] == "2" - # resource_type = "'Course'" - # elsif params[:status] == "3" - # resource_type = "'Project'" - # elsif params[:status] == "5" - # resource_type = "'Principal'" - # else - # resource_type = "'Project','OrgSubfield','Principal','Course'" - # end - # @attachments = get_my_private_resources(apply_ids, resource_type, @order, @score) - end - @type = params[:type] - @limit = 25 - @path = user_resource_user_path(User.current, :type => @type) - @user = User.current - @is_remote = true - @atta_count = @attachments.count - @atta_pages = Paginator.new @atta_count, @limit, params['page'] || 1 - @offset ||= @atta_pages.offset - #@curse_attachments_all = @all_attachments[@offset, @limit] - @attachments = paginateHelper @attachments,25 + # @order, @b_sort = params[:order] || "created_on", params[:sort] || "asc" + # @score = @b_sort == "desc" ? "asc" : "desc" + # user_project_ids = User.current.projects.map {|p| p.id} + # user_course_ids = User.current.courses.map { |c| c.id} #我的资源库的话,那么应该是我上传的所有资源 加上 我加入的课程的所有资源 + # if(params[:type] == "1") # 我的资源 + # # 修正:我的资源库的话,那么应该是我上传的所有资源加上,我加入的课程、项目、组织的所有资源 + # if params[:status] == "2" + # @attachments = get_course_resources(User.current.id, user_course_ids, @order, @score) + # elsif params[:status] == "3" + # @attachments = get_project_resources(User.current.id, user_project_ids, @order, @score) + # elsif params[:status] == "4" + # @attachments = get_attch_resources(User.current.id, @order, @score) + # elsif params[:status] == "5" + # @attachments = get_principal_resources(User.current.id, @order, @score) + # else + # # 公共资源库:所有公开资源或者我上传的私有资源 + # @attachments = get_my_resources(User.current.id, user_course_ids, user_project_ids, @order, @score) + # end + # elsif (params[:type].blank? || params[:type] == "6") # 公共资源 + # if params[:status] == "2" + # @attachments = get_course_resources_public( user_course_ids, @order, @score) + # elsif params[:status] == "3" + # @attachments = get_project_resources_public(user_project_ids, @order, @score) + # elsif params[:status] == "4" + # @attachments = get_attch_resources_public(@order, @score) + # elsif params[:status] == "5" + # @attachments = get_principal_resources_public(@order, @score) + # else + # # 公共资源库:所有公开资源或者我上传的私有资源 + # @attachments = get_public_resources(user_course_ids, user_project_ids, params[:order], @score) + # end + # # elsif params[:type] == "2" + # # apply_ids = ApplyResource.where("user_id =? and status =?", params[:id], 2).map { |ar| ar.attachment_id} + # # if params[:status] == "2" + # # resource_type = "'Course'" + # # elsif params[:status] == "3" + # # resource_type = "'Project'" + # # elsif params[:status] == "5" + # # resource_type = "'Principal'" + # # else + # # resource_type = "'Project','OrgSubfield','Principal','Course'" + # # end + # # @attachments = get_my_private_resources(apply_ids, resource_type, @order, @score) + # end + # @type = params[:type] + # @limit = 25 + # @path = user_resource_user_path(User.current, :type => @type) + # @user = User.current + # @is_remote = true + # @atta_count = @attachments.count + # @atta_pages = Paginator.new @atta_count, @limit, params['page'] || 1 + # @offset ||= @atta_pages.offset + # #@curse_attachments_all = @all_attachments[@offset, @limit] + # @attachments = paginateHelper @attachments,25 + @course = @ori.course respond_to do |format| format.js end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index cd44ea064..a5cf87e77 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -3558,50 +3558,50 @@ module ApplicationHelper if User.current.logged? if User.current.member_of_course?(homework.course) if is_teacher #老师显示作品数量 - link_to "作品(#{count})", student_work_index_url_in_org(homework.id, 2), :class => "c_blue" + link_to "作品(#{count})", student_work_index_url_in_org(homework.id, 2), :class => "c_blue homepagePostSubmit" else #学生显示提交作品、修改作品等按钮 work = cur_user_works_for_homework homework project = cur_user_projects_for_homework homework if work.nil? && homework.end_time >= Time.now if homework.homework_type ==3 && project.nil? && homework.homework_detail_group.base_on_project == 1 - link_to "提交作品(#{count})","javascript:void(0)", :class => 'c_grey',:style=>"cursor:not-allowed",:title => '请先关联项目再提交作品' + link_to "提交作品(#{count})","javascript:void(0)", :class => 'c_grey homepagePostSubmit',:style=>"cursor:not-allowed",:title => '请先关联项目再提交作品' else link_to "提交作品(#{count})", new_student_work_url_without_domain(homework.id),:class => 'c_blue' end elsif work.nil? && homework.end_time < Time.now - if homework.homework_type ==3 && project.nil? && homework.homework_detail_group.base_on_project == 1 - link_to "补交作品(#{count})","javascript:void(0)", :class => 'c_grey',:style=>"cursor:not-allowed",:title => '请先关联项目再补交作品' - else - link_to "补交作品(#{count})", new_student_work_url_without_domain(homework.id),:class => 'c_red' + if homework.allow_late + if homework.homework_type ==3 && project.nil? && homework.homework_detail_group.base_on_project == 1 + link_to "补交作品(#{count})","javascript:void(0)", :class => 'c_grey homepagePostSubmit',:style=>"cursor:not-allowed",:title => '请先关联项目再补交作品' + else + link_to "补交作品(#{count})", new_student_work_url_without_domain(homework.id),:class => 'c_red homepagePostSubmit' + end end - else - if homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 2 && StudentWorksEvaluationDistribution.where("student_work_id = #{work.id}").count > 0 #匿评作业,且作业状态不是在开启匿评之前 + elsif work + if homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 3 && StudentWorksEvaluationDistribution.where("student_work_id = #{work.id}").count > 0 #匿评作业,且作业状态不是在开启匿评之前 if homework.homework_type != 3 - link_to "作品匿评", student_work_index_url_in_org(homework.id, 2), :class => 'c_blue', :title => "开启匿评后不可修改作品" + link_to "作品匿评", student_work_index_url_in_org(homework.id, 2), :class => 'c_blue homepagePostSubmit', :title => "开启匿评后不可修改作品" else work_ids = "(" + homework.student_works.has_committed.map(&:id).join(",") + ")" if User.current.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count > 0 - link_to "作品匿评", student_work_index_url_in_org(homework.id, 2), :class => 'c_blue', :title => "开启匿评后不可修改作品" + link_to "作品匿评", student_work_index_url_in_org(homework.id, 2), :class => 'c_blue homepagePostSubmit', :title => "开启匿评后不可修改作品" else - link_to "查看作品(#{count})",student_work_index_url_in_org(homework.id, 2), :class => 'c_blue', :title => "匿评开启后提交的作品不参与匿评" + link_to "查看作品(#{count})",student_work_index_url_in_org(homework.id, 2), :class => 'c_blue homepagePostSubmit', :title => "匿评开启后提交的作品不参与匿评" end end - elsif homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 3 - link_to "查看作品(#{count})",student_work_index_url_in_org(homework.id, 2), :class => 'c_blue', :title => "匿评已结束" - elsif homework.homework_type == 2 && homework.end_time >= Time.now#编程作业不能修改作品 - link_to "修改作品(#{count})", new_student_work_url_without_domain(homework.id),:class => 'c_blue' + elsif homework.homework_detail_manual && homework.homework_detail_manual.comment_status > 3 + link_to "查看作品(#{count})",student_work_index_url_in_org(homework.id, 2), :class => 'c_blue homepagePostSubmit', :title => "匿评已结束" elsif homework.end_time >= Time.now && work.user_id == User.current.id - link_to "修改作品(#{count})", edit_student_work_url_without_domain(work.id),:class => 'c_blue' + link_to "修改作品(#{count})", edit_student_work_url_without_domain(work.id),:class => 'c_blue homepagePostSubmit' else - link_to "查看作品(#{count})", student_work_index_url_in_org(homework.id, 2), :class => 'c_blue', :title => "作业截止后不可修改作品" + link_to "查看作品(#{count})", student_work_index_url_in_org(homework.id, 2), :class => 'c_blue homepagePostSubmit', :title => "作业截止后不可修改作品" end end end else - link_to "作品(#{count})", "javascript:void(0)", :class => "c_blue", :onclick => "notice_sure_box('您不是班级成员,不能提交作品
请先从老师处获取邀请码后加入班级,再提交作品')" + link_to "作品(#{count})", "javascript:void(0)", :class => "c_blue homepagePostSubmit", :onclick => "notice_sure_box('您不是班级成员,不能提交作品
请先从老师处获取邀请码后加入班级,再提交作品')" end else - link_to "作品(#{count})", "javascript:void(0)", :class => "c_blue", :onclick => "login_notice_box('#{signin_url_without_domain}');" + link_to "作品(#{count})", "javascript:void(0)", :class => "c_blue homepagePostSubmit", :onclick => "login_notice_box('#{signin_url_without_domain}');" end end diff --git a/app/helpers/student_work_helper.rb b/app/helpers/student_work_helper.rb index cca310a02..61b4ff8cd 100644 --- a/app/helpers/student_work_helper.rb +++ b/app/helpers/student_work_helper.rb @@ -103,7 +103,7 @@ module StudentWorkHelper if homework.allow_late link_to "补交作品", new_student_work_url_without_domain(homework.id),:class => 'task-btn task-btn-blue fr' end - else + elsif work if homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 3 && StudentWorksEvaluationDistribution.where("student_work_id = #{work.id}").count > 0 #匿评作业,且作业状态不是在开启匿评之前 if homework.homework_type != 3 link_to "匿评作品", student_work_index_url_in_org(homework.id, 2), :class => 'task-btn task-btn-blue fr', :title => "开启匿评后不可修改作品" @@ -112,15 +112,15 @@ module StudentWorkHelper if User.current.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count > 0 link_to "匿评作品", student_work_index_url_in_org(homework.id, 2), :class => 'task-btn task-btn-blue fr', :title => "开启匿评后不可修改作品" else - link_to "查看作品",student_work_index_url_in_org(homework.id, 2), :class => 'task-btn task-btn-blue fr', :title => "匿评开启后提交的作品不参与匿评" + link_to "查看作品", student_work_path(work), :class => 'task-btn task-btn-blue fr', :title => "匿评开启后提交的作品不参与匿评" end end elsif homework.homework_detail_manual && homework.homework_detail_manual.comment_status > 3 - link_to "查看作品",student_work_index_url_in_org(homework.id, 2), :class => 'task-btn task-btn-blue fr', :title => "匿评已结束" + link_to "查看作品", student_work_path(work), :class => 'task-btn task-btn-blue fr', :title => "匿评已结束" elsif homework.end_time >= Time.now && work.user_id == User.current.id link_to "修改作品", edit_student_work_url_without_domain(work.id),:class => 'task-btn task-btn-blue fr' else - link_to "查看作品", student_work_index_url_in_org(homework.id, 2), :class => 'task-btn task-btn-blue fr', :title => "作业截止后不可修改作品" + link_to "查看作品", student_work_path(work), :class => 'task-btn task-btn-blue fr', :title => "作业截止后不可修改作品" end end end diff --git a/app/views/account/_has_authentication.html.erb b/app/views/account/_has_authentication.html.erb index 844311089..4244df0c5 100644 --- a/app/views/account/_has_authentication.html.erb +++ b/app/views/account/_has_authentication.html.erb @@ -5,6 +5,16 @@ 已认证 <% end %> +<% if !@user.authentication && @apply_user_auth && @apply_user_auth.status == 0 %> + <%= render :partial => "welcome/one_btn_mask_pop", + :locals => { + :tip1 => "更多功能,需要经过管理员的授权审核", + :tip2 => "认证申请已提交,我们将在1个工作日内完成审核", + :btn => "试用申请", + :url => "javascript:void(0);" + } + %> +<% end %>
1.上传图片
@@ -66,4 +76,4 @@
提交认证申请
-
\ No newline at end of file + diff --git a/app/views/account/authentication.html.erb b/app/views/account/authentication.html.erb index e06d9cd61..fef10833c 100644 --- a/app/views/account/authentication.html.erb +++ b/app/views/account/authentication.html.erb @@ -107,4 +107,4 @@ <% else %> <%= render :partial => 'has_authentication' %> <% end %> - \ No newline at end of file + diff --git a/app/views/attachments/_show_attachment_history.html.erb b/app/views/attachments/_show_attachment_history.html.erb index f4bf75339..1a360b451 100644 --- a/app/views/attachments/_show_attachment_history.html.erb +++ b/app/views/attachments/_show_attachment_history.html.erb @@ -1,12 +1,11 @@ -
-
-

更新资源版本

- -
-
-
-
- <%= render :partial => "files/attachment_history_popub" %> +
+
+

更新资源版本

+ +
+
+
+ <%= render :partial => "files/attachment_history_popub" %> +
-
diff --git a/app/views/attachments/_show_attachment_history_delete.html.erb b/app/views/attachments/_show_attachment_history_delete.html.erb index 85f46ea72..2398593b1 100644 --- a/app/views/attachments/_show_attachment_history_delete.html.erb +++ b/app/views/attachments/_show_attachment_history_delete.html.erb @@ -1,15 +1,13 @@ -
-
-

删除资源

- -
-
-
- -
- <%= render :partial => "files/attachment_history_popub_delete" %> +
+
+

删除资源

+ +
+
+
+ <%= render :partial => "files/attachment_history_popub_delete" %> +
-
diff --git a/app/views/courses/index.js.erb b/app/views/courses/index.js.erb index 7ed24fff5..915f15b27 100644 --- a/app/views/courses/index.js.erb +++ b/app/views/courses/index.js.erb @@ -1 +1,4 @@ -$("#intelligence_course_list").html("<%= j(render :partial => "courses/courseList") %>"); \ No newline at end of file +$("#intelligence_course_list").html("<%= j(render :partial => "courses/courseList") %>"); +$("#courses_index_syllabuses_1").attr('href','<%= courses_path(:select => "all", :search => @search) %>'); +$("#courses_index_syllabuses_2").attr('href','<%= courses_path(:select => "create", :search => @search) %>'); +$("#courses_index_syllabuses_3").attr('href','<%= courses_path(:select => "join", :search => @search) %>'); \ No newline at end of file diff --git a/app/views/courses/new.html.erb b/app/views/courses/new.html.erb index 375de3a3b..ccd007b8e 100644 --- a/app/views/courses/new.html.erb +++ b/app/views/courses/new.html.erb @@ -1,7 +1,7 @@

- <%= link_to User.current.show_name, user_path(User.current) %> > <%= link_to '智能课堂', user_course_community_path(User.current) %> + <%= link_to User.current.show_name, user_path(User.current) %> > <%= link_to '智能课堂', courses_path %>

新建班级 @@ -29,9 +29,12 @@
  • - +
    班级名称不能为空且至少有两个字符 +
    +
  • 正确示例:软件工程计算机系2016秋季A班
  • +
  • 错误示例:计算机系2016秋季A班
  • @@ -57,7 +60,7 @@
  • - 结束日期必须早于当前日期 + 结束日期必须晚于当前日期
  • diff --git a/app/views/courses/settings.html.erb b/app/views/courses/settings.html.erb index 22f5c834b..ebb38cb79 100644 --- a/app/views/courses/settings.html.erb +++ b/app/views/courses/settings.html.erb @@ -16,10 +16,10 @@

    -

    - 模块设置 - -

    + + + +
  • @@ -50,9 +50,12 @@
  • - +
    班级名称不能为空且至少有两个字符 +
    +
  • 正确示例:软件工程计算机系2016秋季A班
  • +
  • 错误示例:计算机系2016秋季A班
  • @@ -78,7 +81,7 @@
  • - 结束日期必须早于当前日期 + 结束日期必须晚于当前日期
  • @@ -112,9 +115,9 @@
  • - + + + @@ -132,8 +135,8 @@ '/courses/<%= @course.id %>/has_group_student_list?group_id=<%= @role %>' ); <% end %> - <% elsif @select_tab == 'module'%> - $(".stud-class-set .news .nav p[data-option='module']").click(); + <%# elsif @select_tab == 'module'%> +// $(".stud-class-set .news .nav p[data-option='module']").click(); <% end %> }); diff --git a/app/views/courses/settings/_all_student_list.html.erb b/app/views/courses/settings/_all_student_list.html.erb index 2eb4c07dd..bad689f81 100644 --- a/app/views/courses/settings/_all_student_list.html.erb +++ b/app/views/courses/settings/_all_student_list.html.erb @@ -32,7 +32,7 @@
    diff --git a/app/views/courses/settings/_search_not_students_list.html.erb b/app/views/courses/settings/_search_not_students_list.html.erb index 5c273552a..4248c4eab 100644 --- a/app/views/courses/settings/_search_not_students_list.html.erb +++ b/app/views/courses/settings/_search_not_students_list.html.erb @@ -6,9 +6,9 @@ <% end %> diff --git a/app/views/courses/settings/_search_not_teachers_list.html.erb b/app/views/courses/settings/_search_not_teachers_list.html.erb index eab6be4e0..d526fc768 100644 --- a/app/views/courses/settings/_search_not_teachers_list.html.erb +++ b/app/views/courses/settings/_search_not_teachers_list.html.erb @@ -6,9 +6,9 @@ <% end %> diff --git a/app/views/files/_attachment_history_popub.html.erb b/app/views/files/_attachment_history_popub.html.erb index f864f3a4f..65cc7c87f 100644 --- a/app/views/files/_attachment_history_popub.html.erb +++ b/app/views/files/_attachment_history_popub.html.erb @@ -1,8 +1,8 @@ - +
    - + @@ -10,7 +10,7 @@ - + @@ -51,10 +51,9 @@
    -
    - 取消 - <%#= submit_tag '确定', :onclick => 'upload_attachment_version(event);', :onfocus => 'this.blur()', :id => 'upload_files_submit_btn', :class => 'btn btn-blue fr mr5' %> - 确定 + <% end %> diff --git a/app/views/files/_attachment_history_popub_delete.html.erb b/app/views/files/_attachment_history_popub_delete.html.erb index bab987800..bc5050805 100644 --- a/app/views/files/_attachment_history_popub_delete.html.erb +++ b/app/views/files/_attachment_history_popub_delete.html.erb @@ -1,8 +1,8 @@ -
    资源名称下载数下载数 引用数 版本号
    当前版本当前版本 <%= @attachment.downloads %> <%= @attachment.try(:quotes).to_i %> <%= format_time(@attachment.created_on) %>
    +
    - + @@ -28,7 +28,6 @@
    资源名称下载数下载数 引用数 版本号 <%= link_to( '删除资源', attachment_path(history.attachment, :history_id => history, :type => "history_delete"), :remote => true, - :data => {:confirm => l(:text_are_you_sure)}, :method => :delete, :class => "postOptionLink", :class => "btn") if allow_to_delete_attachment(history) %> diff --git a/app/views/files/_course_file.html.erb b/app/views/files/_course_file.html.erb index 6e10e4114..6a8e6aeed 100644 --- a/app/views/files/_course_file.html.erb +++ b/app/views/files/_course_file.html.erb @@ -101,8 +101,8 @@ <%= submit_tag "班内搜索", :class => "blueBtn mr5 fl",:name => "incourse",:id => "incourse" %> <%#= submit_tag "全站搜索", :class => "blueBtn mr5 fl",:name => "insite",:id => "insite" %> <% if is_course_teacher(User.current,@course) || (@course.publish_resource==1 && User.current.member_of_course?(@course) ) %> - - <%= link_to("导入资源", import_resources_user_path(User.current, :type => 6, :course_id => @course.id), :class => "blue-btn fr mr5", :remote => true) %> + 上传资源 + <%= link_to("导入资源", import_resources_user_path(User.current, :type => 6, :course_id => @course.id), :class => "task-btn task-btn-blue fr mr5", :remote => true) %> <% end %> <% end %> diff --git a/app/views/files/_hidden_file.html.erb b/app/views/files/_hidden_file.html.erb index 6d8d861d5..da0090c5c 100644 --- a/app/views/files/_hidden_file.html.erb +++ b/app/views/files/_hidden_file.html.erb @@ -1,12 +1,11 @@ -
    -
    -

    发布设置

    - -
    +
    +
    +

    发布设置

    +
    -
    +
    <%= form_tag(republish_file_course_file_path(@course,@file), :multipart => true,:remote => !ie8?,:name=>"upload_form") do %>
    @@ -18,8 +17,9 @@
    - 确定 - 取消 + + 确定 + 取消 <% end %>
    diff --git a/app/views/files/_new_style_attachment_list.html.erb b/app/views/files/_new_style_attachment_list.html.erb index 80e41d55a..818c6c24f 100644 --- a/app/views/files/_new_style_attachment_list.html.erb +++ b/app/views/files/_new_style_attachment_list.html.erb @@ -23,12 +23,8 @@ - - <%= l(:label_no_file_uploaded)%> - -单个文件最大限制:<%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %> +单个文件最大限制:<%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>
    - - +
    \ No newline at end of file diff --git a/app/views/files/_resource_detail.html.erb b/app/views/files/_resource_detail.html.erb index dbb3ca880..5f7abeea4 100644 --- a/app/views/files/_resource_detail.html.erb +++ b/app/views/files/_resource_detail.html.erb @@ -17,7 +17,7 @@ :class => "linkGrey3 f_14", :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;", :remote=>true %> <% end %> - <%= file_preview_eye(file, class: 'preview') %> + <%#= file_preview_eye(file, class: 'preview') %> <% if file.is_public? == false%> 私有 @@ -82,7 +82,7 @@ <%end%>
  • <% if file.destroyable %> - <%= link_to( '删除资源', attachment_path(file),:data => {:confirm => l(:text_are_you_sure)}, :method => :delete,:class => "postOptionLink") if (delete_allowed || User.current.id == file.author_id) && file.container_id == @course.id && file.container_type == "Course" %> + <%= link_to( '删除资源', "javascript:void(0);", :onclick => "delete_confirm_box_3('#{attachment_path(file)}', '确定要删除该资源吗?')", :class => "postOptionLink") if (delete_allowed || User.current.id == file.author_id) && file.container_id == @course.id && file.container_type == "Course" %> <% else %> <%= link_to '删除资源',attachment_versions_delete_path(file), :class => "postOptionLink", :remote => true %> <% end %> diff --git a/app/views/files/_upload_course_files.erb b/app/views/files/_upload_course_files.erb index f7cab96b3..943ba8f51 100644 --- a/app/views/files/_upload_course_files.erb +++ b/app/views/files/_upload_course_files.erb @@ -1,47 +1,46 @@ -
    -
    -

    上传资源

    - -
    +
    +
    +

    上传资源

    +
    -
    -
    +
    +
    <%= error_messages_for 'attachment' %> - <%= form_tag(course_files_path(course), :multipart => true,:remote => !ie8?,:name=>"upload_form") do %> + <%= form_tag(course_files_path(course), :multipart => true,:remote => !ie8?,:id=>"upload_course_file_form") do %>
    • - - + +
    • - - + +
    • - - + +
    • - - + +
    • - - + +
    • - - + +
    -
    +
    <%= render :partial => 'files/new_style_attachment_list',:locals => {:container => course} %>
    @@ -62,13 +61,13 @@
    - +
    - - 确定 - 取消 + + 确定 + 取消
    <% end %>
    @@ -103,11 +102,25 @@ function submit_course_resource() { <% if User.current.allowed_to?(:as_teacher,course) %> - if(regex_publish_time()) { - $('#submit_resource').parent().submit(); + if($("#upload_course_file_form").find('.upload_filename').length == 0){ + $("#upload_file_count_notice").html('请至少上传一个资源').show(); + event.preventDefault(); + return false; + }else{ + $("#upload_file_count_notice").hide(); + if(regex_publish_time()) { + $('#submit_resource').parent().submit(); + } } <% else %> - $('#submit_resource').parent().submit(); + if($("#upload_course_file_form").find('.upload_filename').length == 0){ + $("#upload_file_count_notice").html('请至少上传一个资源').show(); + event.preventDefault(); + return false; + }else { + $("#upload_file_count_notice").hide(); + $('#submit_resource').parent().submit(); + } <% end %> } function reset_publish_time(){ diff --git a/app/views/files/index.html.erb b/app/views/files/index.html.erb index e2792254d..1e473f47c 100644 --- a/app/views/files/index.html.erb +++ b/app/views/files/index.html.erb @@ -439,11 +439,11 @@ //更新文件版本 表单提交确认,原则是只能有一个更新文件 function upload_attachment_version(event){ if($("#upload_form").find('.upload_filename').length > 1){ - $("#upload_file_count").html('(只能上传一个更新文件)') + $("#upload_file_count").html('(只能上传一个更新文件)'); event.preventDefault(); return false; }else if($("#upload_form").find('.upload_filename').length == 0){ - $("#upload_file_count").html('(请上传一个更新文件)') + $("#upload_file_count").html('(请上传一个更新文件)'); event.preventDefault(); return false; }else{ diff --git a/app/views/games/_file_edit_form.html.erb b/app/views/games/_file_edit_form.html.erb index e8097423b..dd1afdee6 100644 --- a/app/views/games/_file_edit_form.html.erb +++ b/app/views/games/_file_edit_form.html.erb @@ -10,25 +10,26 @@ + diff --git a/app/views/student_work/_evaluation_work.html.erb b/app/views/student_work/_evaluation_work.html.erb index 61a778e03..063de0caf 100644 --- a/app/views/student_work/_evaluation_work.html.erb +++ b/app/views/student_work/_evaluation_work.html.erb @@ -12,7 +12,7 @@
  • <%= student_work.user.show_name%> <%= student_work.updated_at %> - <%= format("%.1f",student_work.student_score) %>((<%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count%>)) + <%= student_work.student_score.nil? ? '--' : format("%.1f",student_work.student_score) %>((<%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count%>)) <%= link_to '查看', student_work_path(student_work), :class => 'link-color-blue' %> diff --git a/app/views/student_work/index.html.erb b/app/views/student_work/index.html.erb index c11fbf241..63e40c1ff 100644 --- a/app/views/student_work/index.html.erb +++ b/app/views/student_work/index.html.erb @@ -269,16 +269,23 @@ <% if @homework.homework_detail_manual.comment_status == 1%> <% end_time = @homework.end_time.to_i %> <% if end_time >= Time.now.to_i %> - 提交剩余时间 <%= (end_time - Time.now.to_i) / (24*60*60) %> 天 <%= ((end_time - Time.now.to_i) % (24*60*60)) / (60*60)%> 小时 <%= (((end_time - Time.now.to_i) % (24*60*60)) % (60*60)) / 60%> 分 + 提交剩余时间 <%= (end_time - Time.now.to_i) / (24*60*60) %> 天 <%= ((end_time - Time.now.to_i) % (24*60*60)) / (60*60)%> 小时 <%= (((end_time - Time.now.to_i) % (24*60*60)) % (60*60)) / 60%> 分 <% else %> - 提交已截止 + 提交已截止 <% end %> <% elsif @homework.homework_detail_manual.comment_status == 2%> + <% late_time = @homework.late_time.to_i %> + <% if late_time >= Time.now.to_i %> + 补交剩余时间 <%= (late_time - Time.now.to_i) / (24*60*60) %> 天 <%= ((late_time - Time.now.to_i) % (24*60*60)) / (60*60)%> 小时 <%= (((late_time - Time.now.to_i) % (24*60*60)) % (60*60)) / 60%> 分 + <% else %> + 补交已截止 + <% end %> + <% elsif @homework.homework_detail_manual.comment_status == 3%> <% end_time = @homework.homework_detail_manual.evaluation_end.to_time.to_i + 24*60*60 - 1 %> <% if end_time >= Time.now.to_i %> - 匿评剩余时间 <%= (end_time - Time.now.to_i) / (24*60*60)%> 天 <%= ((end_time - Time.now.to_i) % (24*60*60)) / (60*60)%> 小时 <%= (((end_time - Time.now.to_i) % (24*60*60)) % (60*60)) / 60%> 分 + 匿评剩余时间 <%= (end_time - Time.now.to_i) / (24*60*60)%> 天 <%= ((end_time - Time.now.to_i) % (24*60*60)) / (60*60)%> 小时 <%= (((end_time - Time.now.to_i) % (24*60*60)) % (60*60)) / 60%> 分 <% else %> - 匿评已截止 + 匿评已截止 <% end %> <% end%> <% end%> diff --git a/app/views/student_work/work_canrepeat.js.erb b/app/views/student_work/work_canrepeat.js.erb index 4c7cb8489..7e40ba5f8 100644 --- a/app/views/student_work/work_canrepeat.js.erb +++ b/app/views/student_work/work_canrepeat.js.erb @@ -1,13 +1,7 @@ //代码查重 <% if @work_count <= 1 %> //弹框 - $("#ajax-modal").html('<%= escape_javascript( render :partial => 'courses/compare_code_tips_2',:locals => {:des=>"对不起该作业的作品过少不能查重!",:status=>0, :homework=> @homework,:courseid=> @course_id})%>'); - showModal('ajax-modal', '580px'); - $('#ajax-modal').siblings().remove(); - $('#ajax-modal').before(""); - $('#ajax-modal').parent().css("top", "30%").css("left", "50%").css("padding-top", "10px").css("position", "fixed"); - $('#ajax-modal').parent().addClass("resourceUploadPopup"); - $('#ajax-modal').css("padding-left", "16px").css("padding-bottom", "16px"); + notice_box("对不起该作业的作品过少不能查重!"); function closeModal() { hideModal($(".blue-border-box")); diff --git a/app/views/syllabuses/_courses_list.html.erb b/app/views/syllabuses/_courses_list.html.erb index 64341b888..44cd7858d 100644 --- a/app/views/syllabuses/_courses_list.html.erb +++ b/app/views/syllabuses/_courses_list.html.erb @@ -3,7 +3,7 @@ <% allow_visit = course.is_delete == 0 && (User.current.member_of_course?(course) || User.current.admin? || course.is_public == 1) %>
  • - " class="fl mr5" target="<%= allow_visit ? '_blank' : "" %>"><%= course.name %> + " onclick="<%= allow_visit ? '' : 'notice_sure_box(\'你不是该私有班级的成员,不能访问\')' %>" class="fl mr5" target="<%= allow_visit ? '_blank' : "" %>"><%= course.name %> <% if course.is_public == 0 %> <% end %> diff --git a/app/views/syllabuses/_join_syllabuses.html.erb b/app/views/syllabuses/_join_syllabuses.html.erb index 0f559e07a..103f366fc 100644 --- a/app/views/syllabuses/_join_syllabuses.html.erb +++ b/app/views/syllabuses/_join_syllabuses.html.erb @@ -1,4 +1,5 @@ -<% @join_syllabuses.each_with_index do |syllabus, index|%> +<% if @join_syllabuses.count > 0 %> + <% @join_syllabuses.each_with_index do |syllabus, index|%> <% course_count = @status == 1 ? syllabus.courses.where("is_delete = 0 and is_end = 0").count : syllabus.courses.where("is_delete = 0 and is_end = 1").count %> <% if !(@status == 2 && course_count == 0) %>
    @@ -8,7 +9,7 @@ - <%= syllabus.title %> + <%= syllabus.title %> <% if course_count > 0 %> <%= course_count %> <% end %> @@ -37,3 +38,6 @@
    <% end %> <% end %> +<% else %> +<%= render :partial => 'welcome/no_data' %> +<% end %> \ No newline at end of file diff --git a/app/views/syllabuses/_my_syllabuses.html.erb b/app/views/syllabuses/_my_syllabuses.html.erb index df9825c3c..972f44dbe 100644 --- a/app/views/syllabuses/_my_syllabuses.html.erb +++ b/app/views/syllabuses/_my_syllabuses.html.erb @@ -1,3 +1,4 @@ +<% if @my_syllabuses.count > 0 %> <% @my_syllabuses.each_with_index do |syllabus, index|%> <% course_count = @status == 1 ? syllabus.courses.where("is_delete = 0 and is_end = 0").count : syllabus.courses.where("is_delete = 0 and is_end = 1").count %> <% if !(@status == 2 && course_count == 0) %> @@ -8,7 +9,7 @@
    - <%= syllabus.title %> + <%= syllabus.title %> <% if course_count > 0 %> <%= course_count %> <% end %> @@ -36,4 +37,7 @@ <% end %> +<% end %> +<% else %> + <%= render :partial => 'welcome/no_data' %> <% end %> \ No newline at end of file diff --git a/app/views/syllabuses/edit.html.erb b/app/views/syllabuses/edit.html.erb index f087c2ed1..d45d8c451 100644 --- a/app/views/syllabuses/edit.html.erb +++ b/app/views/syllabuses/edit.html.erb @@ -1,7 +1,7 @@

    - <%= link_to User.current.show_name, user_path(User.current) %> > <%= link_to '智能课堂', user_course_community_path(User.current) %> + <%= link_to User.current.show_name, user_path(User.current) %> > <%= link_to '智能课堂', courses_path %>

    编辑课程

    diff --git a/app/views/syllabuses/new.html.erb b/app/views/syllabuses/new.html.erb index 18e13475d..fb482dc44 100644 --- a/app/views/syllabuses/new.html.erb +++ b/app/views/syllabuses/new.html.erb @@ -1,7 +1,7 @@

    - <%= link_to User.current.show_name, user_path(User.current) %> > <%= link_to '智能课堂', user_course_community_path(User.current) %> + <%= link_to User.current.show_name, user_path(User.current) %> > <%= link_to '智能课堂', courses_path %>

    新建课程

    diff --git a/app/views/users/_course_file_form.html.erb b/app/views/users/_course_file_form.html.erb index 750a96053..4d35b6297 100644 --- a/app/views/users/_course_file_form.html.erb +++ b/app/views/users/_course_file_form.html.erb @@ -1,28 +1,18 @@ - <%= form_tag add_exist_file_to_course_user_path(user, :type => defined?(type) ? type : "6" ),:remote=>true,:id=>'course_list_form' do %> -
    - <%= hidden_field_tag(:send_id, send_id) %> - <%= hidden_field_tag(:send_ids, send_ids) %> -
    +
    + <%= hidden_field_tag(:send_id, send_id) %> +
      <% if !courses.empty? %> <% courses.each do |course| %> -
        -
      • - -
      • -
      • <%= truncate(course.name,:lendght=>25) + '['+course.time.to_s+course.term + ']'%>
      • -
      +
    • + +
    • <% end %> <% end %> -
    -
    -
    -
    -
    - - <%= submit_tag '确定',:class=>'sendSourceText',:onfocus=>'this.blur();' %> -
    - +
    <% end %> \ No newline at end of file diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb index 78928e98e..c5a6ac69c 100644 --- a/app/views/users/_course_homework.html.erb +++ b/app/views/users/_course_homework.html.erb @@ -23,7 +23,8 @@ <%= link_to activity.name.to_s, student_work_index_path(:homework => activity.id,:host=> Setting.host_course), :class => "postGrey edu-txt-850"%> <% end %>
    - <%=get_hw_status(activity).html_safe %> + <% homework_curr_status = homework_curr_time(activity) %> + <%= homework_curr_status[:status] %>
    <% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1%> diff --git a/app/views/users/_homework_opr.html.erb b/app/views/users/_homework_opr.html.erb index 650e35744..eeb698492 100644 --- a/app/views/users/_homework_opr.html.erb +++ b/app/views/users/_homework_opr.html.erb @@ -11,7 +11,7 @@
    <% end %> <% end %> -
    +
    <%= user_for_homework_common activity,is_teacher,work %>
    <% if !is_teacher && !work.nil? && work.user == User.current && activity.end_time < Time.now %> diff --git a/app/views/users/_import_resource_info.html.erb b/app/views/users/_import_resource_info.html.erb index 9ad24c8ee..42ced5657 100644 --- a/app/views/users/_import_resource_info.html.erb +++ b/app/views/users/_import_resource_info.html.erb @@ -14,50 +14,51 @@ }); }); -
    选用资源库中的资源
    -
    - <% if !params[:course_id].nil? %> - 公共资源 - 我的资源 - <% elsif !params[:project_id].nil? %> - 公共资源 - 我的资源 - <% elsif !params[:subfield_file_id].nil? %> - 公共资源 - 我的资源 - <% end %> -