diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index fabacf1ba..2f2f014d4 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -11,6 +11,7 @@ class HomeworkCommonController < ApplicationController before_filter :member_of_course, :only => [:index] def index + update_homework_time(@course.homework_commons) @new_homework = HomeworkCommon.new @new_homework.homework_detail_manual = HomeworkDetailManual.new @new_homework.course = @course @@ -400,4 +401,42 @@ class HomeworkCommonController < ApplicationController student_works += student_works student_works[index + 1 .. index + n] end + + def update_homework_time homeworks + unless homeworks.nil? + homeworks.each do |h| + if h.homework_type == 3 + student_works = h.student_works.where("project_id != 0") + time = h.updated_at + unless student_works.nil? + student_works.each do |s| + project = Project.find s.project_id + unless project.nil? && project.gpid.nil? + begin + # gitlab端获取默认分支 + g = Gitlab.client + default_branch = g.project(project.gpid).default_branch + changesets = g.commits(project.gpid, :ref_name => default_branch) + changesets_latest_coimmit = changesets[0] + unless changesets[0].blank? + if time < changesets_latest_coimmit.created_at + time = changesets_latest_coimmit.created_at + end + end + rescue + logger.error("############## ==> update homework project time") + end + end + end + end + puts h.updated_at + puts time + s_time = time + if format_time(time) > format_time(h.updated_at) + h.update_attribute(:updated_at, s_time) + end + end + end + end + end end diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index cc1a1e9c7..344c7d0ad 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -1147,7 +1147,7 @@ class StudentWorkController < ApplicationController blue = Spreadsheet::Format.new :color => :blue, :weight => :bold, :size => 10 sheet1.row(0).default_format = blue if @homework.homework_type == 1 #匿评作业 - sheet1.row(0).concat([l(:excel_user_id),l(:excel_user_name),l(:excel_nickname),l(:excel_student_id),l(:excel_mail),l(:excel_homework_name), + sheet1.row(0).concat([l(:excel_user_id),l(:excel_user_name),l(:excel_nickname),l(:excel_student_id),l(:excel_mail),l(:excel_homework_name),l(:excel_homework_des), l(:excel_t_score),l(:excel_ta_score), l(:excel_n_score),l(:excel_f_score),l(:excel_commit_time)]) count_row = 1 items.each do |homework| @@ -1157,15 +1157,16 @@ class StudentWorkController < ApplicationController sheet1[count_row,3] = homework.user.user_extensions.student_id sheet1[count_row,4] = homework.user.mail sheet1[count_row,5] = homework.name - sheet1[count_row,6] = homework.teacher_score.nil? ? l(:label_without_score) : format("%.2f",homework.teacher_score) - sheet1[count_row,7] = homework.teaching_asistant_score.nil? ? l(:label_without_score) : format("%.2f",homework.teaching_asistant_score) - sheet1[count_row,8] = homework.student_score.nil? ? l(:label_without_score) : format("%.2f",homework.student_score) - sheet1[count_row,9] = homework.respond_to?("score") ? homework.score.nil? ? l(:label_without_score) : format("%.2f",homework.score) : l(:label_without_score) - sheet1[count_row,10] = format_time(homework.created_at) + sheet1[count_row,6] = homework.description + sheet1[count_row,7] = homework.teacher_score.nil? ? l(:label_without_score) : format("%.2f",homework.teacher_score) + sheet1[count_row,8] = homework.teaching_asistant_score.nil? ? l(:label_without_score) : format("%.2f",homework.teaching_asistant_score) + sheet1[count_row,9] = homework.student_score.nil? ? l(:label_without_score) : format("%.2f",homework.student_score) + sheet1[count_row,10] = homework.respond_to?("score") ? homework.score.nil? ? l(:label_without_score) : format("%.2f",homework.score) : l(:label_without_score) + sheet1[count_row,11] = format_time(homework.created_at) count_row += 1 end elsif @homework.homework_type == 2 #编程作业 - sheet1.row(0).concat([l(:excel_user_id),l(:excel_user_name),l(:excel_nickname),l(:excel_student_id),l(:excel_mail),l(:excel_homework_name), + sheet1.row(0).concat([l(:excel_user_id),l(:excel_user_name),l(:excel_nickname),l(:excel_student_id),l(:excel_mail),l(:excel_homework_name),l(:excel_homework_des), l(:excel_t_score),l(:excel_ta_score), l(:excel_s_score),l(:excel_n_score),l(:excel_f_score),l(:excel_commit_time)]) count_row = 1 items.each do |homework| @@ -1175,12 +1176,13 @@ class StudentWorkController < ApplicationController sheet1[count_row,3] = homework.user.user_extensions.student_id sheet1[count_row,4] = homework.user.mail sheet1[count_row,5] = homework.name - sheet1[count_row,6] = homework.teacher_score.nil? ? l(:label_without_score) : format("%.2f",homework.teacher_score) - sheet1[count_row,7] = homework.teaching_asistant_score.nil? ? l(:label_without_score) : format("%.2f",homework.teaching_asistant_score) - sheet1[count_row,8] = homework.system_score.nil? ? l(:label_without_score) : format("%.2f",homework.system_score) - sheet1[count_row,9] = homework.student_score.nil? ? l(:label_without_score) : format("%.2f",homework.student_score) - sheet1[count_row,10] = homework.respond_to?("score") ? homework.score.nil? ? l(:label_without_score) : format("%.2f",homework.score) : l(:label_without_score) - sheet1[count_row,11] = format_time(homework.created_at) + sheet1[count_row,6] = homework.description + sheet1[count_row,7] = homework.teacher_score.nil? ? l(:label_without_score) : format("%.2f",homework.teacher_score) + sheet1[count_row,8] = homework.teaching_asistant_score.nil? ? l(:label_without_score) : format("%.2f",homework.teaching_asistant_score) + sheet1[count_row,9] = homework.system_score.nil? ? l(:label_without_score) : format("%.2f",homework.system_score) + sheet1[count_row,10] = homework.student_score.nil? ? l(:label_without_score) : format("%.2f",homework.student_score) + sheet1[count_row,11] = homework.respond_to?("score") ? homework.score.nil? ? l(:label_without_score) : format("%.2f",homework.score) : l(:label_without_score) + sheet1[count_row,12] = format_time(homework.created_at) count_row += 1 end end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index e2b38bcb1..ead969862 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -396,6 +396,19 @@ class UsersController < ApplicationController end # end + #引用作业请求弹框 + def apply_homework + if User.current.logged? + @homework = HomeworkCommon.find params[:homework_id] + @state = 2 + else + @state = 1 + end + respond_to do |format| + format.js + end + end + #申请引用非公开作业 def apply_for_homework if User.current.logged? @@ -405,7 +418,7 @@ class UsersController < ApplicationController if ah.empty? ApplyHomework.create(:user_id => params[:id].to_i, :homework_common_id => params[:homework_id].to_i, :status => 1) Mailer.run.apply_for_homework_request(homework, User.current) - CourseMessage.create(:user_id => homework.user_id, :course_id => homework.course.id, :viewed => false,:course_message_id=>params[:homework_id].to_i,:course_message_type=>'HomeworkCommon',:status=>5,:apply_user_id=>params[:id].to_i) + CourseMessage.create(:user_id => homework.user_id, :course_id => homework.course.id, :viewed => false,:course_message_id=>params[:homework_id].to_i,:course_message_type=>'HomeworkCommon',:status=>5,:apply_user_id=>params[:id].to_i,:content=>params[:content]) @state = 2 @ah = ApplyHomework.where("user_id = ? and homework_common_id = ?", params[:id].to_i, params[:homework_id].to_i).first @homework = homework @@ -452,7 +465,7 @@ class UsersController < ApplicationController user_course_ids = @user.courses.empty? ? "(-1)" :"(" + @user.courses.visible.map{|course| course.id}.join(",") + ")" #判断当前用户在当前课程的身份 - visibleCourse = @user.courses.empty? ? [] : @user.courses.visible + visibleCourse = @user.courses.empty? ? [] : @user.courses.where("is_delete = 0").visible homework_ids = [] visibleCourse.each do |course| homeworks = HomeworkCommon.where("course_id = #{course.id} and publish_time <= '#{Date.today}'") @@ -473,7 +486,7 @@ class UsersController < ApplicationController def choose_user_course homework = HomeworkCommon.find params[:send_id].to_i - if homework.course.is_public == 0 && homework.user_id != User.current.id + if homework.course.is_public == 0 && !User.current.allowed_to?(:as_teacher,homework.course) ah = ApplyHomework.where("user_id = ? and homework_common_id = ?", User.current.id, params[:send_id].to_i) if ah.empty? @status = 2 @@ -622,7 +635,21 @@ class UsersController < ApplicationController end def show_homework_detail - @homework = HomeworkCommon.find params[:homework].to_i + homework = HomeworkCommon.find params[:homework].to_i + if homework.course.is_public == 0 && !User.current.allowed_to?(:as_teacher,homework.course) + ah = ApplyHomework.where("user_id = ? and homework_common_id = ?", User.current.id, params[:homework].to_i) + if ah.empty? + @status = 2 + @homework = nil + elsif ah.first.status != 2 + @status = ah.first.status + @homework = nil + elsif ah.first.status == 2 + @homework = homework + end + else + @homework = homework + end @is_import = params[:is_import] respond_to do |format| format.js diff --git a/app/views/courses/_course_outlines_list.html.erb b/app/views/courses/_course_outlines_list.html.erb index 42ce30113..2786e59bd 100644 --- a/app/views/courses/_course_outlines_list.html.erb +++ b/app/views/courses/_course_outlines_list.html.erb @@ -18,7 +18,7 @@
  • -
  • <%= article.title%>
  • +
  • <%= article.title%>
  • 发布时间:<%= format_date(article.created_at)%>
    <% end %> diff --git a/app/views/student_work/_add_score.html.erb b/app/views/student_work/_add_score.html.erb index 9d747790f..a2137d103 100644 --- a/app/views/student_work/_add_score.html.erb +++ b/app/views/student_work/_add_score.html.erb @@ -7,7 +7,7 @@

  • 评分: - +
  • diff --git a/app/views/tags/_tag_list.html.erb b/app/views/tags/_tag_list.html.erb index c8e91c1a2..c0b4176c3 100644 --- a/app/views/tags/_tag_list.html.erb +++ b/app/views/tags/_tag_list.html.erb @@ -12,7 +12,7 @@ :taggable_id => obj.id, :taggable_type => object_flag %> <% end %> <% when '6' %> - <% if obj.author_id == User.current.id || User.current.admin?%> + <% if obj.author_id == User.current.id || User.current.admin? || (obj.container_type == 'Course' && User.current.allowed_to?(:as_teacher,obj.course)) %> <% select_tag_name ||= ""%> <%= link_to 'x', :controller => "tags", :action => "remove_tag_new", :remote => true, :tag_name => tag, :taggable_id => obj.id, :taggable_type => object_flag, :select_tag_name => select_tag_name %> diff --git a/app/views/users/_apply_for_homework.html.erb b/app/views/users/_apply_for_homework.html.erb new file mode 100644 index 000000000..250cc5810 --- /dev/null +++ b/app/views/users/_apply_for_homework.html.erb @@ -0,0 +1,16 @@ +
    +
    +

    + <% if state == 2 %> + 请求已发送至<%=homework.user.show_name %>老师,希望他同意与你分享:) + <% elsif state == 3 %> + 您已发送过分享请求,请勿重复发送。 + <% end %> +

    + +
    +
    \ No newline at end of file diff --git a/app/views/users/_apply_homework.html.erb b/app/views/users/_apply_homework.html.erb new file mode 100644 index 000000000..9f909b7a4 --- /dev/null +++ b/app/views/users/_apply_homework.html.erb @@ -0,0 +1,27 @@ +
    +
    +

    请求分享

    +

    + 请求说明(可选): + +

    + +
    +
    + \ No newline at end of file diff --git a/app/views/users/_homework_repository.html.erb b/app/views/users/_homework_repository.html.erb index fce7cd6c7..7b4141906 100644 --- a/app/views/users/_homework_repository.html.erb +++ b/app/views/users/_homework_repository.html.erb @@ -8,7 +8,7 @@ function (data) { } ); - } + };
    @@ -37,11 +37,10 @@
  • <%= homework.quotes %>
  • <%=format_date homework.publish_time %>
  • - <% if homework.course && homework.course.is_public == 0 && homework.user_id != User.current.id %> -
  • + <% if homework.course.is_public == 0 && !User.current.allowed_to?(:as_teacher,homework.course) %>
  • <% ah = ApplyHomework.where("user_id = ? and homework_common_id = ?", User.current.id, homework.id).first %> <% if ah.nil? %> - <%= link_to("提交申请", apply_for_homework_user_path(User.current.id,:homework_id => homework.id), :remote => true) %> + <%= link_to("请求分享", apply_homework_user_path(User.current.id,:homework_id => homework.id), :class => 'green_btn_share c_white', :remote => true) %> <% elsif ah.status == 1 %> 待审核 <% elsif ah.status == 2 %> diff --git a/app/views/users/_homework_repository_detail.html.erb b/app/views/users/_homework_repository_detail.html.erb index efbf24955..cf04e16cb 100644 --- a/app/views/users/_homework_repository_detail.html.erb +++ b/app/views/users/_homework_repository_detail.html.erb @@ -1,7 +1,7 @@
    题目信息
    - <% if homework.nil? %> + <% if homework.nil? && status == 0 %> 本题库遵循创作共用许可证
    教师给学生出题本质上是一种创作行为,题目的作者通常为此付出大量时间和精力。好的题目不仅能加深学生对知识点的理解,还能激发学生兴趣,提升学习效率。为此,本网站的题库许可证基于创作共用许可证( Creative Commons License )建立,其核心条款包括:

    @@ -14,6 +14,14 @@ 对此许可证的支持或反对,请在网站中留言,我们不断完善,谢谢!
    + <% elsif homework.nil? && status == 1 %> + 您选中的作业目前为私有作业,您的分享请求已发送至老师,请耐心等待老师的同意。 + <% elsif homework.nil? && status == 2 %> + 您选中的作业目前为私有作业,请点击“请求分享”按钮向题目的作者发送分享请求吧!
    + 祝您成功:) +
    + <% elsif homework.nil? && status == 3 %> + 您选中的作业目前为私有作业,您的分享请求已被老师拒绝,暂时不可查看作业详情。 <% else %>
    标题:<%=homework.name %>
    来源:<%=homework.course.name %>
    diff --git a/app/views/users/_send_notice.html.erb b/app/views/users/_send_notice.html.erb new file mode 100644 index 000000000..aede2a33b --- /dev/null +++ b/app/views/users/_send_notice.html.erb @@ -0,0 +1,18 @@ +
    +
    +

    + <% if status == 1 %> + 您的分享请求暂未通过审核,暂时不可发送至课程。 + <% elsif status == 2 %> + 您选中的作业目前为私有作业,请点击“请求分享”按钮向题目的作者发送分享请求吧!祝您成功:) + <% elsif status == 3 %> + 您的分享请求已被老师拒绝,不可发送至课程。 + <% end %> +

    + +
    +
    \ No newline at end of file diff --git a/app/views/users/_user_message_course.html.erb b/app/views/users/_user_message_course.html.erb index c0d7020b7..f3942d95e 100644 --- a/app/views/users/_user_message_course.html.erb +++ b/app/views/users/_user_message_course.html.erb @@ -237,7 +237,8 @@ ">您有了新的引用作业申请:
  • - <%=User.find(ma.apply_user_id).show_name+"申请引用作业\""+"#{HomeworkCommon.find(ma.course_message_id).name}"+"\"" %> + <% content = ma.content.nil? ? '' : ':'+ ma.content.to_s %> + <%=User.find(ma.apply_user_id).show_name+"申请引用作业\""+"#{HomeworkCommon.find(ma.course_message_id).name}"+"\"#{content}" %> diff --git a/app/views/users/_watch_btn_for_picture.html.erb b/app/views/users/_watch_btn_for_picture.html.erb index be8673468..50f9b6240 100644 --- a/app/views/users/_watch_btn_for_picture.html.erb +++ b/app/views/users/_watch_btn_for_picture.html.erb @@ -2,8 +2,8 @@ <%= link_to("编辑资料", my_account_path, :class => "fl UsersEditBtn") %> <% else %> <%if(user.watched_by?(User.current))%> - <%= link_to "取消关注",Setting.host_name + "/watch?object_type=user&object_id="+user.id.to_s + "&target_id="+user.id.to_s,:class => "userFollow mr27 fl", :method => "delete",:remote => "true", :title => "取消关注"%> + <%= link_to "取消关注",watch_path(:host=> Setting.host_name,:object_type=> 'user',:object_id=>user.id.to_s,:target_id=>user.id.to_s),:class => "userFollow mr27 fl", :method => "delete",:remote => "true", :title => "取消关注"%> <% else %> - <%= link_to "添加关注",Setting.host_name + "/watch?object_type=user&object_id="+user.id.to_s + "&target_id="+user.id.to_s,:class => "userFollow mr27 fl", :method => "post",:remote => "true", :title => "添加关注"%> + <%= link_to "添加关注",watch_path(:host=> Setting.host_name,:object_type=> 'user',:object_id=>user.id.to_s,:target_id=>user.id.to_s),:class => "userFollow mr27 fl", :method => "post",:remote => "true", :title => "添加关注"%> <% end %> <% end %> \ No newline at end of file diff --git a/app/views/users/apply_for_homework.js.erb b/app/views/users/apply_for_homework.js.erb index 69ad56cf3..ad3c6ed76 100644 --- a/app/views/users/apply_for_homework.js.erb +++ b/app/views/users/apply_for_homework.js.erb @@ -1,8 +1,12 @@ <% if @state == 1 %> -alert("您还未登录"); -<% elsif @state == 2 %> -alert("申请成功,请等待审核"); -$("#homework_apply_status_<%=@homework.id %>").html("待审核"); -<% elsif @state == 3 %> -alert("您已经发送过申请了,请耐心等待"); + hideModal(); + alert("您还未登录"); +<% elsif @state == 2 || @state == 3 %> + $("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/apply_for_homework', :locals => {:homework => @homework, :state => @state}) %>'); + showModal('ajax-modal', '500px'); + $('#ajax-modal').siblings().remove(); + $('#ajax-modal').before("" + + ""); + $('#ajax-modal').parent().css("top","30%").css("left","30%").css("position","fixed").css("border","3px solid #269ac9"); + $("#homework_apply_status_<%=@homework.id %>").html("待审核"); <% end %> \ No newline at end of file diff --git a/app/views/users/apply_homework.js.erb b/app/views/users/apply_homework.js.erb new file mode 100644 index 000000000..9e9da1c7e --- /dev/null +++ b/app/views/users/apply_homework.js.erb @@ -0,0 +1,10 @@ +<% if @state == 1 %> + alert("您还未登录"); +<% elsif @state == 2 %> + $("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/apply_homework', :locals => {:homework => @homework}) %>'); + showModal('ajax-modal', '500px'); + $('#ajax-modal').siblings().remove(); + $('#ajax-modal').before("" + + ""); + $('#ajax-modal').parent().css("top","30%").css("left","30%").css("position","fixed").css("border","3px solid #269ac9"); +<% end %> \ No newline at end of file diff --git a/app/views/users/choose_user_course.js.erb b/app/views/users/choose_user_course.js.erb index 51af05782..15926af5c 100644 --- a/app/views/users/choose_user_course.js.erb +++ b/app/views/users/choose_user_course.js.erb @@ -1,9 +1,10 @@ -<% if @status == 1 %> - alert("您的申请尚未通过审核,暂时不可发送至课程"); -<% elsif @status == 2 %> - alert("该作业是私有的,请先提交申请并通过审核后再发送"); -<% elsif @status == 3 %> - alert("您的申请已被拒绝,不可发送至课程"); +<% if @status == 1 || @status == 2 || @status == 3 %> + $("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/send_notice', :locals => {:status => @status}) %>'); + showModal('ajax-modal', '500px'); + $('#ajax-modal').siblings().remove(); + $('#ajax-modal').before("" + + ""); + $('#ajax-modal').parent().css("top","30%").css("left","30%").css("position","fixed").css("border","3px solid #269ac9"); <% else %> <% if params[:is_observe].nil? %> $("#ajax-modal").html('<%= escape_javascript( render :partial => 'users/send_homework_to_course', :locals => {:courses => @course, :user => @user, :send_id => @send_id}) %>'); diff --git a/app/views/users/show_homework_detail.js.erb b/app/views/users/show_homework_detail.js.erb index a5dd82453..c005eabad 100644 --- a/app/views/users/show_homework_detail.js.erb +++ b/app/views/users/show_homework_detail.js.erb @@ -1,5 +1,5 @@ <% if @is_import.to_i == 1 %> $("#homework_detail_information").html("<%=escape_javascript(render :partial => 'users/homework_detail_information', :locals => {:homework=>@homework}) %>"); <% else %> - $("#homework_repository_detail").html("<%=escape_javascript(render :partial => 'users/homework_repository_detail', :locals => {:homework=>@homework}) %>"); + $("#homework_repository_detail").html("<%=escape_javascript(render :partial => 'users/homework_repository_detail', :locals => {:homework=>@homework,:status=>@status}) %>"); <% end %> \ No newline at end of file diff --git a/app/views/users/user_homework_type.js.erb b/app/views/users/user_homework_type.js.erb index 8cfb4dc04..83c1761e3 100644 --- a/app/views/users/user_homework_type.js.erb +++ b/app/views/users/user_homework_type.js.erb @@ -6,7 +6,7 @@ $("#homework_search_input").html("<%=escape_javascript(render :partial=>'homewor <% else %> $("#homework_repository_list").html('<%= escape_javascript(render :partial => 'users/homework_repository_list', :locals => {:homeworks => @homeworks,:sort => @order,:b_sort => @b_sort,:type=>@type,:is_import => @is_import,:property => @property,:search=>''})%>'); $("#homework_pository_ref_pages").html('<%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true %>'); -$("#homework_repository_detail").html("<%=escape_javascript(render :partial => 'users/homework_repository_detail', :locals => {:homework=>nil}) %>"); +$("#homework_repository_detail").html("<%=escape_javascript(render :partial => 'users/homework_repository_detail', :locals => {:homework=>nil, :status => 0}) %>"); $("#homework_search_input").html("<%=escape_javascript(render :partial=>'homework_repository_search', :locals=>{:type=>@type,:is_import=>@is_import,:property=>@property}) %>"); $("#homework_type_all").attr('href','<%= user_homework_type_user_path(@user,:type => @type,:is_import => 0,:property => 0) %>'); $("#homework_type_nor").attr('href','<%= user_homework_type_user_path(@user,:type => @type,:is_import => 0,:property => 1) %>'); diff --git a/app/views/users/user_homeworks.html.erb b/app/views/users/user_homeworks.html.erb index 93e385070..bc937e672 100644 --- a/app/views/users/user_homeworks.html.erb +++ b/app/views/users/user_homeworks.html.erb @@ -68,7 +68,7 @@ <%=render :partial => 'homework_repository_list', :locals => {:homeworks => @homeworks,:type=>@type,:is_import => 0,:property => @property,:search=>''} %>
    - <%=render :partial => 'homework_repository_detail', :locals => {:homework => nil} %> + <%=render :partial => 'homework_repository_detail', :locals => {:homework => nil, :status => 0} %>
    diff --git a/app/views/users/user_homeworks.js.erb b/app/views/users/user_homeworks.js.erb index ce1bb65e2..5579d8a92 100644 --- a/app/views/users/user_homeworks.js.erb +++ b/app/views/users/user_homeworks.js.erb @@ -1,4 +1,4 @@ /*$("#homework_repository").html('<%#= escape_javascript(render :partial => 'users/homework_repository', :locals => {:homeworks => @homeworks})%>');*/ $("#homework_repository_list").html('<%= escape_javascript(render :partial => 'users/homework_repository_list', :locals => {:homeworks => @homeworks,:sort => @order,:b_sort => @b_sort,:type=>@type,:is_import => 0,:property => @property,:search=>''})%>'); $("#homework_pository_ref_pages").html('<%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true %>'); -$("#homework_repository_detail").html("<%=escape_javascript(render :partial => 'users/homework_repository_detail', :locals => {:homework=>nil}) %>"); +$("#homework_repository_detail").html("<%=escape_javascript(render :partial => 'users/homework_repository_detail', :locals => {:homework=>nil, :status => 0}) %>"); diff --git a/app/views/users/user_search_homeworks.js.erb b/app/views/users/user_search_homeworks.js.erb index 29d490960..807dcc7d0 100644 --- a/app/views/users/user_search_homeworks.js.erb +++ b/app/views/users/user_search_homeworks.js.erb @@ -5,5 +5,5 @@ $("#homework_detail_information").html("<%=escape_javascript(render :partial => <% else %> $("#homework_repository_list").html('<%= escape_javascript(render :partial => 'users/homework_repository_list', :locals => {:homeworks => @homeworks,:sort => @order,:b_sort => @b_sort,:type=>@type,:is_import => @is_import,:property => @property,:search=>@search})%>'); $("#homework_pository_ref_pages").html('<%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true %>'); -$("#homework_repository_detail").html("<%=escape_javascript(render :partial => 'users/homework_repository_detail', :locals => {:homework=>nil}) %>"); +$("#homework_repository_detail").html("<%=escape_javascript(render :partial => 'users/homework_repository_detail', :locals => {:homework=>nil, :status => 0}) %>"); <% end %> \ No newline at end of file diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 10d0af25b..16dbe02ef 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -1864,6 +1864,7 @@ zh: excel_student_id: 学号 excel_mail: 电子邮箱 excel_homework_name: 作品名 + excel_homework_des: 作品描述 excel_t_score: 教师评分 excel_ta_score: 教辅评分 excel_n_score: 匿名评分 diff --git a/config/routes.rb b/config/routes.rb index 351e3ecc2..848234bd7 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -548,6 +548,7 @@ RedmineApp::Application.routes.draw do match 'user_feedback4show', :to => 'users#user_feedback4show', :via => :get match 'user_visitorlist', :to => 'users#user_visitorlist', :via => :get match 'apply_for_homework', :to => 'users#apply_for_homework', :via => :get + match 'apply_homework', :to => 'users#apply_homework', :via => :get match 'user_homeworks', :to => 'users#user_homeworks', :via => :get match 'student_homeworks', :to => 'users#student_homeworks', :via => :get get 'user_import_homeworks' diff --git a/lib/tasks/homework_update.rake b/lib/tasks/homework_update.rake new file mode 100644 index 000000000..b2246bfd5 --- /dev/null +++ b/lib/tasks/homework_update.rake @@ -0,0 +1,7 @@ +namespace :homework_update do + desc "update homework updated_at" + task :update_homework => :environment do + stu_pro = StudentWork.where("project_id != 0") + + end +end \ No newline at end of file diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index 792306692..df9dda302 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -1501,6 +1501,9 @@ a.st_up{ display: block; width:8px; float:left; height:13px; background:url(../i a.st_down{ display: block; width:8px; float:left; height:13px; background:url(../images/pic_up.png) 0 -22px no-repeat; margin-top:5px; margin-left:3px;} a.st_img { display:block;width:32px; height:32px; border:1px solid #CCC; padding:1px;} +.green_btn_share{ background:#28be6c; padding:2px 5px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;} +.apply_content{ border:1px solid #ddd;line-height: 16px; height:80px;width:420px; background:#fff; margin-left:5px; padding:5px; margin-bottom:10px;} + /* 代码查重弹框 */ a.Blue-btn{ display:block; margin-right:15px;width:65px; height:22px; background-color:#ffffff; line-height:24px; vertical-align:middle; text-align:center; border:1px solid #3598db; color:#3598db; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px;} a:hover.Blue-btn{ background:#3598db; color:#fff;} diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index d016fee4a..b2979387f 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -181,6 +181,7 @@ h4{ font-size:14px; color:#3b3b3b;} .h70{ height:70px;} .h150{ height:150px;} .p10 {padding-left:10px; padding-right:10px;} +.mw220 {max-width: 220px !important;} .mw360 {max-width: 360px !important;} .mw380 {max-width: 380px !important;} .mw400 {max-width: 400px !important;}