diff --git a/app/assets/javascripts/rails_admin/ra.filtering-multiselect.js b/app/assets/javascripts/rails_admin/ra.filtering-multiselect.js index 672de48a83..6407a09ebe 100644 --- a/app/assets/javascripts/rails_admin/ra.filtering-multiselect.js +++ b/app/assets/javascripts/rails_admin/ra.filtering-multiselect.js @@ -24,8 +24,7 @@ chooseAll: "Choose all", chosen: "Chosen records", clearAll: "Clear all", - remove: "Remove", - selectChoice: "Select your choice(s) and click" + remove: "Remove" }, searchDelay: 400, remote_source: null, @@ -101,6 +100,13 @@ this.selection.wrap('
'); this.element.css({display: "none"}); + + this.tooManyObjectsPlaceholder = $('').attr('value', matches[i].id).attr('title', matches[i].label).text(matches[i].label) ); } + } else { + widget.collection.html(widget.noObjectsPlaceholder); } }); }, @@ -209,10 +223,11 @@ matches.push({id: i, label: this._cache[i]}); } } + success.apply(this, [matches]); + } else { + this.collection.html(this.tooManyObjectsPlaceholder); } - success.apply(this, [matches]); - } else { if (this.options.xhr) { diff --git a/app/assets/javascripts/rails_admin/ra.i18n.coffee b/app/assets/javascripts/rails_admin/ra.i18n.coffee index 98589d6992..a14ab18594 100644 --- a/app/assets/javascripts/rails_admin/ra.i18n.coffee +++ b/app/assets/javascripts/rails_admin/ra.i18n.coffee @@ -2,5 +2,5 @@ class @RailsAdmin @RailsAdmin.I18n = class Locale @init: (@locale)-> @t:(key) -> - humanize = key.charAt(0).toUpperCase() + key.replace("_", " ").slice(1) + humanize = key.charAt(0).toUpperCase() + key.replace(/_/g, " ").slice(1) @locale[key] || humanize diff --git a/config/locales/rails_admin.en.yml b/config/locales/rails_admin.en.yml index 10b6464e07..ea803803cd 100644 --- a/config/locales/rails_admin.en.yml +++ b/config/locales/rails_admin.en.yml @@ -16,6 +16,8 @@ en: is_exactly: Is exactly starts_with: Starts with ends_with: Ends with + too_many_objects: "Too many objects, use search box above" + no_objects: "No objects found" loading: "Loading..." toggle_navigation: Toggle navigation home: