组织配置中的添加成员,链接使用https://www形式

This commit is contained in:
ouyangxuhua 2016-03-18 16:35:36 +08:00
parent 5c22b23f3a
commit 84703a3e01
3 changed files with 6 additions and 2 deletions

View File

@ -3044,3 +3044,7 @@ def is_default_field? field
(field.name == 'activity' || field.name == 'course' || field.name == 'project') && field.field_type == 'default'
end
def host_with_protocol
return Setting.protocol + "://" + Setting.host_name
end

View File

@ -9,7 +9,7 @@ module OrgMemberHelper
principals = paginateHelper scope,10
s = content_tag('ul', project_member_check_box_tags_ex('membership[user_ids][]', principals), :class => 'mb5', :id => 'principals')
links = pagination_links_full(@obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true){|text, parameters, options|
link_to text, org_member_autocomplete_org_member_index_path(parameters.merge(:q => params[:q],:flag => true,:org=> org, :format => 'js')), :remote => true
link_to text, host_with_protocol + "/org_member/org_member_autocomplete?" + parameters.merge(:q => params[:q],:flag => true,:org=> org, :format => 'js').to_query, :remote => true
}
s + content_tag('ul', links,:class => 'wlist',:style=>'float:left !important', :id => "org_member_pagination_links" )
end

View File

@ -96,7 +96,7 @@
<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" />
<%= javascript_tag "observeSearchfield('not_org_member_search', null, '#{ escape_javascript org_member_autocomplete_org_member_index_path(:org=>@organization, :format => 'js') }')" %>
<%= javascript_tag "observeSearchfield('not_org_member_search', null, '#{ escape_javascript host_with_protocol + "/org_member/org_member_autocomplete?" + {:org=> @organization.id}.to_query }')" %>
<div id="principals_for_new_member">
<%= find_user_not_in_current_org_by_name(@project) %>
</div>