commit
5a7ed4fee9
@ -1,26 +1,30 @@
|
|||||||
var attachment_html_obj = $('#attachments_<%= j params[:attachment_id] %>');
|
<% if @is_destroy%>
|
||||||
//modify by yutao 2015-5-14 当1个页面存在多个上传控件时此块代码存在bug 故改之 start
|
$("#attachment_<%= @attachment.id%>").remove();
|
||||||
var containerid=$('.remove-upload',attachment_html_obj).data('containerid');
|
<%else%>
|
||||||
if(containerid==undefined){
|
var attachment_html_obj = $('#attachments_<%= j params[:attachment_id] %>');
|
||||||
$('#attachments_<%= j params[:attachment_id] %>').remove();
|
//modify by yutao 2015-5-14 当1个页面存在多个上传控件时此块代码存在bug 故改之 start
|
||||||
var count=$('#attachments_fields>span').length;
|
var containerid=$('.remove-upload',attachment_html_obj).data('containerid');
|
||||||
if(count<=0){
|
if(containerid==undefined){
|
||||||
$("#upload_file_count").text('<%= l(:label_no_file_uploaded)%>');
|
$('#attachments_<%= j params[:attachment_id] %>').remove();
|
||||||
$(".remove_all").remove();
|
var count=$('#attachments_fields>span').length;
|
||||||
|
if(count<=0){
|
||||||
|
$("#upload_file_count").text('<%= l(:label_no_file_uploaded)%>');
|
||||||
|
$(".remove_all").remove();
|
||||||
|
}else{
|
||||||
|
$("#upload_file_count").html("<span id=\"count\">"+count+"</span>"+"个文件"+"已上传");
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
$("#upload_file_count").html("<span id=\"count\">"+count+"</span>"+"个文件"+"已上传");
|
$('#attachments_<%= j params[:attachment_id] %>').remove();
|
||||||
|
var count=$('#attachments_fields'+containerid+'>span').length;
|
||||||
|
if(count<=0){
|
||||||
|
$('#upload_file_count'+containerid).text('<%= l(:label_no_file_uploaded)%>');
|
||||||
|
var remove_all_html_obj = $(".remove_all").filter(function(index){
|
||||||
|
return $(this).data('containerid')==containerid;
|
||||||
|
});
|
||||||
|
remove_all_html_obj.remove();
|
||||||
|
}else{
|
||||||
|
$('#upload_file_count'+containerid).html("<span id=\"count\">"+count+"</span>"+"个文件"+"已上传");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}else{
|
//modify by yutao 2015-5-14 当1个页面存在多个上传控件时此块代码存在bug 故改之 end
|
||||||
$('#attachments_<%= j params[:attachment_id] %>').remove();
|
<% end%>
|
||||||
var count=$('#attachments_fields'+containerid+'>span').length;
|
|
||||||
if(count<=0){
|
|
||||||
$('#upload_file_count'+containerid).text('<%= l(:label_no_file_uploaded)%>');
|
|
||||||
var remove_all_html_obj = $(".remove_all").filter(function(index){
|
|
||||||
return $(this).data('containerid')==containerid;
|
|
||||||
});
|
|
||||||
remove_all_html_obj.remove();
|
|
||||||
}else{
|
|
||||||
$('#upload_file_count'+containerid).html("<span id=\"count\">"+count+"</span>"+"个文件"+"已上传");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//modify by yutao 2015-5-14 当1个页面存在多个上传控件时此块代码存在bug 故改之 end
|
|
@ -1,32 +1,32 @@
|
|||||||
<li class="w70 ">
|
<li class="hwork_num ">
|
||||||
<span href="javascript:void(0);" class="c_dark f14 fb fl ">学号</span>
|
<a href="javascript:void(0);" class=" f14 f_b c_dark fl" >学号</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="w70">
|
<li class=" hwork_name f14 fb c_dark">
|
||||||
<span class="c_dark f14 fb fl ">学生姓名</span>
|
学生姓名
|
||||||
</li>
|
</li>
|
||||||
<li class="hwork_tit">
|
<li class="hwork_tit">
|
||||||
<span class="c_dark f14 fb fl">作品名称</span>
|
<span class="c_dark f14 fb fl">作品名称</span>
|
||||||
</li>
|
</li>
|
||||||
<li class="w70 mr5" >
|
<li class="mr5 w70">
|
||||||
<%= link_to "教师评分",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name) : "javascript:void(0)",:class => "c_dark f14 fb fl"%>
|
<%= link_to "教师评分",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name) : "javascript:void(0)",:class => "f14 f_b c_dark fl hwork_code"%>
|
||||||
<% if @show_all && @order == "teacher_score"%>
|
<% if @show_all && @order == "teacher_score"%>
|
||||||
<a href="javascript:void(0);" class="<%= @score == 'desc' ? 'st_up' : 'st_down'%>" ></a>
|
<a href="javascript:void(0);" class="<%= @score == 'desc' ? 'st_up' : 'st_down'%>" ></a>
|
||||||
<% end%>
|
<% end%>
|
||||||
</li>
|
</li>
|
||||||
<li class="w70 mr5">
|
<li class="mr5 w70">
|
||||||
<%= link_to "教辅评分",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name) : "javascript:void(0)",:class => "c_dark f14 fb fl"%>
|
<%= link_to "教辅评分",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name) : "javascript:void(0)",:class => "f14 f_b c_dark fl hwork_code"%>
|
||||||
<% if @show_all && @order == "teaching_asistant_score"%>
|
<% if @show_all && @order == "teaching_asistant_score"%>
|
||||||
<a href="javascript:void(0);" class="<%= @score == 'desc' ? 'st_up' : 'st_down'%>" ></a>
|
<a href="javascript:void(0);" class="<%= @score == 'desc' ? 'st_up' : 'st_down'%>" ></a>
|
||||||
<% end%>
|
<% end%>
|
||||||
</li>
|
</li>
|
||||||
<li class="w60 mr5 ml10">
|
<li class="mr5 ml15 w40">
|
||||||
<%= link_to "匿评",@show_all ? student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name) : "javascript:void(0)",:class => "c_dark f14 fb fl"%>
|
<%= link_to "匿评",@show_all ? student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
|
||||||
<% if @show_all && @order == "student_score"%>
|
<% if @show_all && @order == "student_score"%>
|
||||||
<a href="javascript:void(0);" class="<%= @score == 'desc' ? 'st_up' : 'st_down'%>" ></a>
|
<a href="javascript:void(0);" class="<%= @score == 'desc' ? 'st_up' : 'st_down'%>" ></a>
|
||||||
<% end%>
|
<% end%>
|
||||||
</li>
|
</li>
|
||||||
<li class="w40 ml10" id="final_sort">
|
<li class="ml30">
|
||||||
<%= link_to "成绩",@show_all ? student_work_index_path(:homework => @homework.id,:order => "final_score", :sort => @score, :name => @name) : "javascript:void(0)",:class => "c_dark f14 fb fl"%>
|
<%= link_to "成绩",@show_all ? student_work_index_path(:homework => @homework.id,:order => "final_score", :sort => @score, :name => @name) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
|
||||||
<% if @show_all && @order == "final_score"%>
|
<% if @show_all && @order == "final_score"%>
|
||||||
<a href="javascript:void(0);" class="<%= @score == 'desc' ? 'st_up' : 'st_down'%>" ></a>
|
<a href="javascript:void(0);" class="<%= @score == 'desc' ? 'st_up' : 'st_down'%>" ></a>
|
||||||
<% end%>
|
<% end%>
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
<% for attachment in attachments %>
|
<% attachments.each_with_index do |attachment,i| %>
|
||||||
<%= link_to_short_attachment attachment, :class => 'link_file', :download => true -%>
|
<div id="attachment_<%= attachment.id%>">
|
||||||
<span class="ml5">(<%= number_to_human_size attachment.filesize %>)</span>
|
<%= link_to_short_attachment attachment, :class => 'link_file', :download => true -%>
|
||||||
<div class="cl"></div>
|
<%= link_to(' '.html_safe, attachment_path(attachment, :format => 'js'), :method => 'delete', :remote => true, :title => '删除', :class => 'remove-upload', :confirm => l(:text_are_you_sure)) if attachment.id && User.current == attachment.author %>
|
||||||
|
<span class="ml5">(<%= number_to_human_size attachment.filesize %>)</span>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
|
Loading…
Reference in new issue