2015-04-14 10:23:49 +08:00
|
|
|
<%= error_messages_for 'member' %>
|
|
|
|
<%
|
|
|
|
roles = Role.givable.all
|
|
|
|
if @project.project_type == Project::ProjectType_course
|
|
|
|
roles = roles[3..5]
|
|
|
|
else
|
|
|
|
roles = roles[0..2]
|
|
|
|
end
|
|
|
|
members = @project.member_principals.includes(:roles, :principal).all.sort
|
|
|
|
%>
|
|
|
|
|
2015-04-11 16:17:36 +08:00
|
|
|
<div class="members_left">
|
2015-04-14 10:23:49 +08:00
|
|
|
<% if members.any? %>
|
2015-04-11 16:17:36 +08:00
|
|
|
<ul style=" border-bottom:none;">
|
2015-04-14 10:23:49 +08:00
|
|
|
<li><span class="w90 f_b" ><%= l(:label_user) %></span><span class="w210 f_b"><%= l(:label_role_plural) %></span><span></span></li>
|
|
|
|
<%= call_hook(:view_projects_settings_members_table_header, :project => @project) %>
|
|
|
|
<% members.each do |member| %>
|
|
|
|
<li >
|
|
|
|
<%= link_to_user_header member.principal,false,:class => "w150 c_orange fl" %>
|
|
|
|
<span class="w150 fl">
|
|
|
|
<%= h member.roles.sort.collect(&:to_s).join(', ') %>
|
|
|
|
<%= 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| %>
|
|
|
|
<ul style="text-align: left;" class="ml20">
|
|
|
|
<%= 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? } %>
|
|
|
|
<label ><%= h role %></label>
|
|
|
|
</ul>
|
|
|
|
<!--<br/>-->
|
|
|
|
<% end %>
|
|
|
|
<%= hidden_field_tag 'membership[role_ids][]', '' %>
|
|
|
|
<div class="ml20">
|
|
|
|
<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 ml15 fl" onclick="$('#member-<%= member.id%>-roles-form').show();$(this).parent().height(110);">编辑</a>
|
|
|
|
<%= delete_link membership_path(member),
|
|
|
|
:remote => true,
|
|
|
|
:class => "c_dblue ml30 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%>
|
|
|
|
</li>
|
|
|
|
<% end%>
|
|
|
|
</li>
|
2015-04-11 16:17:36 +08:00
|
|
|
|
|
|
|
</ul>
|
2015-04-14 10:23:49 +08:00
|
|
|
<% else %>
|
|
|
|
<p class="nodata"><%= l(:label_no_data) %></p>
|
|
|
|
<% end %>
|
2015-04-11 16:17:36 +08:00
|
|
|
</div><!-- 左边-->
|
|
|
|
|
|
|
|
<div class="members_right">
|
|
|
|
<div class="members_jion">
|
|
|
|
<p class="c_blue mb10 fb">+申请加入</p>
|
|
|
|
<ul class="mb10">
|
|
|
|
<li><input name="membership[user_ids][]" type="checkbox" value="3172"> <a href="/users/3172" class="c_blue">JackWu (巫 荣杰)</a></li>
|
|
|
|
<li><input name="membership[user_ids][]" type="checkbox" value="3172"> <a href="/users/3172" class="c_blue">JackWu (巫 荣杰)</a></li>
|
|
|
|
<li><input name="membership[user_ids][]" type="checkbox" value="3172"> <a href="/users/3172" class="c_blue">JackWu (巫 荣杰)</a></li>
|
|
|
|
</ul>
|
|
|
|
<ul class="mb10">
|
|
|
|
<li>角色:</li>
|
|
|
|
<li><input type="checkbox" /><label>Manager</label></li>
|
|
|
|
<li><input type="checkbox" /><label>Developer</label></li>
|
|
|
|
<li><input type="checkbox" /><label>Reporter</label></li>
|
|
|
|
</ul>
|
|
|
|
<div class="cl"></div>
|
|
|
|
<a href="javascript:void(0)" class="blue_btn fl" >批准</a><a href="javascript:void(0)" class="grey_btn fl ml10" >拒绝</a>
|
|
|
|
|
|
|
|
</div><!--members_jion end-->
|
|
|
|
<div class="cl"></div>
|
|
|
|
<div class="members_add">
|
|
|
|
<p class="c_blue fb mt10 mb5">添加成员</p>
|
|
|
|
<div class="member_search">
|
|
|
|
<input class="member_search_input fl" type="text" name="" value="输入用户名称搜索好友"><a class="invi_search_btn fl c_white" >搜索</a>
|
|
|
|
<div class="cl"></div>
|
|
|
|
<ul class="mb5">
|
|
|
|
<li><input type="checkbox" name="" checked=""> <label >suntao</label> </li>
|
|
|
|
<li><input type="checkbox" name="" > <label >suntaoalibb</label> </li>
|
|
|
|
<li><input type="checkbox" name="" > <label >用户名称</label> </li>
|
|
|
|
<li><input type="checkbox" name="" > <label >suntao</label> </li>
|
|
|
|
<li><input type="checkbox" name="" checked=""> <label >suntao</label> </li>
|
|
|
|
<li><input type="checkbox" name="" > <label >suntaoalibb</label> </li>
|
|
|
|
<li><input type="checkbox" name="" > <label >用户名称</label> </li>
|
|
|
|
<li><input type="checkbox" name="" > <label >suntao</label> </li>
|
|
|
|
<li><input type="checkbox" name="" > <label >用户名称</label> </li>
|
|
|
|
<li><input type="checkbox" name="" > <label >suntao</label> </li>
|
|
|
|
</ul>
|
|
|
|
<div class="cl"></div>
|
|
|
|
<ul class="wlist mr40" >
|
|
|
|
<li><a href="javascript:void(0)">下一页</a></li>
|
|
|
|
<li><a href="javascript:void(0)">...</a></li>
|
|
|
|
<li><a href="javascript:void(0)">2</a></li>
|
|
|
|
<li class="wlist_select" ><a href="javascript:void(0)">1</a></li>
|
|
|
|
<li><a href="javascript:void(0)">上一页</a></li>
|
|
|
|
</ul>
|
|
|
|
<div class="cl"></div>
|
|
|
|
<ul class="rolebox mb10 mt10">
|
|
|
|
<li class="fb">角色: </li>
|
|
|
|
<li ><input class="fl" type="checkbox" name="" checked=""> <label >TeachingAsistant</label> </li>
|
|
|
|
<li ><input type="checkbox" name="" > <label >Teacher</label> </li>
|
|
|
|
<li ><input type="checkbox" name="" > <label >Student</label> </li>
|
|
|
|
</ul>
|
|
|
|
<div class="cl"></div>
|
|
|
|
<a href="javascript:void(0)" class=" blue_btn">新增成员</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div><!-- 右边 end-->
|