Self hosted FLOSS fitness/workout, nutrition and weight tracker
Give feedback if autocompleter didn't return results
Roland Geiderdc49cc6f32d1
diff --git a/docs/changelog.rst b/docs/changelog.rstindex 3466ad60b..76cfc9e02 100644--- a/docs/changelog.rst+++ b/docs/changelog.rst@@ -32,6 +32,7 @@ New features:Improvements:+* Give feedback when autocompleter didn't find any results `#293`_* The dashboard page was improved and made more user friendly `#201`_ (partly)* Replace jquery UI's autocompleter and sortable this reduces size of JS and CSS `#78`_ and `#79`_* Remove hard-coded CC licence from documentation and website `#247`_@@ -55,6 +56,7 @@ Other improvements and bugfixes: `#243`_, `#279`_, `#275`_, `#270`_, `#258`_, `#.. _#275: https://github.com/wger-project/wger/issues/275.. _#279: https://github.com/wger-project/wger/issues/279.. _#282: https://github.com/wger-project/wger/issues/282+.. _#293: https://github.com/wger-project/wger/issues/293.. _#296: https://github.com/wger-project/wger/issues/296.. _#297: https://github.com/wger-project/wger/issues/297.. _#303: https://github.com/wger-project/wger/issues/303diff --git a/wger/core/static/js/wger-core.js b/wger/core/static/js/wger-core.jsindex 467710b33..6974a40e8 100644--- a/wger/core/static/js/wger-core.js+++ b/wger/core/static/js/wger-core.js@@ -482,6 +482,7 @@ function init_edit_set() {// Initialise the autocompleter (our widget, defined above)$('#exercise-search').devbridgeAutocomplete({serviceUrl: '/api/v2/exercise/search/?language=' + get_current_language(),+ showNoSuggestionNotice: true,onSelect: function (suggestion) {// Add the exercise to the listadd_exercise({id: suggestion.data.id,diff --git a/wger/exercises/templates/equipment/overview.html b/wger/exercises/templates/equipment/overview.htmlindex 438a462b6..a0cb77e6e 100644--- a/wger/exercises/templates/equipment/overview.html+++ b/wger/exercises/templates/equipment/overview.html@@ -16,6 +16,7 @@$(function() {// Init the autocompleter$('#exercise-search').devbridgeAutocomplete({+ showNoSuggestionNotice: true,serviceUrl: '{% url 'exercise-search' %}',onSelect: function (suggestion) {window.location.href = '/exercise/' + suggestion.data.id + '/view/'diff --git a/wger/exercises/templates/exercise/overview.html b/wger/exercises/templates/exercise/overview.htmlindex 1ffa87da4..015c223f5 100644--- a/wger/exercises/templates/exercise/overview.html+++ b/wger/exercises/templates/exercise/overview.html@@ -18,6 +18,7 @@ $(document).ready(function() {// Init the autocompleter$('#exercise-search').devbridgeAutocomplete({+ showNoSuggestionNotice: true,serviceUrl: '{% url 'exercise-search' %}',onSelect: function (suggestion) {window.location.href = '/exercise/' + suggestion.data.id + '/view/'diff --git a/wger/exercises/templates/mobile/exercise/overview.html b/wger/exercises/templates/mobile/exercise/overview.htmlindex 72a67174e..b78390f06 100644--- a/wger/exercises/templates/mobile/exercise/overview.html+++ b/wger/exercises/templates/mobile/exercise/overview.html@@ -15,6 +15,7 @@$(document).ready(function() {// Init the autocompleter$('#exercise-search').devbridgeAutocomplete({+ showNoSuggestionNotice: true,serviceUrl: '{% url 'exercise-search' %}',onSelect: function (suggestion) {window.location.href = '/exercise/' + suggestion.data.id + '/view/'