点击作品名称、姓名、学号、时间列都可以展开作品

This commit is contained in:
sw 2015-09-24 09:25:56 +08:00
parent d727097ed2
commit ad6fbf6c9b
2 changed files with 31 additions and 18 deletions

View File

@ -3,12 +3,13 @@
<li class="hworkList340 <%= @homework.homework_type == 2 ? '' : 'width385'%>">
<ul>
<li class="hworkPortrait mt15 mr10">
<%= image_tag(url_to_avatar(student_work.user),width:"40", height: "40") %>
<%= link_to(image_tag(url_to_avatar(User.current),:width =>"40",:height => "40"),user_activities_path(User.current.id))%>
</li>
<div onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
<li class="hworkName mt15 mr15 <%= @homework.homework_type == 2 ? '' : 'width165'%>">
<% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%>
<div>
<%= link_to student_work_name, student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14 StudentName break_word #{@homework.homework_type == 2 ? '' : 'width165'}"%>
<%= link_to student_work_name,"javascript:void(0)" ,:title => student_work_name, :class => "linkGrey f14 StudentName break_word #{@homework.homework_type == 2 ? '' : 'width165'}"%>
</div>
</li>
<li>
@ -21,9 +22,10 @@
</li>
</ul>
</li>
</div>
</ul>
</li>
<li class="hworkList130 c_grey">
<li class="hworkList130 c_grey" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
<%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>&nbsp;
<% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(student_work.created_at.to_s).strftime("%Y-%m-%d") %>
<span class="c_red">[迟交]</span>

View File

@ -975,3 +975,14 @@ $(function(){
function new_homework_alert(){
alert("您好!课程内直接发布作业的功能正在改进中,请直接点击\n顶部导航栏的“作业”向本课程发送作业。谢谢如有问\n题可参见帮助中心。");
}
function show_student_work(url){
$.get(
url,
{
},
function (data) {
}
);
}