Merge branch 'hjq_beidou' of https://git.trustie.net/jacknudt/trustieforge into hjq_beidou

This commit is contained in:
Tim 2016-05-17 09:00:40 +08:00
commit e9a3bc5094
3 changed files with 15 additions and 2 deletions

View File

@ -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

View File

@ -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

View File

@ -111,7 +111,12 @@
<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|%>
<input type="text" id="not_org_member_search" name="orgAddSearch" placeholder="支持姓名、邮箱、登录名搜索" class="orgAddSearch mb20" />
<% 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>