diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index a3f02cbb9..91a6fb706 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -191,7 +191,8 @@ class StudentWorkController < ApplicationController def show @score = student_work_score @work,User.current - @is_teacher = User.current.allowed_to?(:as_teacher,@course) + @is_teacher = User.current.allowed_to?(:as_teacher,@course) || User.current.admin? + @student_work_scores = @work.student_works_scores.order("updated_at desc") respond_to do |format| format.js end diff --git a/app/views/student_work/_jour_replay.html.erb b/app/views/student_work/_jour_replay.html.erb index 77fb476bf..4b594d7f4 100644 --- a/app/views/student_work/_jour_replay.html.erb +++ b/app/views/student_work/_jour_replay.html.erb @@ -6,9 +6,9 @@ <% if jour.user==User.current || User.current.admin? %> <%= link_to(l(:label_bid_respond_delete), destroy_score_reply_student_work_index_path(:jour_id => jour.id), - :remote => true, :confirm => l(:text_are_you_sure), :title => l(:button_delete), :class => "fr c_purple") %> + :remote => true, :confirm => l(:text_are_you_sure), :title => l(:button_delete), :class => "fr linkBlue mr5") %> <% end %> - + <%=format_time jour.created_on %>
diff --git a/app/views/student_work/_show.html.erb b/app/views/student_work/_show.html.erb index f6580659e..2aa14be71 100644 --- a/app/views/student_work/_show.html.erb +++ b/app/views/student_work/_show.html.erb @@ -1,72 +1,74 @@
-
- -
- <%@work.student_works_scores.order("updated_at desc").each do |score|%> -
- <%= render :partial => 'student_work_score',:locals => {:score => score}%> -
- <% end%> -
-收起 -
-
\ No newline at end of file +
+ <%@student_work_scores.each do |score|%> +
+ <%= render :partial => 'student_work_score',:locals => {:score => score,:is_last => score == @student_work_scores.last}%> +
+ <% end%> +
+ + 收起 +
+ \ No newline at end of file diff --git a/app/views/student_work/_student_work_score.html.erb b/app/views/student_work/_student_work_score.html.erb index 8d10853f8..d4d319fa2 100644 --- a/app/views/student_work/_student_work_score.html.erb +++ b/app/views/student_work/_student_work_score.html.erb @@ -1,22 +1,29 @@ - diff --git a/app/views/student_work/_work_attachments.html.erb b/app/views/student_work/_work_attachments.html.erb index f303897bc..a75f68f70 100644 --- a/app/views/student_work/_work_attachments.html.erb +++ b/app/views/student_work/_work_attachments.html.erb @@ -1,8 +1,8 @@ <% attachments.each_with_index do |attachment,i| %>
- <%= 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 %> - (<%= number_to_human_size attachment.filesize %>) + <%= link_to_short_attachment attachment, :class => 'link_file_a fl', :download => true -%> + <%= link_to(' '.html_safe, attachment_path(attachment, :format => 'js'), :method => 'delete', :remote => true, :title => '删除', :class => 'remove-upload fl', :confirm => l(:text_are_you_sure)) if attachment.id && User.current == attachment.author %> + (<%= number_to_human_size attachment.filesize %>)
<% end -%> diff --git a/app/views/student_work/index.html.erb b/app/views/student_work/index.html.erb index 4979c5c95..fee601b5f 100644 --- a/app/views/student_work/index.html.erb +++ b/app/views/student_work/index.html.erb @@ -17,6 +17,10 @@ $('#ajax-modal').parent().addClass("anonymos"); }); <% end%> + +// $(function(){ +// $('.animated').autosize(); +// });
diff --git a/app/views/student_work/show.js.erb b/app/views/student_work/show.js.erb index 1c8874c2f..e6b99c146 100644 --- a/app/views/student_work/show.js.erb +++ b/app/views/student_work/show.js.erb @@ -1,11 +1,11 @@ -if($("#about_hwork_<%= @work.id%>").children().length > 0) - {$("#about_hwork_<%= @work.id%>").html("");} -else - { - <% if @homework.homework_type == 2%> - $("#about_hwork_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'programing_work_show') %>"); - <% else%> - $("#about_hwork_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'show') %>"); - <% end%> - $('#score_<%= @work.id%>').peSlider({range: 'min'}); - } \ No newline at end of file +if($("#about_hwork_<%= @work.id%>").children().length > 0){ + $("#about_hwork_<%= @work.id%>").html(""); +} +else{ + <% if @homework.homework_type == 2%> + $("#about_hwork_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'programing_work_show') %>"); + <% else%> + $("#about_hwork_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'show') %>"); + <% end%> + $('#score_<%= @work.id%>').peSlider({range: 'min'}); +} \ No newline at end of file diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index adad76d3d..72ccc33c1 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -692,15 +692,15 @@ a.hwork_center{ display:block; width:60px; text-align:center; margin-right:5px;} .tit_fb{ font-weight:bold; width:66px; text-align:right; display:block; float:left;} .ml160{ margin-left:160px;} .show_hwork_p{ width:580px; float:left;} -.hwork_ping_text{ float:left; border:1px solid #e4e4e4; padding:5px; width:568px; height:35px;} -.ping_box{ width:626px; padding:10px; background:#f5f3f3; } +.hwork_ping_text{ float:left; border:1px solid #e4e4e4; padding:5px; width:615px; height:35px;} +.ping_box{ width:676px; padding:10px; background:#f5f3f3; } a.ping_pic{ display:block; width:34px; height:34px; padding:2px; border:1px solid #e3e3e3;} a:hover.ping_pic{border:1px solid #64bdd9;} .ping_box_tit{ float:left; width:575px; margin-left:10px;} .ping_box_ul{} .ping_line{ border-bottom:1px dashed #CCCCCC; padding-bottom:8px; margin-bottom:8px;} -.ping_text{border:1px solid #CCCCCC; margin:5px; padding:5px; width:560px; height:20px; } -.ping_back_tit{ float:left; width:523px; margin-left:10px; } +.ping_text{border:1px solid #CCCCCC; margin:5px; padding:5px; width:610px; height:20px; } +.ping_back_tit{ float:left; width:578px; margin-left:10px; } a.down_btn{ border:1px solid #CCC; color:#999; padding:0px 5px; font-size:12px; text-align:center; display:block;} a:hover.down_btn{ background:#14ad5a; color:#fff; border:1px solid #14ad5a;} .fr{ float:right;} @@ -800,8 +800,8 @@ a:hover.icon_remove{background:url(images/icons.png) -20px -338px no-repeat;} .T_C{ text-align:center;} .SearchIcon{background:url(../images/homepage_icon2.png) 676px -393px no-repeat; } .SearchIcon:hover{background:url(../images/homepage_icon2.png) 676px -419px no-repeat; } -a.link_file{ background:url(../images/pic_file.png) 0 2px no-repeat; padding-left:20px; } -a:hover.link_file{ background:url(../images/pic_file.png) 0 -25px no-repeat; color:#3ca5c6;} +a.link_file_a{ background:url(../images/pic_file.png) 0 2px no-repeat; padding-left:20px; } +a:hover.link_file_a{ background:url(../images/pic_file.png) 0 -25px no-repeat; color:#3ca5c6;} a.remove-upload {background: url(../images/delete.png) no-repeat 1px 50%;width: 1px;display: inline-block;padding-left: 16px;} a.FilesName{ max-width:540px;overflow:hidden; white-space:nowrap; text-overflow:ellipsis; display:block;} a.FilesName02{ max-width:665px;overflow:hidden; white-space:nowrap; text-overflow:ellipsis; display:block;} @@ -847,7 +847,7 @@ a.pro_mes_w{ height:20px; display:block; color:#999999;} .rside_work_con{ width:650px;} a.c_grey{ color:#999999;} a:hover.c_grey{ color:#333;} -.link_file{ display:block; max-width:300px;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} +.link_file_a{ display:block; max-width:450px;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} .last_time{width:auto; text-align:right; margin-right:70px;} .link_file_box{ width:360px;}