Return-Path: X-Original-To: apmail-couchdb-commits-archive@www.apache.org Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7027CE8A7 for ; Mon, 11 Feb 2013 11:12:22 +0000 (UTC) Received: (qmail 49579 invoked by uid 500); 11 Feb 2013 11:12:19 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 49436 invoked by uid 500); 11 Feb 2013 11:12:19 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 48292 invoked by uid 99); 11 Feb 2013 11:12:15 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Feb 2013 11:12:14 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 820CF3C730; Mon, 11 Feb 2013 11:12:14 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jan@apache.org To: commits@couchdb.apache.org X-Mailer: ASF-Git Admin Mailer Subject: [42/50] [abbrv] git commit: Update changes for links to docs and a few other things Message-Id: <20130211111214.820CF3C730@tyr.zones.apache.org> Date: Mon, 11 Feb 2013 11:12:14 +0000 (UTC) Update changes for links to docs and a few other things Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/cc9f021b Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/cc9f021b Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/cc9f021b Branch: refs/heads/fauxton Commit: cc9f021b2f610919a61ccad8b9172ca6e87696c5 Parents: 9dfa09a Author: Russell Branca Authored: Tue Feb 5 17:58:09 2013 -0800 Committer: Russell Branca Committed: Tue Feb 5 17:58:09 2013 -0800 ---------------------------------------------------------------------- src/fauxton/app/modules/databases/resources.js | 2 + src/fauxton/app/modules/documents/routes.js | 14 ++++++------ src/fauxton/app/modules/documents/views.js | 13 +++++------ src/fauxton/app/templates/documents/changes.html | 18 +++++++++++----- 4 files changed, 27 insertions(+), 20 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb/blob/cc9f021b/src/fauxton/app/modules/databases/resources.js ---------------------------------------------------------------------- diff --git a/src/fauxton/app/modules/databases/resources.js b/src/fauxton/app/modules/databases/resources.js index 73af4f7..0d2f311 100644 --- a/src/fauxton/app/modules/databases/resources.js +++ b/src/fauxton/app/modules/databases/resources.js @@ -34,6 +34,8 @@ function(app, FauxtonAPI, Documents) { url: function(context) { if (context === "index") { return "/database/" + this.id + "/_all_docs"; + } else if (context === "changes") { + return "/database/" + this.id + "/_changes?descending=true&limit=100"; } else if (context === "app") { return "/database/" + this.id; } else { http://git-wip-us.apache.org/repos/asf/couchdb/blob/cc9f021b/src/fauxton/app/modules/documents/routes.js ---------------------------------------------------------------------- diff --git a/src/fauxton/app/modules/documents/routes.js b/src/fauxton/app/modules/documents/routes.js index ab66670..6eddb03 100644 --- a/src/fauxton/app/modules/documents/routes.js +++ b/src/fauxton/app/modules/documents/routes.js @@ -1,11 +1,11 @@ define([ - "app", + "app", - "api", + "api", - // Modules - "modules/documents/resources", - "modules/databases/base" + // Modules + "modules/documents/resources", + "modules/databases/base" ], function(app, FauxtonAPI, Documents, Databases) { @@ -77,7 +77,7 @@ function(app, FauxtonAPI, Documents, Databases) { crumbs: [ {"name": "Databases", "link": "/_all_dbs"}, - {"name": data.database.id, "link": Databases.databaseUrl(data.database)} + {"name": data.database.id, "link": data.database.url('app')} ], views: { @@ -321,7 +321,7 @@ function(app, FauxtonAPI, Documents, Databases) { views: { "#dashboard-content": new Documents.Views.Changes({ - collection: data.database.changes + model: data.database }), "#tabs": new Documents.Views.Tabs({ http://git-wip-us.apache.org/repos/asf/couchdb/blob/cc9f021b/src/fauxton/app/modules/documents/views.js ---------------------------------------------------------------------- diff --git a/src/fauxton/app/modules/documents/views.js b/src/fauxton/app/modules/documents/views.js index d41d53e..d11b96c 100644 --- a/src/fauxton/app/modules/documents/views.js +++ b/src/fauxton/app/modules/documents/views.js @@ -30,8 +30,8 @@ function(app, FauxtonAPI, Codemirror, JSHint) { serialize: function () { return { // TODO make this not hard coded here - changes_url: '#database/'+ this.database.id + '/_changes?descending=true&limit=100', - db_url: '#database/'+ this.database.id + '/_all_docs?limit=100' + changes_url: '#' + this.database.url('changes'), + db_url: '#' + this.database.url('index') + '?limit=100' }; }, @@ -56,12 +56,10 @@ function(app, FauxtonAPI, Codemirror, JSHint) { if (!result) { return; } - var promise = this.database.destroy(); - promise.done(function () { + return this.database.destroy().done(function () { app.router.navigate('/', {trigger: true}); }); } - }); Views.SearchBox = FauxtonAPI.View.extend({ @@ -848,13 +846,14 @@ function(app, FauxtonAPI, Codemirror, JSHint) { establish: function() { return [ - this.collection.fetch() + this.model.changes.fetch() ]; }, serialize: function () { return { - changes: this.collection.toJSON() + changes: this.model.changes.toJSON(), + database: this.model }; } http://git-wip-us.apache.org/repos/asf/couchdb/blob/cc9f021b/src/fauxton/app/templates/documents/changes.html ---------------------------------------------------------------------- diff --git a/src/fauxton/app/templates/documents/changes.html b/src/fauxton/app/templates/documents/changes.html index 9cdb30a..e9c191b 100644 --- a/src/fauxton/app/templates/documents/changes.html +++ b/src/fauxton/app/templates/documents/changes.html @@ -2,15 +2,21 @@ seq id - + changes + deleted? <% _.each(changes, function (change) { %> - - <%= change.seq %> - <%= change.id %> - <%= JSON.stringify(change.changes) %> - + + <%= change.seq %> + <% if (change.deleted) { %> + <%= change.id %> + <% } else { %> + <%= change.id %> + <% } %> + <%= JSON.stringify(change.changes) %> + <%= change.deleted ? "true" : "false" %> + <% }); %>