ucb_rails 0.0.12 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,7 +11,9 @@ module UcbRails::LpsTypeaheadHelper
|
|
11
11
|
# @option options [String] :result_link_text ('Select') the text of the link button in search results
|
12
12
|
# @option options [String] :result_link_class ('lps-typeahead-item') class to be added the the results link
|
13
13
|
# @option options [String] :uid_dom_id ('uid') the dom-id of the (hidden) uid <input>
|
14
|
-
# @option options [String] :
|
14
|
+
# @option options [String] :typeahead_url ('/ucb_rails/admin/users/typeahead_search') the typeahead url
|
15
|
+
# @option options [String] :ldap_search_url ('/ucb_rails/ldap_person_search/) the ldap search rul
|
16
|
+
# @option options [Boolean] :ldap_search (true) include the icon/markup for ldap searches
|
15
17
|
def lps_typeahead_search_field(options={})
|
16
18
|
UcbRails::Renderer::LpsTypeaheadSearchField.new(self, options).html
|
17
19
|
end
|
@@ -3,7 +3,7 @@ module UcbRails
|
|
3
3
|
|
4
4
|
class LpsTypeaheadSearchField < Base
|
5
5
|
|
6
|
-
attr_accessor :name, :label, :required, :value, :placeholder, :hint, :result_link_text, :result_link_class, :uid_dom_id, :typeahead_url, :ldap_search_url
|
6
|
+
attr_accessor :name, :label, :required, :value, :placeholder, :hint, :result_link_text, :result_link_class, :uid_dom_id, :typeahead_url, :ldap_search_url, :ldap_search
|
7
7
|
|
8
8
|
def initialize(template, options={})
|
9
9
|
super
|
@@ -14,11 +14,8 @@ module UcbRails
|
|
14
14
|
content_tag(:div, class: 'control-group lps-typeahead') do
|
15
15
|
label_html +
|
16
16
|
content_tag(:div, class: 'controls') do
|
17
|
-
|
18
|
-
|
19
|
-
span_html
|
20
|
-
end +
|
21
|
-
content_tag(:p, hint, class: 'help-block')
|
17
|
+
inputs +
|
18
|
+
hint_html
|
22
19
|
end
|
23
20
|
end
|
24
21
|
end
|
@@ -35,7 +32,27 @@ module UcbRails
|
|
35
32
|
label
|
36
33
|
end
|
37
34
|
end
|
38
|
-
|
35
|
+
|
36
|
+
def inputs
|
37
|
+
if ldap_search
|
38
|
+
input_append_div
|
39
|
+
else
|
40
|
+
text_field_html
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
def hint_html
|
45
|
+
if ldap_search
|
46
|
+
content_tag(:p, hint, class: 'help-block')
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
def input_append_div
|
51
|
+
content_tag(:div, class: 'input-append') do
|
52
|
+
text_field_html + span_html
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
39
56
|
def text_field_html
|
40
57
|
text_field_tag(name, value, {
|
41
58
|
autocomplete: 'off',
|
@@ -75,6 +92,7 @@ module UcbRails
|
|
75
92
|
self.uid_dom_id = options.delete(:uid_dom_id) || 'uid'
|
76
93
|
self.typeahead_url = options.delete(:typeahead_url) || typeahead_search_ucb_rails_admin_users_path
|
77
94
|
self.ldap_search_url = options.delete(:ldap_search_url) || ldap_search_ucb_rails_admin_users_path
|
95
|
+
self.ldap_search = options.delete(:ldap_search) != false
|
78
96
|
|
79
97
|
validate_options
|
80
98
|
end
|
@@ -83,7 +101,7 @@ module UcbRails
|
|
83
101
|
return if options.blank?
|
84
102
|
|
85
103
|
msg = "Unknown lps_typeahead_search_field option(s): #{options.keys.map(&:inspect).join(', ')}. "
|
86
|
-
msg << "Did you mean one of :name, :required, :label, :value, :placeholder, :hint, :result_link_text, :result_link_class, :uid_dom_id, :
|
104
|
+
msg << "Did you mean one of :name, :required, :label, :value, :placeholder, :hint, :ldap_search, :ldap_search_url, :result_link_text, :result_link_class, :uid_dom_id, :typeahead_url"
|
87
105
|
raise ArgumentError, msg
|
88
106
|
end
|
89
107
|
|
data/lib/ucb_rails/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ucb_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.13
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-07-
|
12
|
+
date: 2013-07-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|