1、当作品描述为空时,打开作品报错

2、作品名称为空时,默认显示作品名为:XX的作品
This commit is contained in:
sw 2015-07-22 09:56:27 +08:00
parent 71b6d3a5c4
commit d9f312bbe3
4 changed files with 7 additions and 4 deletions

View File

@ -9,7 +9,8 @@
<%= link_to student_work.user.show_name,user_path(student_work.user),:title => student_work.user.show_name, :class => "c_blue02"%>
</li>
<li class=" hwork_tit">
<%= link_to student_work.name, student_work_path(student_work.id),:remote => true,:title => student_work.name, :class => "c_blue02"%>
<% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%>
<%= link_to student_work_name, student_work_path(student_work.id),:remote => true,:title => student_work.name, :class => "c_blue02"%>
</li>
<li class=" hwork_time_c">
<% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(student_work.created_at.to_s).strftime("%Y-%m-%d") %>

View File

@ -18,7 +18,8 @@
<% end%>
</li>
<li class=" hwork_tit_e" style="width: 410px">
<%= link_to student_work.name, student_work_path(student_work),:remote => true, :title => student_work.name, :class => "c_blue02"%>
<% student_work_name = student_work.name.nil? || student_work.name.empty? ? '匿名的作品' : student_work.name%>
<%= link_to student_work_name, student_work_path(student_work),:remote => true, :title => student_work.name, :class => "c_blue02"%>
</li>
<% my_score = student_work_score(student_work,User.current) %>
<li class=" hwork_code <%= my_score.nil? ? 'c_grey' : 'c_red'%>">

View File

@ -36,7 +36,7 @@
<li >
<span class="tit_fb ">内容:</span>
<div class="show_hwork_p break_word">
<%= text_format @work.description%>
<%= text_format(@work.description) if @work.description%>
</div>
<div class="cl"></div>
</li>

View File

@ -9,7 +9,8 @@
<%= link_to student_work.user.show_name,user_path(student_work.user),:title => student_work.user.show_name, :class => "c_blue02"%>
</li>
<li class=" hwork_tit_une">
<%= link_to student_work.name, student_work_path(student_work),:remote => true,:title => student_work.name, :class => "c_blue02"%>
<% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%>
<%= link_to student_work_name, student_work_path(student_work),:remote => true,:title => student_work.name, :class => "c_blue02"%>
</li>
<li class=" hwork_time_c">
<% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(student_work.created_at.to_s).strftime("%Y-%m-%d") %>