From fc27e23f3cc57159b1ee91747591cb0496385489 Mon Sep 17 00:00:00 2001 From: Christopher Lenz Date: Fri, 11 Dec 2009 20:17:40 +0000 Subject: Futon: Allow control over the group and group_level options on reduce views. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@889795 13f79535-47bb-0310-9956-ffa450edef68 --- share/www/database.html | 38 +++++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) (limited to 'share/www/database.html') diff --git a/share/www/database.html b/share/www/database.html index a4dedfcf..64785e14 100644 --- a/share/www/database.html +++ b/share/www/database.html @@ -71,6 +71,7 @@ specific language governing permissions and limitations under the License. // Restore preferences/state $("#documents thead th.key").toggleClass("desc", $.futon.storage.get("desc")); + $("#grouplevel select").val($.futon.storage.get("group_level")); $("#reduce :checkbox")[0].checked = $.futon.storage.get("reduce"); $("#perpage").val($.futon.storage.get("per_page")); @@ -87,12 +88,20 @@ specific language governing permissions and limitations under the License. location.href = "?" + encodeURIComponent(page.db.name) + (viewName ? "/" + viewName : ""); }); - $("#documents thead th.key").click(function() { - $(this).toggleClass("desc"); + $("#documents thead th.key span").click(function() { + $(this).closest("th").toggleClass("desc"); page.updateDocumentListing(); }); + $("#grouplevel select").change(function() { + page.updateDocumentListing(); + $.futon.storage.set("group_level", this.value); + }); $("#reduce :checkbox").click(function() { page.updateDocumentListing(); + var cb = this; + $("#grouplevel").toggleClass("disabled", !cb.checked).find("select").each(function() { + this.disabled = !cb.checked; + }); $.futon.storage.set("reduce", this.checked); }); $("#perpage").change(function() { @@ -188,7 +197,24 @@ specific language governing permissions and limitations under the License. Documents -
Key
+ + + Key + Value @@ -215,12 +241,6 @@ specific language governing permissions and limitations under the License. -

- Note: Views with a reduce function will return a single row of reduced values. - If you are looking for the same results that you can see here in Futon, - add a ?group=true parameter to your view query. Futon does - this automatically. -

-- cgit v1.2.3