From 71bbc50542d2ab074f30bc1ca8d16b37969e847e Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 22 May 2014 20:01:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BD=9C=E4=B8=9A=E7=95=99?= =?UTF-8?q?=E8=A8=80=E7=9A=84=E5=88=86=E9=A1=B5=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_attach_controller.rb | 12 ++++++------ app/views/homework_attach/addjours.js.erb | 2 +- app/views/homework_attach/show.html.erb | 10 +++++++++- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/app/controllers/homework_attach_controller.rb b/app/controllers/homework_attach_controller.rb index c3ac15197..8eae8b855 100644 --- a/app/controllers/homework_attach_controller.rb +++ b/app/controllers/homework_attach_controller.rb @@ -101,8 +101,8 @@ class HomeworkAttachController < ApplicationController @stars_status_map["star#{star_status.stars.to_i}".to_sym] = percent_m.to_s + "%" end - @jours = @homework.journals_for_messages.order("created_on DESC") @limit = 10 + @jours = @homework.journals_for_messages.order("created_on DESC") @feedback_count = @jours.count @feedback_pages = Paginator.new @feedback_count, @limit, params['page'] @offset ||= @feedback_pages.offset @@ -129,11 +129,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 e0f32581e..e463237e5 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 =>@jours, :state => false} )) %>'); +$('#message').html('<%= escape_javascript(render(:partial => 'showjour', :locals => {:jour =>@jour, :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/show.html.erb b/app/views/homework_attach/show.html.erb index d7c1e8eb0..f2c37d9ac 100644 --- a/app/views/homework_attach/show.html.erb +++ b/app/views/homework_attach/show.html.erb @@ -142,7 +142,15 @@
- <%= render :partial => 'showjour', :locals => {:jour => @jours} %> + <%= render :partial => 'showjour', :locals => {:jour => @jour} %>
+ + + +