From b876a7b063dc44d6b909656884ffebcbd56242b4 Mon Sep 17 00:00:00 2001 From: z9hang Date: Tue, 4 Nov 2014 09:22:29 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=B0=86=E8=AF=84=E8=AE=BA=E6=A0=87?= =?UTF-8?q?=E7=AD=BE=E9=A1=B5=E5=88=87=E6=8D=A2=E6=94=B9=E4=B8=BA=E9=BC=A0?= =?UTF-8?q?=E6=A0=87=E7=82=B9=E5=87=BB=E5=88=87=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/homework_attach/_histoey_new.html.erb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/homework_attach/_histoey_new.html.erb b/app/views/homework_attach/_histoey_new.html.erb index a204f87de..183eb067d 100644 --- a/app/views/homework_attach/_histoey_new.html.erb +++ b/app/views/homework_attach/_histoey_new.html.erb @@ -1,11 +1,11 @@
    -
  • +
  • <%= l(:label_teacher_comments) %>(<%= @comprehensive_evaluation.nil? ? 0 : @comprehensive_evaluation.count %>
  • -
  • +
  • <%= l(:label_anonymous_comments) %>(<%= @anonymous_comments.nil? ? 0 : @anonymous_comments.count %>
  • -
  • +
  • <%= l(:label_responses) %>(<%= @jours.nil? ? 0 : @jours.count %>
From c3152b55de4b5664b4e57008e103fa255795b389 Mon Sep 17 00:00:00 2001 From: z9hang Date: Tue, 4 Nov 2014 09:30:17 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E5=90=8E=E8=B7=AF=E7=94=B1=E8=B7=B3=E8=BD=AC=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/bids_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/bids_controller.rb b/app/controllers/bids_controller.rb index 83862d22e..3c0780c0f 100644 --- a/app/controllers/bids_controller.rb +++ b/app/controllers/bids_controller.rb @@ -819,7 +819,7 @@ class BidsController < ApplicationController flash[:notice] = l(:label_bid_succeed) end end - redirect_to respond_url(@bid) + redirect_to course_for_bid_path(@bid) else @bid.safe_attributes = params[:bid] @homework = @bid From 1ec82a923ea0efcddee366e379ef30c59acd8209 Mon Sep 17 00:00:00 2001 From: z9hang Date: Tue, 4 Nov 2014 10:07:15 +0800 Subject: [PATCH 3/4] =?UTF-8?q?1=E3=80=81=E9=87=8D=E6=96=B0=E8=BF=9B?= =?UTF-8?q?=E5=85=A5=E7=95=99=E8=A8=80=E7=95=8C=E9=9D=A2=E5=90=8E=EF=BC=8C?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E5=88=A0=E9=99=A4=E8=87=AA=E5=B7=B1=E7=9A=84?= =?UTF-8?q?=E7=95=99=E8=A8=80bug=E3=80=822=E3=80=81=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E7=95=99=E8=A8=80=E5=90=8E=E7=95=99=E8=A8=80=E6=95=B0=E9=87=8F?= =?UTF-8?q?=E6=9C=AA=E5=8F=98=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_attach_controller.rb | 2 +- app/controllers/words_controller.rb | 7 ++++++- app/views/homework_attach/_history.erb | 2 +- app/views/words/destroy.js.erb | 11 +++++++---- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/app/controllers/homework_attach_controller.rb b/app/controllers/homework_attach_controller.rb index a143fe4aa..d601d32a1 100644 --- a/app/controllers/homework_attach_controller.rb +++ b/app/controllers/homework_attach_controller.rb @@ -112,7 +112,7 @@ class HomeworkAttachController < ApplicationController #获取作业的留言列表 def get_homework_jours - #@user = @bid.author + @user = @bid.author @jours = @bid.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC') @jour = paginateHelper @jours,10 @state = false diff --git a/app/controllers/words_controller.rb b/app/controllers/words_controller.rb index c6a5d2819..8797474ec 100644 --- a/app/controllers/words_controller.rb +++ b/app/controllers/words_controller.rb @@ -82,7 +82,12 @@ class WordsController < ApplicationController def destroy @journal_destroyed = JournalsForMessage.delete_message(params[:object_id]) - + if @journal_destroyed.jour_type == "Bid" + @bid = Bid.find(@journal_destroyed.jour_id) + end + if @bid + @jours_count = @bid.journals_for_messages.where('m_parent_id IS NULL').count + end respond_to do |format| format.js #format.api { render_api_ok } diff --git a/app/views/homework_attach/_history.erb b/app/views/homework_attach/_history.erb index 299ba1aa5..c235e0867 100644 --- a/app/views/homework_attach/_history.erb +++ b/app/views/homework_attach/_history.erb @@ -26,7 +26,7 @@
<% ids = 'project_respond_form_'+ journal.id.to_s%> - <% if @user==User.current|| User.current.admin? %> + <% if journal.user == User.current|| User.current.admin? %> <%= link_to(l(:label_bid_respond_delete), {:controller => 'words', :action => 'destroy', :object_id => journal, :user_id => @user}, :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', diff --git a/app/views/words/destroy.js.erb b/app/views/words/destroy.js.erb index af1740b7a..d00db0695 100644 --- a/app/views/words/destroy.js.erb +++ b/app/views/words/destroy.js.erb @@ -1,10 +1,13 @@ <% if @journal_destroyed.nil? %> alert('<%=l(:notice_failed_delete)%>'); <% elsif (['Principal','Project','Course', 'Bid', 'Contest', 'Softapplication'].include? @journal_destroyed.jour_type)%> - var destroyedItem = $('#word_li_<%=@journal_destroyed.id%>') - destroyedItem.fadeOut(600,function(){ - destroyedItem.remove(); - }); + <% if @jours_count %> + $('#jours_count').html("<%= @jours_count %>"); + <% end %> + var destroyedItem = $('#word_li_<%=@journal_destroyed.id%>') + destroyedItem.fadeOut(600,function(){ + destroyedItem.remove(); + }); <% else %> $('#message').html('<%= escape_javascript(render(:partial => 'words/message', :locals => {:jour => @jour, :state => false, :user => @user, :feedback_pages => @feedback_pages})) %>'); $('#new_form_reference_user_id').val(""); From 385009b688d89d828e88b4a19c7cb4f3decff2fc Mon Sep 17 00:00:00 2001 From: z9hang Date: Tue, 4 Nov 2014 10:22:48 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E7=95=99=E8=A8=80=E5=8C=BA=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/attachments/_links.html.erb | 2 +- app/views/homework_attach/_history.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/attachments/_links.html.erb b/app/views/attachments/_links.html.erb index 29ed094bf..2954adbcb 100644 --- a/app/views/attachments/_links.html.erb +++ b/app/views/attachments/_links.html.erb @@ -1,7 +1,7 @@
<% for attachment in attachments %>

- + <% if options[:length] %> <%= link_to_short_attachment attachment, :class => 'icon icon-attachment', :download => true,:length => options[:length] -%> <% else %> diff --git a/app/views/homework_attach/_history.erb b/app/views/homework_attach/_history.erb index c235e0867..3376d696f 100644 --- a/app/views/homework_attach/_history.erb +++ b/app/views/homework_attach/_history.erb @@ -19,7 +19,7 @@

- <%= link_to journal.user, user_path(journal.user),:style => " font-weight:bold; color:#15bccf; margin-right:30px; background:none;", :target => "_blank"%><%= journal.created_on %> + <%= link_to journal.user, user_path(journal.user),:style => " font-weight:bold; color:#15bccf; margin-right:30px; background:none;", :target => "_blank"%><%= format_time(journal.created_on) %>

<%= textilizable journal.notes%>