commit
5a7ed4fee9
@ -1,26 +1,30 @@
|
||||
var attachment_html_obj = $('#attachments_<%= j params[:attachment_id] %>');
|
||||
//modify by yutao 2015-5-14 当1个页面存在多个上传控件时此块代码存在bug 故改之 start
|
||||
var containerid=$('.remove-upload',attachment_html_obj).data('containerid');
|
||||
if(containerid==undefined){
|
||||
$('#attachments_<%= j params[:attachment_id] %>').remove();
|
||||
var count=$('#attachments_fields>span').length;
|
||||
if(count<=0){
|
||||
$("#upload_file_count").text('<%= l(:label_no_file_uploaded)%>');
|
||||
$(".remove_all").remove();
|
||||
<% if @is_destroy%>
|
||||
$("#attachment_<%= @attachment.id%>").remove();
|
||||
<%else%>
|
||||
var attachment_html_obj = $('#attachments_<%= j params[:attachment_id] %>');
|
||||
//modify by yutao 2015-5-14 当1个页面存在多个上传控件时此块代码存在bug 故改之 start
|
||||
var containerid=$('.remove-upload',attachment_html_obj).data('containerid');
|
||||
if(containerid==undefined){
|
||||
$('#attachments_<%= j params[:attachment_id] %>').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{
|
||||
$("#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{
|
||||
$('#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>"+"个文件"+"已上传");
|
||||
}
|
||||
}
|
||||
//modify by yutao 2015-5-14 当1个页面存在多个上传控件时此块代码存在bug 故改之 end
|
||||
//modify by yutao 2015-5-14 当1个页面存在多个上传控件时此块代码存在bug 故改之 end
|
||||
<% end%>
|
@ -1,32 +1,32 @@
|
||||
<li class="w70 ">
|
||||
<span href="javascript:void(0);" class="c_dark f14 fb fl ">学号</span>
|
||||
<li class="hwork_num ">
|
||||
<a href="javascript:void(0);" class=" f14 f_b c_dark fl" >学号</a>
|
||||
</li>
|
||||
<li class="w70">
|
||||
<span class="c_dark f14 fb fl ">学生姓名</span>
|
||||
<li class=" hwork_name f14 fb c_dark">
|
||||
学生姓名
|
||||
</li>
|
||||
<li class="hwork_tit">
|
||||
<span class="c_dark f14 fb fl">作品名称</span>
|
||||
</li>
|
||||
<li class="w70 mr5" >
|
||||
<%= 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"%>
|
||||
<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 => "f14 f_b c_dark fl hwork_code"%>
|
||||
<% if @show_all && @order == "teacher_score"%>
|
||||
<a href="javascript:void(0);" class="<%= @score == 'desc' ? 'st_up' : 'st_down'%>" ></a>
|
||||
<% end%>
|
||||
</li>
|
||||
<li class="w70 mr5">
|
||||
<%= 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"%>
|
||||
<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 => "f14 f_b c_dark fl hwork_code"%>
|
||||
<% if @show_all && @order == "teaching_asistant_score"%>
|
||||
<a href="javascript:void(0);" class="<%= @score == 'desc' ? 'st_up' : 'st_down'%>" ></a>
|
||||
<% end%>
|
||||
</li>
|
||||
<li class="w60 mr5 ml10">
|
||||
<%= 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"%>
|
||||
<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 => "f14 f_b c_dark fl"%>
|
||||
<% if @show_all && @order == "student_score"%>
|
||||
<a href="javascript:void(0);" class="<%= @score == 'desc' ? 'st_up' : 'st_down'%>" ></a>
|
||||
<% end%>
|
||||
</li>
|
||||
<li class="w40 ml10" id="final_sort">
|
||||
<%= 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"%>
|
||||
<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 => "f14 f_b c_dark fl"%>
|
||||
<% if @show_all && @order == "final_score"%>
|
||||
<a href="javascript:void(0);" class="<%= @score == 'desc' ? 'st_up' : 'st_down'%>" ></a>
|
||||
<% end%>
|
||||
|
@ -1,5 +1,8 @@
|
||||
<% for attachment in attachments %>
|
||||
<%= link_to_short_attachment attachment, :class => 'link_file', :download => true -%>
|
||||
<span class="ml5">(<%= number_to_human_size attachment.filesize %>)</span>
|
||||
<div class="cl"></div>
|
||||
<% attachments.each_with_index do |attachment,i| %>
|
||||
<div id="attachment_<%= attachment.id%>">
|
||||
<%= link_to_short_attachment attachment, :class => 'link_file', :download => true -%>
|
||||
<%= 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 -%>
|
||||
|
Loading…
Reference in new issue