子域名添加成员问题
This commit is contained in:
parent
6cca44df98
commit
5ee6c9e5d3
|
@ -3087,6 +3087,10 @@ def host_with_protocol
|
|||
return Setting.protocol + "://" + Setting.host_name
|
||||
end
|
||||
|
||||
def secdomain_with_protocol secdomain
|
||||
return Setting.protocol + "://" + secdomain + ".trustie.net"
|
||||
end
|
||||
|
||||
|
||||
#获取回复的所有父节点
|
||||
def get_reply_parents parents_rely, comment
|
||||
|
|
|
@ -30,4 +30,8 @@ class Organization < ActiveRecord::Base
|
|||
def allow_set_teachers
|
||||
self.allow_teacher.to_i == 1 ? true : false
|
||||
end
|
||||
|
||||
def secdomain
|
||||
Secdomain.where("sub_type=2 and pid=?", self.id).first.try(:subname)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -109,9 +109,14 @@
|
|||
<div class="fr orgMemContainer">
|
||||
<div class="orgMemberAdd">
|
||||
<p class="fontBlue fb mb5">添加成员</p>
|
||||
<%= form_tag url_for(:controller => 'org_member',:action => 'create',:org=>@organization),:id=>'org_member_add_form',:remote=>true do |f|%>
|
||||
<%= form_tag url_for(:controller => 'org_member', :action => 'create', :org => @organization),:id=>'org_member_add_form',:remote=>true do |f|%>
|
||||
<input type="text" id="not_org_member_search" name="orgAddSearch" placeholder="支持姓名、邮箱、登录名搜索" class="orgAddSearch mb20" />
|
||||
<%= javascript_tag "observeSearchfield('not_org_member_search', null, '#{ escape_javascript host_with_protocol + "/org_member/org_member_autocomplete?" + {:org=> @organization.id}.to_query }')" %>
|
||||
<% if @organization.secdomain.nil? %>
|
||||
<%= javascript_tag "observeSearchfield('not_org_member_search', null, '#{ escape_javascript host_with_protocol + "/org_member/org_member_autocomplete?" + {:org=> @organization.id}.to_query }')" %>
|
||||
<% else %>
|
||||
<%= javascript_tag "observeSearchfield('not_org_member_search', null, '#{ escape_javascript secdomain_with_protocol(@organization.secdomain) + "/org_member/org_member_autocomplete?" + {:org=> @organization.id}.to_query }')" %>
|
||||
<% end %>
|
||||
|
||||
<div id="principals_for_new_member">
|
||||
<%= find_user_not_in_current_org_by_name(@project) %>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue