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 3B882117F3 for ; Mon, 18 Aug 2014 09:48:32 +0000 (UTC) Received: (qmail 46403 invoked by uid 500); 18 Aug 2014 09:48:32 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 46213 invoked by uid 500); 18 Aug 2014 09:48:32 -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 46046 invoked by uid 99); 18 Aug 2014 09:48:32 -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, 18 Aug 2014 09:48:32 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id AE9049ACABE; Mon, 18 Aug 2014 09:48:31 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: garren@apache.org To: commits@couchdb.apache.org Date: Mon, 18 Aug 2014 09:48:33 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [3/6] fauxton commit: updated refs/heads/sidebar-fixes to 1ba9f1a Improve sidebar list of index types Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/84440ec6 Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/84440ec6 Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/84440ec6 Branch: refs/heads/sidebar-fixes Commit: 84440ec6e3ae0ec1ccad217ca2c9468b70c69db1 Parents: 77d6433 Author: Garren Smith Authored: Wed Aug 13 14:42:22 2014 +0200 Committer: Garren Smith Committed: Mon Aug 18 11:36:09 2014 +0200 ---------------------------------------------------------------------- app/addons/documents/routes.js | 2 +- .../documents/templates/design_doc_menu.html | 2 +- .../documents/templates/index_menu_item.html | 4 ++-- app/addons/documents/views-sidebar.js | 25 ++++++++++++-------- 4 files changed, 19 insertions(+), 14 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/84440ec6/app/addons/documents/routes.js ---------------------------------------------------------------------- diff --git a/app/addons/documents/routes.js b/app/addons/documents/routes.js index c5287e7..8eca7f6 100644 --- a/app/addons/documents/routes.js +++ b/app/addons/documents/routes.js @@ -134,7 +134,7 @@ function(app, FauxtonAPI, Documents, Changes, Index, DocEditor, Databases, Resou route: "allDocs", roles: ["_reader","_writer","_admin"] }, - "database/:database/_design/:ddoc/_view/:view": { + "database/:database/_design/:ddoc/_views/:view": { route: "viewFn", roles: ['_admin'] }, http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/84440ec6/app/addons/documents/templates/design_doc_menu.html ---------------------------------------------------------------------- diff --git a/app/addons/documents/templates/design_doc_menu.html b/app/addons/documents/templates/design_doc_menu.html index 1227d33..8180f48 100644 --- a/app/addons/documents/templates/design_doc_menu.html +++ b/app/addons/documents/templates/design_doc_menu.html @@ -16,7 +16,7 @@ the License. http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/84440ec6/app/addons/documents/templates/index_menu_item.html ---------------------------------------------------------------------- diff --git a/app/addons/documents/templates/index_menu_item.html b/app/addons/documents/templates/index_menu_item.html index 8519f42..434a02a 100644 --- a/app/addons/documents/templates/index_menu_item.html +++ b/app/addons/documents/templates/index_menu_item.html @@ -14,12 +14,12 @@ the License.
- <%- ddocType %> + <%- name %>
    <% _.each(collection, function (item, index) { %>
  • - + <%- index %>
  • http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/84440ec6/app/addons/documents/views-sidebar.js ---------------------------------------------------------------------- diff --git a/app/addons/documents/views-sidebar.js b/app/addons/documents/views-sidebar.js index bfd921d..9f8c0ee 100644 --- a/app/addons/documents/views-sidebar.js +++ b/app/addons/documents/views-sidebar.js @@ -151,14 +151,14 @@ function(app, FauxtonAPI, Components, Documents, Databases) { toggleArrow: function(e){ this.$(e.currentTarget).toggleClass("down"); }, - buildIndexList: function(collection, selector, ddocType){ + buildIndexList: function(collection, info){ var design = this.model.id.replace(/^_design\//,""); this.insertView(".accordion-body", new Views.IndexItem({ - selector: selector, + selector: info.selector, ddoc: design, - collection: collection[selector], - ddocType: ddocType, + collection: collection[info.selector], + name: info.name, database: this.model.collection.database.id })); }, @@ -202,9 +202,13 @@ function(app, FauxtonAPI, Components, Documents, Databases) { if (!ddocDocs){ return; } - this.buildIndexList(ddocDocs, "views", "view"); - _.each(sidebarListTypes, function (type) { - this.buildIndexList(ddocDocs, type); + this.buildIndexList(ddocDocs, { + selector: "views", + name: 'Views' + }); + + _.each(sidebarListTypes, function (info) { + this.buildIndexList(ddocDocs, info); },this); }, @@ -234,9 +238,9 @@ function(app, FauxtonAPI, Components, Documents, Databases) { this.database = options.database; this.selected = !! options.selected; this.selector = options.selector; - this.ddocType = options.ddocType || this.selector; + this.name = options.name; this.icons = { - "view": "fonticon-sidenav-map-reduce", + "Views": "fonticon-sidenav-map-reduce", "indexes": "fonticon-sidenav-search" }; @@ -245,7 +249,8 @@ function(app, FauxtonAPI, Components, Documents, Databases) { serialize: function() { return { icon: this.icons[this.ddocType], - ddocType: this.ddocType, + ddocType: this.selector, + name: this.name, index: this.index, ddoc: this.ddoc, database: this.database,