diff --git a/app/controllers/homework_attach_controller.rb b/app/controllers/homework_attach_controller.rb index 8dc5d80a0..2a0f97613 100644 --- a/app/controllers/homework_attach_controller.rb +++ b/app/controllers/homework_attach_controller.rb @@ -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 diff --git a/app/views/homework_attach/addjours.js.erb b/app/views/homework_attach/addjours.js.erb index e463237e5..e0f32581e 100644 --- a/app/views/homework_attach/addjours.js.erb +++ b/app/views/homework_attach/addjours.js.erb @@ -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(""); \ No newline at end of file diff --git a/app/views/homework_attach/destroy.js.erb b/app/views/homework_attach/destroy.js.erb index 9691a6aee..22f7fc048 100644 --- a/app/views/homework_attach/destroy.js.erb +++ b/app/views/homework_attach/destroy.js.erb @@ -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 %> diff --git a/config/routes.rb b/config/routes.rb index be132dd68..f6717583b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -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'