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