socialforge/app/views/homework_attach/addjours.js.erb

34 lines
2.0 KiB
Plaintext

//教师评论
<% if @is_teacher %>
HoverLi(4);
$('#jour_count_4').html('<%= @teacher_stars.count %>');
$('#tbc_04').html('<%= escape_javascript(render(:partial => 'homework_attach/review',:locals => {:review_list => @teacher_stars,:show_name => true,:show_jour => true})) %>');
$("#homework_attach_jour_attachment").html('<%= escape_javascript(render :partial => 'attachments/form') %>');
//匿评
<% elsif @is_anonymous_comments %>
HoverLi(5);
$('#jour_count_5').html('<%= @student_stars.count %>');
$('#tbc_05').html('<%= escape_javascript(render(:partial => 'homework_attach/review',:locals => {:review_list => @student_stars,:show_name => false || @is_teacher, :show_jour => false})) %>');
$("#homework_attach_jour_attachment").html('<%= escape_javascript(render :partial => 'attachments/form') %>');
//留言
<% else %>
HoverLi(3);
$('#jour_count_3').html('<%= @obj_count %>');
$('#tbc_03').html('<%= escape_javascript(render(:partial => 'homework_attach/jour',:locals => {:jours => @jour, :obj_pages => @obj_pages, :obj_count => @obj_count,:homework => @homework})) %>');
<% end %>
$('#new_form_user_message').val("");
$('#new_form_reference_user_id').val("");
<% if @is_anonymous_comments || @is_teacher %>
<% if @cur_type == "1" %>
$("#tbc_01").html('<%= escape_javascript(render(:partial => 'homework_attach/homeworks_list',:locals => {:homeworks => @homework_list,
:homework_count => @obj_count,
:remote => false,:is_student_batch_homework => false})) %>');
<% elsif @cur_type == "2" || @cur_type == "3" || @cur_type == "4" %>
$("#homework_li_<%= @homework.id%>").html('<%= escape_javascript(render(:partial => 'homework_attach/homework',:locals => {:homework => @result_homework || @homework,
:is_student_batch_homework => @is_student_batch_homework || false,
:is_my_homework => false, :is_teacher => @is_teacher})) %>');
<% end %>
<% end %>