个人留言的回复不能自动刷新

This commit is contained in:
cxt 2016-02-23 15:22:44 +08:00
parent b6bf78a5df
commit e4bf35a1b8
4 changed files with 11 additions and 5 deletions

View File

@ -74,9 +74,10 @@ class WordsController < ApplicationController
# render 'test/index'
# }
format.js {
#@reply_type = params[:reply_type]
@user_activity_id = params[:user_activity_id]
@activity = JournalsForMessage.find(parent_id)
@is_activity = params[:is_activity]
@is_activity = params[:is_activity] if params[:is_activity]
}
end
@ -98,6 +99,10 @@ class WordsController < ApplicationController
@user_activity_id = params[:user_activity_id] if params[:user_activity_id]
@is_activity = params[:is_activity].to_i if params[:is_activity]
@activity = @journal_destroyed.parent if @journal_destroyed.parent
unless @activity
redirect_to feedback_path(@user)
return
end
elsif @journal_destroyed.jour_type == 'HomeworkCommon'
@homework = HomeworkCommon.find @journal_destroyed.jour_id
if params[:user_activity_id]

View File

@ -47,7 +47,7 @@
<li>
<%= link_to(l(:label_bid_respond_delete),
{:controller => 'words', :action => 'destroy', :object_id => activity, :user_id => activity.user,:user_activity_id => user_activity_id,:is_activity=>is_activity},
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete',
:confirm => l(:text_are_you_sure), :method => 'delete',
:class => "postOptionLink", :title => l(:button_delete)) %>
</li>
</ul>

View File

@ -1,11 +1,11 @@
<% if @save_succ %>
<% if @user_activity_id %>
<% if @reply_type == 'user' %>
<% if @is_activity %>
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/user_journalsformessage', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id,:is_activity=>@is_activity}) %>");
<% else %>
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_journalsformessage', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id}) %>");
<% end %>
#init_activity_KindEditor_data('<%= @user_activity_id%>', "", "87%", "UserActivity");
//init_activity_KindEditor_data('<%#= @user_activity_id%>', "", "87%", "UserActivity");
sd_create_editor_from_data('<%= @user_activity_id%>', "", "100%", "UserActivity");
<% else %>
<% if !@jfm.nil? && @jfm.jour_type == 'Principal' %>

View File

@ -4,7 +4,8 @@
<% if @is_user%>
<% if @activity %>
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/user_journalsformessage', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id,:is_activity=>@is_activity}) %>");
init_activity_KindEditor_data('<%= @user_activity_id%>', "", "87%", "UserActivity");
//init_activity_KindEditor_data('<%#= @user_activity_id%>', "", "87%", "UserActivity");
sd_create_editor_from_data('<%= @user_activity_id%>', "", "100%", "UserActivity");
<% else %>
$("#user_activity_<%= @user_activity_id%>").hide();
<% end %>