2015-03-30 11:20:16 +08:00
|
|
|
<% @members.each do |member| %>
|
|
|
|
<li >
|
2015-04-09 14:29:35 +08:00
|
|
|
<%= link_to_user_header member.principal,true,:class => "w150 c_orange fl" %>
|
2015-03-30 11:20:16 +08:00
|
|
|
<span class="w150 fl">
|
2015-05-08 09:37:57 +08:00
|
|
|
<%= zh_course_role(h member.roles.sort.collect(&:to_s).join(', ')) %>
|
2015-03-30 15:57:10 +08:00
|
|
|
<%= form_for(member, {:as => :membership, :remote => true, :url => membership_path(member),
|
|
|
|
:method => :put,
|
|
|
|
:html => {:id => "member-#{member.id}-roles-form", :class => 'hol'}}
|
|
|
|
) do |f| %>
|
|
|
|
<% @roles.each do |role| %>
|
2015-05-08 09:37:57 +08:00
|
|
|
<ul style="text-align: left;" class="ml45">
|
2015-03-30 15:57:10 +08:00
|
|
|
<%= radio_button_tag 'membership[role_ids][]', role.id, member.roles.include?(role),
|
|
|
|
:disabled => member.member_roles.detect { |mr| mr.role_id == role.id && !mr.inherited_from.nil? } %>
|
2015-05-08 09:37:57 +08:00
|
|
|
<label ><%= zh_course_role(h role) %></label>
|
2015-03-30 15:57:10 +08:00
|
|
|
</ul>
|
|
|
|
<!--<br/>-->
|
|
|
|
<% end %>
|
|
|
|
<%= hidden_field_tag 'membership[role_ids][]', '' %>
|
2015-05-08 09:37:57 +08:00
|
|
|
<div class="ml45">
|
2015-03-30 15:57:10 +08:00
|
|
|
<a href="javascript:void(0)" class="member_btn" onclick="$('#member-<%= member.id%>-roles-form').submit();" style="margin-right: 10px;">
|
|
|
|
<%= l(:button_change)%>
|
|
|
|
</a>
|
|
|
|
<a href="javascript:void(0)" class="member_btn" onclick="$('#member-<%= member.id%>-roles-form').hide();$(this).parent().parent().parent().parent().height(30)">
|
|
|
|
<%= l(:button_cancel)%>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
</span>
|
|
|
|
<% unless member.roles.first.to_s == "Manager"%>
|
|
|
|
<a href="javascript:void(0) " class="c_dblue w40 fl" onclick="$('#member-<%= member.id%>-roles-form').show();$(this).parent().height(110);">编辑</a>
|
|
|
|
<%= delete_link membership_path(member),
|
|
|
|
:remote => true,
|
|
|
|
:class => "c_dblue w40 fl",
|
|
|
|
:data => (!User.current.admin? && member.include?(User.current) ? {:confirm => l(:text_own_membership_delete_confirmation)} : {confirm: l(:label_delete_confirm)}) if member.deletable? %>
|
|
|
|
<% end%>
|
2015-03-30 11:20:16 +08:00
|
|
|
</li>
|
|
|
|
<% end%>
|