From fde4ce74ba5378eb2d8b8ac5f4210043979a0535 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 23 Oct 2015 14:45:56 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=E5=A2=9E=E5=8A=A0=E8=AF=84=E5=88=86=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_common_controller.rb | 9 +++++++-- app/controllers/student_work_controller.rb | 8 +++++++- app/views/homework_common/score_rule_set.js.erb | 6 ++++++ app/views/student_work/_set_score_rule.html.erb | 3 +++ app/views/student_work/index.html.erb | 2 +- app/views/users/_user_homework_detail.html.erb | 3 +++ config/routes.rb | 1 + 7 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 app/views/homework_common/score_rule_set.js.erb diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index 9e3a4b836..7793ef097 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -6,8 +6,8 @@ class HomeworkCommonController < ApplicationController include StudentWorkHelper before_filter :find_course, :only => [:index,:new,:create] - before_filter :find_homework, :only => [:edit,:update,:alert_anonymous_comment,:start_anonymous_comment,:stop_anonymous_comment,:destroy,:start_evaluation_set,:set_evaluation_attr] - before_filter :teacher_of_course, :only => [:new, :create, :edit, :update, :destroy, :start_anonymous_comment, :stop_anonymous_comment, :alert_anonymous_comment,:start_evaluation_set,:set_evaluation_attr] + before_filter :find_homework, :only => [:edit,:update,:alert_anonymous_comment,:start_anonymous_comment,:stop_anonymous_comment,:destroy,:start_evaluation_set,:set_evaluation_attr,:score_rule_set] + before_filter :teacher_of_course, :only => [:new, :create, :edit, :update, :destroy, :start_anonymous_comment, :stop_anonymous_comment, :alert_anonymous_comment,:start_evaluation_set,:set_evaluation_attr,:score_rule_set] before_filter :member_of_course, :only => [:index] def index @@ -215,6 +215,11 @@ class HomeworkCommonController < ApplicationController end end + #评分设置 + def score_rule_set + + end + private #获取课程 def find_course diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index e5e1bf391..529c5ea72 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -457,7 +457,13 @@ class StudentWorkController < ApplicationController end end respond_to do |format| - format.html{redirect_to student_work_index_url(:homework => @homework.id)} + format.html{ + if params[:student_path] + redirect_to student_work_index_url(:homework => @homework.id) + else + redirect_to user_homeworks_user_path(User.current.id) + end + } end end diff --git a/app/views/homework_common/score_rule_set.js.erb b/app/views/homework_common/score_rule_set.js.erb new file mode 100644 index 000000000..5ff42dff7 --- /dev/null +++ b/app/views/homework_common/score_rule_set.js.erb @@ -0,0 +1,6 @@ +$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/set_score_rule',:locals => {:homework => @homework, :student_path => false}) %>'); +showModal('ajax-modal', '350px'); +$('#ajax-modal').siblings().remove(); +$('#ajax-modal').before("" + + ""); +$('#ajax-modal').parent().css("top","25%").css("left","35%").css("position","fixed"); \ No newline at end of file diff --git a/app/views/student_work/_set_score_rule.html.erb b/app/views/student_work/_set_score_rule.html.erb index 7deed7fb8..508b89a1c 100644 --- a/app/views/student_work/_set_score_rule.html.erb +++ b/app/views/student_work/_set_score_rule.html.erb @@ -1,4 +1,7 @@ <%= form_for('new_form',:url => {:controller => 'student_work',:action => 'set_score_rule',:homework => homework.id},:method => "post") do |f|%> + <% if student_path %> + <%=hidden_field_tag 'student_path', params[:student_path], :value => student_path %> + <% end %>
评分设置
diff --git a/app/views/student_work/index.html.erb b/app/views/student_work/index.html.erb index 72ca36ca9..0ea5e7055 100644 --- a/app/views/student_work/index.html.erb +++ b/app/views/student_work/index.html.erb @@ -20,7 +20,7 @@ //设置评分规则 function set_score_rule(){ - $('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/set_score_rule',:locals => {:homework => @homework}) %>'); + $('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/set_score_rule',:locals => {:homework => @homework,:student_path => true}) %>'); showModal('ajax-modal', '350px'); $('#ajax-modal').siblings().remove(); $('#ajax-modal').before("" + diff --git a/app/views/users/_user_homework_detail.html.erb b/app/views/users/_user_homework_detail.html.erb index 848417d3e..b4beb7aa3 100644 --- a/app/views/users/_user_homework_detail.html.erb +++ b/app/views/users/_user_homework_detail.html.erb @@ -68,6 +68,9 @@
  • <%= link_to(l(:label_bid_respond_delete), homework_common_path(homework_common,:is_in_course => is_in_course),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "postOptionLink") %>
  • +
  • + <%= link_to("评分设置", score_rule_set_homework_common_path(homework_common),:class => "postOptionLink", :remote => true) %> +
  • <%= link_to("匿评设置", start_evaluation_set_homework_common_path(homework_common),:class => "postOptionLink", :remote => true) if homework_common.homework_detail_manual.comment_status == 1%>
  • diff --git a/config/routes.rb b/config/routes.rb index 649cfbb75..f7edee954 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -102,6 +102,7 @@ RedmineApp::Application.routes.draw do get 'stop_anonymous_comment' get 'alert_anonymous_comment' get 'start_evaluation_set' + get 'score_rule_set' post 'set_evaluation_attr' end collection do From 1ddb21d0a999545eee59420f43a3f9b078c48134 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 23 Oct 2015 14:53:53 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E5=8A=A8=E6=80=81=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=E6=8F=8F=E8=BF=B0=E5=B1=95=E5=BC=80=E6=97=B6=E5=8E=BB=E6=8E=89?= =?UTF-8?q?line-height=EF=BC=8C=E6=94=B6=E8=B5=B7=E6=97=B6=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0line-height?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/_course_activity.html.erb | 2 ++ app/views/users/_user_activities.html.erb | 2 ++ app/views/users/_user_homework_list.html.erb | 2 ++ 3 files changed, 6 insertions(+) diff --git a/app/views/courses/_course_activity.html.erb b/app/views/courses/_course_activity.html.erb index b79964a8d..4a7cb900d 100644 --- a/app/views/courses/_course_activity.html.erb +++ b/app/views/courses/_course_activity.html.erb @@ -76,11 +76,13 @@ } $("#intro_content_show_<%= activity.id %>").click(function(){ $("#activity_description_<%= activity.id %>").toggleClass("maxh360"); + $("#activity_description_<%= activity.id%>").toggleClass("lh18"); $("#intro_content_show_<%= activity.id %>").hide(); $("#intro_content_hide_<%= activity.id %>").show(); }); $("#intro_content_hide_<%= activity.id %>").click(function(){ $("#activity_description_<%= activity.id %>").toggleClass("maxh360"); + $("#activity_description_<%= activity.id%>").toggleClass("lh18"); $("#intro_content_hide_<%= activity.id %>").hide(); $("#intro_content_show_<%= activity.id %>").show(); }); diff --git a/app/views/users/_user_activities.html.erb b/app/views/users/_user_activities.html.erb index a9584c80e..b7981bdbc 100644 --- a/app/views/users/_user_activities.html.erb +++ b/app/views/users/_user_activities.html.erb @@ -44,11 +44,13 @@ } $("#intro_content_show_<%= user_activity.id %>").click(function(){ $("#activity_description_<%= user_activity.id %>").toggleClass("maxh360"); + $("#activity_description_<%= user_activity.id%>").toggleClass("lh18"); $("#intro_content_show_<%= user_activity.id %>").hide(); $("#intro_content_hide_<%= user_activity.id %>").show(); }); $("#intro_content_hide_<%= user_activity.id %>").click(function(){ $("#activity_description_<%= user_activity.id %>").toggleClass("maxh360"); + $("#activity_description_<%= user_activity.id%>").toggleClass("lh18"); $("#intro_content_hide_<%= user_activity.id %>").hide(); $("#intro_content_show_<%= user_activity.id %>").show(); }); diff --git a/app/views/users/_user_homework_list.html.erb b/app/views/users/_user_homework_list.html.erb index ee3e05795..2e530d489 100644 --- a/app/views/users/_user_homework_list.html.erb +++ b/app/views/users/_user_homework_list.html.erb @@ -21,11 +21,13 @@ } $("#intro_content_show_<%= homework_common.id%>").click(function(){ $("#homework_description_<%= homework_common.id%>").toggleClass("maxh360"); + $("#homework_description_<%= homework_common.id%>").toggleClass("lh18"); $("#intro_content_show_<%= homework_common.id%>").hide(); $("#intro_content_hide_<%= homework_common.id%>").show(); }); $("#intro_content_hide_<%= homework_common.id%>").click(function(){ $("#homework_description_<%= homework_common.id%>").toggleClass("maxh360"); + $("#homework_description_<%= homework_common.id%>").toggleClass("lh18"); $("#intro_content_hide_<%= homework_common.id%>").hide(); $("#intro_content_show_<%= homework_common.id%>").show(); }); From b063be917b7fbb9d6f9d8c8e7e66fd9a998627d0 Mon Sep 17 00:00:00 2001 From: Tim Date: Fri, 23 Oct 2015 15:45:48 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E9=99=84=E4=BB=B6=E5=9B=BE=E6=A0=87?= =?UTF-8?q?=E6=9B=B4=E6=94=B9=EF=BC=9B=E5=BC=B9=E7=AA=97=E6=96=87=E5=AD=97?= =?UTF-8?q?=E4=B8=8Apadding=E5=87=8F=E5=B0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/courses.css | 2 +- public/stylesheets/new_user.css | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 36a01f5d1..41771eb6e 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -158,7 +158,7 @@ a.postOptionLink:hover {color:#ffffff; background-color:#269ac9;} .homepagePostReplyContent {font-size:12px; color:#484848; margin-bottom:12px;} .homepagePostProjectState {width:52px; height:20px; line-height:20px; border-radius:1px; background-color:#28be6c; color:#ffffff; text-align:center; vertical-align:middle; font-size:12px; display:inline-block; margin-left:5px;} .homepagePostAssignTo {float:left; font-size:14px; color:#269ac9;} -.homepagePostFileAtt {height:22px; line-height:22px; vertical-align:middle; background:url(../images/homepage_icon.png) -85px -150px no-repeat; padding-left:35px; font-size:14px; margin-right:25px;} +.homepagePostFileAtt {height:22px; line-height:22px; vertical-align:middle; background:url(../images/public_icon.png) -27px -577px no-repeat; padding-left:25px; font-size:14px; margin-right:25px;} .homepagePostImageAtt {height:22px; line-height:22px; vertical-align:middle; background:url(../images/homepage_icon.png) -86px -195px no-repeat; padding-left:35px; font-size:14px; margin-right:25px;} .postAttSize {color:#888888; font-size:12px;} a.postGrey {color:#484848;} diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index ee3d96b4b..22be12633 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -501,7 +501,7 @@ input.sendSourceText:hover {background-color:#297fb8;} .popbox{/* width:300px; *//* height:100px; */position:fixed !important;/* z-index:100; */left:50%;top:50%;margin:-100px 0 0 -150px; /* background:#fff; */ -moz-border-radius:5px; /* -webkit-border-radius:5px; */ /* border-radius:5px; */ /* box-shadow:0px 0px 8px #194a81; */ /* overflow:auto; */} /*上传资源弹窗*/ .resourceUploadPopup {width:400px; height:auto; border:3px solid #269ac9; padding-left:16px; padding-bottom:16px; background-color:#ffffff; position:absolute; top:50%; left:50%; margin-left:-200px; z-index:1000;} -.uploadText {font-size:16px; color:#269ac9; line-height:16px; padding-top:20px; width:140px; display:inline-block;} +.uploadText {font-size:16px; color:#269ac9; line-height:16px; padding-top:15px; width:140px; display:inline-block;} .uploadBoxContainer {height:33px; line-height:33px; margin-top:10px; position:relative;} .uploadBox {width:100px; height:33px; line-height:33px; text-align:center; vertical-align:middle; background-color:#269ac9; border-radius:3px; float:left; margin-right:12px;} .uploadBox:hover {background-color:#297fb8;} @@ -684,7 +684,7 @@ a.postOptionLink:hover {color:#ffffff; background-color:#269ac9;} .homepagePostReplyContent {font-size:12px; color:#484848; margin-bottom:12px;} .homepagePostProjectState {width:52px; height:20px; line-height:20px; border-radius:1px; background-color:#28be6c; color:#ffffff; text-align:center; vertical-align:middle; font-size:12px; display:inline-block; margin-left:5px;} .homepagePostAssignTo {float:left; font-size:14px; color:#269ac9;} -.homepagePostFileAtt {height:22px; line-height:22px; vertical-align:middle; background:url(../images/homepage_icon.png) -85px -150px no-repeat; padding-left:35px; font-size:14px; margin-right:25px;} +.homepagePostFileAtt {height:22px; line-height:22px; vertical-align:middle; background:url(../images/public_icon.png) -27px -577px no-repeat; padding-left:25px; font-size:14px; margin-right:25px;} .homepagePostImageAtt {height:22px; line-height:22px; vertical-align:middle; background:url(../images/homepage_icon.png) -86px -195px no-repeat; padding-left:35px; font-size:14px; margin-right:25px;} .postAttSize {color:#888888; font-size:12px;} a.postGrey {color:#484848;} From 4bedc81524efc9d19ce9a3ef4ce55e53517a1477 Mon Sep 17 00:00:00 2001 From: Tim Date: Fri, 23 Oct 2015 16:26:58 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=BD=9C=E5=93=81=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E6=8C=89=E9=92=AE=E4=BD=8D=E7=BD=AE=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../_student_work_attachment_form.html.erb | 70 +++++++++---------- public/stylesheets/new_user.css | 1 + public/stylesheets/public.css | 1 + 3 files changed, 37 insertions(+), 35 deletions(-) diff --git a/app/views/student_work/_student_work_attachment_form.html.erb b/app/views/student_work/_student_work_attachment_form.html.erb index 7802f6eb6..265ff9be7 100644 --- a/app/views/student_work/_student_work_attachment_form.html.erb +++ b/app/views/student_work/_student_work_attachment_form.html.erb @@ -1,35 +1,35 @@ -
    - - -
    - - <%= button_tag "文件浏览", :type=>"button", :onclick=>"$('#_file#{work.id}').click();",:onmouseover => 'this.focus()',:class => 'sub_btn' %> - <%= file_field_tag 'attachments[dummy][file]', - :id => "_file#{work.id}", - :class => 'file_selector', - :multiple => true, - :onchange => "addInputFiles_board(this, '#{work.id}');", - :style => 'display:none', - :data => { - :max_file_size => Setting.attachment_max_size.to_i.kilobytes, - :max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)), - :max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i, - :upload_path => uploads_path(:format => 'js'), - :description_placeholder => l(:label_optional_description), - :field_is_public => l(:field_is_public), - :are_you_sure => l(:text_are_you_sure), - :file_count => l(:label_file_count), - :delete_all_files => l(:text_are_you_sure_all), - :containerid => "#{work.id}" - } %> - - <%= l(:label_no_file_uploaded) %> - - (<%= l(:label_max_size) %>: - <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>) - - <% content_for :header_tags do %> - <%= javascript_include_tag 'attachments' %> - <% end %> -
    - +
    + + +
    + + <%= button_tag "文件浏览", :type=>"button", :onclick=>"$('#_file#{work.id}').click();",:onmouseover => 'this.focus()',:class => 'sub_btn mb0' %> + <%= file_field_tag 'attachments[dummy][file]', + :id => "_file#{work.id}", + :class => 'file_selector', + :multiple => true, + :onchange => "addInputFiles_board(this, '#{work.id}');", + :style => 'display:none', + :data => { + :max_file_size => Setting.attachment_max_size.to_i.kilobytes, + :max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)), + :max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i, + :upload_path => uploads_path(:format => 'js'), + :description_placeholder => l(:label_optional_description), + :field_is_public => l(:field_is_public), + :are_you_sure => l(:text_are_you_sure), + :file_count => l(:label_file_count), + :delete_all_files => l(:text_are_you_sure_all), + :containerid => "#{work.id}" + } %> + + <%= l(:label_no_file_uploaded) %> + + (<%= l(:label_max_size) %>: + <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>) + + <% content_for :header_tags do %> + <%= javascript_include_tag 'attachments' %> + <% end %> +
    + diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index c1ddfa457..a3b7d7e76 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -105,6 +105,7 @@ a.linkGrey6:hover {color:#ffffff !important;} .mt12 { margin-top:12px;} .mt15 {margin-top:15px;} .mt19 {margin-top:19px !important;} +.mb0 {margin-bottom: 0px !important;} .mb4{ margin-bottom:4px;} .mb5{ margin-bottom:5px;} .mb8 {margin-bottom:8px !important;} diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index 630b96bcd..d45b6f94d 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -108,6 +108,7 @@ h4{ font-size:14px; color:#3b3b3b;} .mt15 {margin-top:15px;} .mt19 {margin-top:19px !important;} .ml70{margin-left: 70px;} +.mb0 {margin-bottom: 0px !important;} .mb4{ margin-bottom:4px;} .mb5{ margin-bottom:5px;} .mb8 {margin-bottom:8px;}