Merge branch 'Homework' of http://repository.trustie.net/xianbo/trustie2 into Homework

This commit is contained in:
sw 2014-11-04 10:41:57 +08:00
commit df7744e22e
7 changed files with 21 additions and 13 deletions

View File

@ -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

View File

@ -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

View File

@ -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 }

View File

@ -1,7 +1,7 @@
<div class="attachments" style="font-weight:normal;">
<% for attachment in attachments %>
<p style="width: 100%;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
<span title="<%= attachment.filename%>" id = "attachment_"">
<span title="<%= attachment.filename%>" id = "attachment_">
<% if options[:length] %>
<%= link_to_short_attachment attachment, :class => 'icon icon-attachment', :download => true,:length => options[:length] -%>
<% else %>

View File

@ -1,11 +1,11 @@
<div class="ping_list">
<div id="ping_tb_" class="ping_tb_">
<ul>
<li id="ping_tb_4" class="ping_normaltab" onmouseover="i:HoverLi(4);">
<li id="ping_tb_4" class="ping_normaltab" onclick="i:HoverLi(4);">
<%= l(:label_teacher_comments) %><span class="c_red" id="jour_count_4"><%= @comprehensive_evaluation.nil? ? 0 : @comprehensive_evaluation.count %></span></li>
<li id="ping_tb_5" class="ping_normaltab" onmouseover="i:HoverLi(5);">
<li id="ping_tb_5" class="ping_normaltab" onclick="i:HoverLi(5);">
<%= l(:label_anonymous_comments) %><span class="c_red" id="jour_count_5" ><%= @anonymous_comments.nil? ? 0 : @anonymous_comments.count %></span></li>
<li id="ping_tb_3" class="ping_hovertab" onmouseover="x:HoverLi(3);">
<li id="ping_tb_3" class="ping_hovertab" onclick="x:HoverLi(3);">
<%= l(:label_responses) %><span class="c_red" id="jour_count_3"><%= @jours.nil? ? 0 : @jours.count %></span></li>
</ul>
</div>

View File

@ -19,14 +19,14 @@
<div class="ping_discon" style="width: 85%;">
<div class="ping_distop">
<!-- <a style=" font-weight:bold; color:#15bccf; margin-right:30px; background:none;" target="_blank" href="#">gugu01</a> -->
<span><%= link_to journal.user, user_path(journal.user),:style => " font-weight:bold; color:#15bccf; margin-right:30px; background:none;", :target => "_blank"%></span><span style="color:#a6a6a6; margin-right:40px; margin-left:30px;"><%= journal.created_on %></span>
<span><%= link_to journal.user, user_path(journal.user),:style => " font-weight:bold; color:#15bccf; margin-right:30px; background:none;", :target => "_blank"%></span><span style="color:#a6a6a6; margin-right:40px; margin-left:30px;"><%= format_time(journal.created_on) %></span>
<div class="cl"></div>
<p><%= textilizable journal.notes%></p>
</div>
<div class="ping_disfoot">
<% ids = 'project_respond_form_'+ journal.id.to_s%>
<span style="float: right">
<% 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',

View File

@ -1,6 +1,9 @@
<% if @journal_destroyed.nil? %>
alert('<%=l(:notice_failed_delete)%>');
<% elsif (['Principal','Project','Course', 'Bid', 'Contest', 'Softapplication'].include? @journal_destroyed.jour_type)%>
<% if @jours_count %>
$('#jours_count').html("<%= @jours_count %>");
<% end %>
var destroyedItem = $('#word_li_<%=@journal_destroyed.id%>')
destroyedItem.fadeOut(600,function(){
destroyedItem.remove();