From: stefan Date: Tue, 2 Nov 2010 01:54:17 +0000 (+0000) Subject: Improve query UI. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=2c45e63f2b065091f35cf66a1dfb09e71771faf3;p=roundup.git Improve query UI. git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4561 57a73879-2fb5-44c3-a270-3262357dd7e2 --- diff --git a/share/roundup/templates/devel/html/_generic.query.html b/share/roundup/templates/devel/html/_generic.query.html new file mode 100644 index 0000000..e262bf4 --- /dev/null +++ b/share/roundup/templates/devel/html/_generic.query.html @@ -0,0 +1,41 @@ + +

You are not + allowed to view this page.

+ + + +
+ + + + + + + + + + + + + + + + + +
+ + + +
+
+
+
+
+ diff --git a/share/roundup/templates/devel/html/query.html b/share/roundup/templates/devel/html/query.html new file mode 100644 index 0000000..40b6825 --- /dev/null +++ b/share/roundup/templates/devel/html/query.html @@ -0,0 +1,27 @@ + + + + + x + + + + + + + + + + .. + out of + + + + + + diff --git a/share/roundup/templates/devel/html/query.js b/share/roundup/templates/devel/html/query.js new file mode 100644 index 0000000..b1c4594 --- /dev/null +++ b/share/roundup/templates/devel/html/query.js @@ -0,0 +1,40 @@ +var action; + +function display(data) +{ + var list = $("div.list"); + list.empty(); + list.append(data); +} + +// Run a query with a specific starting point and size +function query_start(start, size) +{ + var inputs = $(":input"); + var data = {} + if (start > 0) data['@startwith'] = start + if (size > -1) data['@pagesize'] = size + for (var i = 0; i < inputs.length; i++) + data[inputs[i].name] = inputs[i].value; + jQuery.get(action, data, display); + return false; +} + +// Run a query, starting at the first element +function query() +{ + return query_start(0, -1) +} + +// Deactivate the form's submit action, and instead +// invoke the action as part of (inline) query. +function replace_submit() +{ + var form = $("form"); + action = form.attr("action"); + form.attr("action",""); // reset + form.submit(query); +} + + +$(document).ready(replace_submit); diff --git a/share/roundup/templates/devel/html/search.js b/share/roundup/templates/devel/html/search.js deleted file mode 100644 index 86d4eef..0000000 --- a/share/roundup/templates/devel/html/search.js +++ /dev/null @@ -1,31 +0,0 @@ -// Inspect a form element to construct a 'get' request, -// register it to the 'submit' event, and deactivate the -// form's submit action. -function bind_search() -{ - var form = $("form"); - var action = form.attr("action"); - form.attr("action",""); // reset - - function display(data) - { - var list = $("div.list"); - list.empty(); - list.append(data); - } - - function query() - { - var inputs = $(":input"); - var data = {} - for (var i = 0; i < inputs.length; i++) - data[inputs[i].name] = inputs[i].value; - jQuery.get(action, data, display); - return false; - } - - form.submit(query); -} - - -$(document).ready(bind_search); diff --git a/share/roundup/templates/devel/html/user.help.html b/share/roundup/templates/devel/html/user.help.html index 328d789..a04ee4c 100644 --- a/share/roundup/templates/devel/html/user.help.html +++ b/share/roundup/templates/devel/html/user.help.html @@ -5,7 +5,7 @@ form request/form/form/value; field request/form/property/value"> - - +
@@ -50,7 +49,7 @@ search_select_roles templates/page/macros/search_select_roles; required python:[]; th_label templates/page/macros/th_label; "> - + @@ -85,8 +84,10 @@ - -

Please specify your search parameters!

+ +
+

Please specify your search parameters!

+