From ff6173c5f544e243f18016b2290afc9f48699961 Mon Sep 17 00:00:00 2001 From: yutao <283765470@qq.com> Date: Tue, 19 May 2015 09:04:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug#2623:=E7=95=99=E8=A8=80?= =?UTF-8?q?=E2=80=94=E5=88=A0=E9=99=A4=E7=95=99=E8=A8=80=EF=BC=9A=E5=BD=93?= =?UTF-8?q?=E7=95=99=E8=A8=80=E6=88=90=E5=8A=9F=E5=88=A0=E9=99=A4=E5=90=8E?= =?UTF-8?q?=EF=BC=8C=E7=95=99=E8=A8=80=E7=9A=84=E6=95=B0=E9=87=8F=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E6=89=8B=E5=8A=A8=E5=88=B7=E6=96=B0=E6=89=8D=E4=BC=9A?= =?UTF-8?q?=E6=94=B9=E5=8F=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/words_controller.rb | 3 +++ app/views/words/destroy.js.erb | 2 ++ 2 files changed, 5 insertions(+) diff --git a/app/controllers/words_controller.rb b/app/controllers/words_controller.rb index 3d6772ea8..cc6c4f47e 100644 --- a/app/controllers/words_controller.rb +++ b/app/controllers/words_controller.rb @@ -85,6 +85,9 @@ class WordsController < ApplicationController elsif @journal_destroyed.jour_type == "Course" @course = Course.find @journal_destroyed.jour_id @jours_count = @course.journals_for_messages.where('m_parent_id IS NULL').count + elsif @journal_destroyed.jour_type == "Principal" + @user = User.find(@journal_destroyed.jour_id) + @jours_count = @user.journals_for_messages.where('m_parent_id IS NULL').count end respond_to do |format| format.js diff --git a/app/views/words/destroy.js.erb b/app/views/words/destroy.js.erb index 43da9a7d8..dabd3a8c7 100644 --- a/app/views/words/destroy.js.erb +++ b/app/views/words/destroy.js.erb @@ -5,6 +5,8 @@ $('#jours_count').html("<%= @jours_count %>"); <% elsif @course && @jours_count%> $('#course_jour_count').html("(<%= @jours_count %>)"); + <% elsif @user && @jours_count%> + $('#jour_count').html("<%= @jours_count %>"); <% end %> var destroyedItem = $('#word_li_<%=@journal_destroyed.id%>') destroyedItem.fadeOut(600,function(){