作业显示界面页面改造,实现新的页面显示效果
This commit is contained in:
parent
2f66296b62
commit
71bb76ff91
|
@ -28,67 +28,19 @@
|
|||
<% @homework_list.each do |homework|%>
|
||||
<table width="660px" border="0" align="center" id="homework_attach_<%= homework.id %>" >
|
||||
<tr>
|
||||
<td colspan="2" valign="top" width="50" ><%= image_tag(url_to_avatar(homework.user), :class => "avatar")%></td>
|
||||
<td>
|
||||
<table width="580px" border="0">
|
||||
<td style="vertical-align: top;width: 70px" >
|
||||
<table style="text-align: center;width: 100%;table-layout: fixed">
|
||||
<tr>
|
||||
<td style="width: 300px;">
|
||||
<strong>作业 :</strong>
|
||||
<% if homework.name == nil || homework.name == "" %>
|
||||
<% attachments = homework.attachments.map %>
|
||||
<% for attachment in attachments %>
|
||||
<% if attachments.count > 1 %>
|
||||
<% homework_filename = attachment.filename + "等" + attachments.count.to_s + "个文件" %>
|
||||
<% else %>
|
||||
<% homework_filename = attachment.filename %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% homework_filename = homework.name %>
|
||||
<% end %>
|
||||
<strong>
|
||||
<% if is_evaluation || is_teacher%>
|
||||
<%= link_to homework_filename, :controller => "zipdown", :action => "download_user_homework",:homework => homework%>
|
||||
<% else %>
|
||||
<%= homework_filename %>
|
||||
<% end %>
|
||||
</strong>
|
||||
</td>
|
||||
<td style="vertical-align: top">
|
||||
<% if is_student %>
|
||||
<% if is_evaluation %>
|
||||
<%= link_to "互评>>" , homework_attach_path(homework)%>
|
||||
<% else %>
|
||||
<%= link_to "查看详细" , homework_attach_path(homework)%>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% if is_teacher %>
|
||||
<%= link_to "综评>>" , homework_attach_path(homework)%>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<td title="<%= homework.user.name %>"><%= image_tag(url_to_avatar(homework.user), :class => "avatar")%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td title="<%= homework.user.name %>">
|
||||
<p style="width: 100%;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"><strong>
|
||||
<%= link_to (is_teacher ? homework.user.realname : homework.user ), user_path(homework.user)%>
|
||||
</strong></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="1" valign="top" style="width: 300px">
|
||||
<strong>发布人: <%= link_to ( is_teacher ? homework.user.realname : homework.user ), user_path(homework.user)%></strong>
|
||||
</td>
|
||||
<td>
|
||||
<strong>作业评分:</strong>
|
||||
|
||||
<%= format("%.2f", homework.rate_averages.first.try(:avg).to_f ) %>
|
||||
</td>
|
||||
<td valign="top" align="right">
|
||||
<% if Time.parse(@bid.deadline.to_s) < Time.parse(homework.created_at.to_s) %>
|
||||
<span class="required">迟交</span>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top">
|
||||
<% if User.current.member_of?(@bid.courses.first) %>
|
||||
<strong><%= l(:label_bidding_user_studentcode) %> : <%= homework.user.student_id%></strong>
|
||||
<% end %>
|
||||
</td>
|
||||
<td>
|
||||
<% if (users_for_homework(homework).include?(User.current) || is_teacher) %>
|
||||
<%= link_to l(:button_edit), edit_homework_attach_path(homework) %>
|
||||
|
@ -100,6 +52,84 @@
|
|||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<span></span>
|
||||
</td>
|
||||
<td colspan="2">
|
||||
<table width="580px" border="0" style="table-layout: fixed">
|
||||
<tr>
|
||||
<td style="width: 300px;">
|
||||
<strong>作业名称:</strong>
|
||||
<% if homework.name == nil || homework.name == "" %>
|
||||
<% homework_filename = homework.user.name + "提交的作业" %>
|
||||
<% else %>
|
||||
<% homework_filename = homework.name %>
|
||||
<% end %>
|
||||
<strong>
|
||||
<%= link_to homework_filename , homework_attach_path(homework)%>
|
||||
</strong>
|
||||
</td>
|
||||
<td style="vertical-align: top;width: 200px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
|
||||
<strong>参与人员: </strong>
|
||||
<% homework_users = "" %>
|
||||
<% homework.users.each do |user| %>
|
||||
<% homework_users = user.name %>
|
||||
<% end %>
|
||||
<% if homework.users.count == 0 %>
|
||||
无
|
||||
<% else %>
|
||||
<%= homework_users %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td rowspan="4" style="text-align: center;vertical-align: middle;width: 30px">
|
||||
<% if Time.parse(@bid.deadline.to_s) < Time.parse(homework.created_at.to_s) %>
|
||||
<span class="required">迟交</span>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<strong>开发项目:</strong>
|
||||
<% if homework.project != nil %>
|
||||
<%= link_to homework.project.name,project_path(homework.project.id)%>
|
||||
<% else %>
|
||||
该作业暂无项目
|
||||
<% end %>
|
||||
</td>
|
||||
<td>
|
||||
<strong>项目得分:</strong>
|
||||
<% if homework.project != nil %>
|
||||
0分
|
||||
<% else %>
|
||||
0分
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<strong>提交文件:
|
||||
<%= link_to "打包下载", :controller => "zipdown", :action => "download_user_homework",:homework => homework%>
|
||||
</strong>
|
||||
</td>
|
||||
<td>
|
||||
<strong>互评得分:
|
||||
<span class="required"><%= format("%.2f", homework.rate_averages.first.try(:avg).to_f ) %></span>
|
||||
<%= link_to "学生互评>>",homework_attach_path(homework) %></strong>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
<strong>综评得分:
|
||||
<span class="required"><%= format("%.2f", homework.rate_averages.first.try(:avg).to_f ) %></span>
|
||||
<%= link_to "教师评分>>",homework_attach_path(homework) %></strong>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
|
Loading…
Reference in New Issue