1、添加评分回复路由改变

2、删除回复功能及界面刷新
This commit is contained in:
sw 2015-05-27 15:11:11 +08:00
parent 2bb59ffd79
commit fea784cbcc
6 changed files with 12 additions and 9 deletions

View File

@ -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

View File

@ -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 %>
<a href="javascript:void(0);" class="fr blue_n_btn" onclick="$('#add_score_reply_<%= score.id%>').find('form').submit();">回复</a>
<% end%>

View File

@ -1,4 +1,4 @@
<div class="ping_back mt10">
<div class="ping_back mt10" id="jour_replay_<%= jour.id%>">
<%= link_to image_tag(url_to_avatar(jour.user), :width => "32", :height => "32"), user_path(jour.user),:class => "st_img fl" %>
<div class="ping_back_tit">
<a href="javascript:void(0);" class="c_blue fl" >

View File

@ -0,0 +1 @@
$("#jour_replay_<%= @jour.id%>").remove();

View File

@ -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

View File

@ -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;}