From 2b9489fb49b8a66e16ece5470cacb9ae314556c3 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 28 Feb 2017 19:39:41 +0100 Subject: UI: explicitly remind the current pinned search above the result table (refs #3485) --- ishtar_common/templates/blocks/JQueryJqGrid.html | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'ishtar_common/templates') diff --git a/ishtar_common/templates/blocks/JQueryJqGrid.html b/ishtar_common/templates/blocks/JQueryJqGrid.html index 607f81f7d..258082877 100644 --- a/ishtar_common/templates/blocks/JQueryJqGrid.html +++ b/ishtar_common/templates/blocks/JQueryJqGrid.html @@ -8,6 +8,12 @@

{% trans "Search and select an item" %}

+
+   + {% trans "Pinned search:" %} + +
+
@@ -97,6 +103,19 @@ jQuery(document).ready(function(){ jsonReader : {repeatitems: false}, loadError: function (jqXHR, textStatus, errorThrown) { alert("{% trans "An error as occured during search. Check your query fields." %}"); + }, + beforeProcessing: function(data, status, xhr){ + $('#pinned_search_content_{{name}}').html(''); + for (idx in data){ + if (idx == 'pinned-search' && data[idx] != ''){ + $('#pinned_search_content_{{name}}').html(data[idx]); + } + } + if ($('#pinned_search_content_{{name}}').html()){ + $('#pinned_search_{{name}}').show(); + } else { + $('#pinned_search_{{name}}').hide(); + } } }); {% if multiple %} -- cgit v1.2.3