bigdir/app/views/bids/_homework_list.html.erb

50 lines
2.1 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!-- fq -->
<%= render_flash_messages %>
<%= form_tag(:controller => 'bids', :action => "show_project", :method => :get) do %>
<div class="project-search-block">
<table width="100%" valign="center">
<tr>
<td ><span style="margin-left:0px"><%= l(:label_task_plural)%></span></td>
<td align="right">
<div class="project-search">
<%= text_field_tag 'student_id', params[:student_id], :size => 30 %>
<%= submit_tag l(:label_search_by_student_id), :class => "small", :name => nil %>
</div></td>
</tr>
</table>
</div>
<% end %>
<% @homework_list.each do |homework|%>
<% if homework.attachments.any?%>
<table width="660px" border="0" align="center">
<tr>
<!-- <td colspan="2" valign="top" width="50" ><%= link_to image_tag(url_to_avatar(homework.user), :class => "avatar"), user_path(homework.user), :class => "avatar" %></td> -->
<td colspan="2" valign="top" width="50" ><%= image_tag(url_to_avatar(homework.user), :class => "avatar")%></td>
<td>
<table width="580px" border="0">
<tr>
<td colspan="2" valign="top"><strong> <%= link_to homework.user, user_path(homework.user)%></strong> <span class="font_lighter">提交了作业</span></td>
</tr>
<tr>
<td colspan="2" valign="top"><strong><%= l(:label_bidding_user_studentcode) %> <%= homework.user.user_extensions.student_id%></td>
</tr>
<tr>
<td colspan="2" width="580px" >
<% if (User.current == homework.user) || (!Member.where('user_id = ? and project_id = ?', User.current.id, @bid.courses.first.id).first.nil? && (Member.where('user_id = ? and project_id = ?', User.current.id, @bid.courses.first.id).first.roles&Role.where('id = ? or id = ? or id =?',3,7, 9)).size >0) %>
<p class="font_description">
<% options = {:author => true, :deletable => attach_delete(homework)} %>
<%= render :partial => 'attachments/links',
:locals => {:attachments => homework.attachments, :options => options} %>
</p>
<% end %>
</td>
</tr>
</table>
</td>
</tr>
</table>
<div class="line_under"></div>
<% end %>
<% end %>