Module: UcbRails::LdapPersonSearchHelper

Defined in:
app/helpers/ucb_rails/ldap_person_search_helper.rb

Instance Method Summary collapse

Instance Method Details

#ldap_already_include?(uid) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
# File 'app/helpers/ucb_rails/ldap_person_search_helper.rb', line 13

def ldap_already_include?(uid)
  ldap_person_search_existing_uids.include?(uid.to_s)
end

#ldap_entry_class(entry) ⇒ Object



7
8
9
10
11
# File 'app/helpers/ucb_rails/ldap_person_search_helper.rb', line 7

def ldap_entry_class(entry)
  Array['ldap-result'].tap do |result|
    result << 'ldap-result-exists' if ldap_already_include?(entry.uid)
  end
end

#ldap_person_search_existing_uidsObject



17
18
19
# File 'app/helpers/ucb_rails/ldap_person_search_helper.rb', line 17

def ldap_person_search_existing_uids
  @ldap_person_search_existing_uids ||= (@lps_existing_uids || []).map(&:to_s)
end

#link_to_ldap_person_entry(entry) ⇒ Object



3
4
5
# File 'app/helpers/ucb_rails/ldap_person_search_helper.rb', line 3

def link_to_ldap_person_entry(entry)
  UcbRails::Renderer::LdapPersonSearchResultLink.new(self, entry).html
end

#lps_matchesObject



21
22
23
# File 'app/helpers/ucb_rails/ldap_person_search_helper.rb', line 21

def lps_matches
  @lps_entries.size.zero? ? '' : "Matches: #{@lps_entries.size}"
end