2015-03-07 10:52:20 +08:00
|
|
|
<div class="project_r_h">
|
|
|
|
<h2 class="project_h2">邀请加入</h2>
|
|
|
|
</div>
|
|
|
|
<%= 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
|
|
|
|
%>
|
|
|
|
|
|
|
|
<div style="margin-left: 30px" >
|
|
|
|
<div class="floatbox" style="margin:100px;">
|
|
|
|
<div ><a href="#" class="box_close"></a></div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
<div class="box_main">
|
|
|
|
<h3 class="box_h3">邀请Trustie注册用户</h3>
|
|
|
|
<% if roles.any? %>
|
|
|
|
<%= form_for(@member, {:as => :membership, :url => project_memberships_path(@project), :remote => true, :method => :post}) do |f| %>
|
|
|
|
|
|
|
|
<div class="invi_search">
|
|
|
|
<%= label_tag "principal_search", l(:label_principal_search) %>
|
|
|
|
<%= text_field_tag 'principal_search', nil %>
|
|
|
|
<%= javascript_tag "observeSearchfield('principal_search', null, '#{ escape_javascript autocomplete_project_memberships_path(@project, :format => 'js') }')" %>
|
|
|
|
|
|
|
|
<div id="principals_for_new_member">
|
|
|
|
<%= render_principals_for_new_members(@project) %>
|
|
|
|
</div>
|
|
|
|
<p style="padding-top: 5px">
|
|
|
|
<%= l(:label_role_plural) %>:
|
|
|
|
<% roles.each do |role| %>
|
|
|
|
<label>
|
|
|
|
<%= check_box_tag 'membership[role_ids][]', role.id %>
|
|
|
|
<%= h role %>
|
|
|
|
</label>
|
|
|
|
<% end %>
|
|
|
|
</p>
|
|
|
|
<p>
|
2015-03-07 15:32:50 +08:00
|
|
|
<%= submit_tag l(:label_invite_members), :id => 'member-add-submit', :style => 'display:block; width:80px; text-align:center; color:#fff; height:26px; padding-top:3px; margin-bottom:10px;' %>
|
2015-03-07 10:52:20 +08:00
|
|
|
</p>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<script type="text/javascript">
|
|
|
|
$(document).ready(function () {
|
|
|
|
var collection=$("#principals_for_new_member").children("#principals").children("label");
|
|
|
|
collection.css("text-overflow","ellipsis");
|
|
|
|
collection.css("white-space","nowrap");
|
|
|
|
collection.css("width","200px");
|
|
|
|
collection.css("overflow","hidden");
|
|
|
|
for(i=0;i<collection.length;i++){ //增加悬浮显示
|
|
|
|
var label=collection[i];
|
|
|
|
var text=$(label).text();
|
|
|
|
$(label).attr("title",text);
|
|
|
|
}
|
|
|
|
});
|
2015-03-07 09:32:27 +08:00
|
|
|
</script>
|