项目配置,成员界面,点击操作-编辑按钮,角色出现下拉列表框
This commit is contained in:
parent
daf0263be9
commit
7499f4659d
|
@ -33,6 +33,7 @@
|
||||||
<th><%= i += 1 %></th>
|
<th><%= i += 1 %></th>
|
||||||
<th> <%= link_to_user_header member.principal, true %></th>
|
<th> <%= link_to_user_header member.principal, true %></th>
|
||||||
<th>
|
<th>
|
||||||
|
|
||||||
<% if User.current.language == "zh" %>
|
<% if User.current.language == "zh" %>
|
||||||
<% zh_roles = [] %>
|
<% zh_roles = [] %>
|
||||||
<% member.roles.each do |role| %>
|
<% member.roles.each do |role| %>
|
||||||
|
@ -45,13 +46,23 @@
|
||||||
end
|
end
|
||||||
%>
|
%>
|
||||||
<% end %>
|
<% end %>
|
||||||
<%= h zh_roles.sort.reverse.collect(&:to_s).join(', ') %>
|
<label style="text-align:center;" id="members_<%= member.id %>_role_show"><%= h zh_roles.sort.reverse.collect(&:to_s).join(', ') %></label>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= h member.roles.sort.collect(&:to_s).join(', ') %>
|
<label style="text-align:center;" id="members_<%= member.id %>_role_show"> <%= h member.roles.sort.collect(&:to_s).join(', ') %></label>
|
||||||
<% end %></th>
|
<% end %>
|
||||||
|
<%= form_for(member, {:as => :membership, :remote => true, :url => membership_path(member),
|
||||||
|
:method => :put,
|
||||||
|
:html => {:id => "members-#{member.id}-roles-form", :class => 'undis'}}
|
||||||
|
) do |f| %>
|
||||||
|
<%= select( :membership, :roles, [["管理人员",3],["开发人员",4],["报告人员",5]],
|
||||||
|
{ :include_blank => false, :selected => member.roles[0].id ? member.roles[0].id : 0 },
|
||||||
|
{ :onchange=>"remote_function('#members-#{member.id}-roles-form');", :id =>"membership[role_ids][]", :name => "membership[role_ids][]", :style => "border:1px solid #e5e5e5;"}) %>
|
||||||
|
|
||||||
|
<% end %>
|
||||||
|
</th>
|
||||||
<th>
|
<th>
|
||||||
<% unless member.user_id == @project.user_id %>
|
<% unless member.user_id == @project.user_id %>
|
||||||
<a href="javascript:void(0);" class=" sy_btn_blue mr5 ">编辑</a>
|
<a href="javascript:void(0);" class=" sy_btn_blue mr5 " onclick="$('#members-<%= member.id%>-roles-form').show();$('#members_<%= member.id %>_role_show').hide();">编辑</a>
|
||||||
<%= delete_link membership_path(member),
|
<%= delete_link membership_path(member),
|
||||||
:remote => true,
|
:remote => true,
|
||||||
:class => "sy_btn_grey mr5",
|
:class => "sy_btn_grey mr5",
|
||||||
|
@ -279,4 +290,7 @@
|
||||||
function add_members_submit(){
|
function add_members_submit(){
|
||||||
$("#new_membership").submit();
|
$("#new_membership").submit();
|
||||||
}
|
}
|
||||||
|
function remote_function(id) {
|
||||||
|
$(id).submit();
|
||||||
|
}
|
||||||
</script>
|
</script>
|
Loading…
Reference in New Issue