Merge branch 'dev_newproject' of https://git.trustie.net/jacknudt/trustieforge into dev_newproject
This commit is contained in:
commit
a3126870a1
|
@ -33,6 +33,7 @@
|
|||
<th><%= i += 1 %></th>
|
||||
<th> <%= link_to_user_header member.principal, true %></th>
|
||||
<th>
|
||||
|
||||
<% if User.current.language == "zh" %>
|
||||
<% zh_roles = [] %>
|
||||
<% member.roles.each do |role| %>
|
||||
|
@ -45,13 +46,23 @@
|
|||
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 %>
|
||||
<%= h member.roles.sort.collect(&:to_s).join(', ') %>
|
||||
<% end %></th>
|
||||
<label style="text-align:center;" id="members_<%= member.id %>_role_show"> <%= h member.roles.sort.collect(&:to_s).join(', ') %></label>
|
||||
<% 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>
|
||||
<% 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),
|
||||
:remote => true,
|
||||
:class => "sy_btn_grey mr5",
|
||||
|
@ -279,4 +290,7 @@
|
|||
function add_members_submit(){
|
||||
$("#new_membership").submit();
|
||||
}
|
||||
function remote_function(id) {
|
||||
$(id).submit();
|
||||
}
|
||||
</script>
|
Loading…
Reference in New Issue