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