From df45eab86aef9db943fabb43667f560bfd388f3b Mon Sep 17 00:00:00 2001 From: Egil Moeller Date: Fri, 12 Mar 2010 21:32:38 +0100 Subject: Added a view of the current query to the search page --- trunk/etherpad/src/etherpad/control/tag/tag_control.js | 3 +-- trunk/etherpad/src/templates/tag/tag_search.ejs | 11 +++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'trunk') diff --git a/trunk/etherpad/src/etherpad/control/tag/tag_control.js b/trunk/etherpad/src/etherpad/control/tag/tag_control.js index d902b56..56dd50b 100644 --- a/trunk/etherpad/src/etherpad/control/tag/tag_control.js +++ b/trunk/etherpad/src/etherpad/control/tag/tag_control.js @@ -180,7 +180,7 @@ function onRequest() { var tags = new Array(); var antiTags = new Array(); - if (request.params.query != undefined) { + if (request.params.query != undefined && request.params.query != '') { var query = request.params.query.split(','); for (i = 0; i < query.length; i++) if (query[i][0] == '!') @@ -206,7 +206,6 @@ function onRequest() { for (i = 0; i < matchingPads.length; i++) { matchingPads[i].TAGS = matchingPads[i].TAGS.split('#'); } -log.info({pads:matchingPads}); var isPro = pro_utils.isProDomainRequest(); var userId = padusers.getUserId(); diff --git a/trunk/etherpad/src/templates/tag/tag_search.ejs b/trunk/etherpad/src/templates/tag/tag_search.ejs index 18e88e1..c7a1d4e 100644 --- a/trunk/etherpad/src/templates/tag/tag_search.ejs +++ b/trunk/etherpad/src/templates/tag/tag_search.ejs @@ -87,6 +87,17 @@ limitations under the License. */ %>
+

Current query

+ <% if (tags.length == 0 && antiTags.length == 0) { %> + < No current query; please select some tags below to search for pads > + <% } else { %> + <% for (i = 0; i < tags.length; i++) { %> + <%= tags[i] %> + <% } %> + <% for (i = 0; i < antiTags.length; i++) { %> + !<%= antiTags[i] %> + <% } %> + <% } %>

Refine your query

Search for pads that have a tag

<% for (i = 0; i < newTags.length; i++) { %> -- cgit v1.2.3