socialforge/app/views/projects/invite_members.html.erb

74 lines
3.0 KiB
Plaintext
Raw Normal View History

<div class="project_r_h">
2015-03-13 17:47:58 +08:00
<h2 class="project_h2"><%= l(:label_invite_join) %></h2>
</div>
<%#= render_flash_messages %>
<%
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;">
2015-03-12 15:46:24 +08:00
<div >
<a href="#" class="box_close"></a>
</div>
<div class="cl"></div>
<div class="box_main">
2015-03-13 17:47:58 +08:00
<h3 class="box_h3"><%= l(:label_invite_trustie_user) %></h3>
<% if roles.any? %>
<%= form_for(@member, {:as => :membership, :url => project_memberships_path(@project), :method => :post}) do |f| %>
2015-03-12 15:46:24 +08:00
<div class="invi_search">
<input hidden="hidden" value="true" name="flag">
2015-03-13 17:47:58 +08:00
<input id="principal_search" class="invi_search_input fl" type="text" placeholder="请输入用户名称来搜索好友">
2015-03-12 15:46:24 +08:00
<%= javascript_tag "observeSearchfield('principal_search', null, '#{ escape_javascript autocomplete_project_memberships_path(@project, :format => 'js',:flag => true) }')" %>
<div class="cl"></div>
2015-03-12 15:46:24 +08:00
<div id="principals_for_new_member">
<%= render_project_members(@project) %>
</div>
<div class="cl"></div>
2015-03-12 15:46:24 +08:00
<ul class="rolebox">
<li class="fl mr5">
<%= l(:label_role_plural) %>:
</li>
<% roles.each do |role| %>
<li class="fl mr5">
<%= check_box_tag 'membership[role_ids][]', role.id %>
<%= h role %>
</li>
<% end %>
</ul>
<div class="cl mb10"></div>
<a href="#" class="btn_free" onclick="$('#new_membership').submit();">
<%= l(:label_invite_members)%>
</a>
</div>
<!--<p>-->
<!--<%#= 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;' %>-->
<!--</p>-->
<% end %>
<% end %>
2015-03-09 11:31:42 +08:00
</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>