diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 98ebc0705..63ab4d0f0 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -103,7 +103,7 @@ class StudentWorkController < ApplicationController #添加评分的回复 def add_score_reply - @score = StudentWorksScore.find params[:id] + @score = StudentWorksScore.find params[:score_id] @jour = @score.journals_for_messages.new(:user_id => User.current.id,:notes =>params[:message], :reply_id => 0) if @jour.save respond_to do |format| @@ -114,9 +114,11 @@ class StudentWorkController < ApplicationController #删除评分的回复 def destroy_score_reply - - respond_to do |format| - format.js + @jour = JournalsForMessage.find params[:jour_id] + if @jour.destroy + respond_to do |format| + format.js + end end end diff --git a/app/views/student_work/_add_score_reply.html.erb b/app/views/student_work/_add_score_reply.html.erb index 99e9c3793..2866b2da6 100644 --- a/app/views/student_work/_add_score_reply.html.erb +++ b/app/views/student_work/_add_score_reply.html.erb @@ -1,4 +1,4 @@ -<%= form_for('', :remote => true, :method => :post,:url => add_score_reply_student_work_path(score.id)) do |f|%> +<%= form_for('', :remote => true, :method => :post,:url => add_score_reply_student_work_index_path(:score_id => score.id)) do |f|%> <%= f.text_area 'message', :class => 'ping_text', :placeholder => l(:text_caracters_maximum,:count=>250),:maxlength => 250 %> 回复 <% end%> \ No newline at end of file diff --git a/app/views/student_work/_jour_replay.html.erb b/app/views/student_work/_jour_replay.html.erb index d673fb8b0..77fb476bf 100644 --- a/app/views/student_work/_jour_replay.html.erb +++ b/app/views/student_work/_jour_replay.html.erb @@ -1,4 +1,4 @@ -
+
<%= link_to image_tag(url_to_avatar(jour.user), :width => "32", :height => "32"), user_path(jour.user),:class => "st_img fl" %>
diff --git a/app/views/student_work/destroy_score_reply.js.erb b/app/views/student_work/destroy_score_reply.js.erb new file mode 100644 index 000000000..895e501bf --- /dev/null +++ b/app/views/student_work/destroy_score_reply.js.erb @@ -0,0 +1 @@ +$("#jour_replay_<%= @jour.id%>").remove(); \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 0bb3f6bed..ecdaac48c 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -94,10 +94,10 @@ RedmineApp::Application.routes.draw do resources :student_work do member do post 'add_score' - post 'add_score_reply' end collection do - delete 'destroy_score_reply' + post 'add_score_reply' + get 'destroy_score_reply' end end diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index a4c19e0e4..f32387c19 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -646,7 +646,7 @@ a.hwork_name{ display:block;width:65px; text-align:center; margin-right:10px;} .tit_fb{ font-weight:bold; width:66px; text-align:right; display:block; float:left;} .ml160{ margin-left:160px;} .show_hwork_p{ width:580px; float:left;} -.hwork_ping_text{ float:left; border:1px solid #e4e4e4; padding:5px; width:568px; height:35px;} +.hwork_ping_text{ float:left; border:1px solid #e4e4e4; padding:5px; width:568px; height:50px;} .ping_box{ width:626px; padding:10px; background:#f5f3f3; } a.ping_pic{ display:block; width:34px; height:34px; padding:2px; border:1px solid #e3e3e3;} a:hover.ping_pic{border:1px solid #64bdd9;}