bigdir/app/views/homework_attach/_homework_member.html.erb

45 lines
2.2 KiB
Plaintext

<%= error_messages_for 'member' %>
<div style="float:left; width:60%;padding-left: 10px;padding-right: 10px"
xmlns="http://www.w3.org/1999/html" id = "homework_of_users">
<table class="list members" style="width: 100%">
<thead>
<tr>
<th><%= l(:label_user) %></th>
<th><%= l(:label_role_plural) %></th>
<th style="width:10%"></th>
</tr>
</thead>
<tbody>
<!-- 发布人员不能被删除,将发布人员放在第一位 -->
<tr id="member-<%= homework.user.id %>" class="<%= cycle 'odd', 'even' %> member" style="text-align: center">
<td style="width: 40%"><%= link_to_user homework.user %></td>
<td style="text-align: center;width: 50%"> 发布人员 </td>
<td></td>
</tr>
<% hoemwork_users.each do |user| %>
<tr id="member-<%= user.id %>" class="<%= cycle 'odd', 'even' %> member" style="text-align: center">
<% if homework.user != user %>
<td style="width: 40%"><%= link_to_user user %></td>
<td style="text-align: center;width: 50%"> 参与人员 </td>
<td><%= link_to l(:button_delete),destory_homework_users_homework_attach_path(:user_id=>user),:remote => true, :method => :post %></td>
<% end %>
</tr>
<% end %>
</tbody>
</table>
</div>
<div class="splitcontentright" style="width: 37%">
<%= form_for(hoemwork_users, {:url => add_homework_users_homework_attach_path(homework), :remote => true, :method => :post}) do |f| %>
<fieldset>
<legend><%= l(:label_member_new) %></legend>
<p><%= label_tag "principal_search", l(:label_principal_search) %><%= text_field_tag 'principal_search', nil %></p>
<%= javascript_tag "observeSearchfield('principal_search', null, '#{ escape_javascript get_homework_member_list_homework_attach_index_path(:q => params[:q], :bid_id => params[:id]||homework, :format => 'js') }')" %>
<div id="principals_for_new_member">
<%= render_new_members_for_homework(members) %>
</div>
<p><%= submit_tag l(:button_add), :id => 'member-add-submit' %></p>
</fieldset>
<% end %>
</div>