diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 32cfefa9d..78ac4d208 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -309,7 +309,7 @@ class ApplicationController < ActionController::Base
# Find project of id params[:id]
def find_project
- @project = Project.find_by_id(params[:id])
+ @project = Project.find(params[:id])
rescue ActiveRecord::RecordNotFound
render_404
end
diff --git a/app/controllers/contests_controller.rb b/app/controllers/contests_controller.rb
index af532cd87..6213b2315 100644
--- a/app/controllers/contests_controller.rb
+++ b/app/controllers/contests_controller.rb
@@ -37,7 +37,7 @@ class ContestsController < ApplicationController
def index
- render_404
+ render_404 unless params[:name]
# @contests = Contest.visible
# @contests ||= []
@offset, @limit = api_offset_and_limit(:limit => 10)
diff --git a/app/controllers/zipdown_controller.rb b/app/controllers/zipdown_controller.rb
index f0dc157b5..d4699b6c4 100644
--- a/app/controllers/zipdown_controller.rb
+++ b/app/controllers/zipdown_controller.rb
@@ -44,7 +44,9 @@ class ZipdownController < ApplicationController
if homework != nil
unless homework.attachments.empty?
zipfile = zip_homework_by_user homework
- send_file zipfile, :filename => homework.user.user_extensions.student_id + "_" + homework.user.lastname + homework.user.firstname + "_" + homework.name+".zip", :type => detect_content_type(zipfile) if(zipfile)
+ send_file zipfile, :filename => (homework.user.user_extensions.student_id.nil? ? "" : homework.user.user_extensions.student_id) +
+ "_" + (homework.user.lastname.nil? ? "" : homework.user.lastname) + (homework.user.firstname.nil? ? "" : homework.user.firstname) +
+ "_" + homework.name + ".zip", :type => detect_content_type(zipfile) if(zipfile)
else
render file: 'public/no_file_found.html'
end
@@ -78,7 +80,7 @@ class ZipdownController < ApplicationController
homeattach.attachments.each do |attach|
homeworks_attach_path << attach.diskfile#.to_s.slice((length+1)..-1)
end
- zipping("#{homeattach.user.lastname}#{homeattach.user.firstname}_#{homeattach.user.user_extensions.student_id}_#{Time.now.to_i.to_s}.zip", homeworks_attach_path, OUTPUT_FOLDER, true)
+ zipping("#{homeattach.user.lastname}#{homeattach.user.firstname}_#{(homework.user.user_extensions.student_id.nil? ? "" : homework.user.user_extensions.student_id)}_#{Time.now.to_i.to_s}.zip", homeworks_attach_path, OUTPUT_FOLDER, true)
end
diff --git a/app/helpers/stores_helper.rb b/app/helpers/stores_helper.rb
index e987367ad..0ae91a644 100644
--- a/app/helpers/stores_helper.rb
+++ b/app/helpers/stores_helper.rb
@@ -156,11 +156,11 @@ module StoresHelper
klass = project.class.to_s
case klass
when "Project"
- project_list = link_to l(:label_project_plural), projects_path
+ project_list = "
+
<%= f.check_box :open_anonymous_evaluation, :style => "margin-left:10px;" %> - 未开启匿评作业将直接进入众评点赞阶段 +
<%= f.text_field :evaluation_num, :required => true, :size => 60, :style => "width:150px;", :onblur => "regexEvaluationNum();" , :maxlength => 4%> - 匿评分配数量不宜太大,否则会影响开启匿评速度 + 即每份作业被允许匿评的人数
<%= hidden_field_tag 'course_id', @course.id %> diff --git a/app/views/bids/edit.html.erb b/app/views/bids/edit.html.erb index 17e805fce..ee2142dd5 100644 --- a/app/views/bids/edit.html.erb +++ b/app/views/bids/edit.html.erb @@ -91,16 +91,19 @@ } }); }); - $(function(){ - if($("#bid_open_anonymous_evaluation").attr("checked") == "checked") - { - $("#evaluation_num_p").show(); - } - else - { - $("#evaluation_num_p").hide(); - } + $("#bid_open_anonymous_evaluation").click(function(){ + if($("#bid_open_anonymous_evaluation").attr("checked") == "checked") + { + $("#evaluation_num_p").slideDown(); + $("#open_anonymous_evaluation_span").slideUp(); + } + else + { + $("#evaluation_num_p").slideUp(); + $("#open_anonymous_evaluation_span").slideDown(); + } + }); }); function submitHomework(id) diff --git a/app/views/courses/_homework_form.html.erb b/app/views/courses/_homework_form.html.erb index 2d20ecf07..7e09e84fc 100644 --- a/app/views/courses/_homework_form.html.erb +++ b/app/views/courses/_homework_form.html.erb @@ -48,13 +48,13 @@
-+
<%= f.check_box :open_anonymous_evaluation, :style => "margin-left:10px;" %> - 未开启匿评作业将直接进入众评点赞阶段 +
<%= f.text_field :evaluation_num, :required => true, :size => 60, :style => "width:150px;", :onblur => "regexEvaluationNum();" , :maxlength => 4%> - 匿评分配数量不宜太大,否则会影响开启匿评速度 + 即每份作业被允许匿评的人数
<%= hidden_field_tag 'course_id', @course.id %> diff --git a/app/views/courses/_member_list.html.erb b/app/views/courses/_member_list.html.erb index c6c20b542..9281634bd 100644 --- a/app/views/courses/_member_list.html.erb +++ b/app/views/courses/_member_list.html.erb @@ -3,9 +3,12 @@ <% if !@canShowCode %> <%= join_in_course_group(@course.course_groups,@group, User.current) %> <% end %> - <%= l(:label_current_group)%>: <%= @group.name %> - <% end %> - <% if @subPage_title == l(:label_student_list) %> + + <%= l(:label_current_group)%>: + <%= @group.name %> + +<% end %> + <% if @subPage_title && @subPage_title == l(:label_student_list)%> <%= form_tag( searchmembers_course_path(@course), method: 'get',:class => "f_l",:style => "margin-left: 5px; ",:remote=>true) do %> <%= text_field_tag 'name', params[:name], name: "name", :class => 'f_1', :style => "height:15px"%> <% if @group %> diff --git a/app/views/courses/new_homework.html.erb b/app/views/courses/new_homework.html.erb index e3121c6ad..2e0b35c6d 100644 --- a/app/views/courses/new_homework.html.erb +++ b/app/views/courses/new_homework.html.erb @@ -84,10 +84,12 @@ if($("#bid_open_anonymous_evaluation").attr("checked") == "checked") { $("#evaluation_num_p").slideDown(); + $("#open_anonymous_evaluation_span").slideUp(); } else { $("#evaluation_num_p").slideUp(); + $("#open_anonymous_evaluation_span").slideDown(); } }); }); diff --git a/app/views/files/_upload_show.html.erb b/app/views/files/_upload_show.html.erb index a979715de..13bcd043e 100644 --- a/app/views/files/_upload_show.html.erb +++ b/app/views/files/_upload_show.html.erb @@ -8,7 +8,8 @@ <%= render :partial => 'attachement_list',:locals => {:course => course} %>
- 上传资源取 消 + 确 认 + 取 消 <% end %> diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index beb3291d0..978eb7e35 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -249,7 +249,7 @@ <%= l(:label_course_description_no) %> <% end %> -
- <%= l(:label_tags_project_name) %><%= link_to "#{prj.name}",:controller => "projects",:action => "show",:id => prj.id %>
+
+ <%= l(:label_tags_project_name) %>
+ <%= link_to "#{prj.name}",:controller => "projects",:action => "show",:id => prj.id %>
+
- <%= l(:label_tags_project_description) %><%= textilizable prj.description %>
+
+ <%= l(:label_tags_project_description) %>
+
+ <%= textilizable prj.description %>