socialforge/app/helpers/organizations_helper.rb

20 lines
897 B
Ruby
Raw Normal View History

2015-11-05 17:57:07 +08:00
# encoding: utf-8
module OrganizationsHelper
2015-11-05 17:57:07 +08:00
include ApplicationHelper
def find_user_not_in_current_org_by_name org
if params[:q] && params[:q].lstrip.rstrip != ""
scope = Principal.active.sorted.not_member_of_org(org).like(params[:q])
else
scope = []
end
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
}
s + content_tag('ul', links,:class => 'wlist', :id => "org_member_pagination_links" )
end
2015-01-30 14:11:35 +08:00
end