diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 2aaf9a3..fae3f0e 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1337,4 +1337,53 @@ module ApplicationHelper _("Are you sure that you want to remove the item \"#{article.name}\"?") end end + + def token_input_field_tag(name, element_id, search_action, options = {}, text_field_options = {}, html_options = {}) + options[:min_chars] ||= 3 + options[:hint_text] ||= _("Type in a search term") + options[:no_results_text] ||= _("No results") + options[:searching_text] ||= _("Searching...") + options[:search_delay] ||= 1000 + options[:prevent_duplicates] ||= true + options[:backspace_delete_item] ||= false + options[:focus] ||= false + options[:avoid_enter] ||= true + options[:on_result] ||= 'null' + options[:on_add] ||= 'null' + options[:on_delete] ||= 'null' + options[:on_ready] ||= 'null' + + result = text_field_tag(name, nil, text_field_options.merge(html_options.merge({:id => element_id}))) + result += + " + " + result + end + end -- libgit2 0.21.2