From 223dc1698f559cc43112aef4547c02b5b5f6cfb0 Mon Sep 17 00:00:00 2001 From: mathieu Date: Thu, 19 May 2016 10:58:13 +0200 Subject: [PATCH] Fix autocomplete location + move scripts from mediaitem_list.html to mediaitem_list.js --- telemeta/static/telemeta/js/mediaitem_list.js | 25 +++++++++++++++++ .../search/indexes/telemeta/location_text.txt | 2 +- .../indexes/telemeta/locationalias_text.txt | 2 +- .../templates/telemeta/mediaitem_list.html | 28 +------------------ 4 files changed, 28 insertions(+), 29 deletions(-) create mode 100644 telemeta/static/telemeta/js/mediaitem_list.js diff --git a/telemeta/static/telemeta/js/mediaitem_list.js b/telemeta/static/telemeta/js/mediaitem_list.js new file mode 100644 index 00000000..62e1357e --- /dev/null +++ b/telemeta/static/telemeta/js/mediaitem_list.js @@ -0,0 +1,25 @@ +/** + * Created by crem on 19/05/16. + */ +$(function () { + $("#results-per-page").selectmenu({ + icons: {button: "ui-icon-carat-2-n-s"}, + change: function () { + location.search = '?page=1&results_page=' + $(this).val(); + } + }).selectmenu("menuWidget").addClass("overflow"); + + $("#selectAll").click(function () { + if (this.checked) { + $(".check1").each(function () { + this.checked = true; + }); + } + else { + $(".check1").each(function () { + this.checked = false; + }); + } + }); + +}); \ No newline at end of file diff --git a/telemeta/templates/search/indexes/telemeta/location_text.txt b/telemeta/templates/search/indexes/telemeta/location_text.txt index 28701c17..038e4c54 100644 --- a/telemeta/templates/search/indexes/telemeta/location_text.txt +++ b/telemeta/templates/search/indexes/telemeta/location_text.txt @@ -1 +1 @@ -{{ object.name }} \ No newline at end of file +{{ object.name|safe }} \ No newline at end of file diff --git a/telemeta/templates/search/indexes/telemeta/locationalias_text.txt b/telemeta/templates/search/indexes/telemeta/locationalias_text.txt index fb2c54be..d6270a96 100644 --- a/telemeta/templates/search/indexes/telemeta/locationalias_text.txt +++ b/telemeta/templates/search/indexes/telemeta/locationalias_text.txt @@ -1 +1 @@ -{{ object.alias }} \ No newline at end of file +{{ object.alias|safe }} \ No newline at end of file diff --git a/telemeta/templates/telemeta/mediaitem_list.html b/telemeta/templates/telemeta/mediaitem_list.html index 4afb0806..8490662a 100644 --- a/telemeta/templates/telemeta/mediaitem_list.html +++ b/telemeta/templates/telemeta/mediaitem_list.html @@ -71,32 +71,6 @@ {% block extra_javascript %} - - + {% endblock %} \ No newline at end of file -- 2.39.5