diff --git a/app/controllers/bids_controller.rb b/app/controllers/bids_controller.rb index e898b855d..8eaf20716 100644 --- a/app/controllers/bids_controller.rb +++ b/app/controllers/bids_controller.rb @@ -822,7 +822,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 diff --git a/app/controllers/homework_attach_controller.rb b/app/controllers/homework_attach_controller.rb index e54df3d22..45564addd 100644 --- a/app/controllers/homework_attach_controller.rb +++ b/app/controllers/homework_attach_controller.rb @@ -127,7 +127,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/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/_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 %>
diff --git a/app/views/homework_attach/_history.erb b/app/views/homework_attach/_history.erb index 299ba1aa5..3376d696f 100644 --- a/app/views/homework_attach/_history.erb +++ b/app/views/homework_attach/_history.erb @@ -19,14 +19,14 @@
- <%= 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%>

<% 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("");