修复作业留言模块先回复留言然后删除回复留言界面不会及时刷新的BUG
This commit is contained in:
parent
b80c51475f
commit
9a62fe22c6
|
@ -26,13 +26,13 @@ class HomeworkAttachController < ApplicationController
|
||||||
#删除留言
|
#删除留言
|
||||||
def destroy
|
def destroy
|
||||||
@journal_destroyed = JournalsForMessage.delete_message(params[:object_id])
|
@journal_destroyed = JournalsForMessage.delete_message(params[:object_id])
|
||||||
@homework = HomeworkAttach.find(params[:id])
|
#@homework = HomeworkAttach.find(params[:id])
|
||||||
@jours = @homework.journals_for_messages.order("created_on DESC")
|
#@jours = @homework.journals_for_messages.order("created_on DESC")
|
||||||
@limit = 10
|
#@limit = 10
|
||||||
@feedback_count = @jours.count
|
#@feedback_count = @jours.count
|
||||||
@feedback_pages = Paginator.new @feedback_count, @limit, params['page']
|
#@feedback_pages = Paginator.new @feedback_count, @limit, params['page']
|
||||||
@offset ||= @feedback_pages.offset
|
#@offset ||= @feedback_pages.offset
|
||||||
@jour = @jours[@offset, @limit]
|
#@jour = @jours[@offset, @limit]
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.js
|
format.js
|
||||||
end
|
end
|
||||||
|
@ -43,11 +43,11 @@ class HomeworkAttachController < ApplicationController
|
||||||
@homework = HomeworkAttach.find(params[:jour_id])
|
@homework = HomeworkAttach.find(params[:jour_id])
|
||||||
@homework.addjours User.current.id, params[:new_form][:user_message],0
|
@homework.addjours User.current.id, params[:new_form][:user_message],0
|
||||||
@jours = @homework.journals_for_messages.order("created_on DESC")
|
@jours = @homework.journals_for_messages.order("created_on DESC")
|
||||||
@limit = 10
|
#@limit = 10
|
||||||
@feedback_count = @jours.count
|
#@feedback_count = @jours.count
|
||||||
@feedback_pages = Paginator.new @feedback_count, @limit, params['page']
|
#@feedback_pages = Paginator.new @feedback_count, @limit, params['page']
|
||||||
@offset ||= @feedback_pages.offset
|
#@offset ||= @feedback_pages.offset
|
||||||
@jour = @jours[@offset, @limit]
|
#@jour = @jours[@offset, @limit]
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.js
|
format.js
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
$('#message').html('<%= escape_javascript(render(:partial => 'showjour', :locals => {:jour =>@jour, :state => false} )) %>');
|
$('#message').html('<%= escape_javascript(render(:partial => 'showjour', :locals => {:jour =>@jours, :state => false} )) %>');
|
||||||
$('#pre_show').html('<%= escape_javascript(render(:partial => 'pre_show', :locals => {:content => nil})) %>');
|
$('#pre_show').html('<%= escape_javascript(render(:partial => 'pre_show', :locals => {:content => nil})) %>');
|
||||||
$('#new_form_user_message').val("");
|
$('#new_form_user_message').val("");
|
||||||
$('#new_form_reference_user_id').val("");
|
$('#new_form_reference_user_id').val("");
|
|
@ -1,12 +1,8 @@
|
||||||
<% if @journal_destroyed.nil? %>
|
<% if @journal_destroyed.nil? %>
|
||||||
alert('<%=l(:notice_failed_delete)%>');
|
alert('<%=l(:notice_failed_delete)%>');
|
||||||
<% elsif (['Principal','Project', 'Bid', 'Contest', 'Softapplication','HomeworkAttach'].include? @journal_destroyed.jour_type)%>
|
<% else %>
|
||||||
var destroyedItem = $('#word_li_<%=@journal_destroyed.id%>')
|
var destroyedItem = $('#word_li_<%=@journal_destroyed.id%>')
|
||||||
destroyedItem.fadeOut(600,function(){
|
destroyedItem.fadeOut(600,function(){
|
||||||
destroyedItem.remove();
|
destroyedItem.remove();
|
||||||
});
|
});
|
||||||
<% else %>
|
|
||||||
|
|
||||||
$('#message').html('<%= escape_javascript(render(:partial => 'showjour', :locals => {:jour => @jours, :state => false})) %>');
|
|
||||||
$('#new_form_reference_user_id').val("");
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
Loading…
Reference in New Issue