couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From deathb...@apache.org
Subject [1/2] fauxton commit: updated refs/heads/secondary-indexes to 2474d73
Date Tue, 29 Jul 2014 15:14:01 GMT
Repository: couchdb-fauxton
Updated Branches:
  refs/heads/secondary-indexes 4c45e1296 -> 2474d7335


Add all the indexes to the sidebar
Fix sidebar to work with different indexes
Added the apache license
changed a comment ffs.


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/f1cbc269
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/f1cbc269
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/f1cbc269

Branch: refs/heads/secondary-indexes
Commit: f1cbc2698ff80c1303dd563157dd0cd4c87ddfd6
Parents: 4c45e12
Author: deathbearbrown <deathbearbrown@gmail.com>
Authored: Tue Jul 29 09:10:42 2014 -0400
Committer: deathbearbrown <deathbearbrown@gmail.com>
Committed: Tue Jul 29 09:10:42 2014 -0400

----------------------------------------------------------------------
 .../documents/assets/less/advancedOptions.less  |  13 +++
 app/addons/documents/assets/less/changes.less   |  12 ++
 app/addons/documents/assets/less/documents.less |   2 +-
 app/addons/documents/assets/less/sidenav.less   |  12 ++
 app/addons/documents/resources.js               |  69 +----------
 .../documents/templates/index_menu_item.html    |   4 +-
 app/addons/documents/views-sidebar.js           |  53 ++++-----
 app/addons/indexes/base.js                      |  36 +++++-
 app/addons/indexes/less/indexes.less            |  13 +++
 .../indexes/less/new-index-placeholder.less     |   3 +
 app/addons/indexes/resources.js                 | 109 ++++++++++++++++-
 app/addons/indexes/routes-core.js               | 117 +++++++++++++++++++
 app/addons/indexes/routes-filter.js             |  47 --------
 app/addons/indexes/routes-list.js               |  25 ++--
 app/addons/indexes/routes-show.js               |  21 +++-
 app/addons/indexes/routes-viewindexes.js        | 110 +----------------
 app/addons/indexes/routes.js                    |   5 +-
 app/addons/indexes/templates/index_editor.html  |  18 +++
 .../indexes/templates/new_placeholder.html      |  16 +++
 app/addons/indexes/views.js                     |  10 ++
 app/templates/layouts/two_pane.html             |   7 +-
 assets/img/couchWatermark.png                   | Bin 0 -> 7125 bytes
 assets/less/fauxton.less                        |  15 ++-
 23 files changed, 440 insertions(+), 277 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f1cbc269/app/addons/documents/assets/less/advancedOptions.less
----------------------------------------------------------------------
diff --git a/app/addons/documents/assets/less/advancedOptions.less b/app/addons/documents/assets/less/advancedOptions.less
index 2e29d38..5f278a4 100644
--- a/app/addons/documents/assets/less/advancedOptions.less
+++ b/app/addons/documents/assets/less/advancedOptions.less
@@ -1 +1,14 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+/*ALL DOCS TABLE*/
+
 /*for advanced options css*/

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f1cbc269/app/addons/documents/assets/less/changes.less
----------------------------------------------------------------------
diff --git a/app/addons/documents/assets/less/changes.less b/app/addons/documents/assets/less/changes.less
index 43823cf..4c8edc6 100644
--- a/app/addons/documents/assets/less/changes.less
+++ b/app/addons/documents/assets/less/changes.less
@@ -1,3 +1,15 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
 /** used in changes.html **/
 .change-box {
   margin: 0 20px 20px 20px;

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f1cbc269/app/addons/documents/assets/less/documents.less
----------------------------------------------------------------------
diff --git a/app/addons/documents/assets/less/documents.less b/app/addons/documents/assets/less/documents.less
index 13bd4fc..ed07968 100644
--- a/app/addons/documents/assets/less/documents.less
+++ b/app/addons/documents/assets/less/documents.less
@@ -9,7 +9,7 @@
 // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 // License for the specific language governing permissions and limitations under
 // the License.
-/*ALL DOCS TABLE*/
+
 
 @import "../../../../../assets/less/variables.less";
 @import "../../../../../assets/less/bootstrap/variables.less";

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f1cbc269/app/addons/documents/assets/less/sidenav.less
----------------------------------------------------------------------
diff --git a/app/addons/documents/assets/less/sidenav.less b/app/addons/documents/assets/less/sidenav.less
index 477af7a..fa65a23 100644
--- a/app/addons/documents/assets/less/sidenav.less
+++ b/app/addons/documents/assets/less/sidenav.less
@@ -1,3 +1,15 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
 
 .sidenav{
   .nav-list > .active > a{

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f1cbc269/app/addons/documents/resources.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/resources.js b/app/addons/documents/resources.js
index dc71153..5fc6aa0 100644
--- a/app/addons/documents/resources.js
+++ b/app/addons/documents/resources.js
@@ -514,7 +514,7 @@ function(app, FauxtonAPI, PagingCollection) {
 
     urlRef: function(context, params) {
       var query = "";
-      
+
       if (params) {
         if (!_.isEmpty(params)) {
           query = "?" + $.param(params);
@@ -628,74 +628,7 @@ function(app, FauxtonAPI, PagingCollection) {
   });
 
 
-  Documents.PouchIndexCollection = PagingCollection.extend({
-    model: Documents.ViewRow,
-    documentation: function(){
-      return "docs";
-    },
-    initialize: function(_models, options) {
-      this.database = options.database;
-      this.rows = options.rows;
-      this.view = options.view;
-      this.design = options.design.replace('_design/','');
-      this.params = _.extend({limit: 20, reduce: false}, options.params);
-
-      this.idxType = "_view";
-    },
-
-    url: function () {
-      return '';
-    },
-
-    simple: function () {
-      var docs = this.map(function (item) {
-        return {
-          _id: item.id,
-          key: item.get('key'),
-          value: item.get('value')
-        };
-      });
-
-      return new Documents.PouchIndexCollection(docs, {
-        database: this.database,
-        params: this.params,
-        view: this.view,
-        design: this.design,
-        rows: this.rows
-      });
-
-    },
-
-    fetch: function() {
-      var deferred = FauxtonAPI.Deferred();
-      this.reset(this.rows, {silent: true});
-
-      this.viewMeta = {
-        total_rows: this.rows.length,
-        offset: 0,
-        update_seq: false
-      };
-
-      deferred.resolve();
-      return deferred;
-    },
 
-    totalRows: function() {
-      return this.viewMeta.total_rows || "unknown";
-    },
-
-    updateSeq: function() {
-      return this.viewMeta.update_seq || false;
-    },
-
-    buildAllDocs: function(){
-      this.fetch();
-    },
-
-    allDocs: function(){
-      return this.models;
-    }
-  });
 
 
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f1cbc269/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..42ff833 100644
--- a/app/addons/documents/templates/index_menu_item.html
+++ b/app/addons/documents/templates/index_menu_item.html
@@ -15,8 +15,8 @@ the License.
   <div class="fonticon-play"></div>
   <span class="<%- icon %> fonticon"></span>
   <%- ddocType %>
-  </a>
-  <ul class="accordion-body collapse" id="<%- removeSpecialCharacters(ddoc) + ddocType
%>">
+</a>
+<ul class="accordion-body collapse" id="<%- removeSpecialCharacters(ddoc) + ddocType
%>">
   <% _.each(collection, function (item, index) { %>
   <li>
   <a data-ddoctype="<%- ddocType %>" id="<%- removeSpecialCharacters(ddoc) %>_<%-
removeSpecialCharacters(index) %>" href="#/database/<%- safeURL(database) %>/_design/<%=
safeURL(ddoc)%>/_<%=ddocType%>/<%= safeURL(index) %>" class="toggle-view">

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f1cbc269/app/addons/documents/views-sidebar.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/views-sidebar.js b/app/addons/documents/views-sidebar.js
index e3cc629..53869e8 100644
--- a/app/addons/documents/views-sidebar.js
+++ b/app/addons/documents/views-sidebar.js
@@ -137,16 +137,22 @@ function(app, FauxtonAPI, Components, Documents, Databases) {
     toggleArrow:  function(e){
       this.$(e.currentTarget).toggleClass("down");
     },
-    buildIndexList: function(collection, selector, ddocType){
+    buildIndexList: function(collection, indexType){
       var design = this.model.id.replace(/^_design\//,"");
-
-      this.insertView(".accordion-body", new Views.IndexItem({
-        selector: selector,
-        ddoc: design,
-        collection: collection[selector],
-        ddocType: ddocType,
-        database: this.model.collection.database.id
-      }));
+      var selector = indexType.selector;
+      var ddocType = indexType.ddocType;
+      var icon = indexType.icon;
+
+      if (collection[selector]){
+        this.insertView(".accordion-body", new Views.IndexItem({
+          selector: selector,
+          ddoc: design,
+          collection: collection[selector],
+          ddocType: ddocType,
+          database: this.model.collection.database.id,
+          icon: icon
+        }));
+      }
     },
 
     serialize: function(){
@@ -162,23 +168,19 @@ function(app, FauxtonAPI, Components, Documents, Databases) {
 
     getSidebarLinks: function () {
       var ddocName = this.model.id.replace(/^_design\//,""),
-          docSafe = app.utils.safeURLName(ddocName), 
+          docSafe = app.utils.safeURLName(ddocName),
           database = this.collection.database;
 
       return _.reduce(FauxtonAPI.getExtensions('sidebar:links'), function (menuLinks, link)
{
 
         menuLinks.push({
           title: link.title,
-          url: "#" + database.url('app') + "/" + link.url + "/" + docSafe,
+          url: "#" + database.url('app') + "/_design/" + docSafe + "/" + link.url,
           icon: 'fonticon-plus-circled'
         });
 
-        return menuLinks; 
-     }, [{
-      title: 'Secondary View',
-      url: "#" + database.url('app') + "/new_view/" + docSafe,
-      icon: 'fonticon-plus-circled'
-     }]);
+        return menuLinks;
+     }, []);
 
     },
 
@@ -188,9 +190,9 @@ 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, "views", "view");
+      _.each(sidebarListTypes, function (listType) {
+        this.buildIndexList(ddocDocs, listType);
       },this);
 
     },
@@ -210,6 +212,7 @@ function(app, FauxtonAPI, Components, Documents, Databases) {
     }
   });
 
+  //Sidebar Index Item
   Views.IndexItem = FauxtonAPI.View.extend({
     template: "addons/documents/templates/index_menu_item",
     tagName: 'li',
@@ -221,16 +224,13 @@ function(app, FauxtonAPI, Components, Documents, Databases) {
       this.selected = !! options.selected;
       this.selector = options.selector;
       this.ddocType = options.ddocType || this.selector;
-      this.icons = {
-        "view": "fonticon-sidenav-map-reduce",
-        "indexes": "fonticon-sidenav-search"
-      };
+      this.icon = options.icon;
 
     },
 
     serialize: function() {
       return {
-        icon: this.icons[this.ddocType],
+        icon: this.icon,
         ddocType:  this.ddocType,
         index: this.index,
         ddoc: this.ddoc,
@@ -239,7 +239,6 @@ function(app, FauxtonAPI, Components, Documents, Databases) {
         collection: this.collection
       };
     },
-
     afterRender: function() {
       if (this.selected) {
         $(".sidenav ul.nav-list li").removeClass("active");
@@ -248,6 +247,8 @@ function(app, FauxtonAPI, Components, Documents, Databases) {
     }
   });
 
+
+
   return Views;
 });
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f1cbc269/app/addons/indexes/base.js
----------------------------------------------------------------------
diff --git a/app/addons/indexes/base.js b/app/addons/indexes/base.js
index a7107a1..6365c61 100644
--- a/app/addons/indexes/base.js
+++ b/app/addons/indexes/base.js
@@ -15,15 +15,14 @@
 define([
   "app",
   "api",
-  "addons/indexes/views",
   "addons/indexes/routes"
 ],
-function(app, FauxtonAPI, Views, Routes) {
+function(app, FauxtonAPI, Routes) {
   Routes.initialize = function() {
 
     /*
       Example of an extension:
-      An extension is just an event that may or may not have listener in another view.
+      An extension is just like an event that may or may not have listener in another view.
       In this case the listener is in the documents addon in the sidebar.
 
       If there are is a view that you want rendered in another route, this is the way to
do it.
@@ -39,6 +38,37 @@ function(app, FauxtonAPI, Views, Routes) {
 
 
     */
+    //Show in the sidebar
+    FauxtonAPI.registerExtension('sidebar:list', {
+      selector:'views',
+      ddocType:'view',
+      icon: "fonticon-sidenav-map-reduce"
+    });
+    FauxtonAPI.registerExtension('sidebar:list', {
+      selector:'list',
+      icon: "fonticon-sidenav-list-function"
+    });
+    FauxtonAPI.registerExtension('sidebar:list', {
+      selector:'show',
+      icon: "fonticon-sidenav-show-function"
+    });
+
+
+    /* show in the add new menu dropdown */
+    FauxtonAPI.registerExtension('sidebar:links', {
+      title: "Secondary View",
+      url: "new_view"
+    });
+    FauxtonAPI.registerExtension('sidebar:links', {
+      title: "List Function",
+      url: "new_list"
+    });
+
+    FauxtonAPI.registerExtension('sidebar:links', {
+      url: 'new_show',
+      title: 'Show Index'
+    });
+
   };
   return Routes;
 });

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f1cbc269/app/addons/indexes/less/indexes.less
----------------------------------------------------------------------
diff --git a/app/addons/indexes/less/indexes.less b/app/addons/indexes/less/indexes.less
new file mode 100644
index 0000000..d526ee9
--- /dev/null
+++ b/app/addons/indexes/less/indexes.less
@@ -0,0 +1,13 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+@import "new-index-placeholder.less";

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f1cbc269/app/addons/indexes/less/new-index-placeholder.less
----------------------------------------------------------------------
diff --git a/app/addons/indexes/less/new-index-placeholder.less b/app/addons/indexes/less/new-index-placeholder.less
new file mode 100644
index 0000000..3f5db0e
--- /dev/null
+++ b/app/addons/indexes/less/new-index-placeholder.less
@@ -0,0 +1,3 @@
+.watermark-logo {
+  background: transparent url(../img/couchWatermark.png') no-repeat 0 0;
+}

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f1cbc269/app/addons/indexes/resources.js
----------------------------------------------------------------------
diff --git a/app/addons/indexes/resources.js b/app/addons/indexes/resources.js
index 667eaba..629170c 100644
--- a/app/addons/indexes/resources.js
+++ b/app/addons/indexes/resources.js
@@ -11,11 +11,114 @@
 // the License.
 define([
   "app",
-  "addons/fauxton/base",
+  "api",
+  "cloudant.pagingcollection"
 ],
 
-function (app, Fauxton) {
-  var Resources = {};
+function(app, FauxtonAPI, PagingCollection) {
+ var Resources = {};
+
+  Resources.ViewRow = FauxtonAPI.Model.extend({
+    // this is a hack so that backbone.collections doesn't group
+    // these by id and reduce the number of items returned.
+    idAttribute: "_id",
+
+    docType: function() {
+      if (!this.id) return "reduction";
+
+      return this.id.match(/^_design/) ? "design doc" : "doc";
+    },
+    documentation: function(){
+      return "docs";
+    },
+    url: function(context) {
+      return this.collection.database.url(context) + "/" + this.safeID();
+    },
+
+    isEditable: function() {
+      return this.docType() != "reduction";
+    },
+    safeID: function() {
+      var id = this.id || this.get("id");
+
+      return app.utils.safeURLName(id);
+    },
+
+    prettyJSON: function() {
+      //var data = this.get("doc") ? this.get("doc") : this;
+      return JSON.stringify(this, null, "  ");
+    }
+  });
+
+
+  Resources.PouchIndexCollection = PagingCollection.extend({
+    model: Resources.ViewRow,
+    documentation: function(){
+      return "docs";
+    },
+    initialize: function(_models, options) {
+      this.database = options.database;
+      this.rows = options.rows;
+      this.view = options.view;
+      this.design = options.design.replace('_design/','');
+      this.params = _.extend({limit: 20, reduce: false}, options.params);
+
+      this.idxType = "_view";
+    },
+
+    url: function () {
+      return '';
+    },
+
+    simple: function () {
+      var docs = this.map(function (item) {
+        return {
+          _id: item.id,
+          key: item.get('key'),
+          value: item.get('value')
+        };
+      });
+
+      return new Resources.PouchIndexCollection(docs, {
+        database: this.database,
+        params: this.params,
+        view: this.view,
+        design: this.design,
+        rows: this.rows
+      });
+
+    },
+
+    fetch: function() {
+      var deferred = FauxtonAPI.Deferred();
+      this.reset(this.rows, {silent: true});
+
+      this.viewMeta = {
+        total_rows: this.rows.length,
+        offset: 0,
+        update_seq: false
+      };
+
+      deferred.resolve();
+      return deferred;
+    },
+
+    totalRows: function() {
+      return this.viewMeta.total_rows || "unknown";
+    },
+
+    updateSeq: function() {
+      return this.viewMeta.update_seq || false;
+    },
+
+    buildAllDocs: function(){
+      this.fetch();
+    },
+
+    allDocs: function(){
+      return this.models;
+    }
+  });
 
   return Resources;
 });

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f1cbc269/app/addons/indexes/routes-core.js
----------------------------------------------------------------------
diff --git a/app/addons/indexes/routes-core.js b/app/addons/indexes/routes-core.js
new file mode 100644
index 0000000..653140b
--- /dev/null
+++ b/app/addons/indexes/routes-core.js
@@ -0,0 +1,117 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+define([
+  "app",
+  "api",
+  "addons/databases/base",
+  "addons/indexes/views",
+  "addons/documents/views",
+  "addons/indexes/resources"
+],
+
+function (app, FauxtonAPI, Databases, Views, Documents, Resources) {
+
+  var CoreIndexRouteObj =  FauxtonAPI.RouteObject.extend({
+    layout: "two_pane",
+    apiUrl: function() {
+      return [this.doc.url("apiurl"), this.doc.documentation()];
+    },
+    initialize: function (route, masterLayout, options) {
+      this.databaseName = options[0];
+
+      this.setView("#breadcrumbs", new Views.EditorPlaceholder({}));
+
+      this.data = {
+        database: new Databases.Model({id:this.databaseName})
+      };
+      this.docID = options[1]||'new';
+
+      this.doc = new Documents.DDoc({
+        _id: this.docID
+      }, {
+        database: this.data.database
+      });
+
+      this.data.designDocs = new Documents.AllDocs(null, {
+        database: this.data.database,
+        paging: {
+          pageSize: 500
+        },
+        params: {
+          startkey: '_design',
+          endkey: '_design1',
+          include_docs: true,
+          limit: 500
+        }
+      });
+    },
+
+    createViewDocumentsView: function (options) {
+      return this.setView("#right-content", new Documents.Views.AllDocsList({
+        database: options.database,
+        collection: options.indexedDocs,
+        nestedView: Documents.Views.Row,
+        viewList: true,
+        ddocInfo: this.ddocInfo(options.designDoc, options.designDocs, options.view),
+        docParams: options.docParams,
+        params: options.urlParams
+      }));
+    },
+
+
+    ddocInfo: function (designDoc, designDocs, view) {
+      return {
+        id: "_design/" + designDoc,
+        currView: view,
+        designDocs: designDocs
+      };
+    },
+
+    createParams: function (options) {
+      var urlParams = app.getParams(options);
+      var params = Documents.QueryParams.parse(urlParams);
+
+      return {
+        urlParams: urlParams,
+        docParams: _.extend(params, {limit: this.getDocPerPageLimit(params, 20)})
+      };
+    },
+
+    getDocPerPageLimit: function (urlParams, perPage) {
+      var storedPerPage = perPage;
+
+      if (window.localStorage) {
+        storedPerPage = window.localStorage.getItem('fauxton:perpage');
+
+        if (!storedPerPage) {
+          this.setDocPerPageLimit(perPage);
+          storedPerPage = perPage;
+        } else {
+          storedPerPage = parseInt(storedPerPage, 10);
+        }
+      }
+
+      if (!urlParams.limit || urlParams.limit > storedPerPage) {
+        return parseInt(storedPerPage, 10);
+      } else {
+        return parseInt(urlParams.limit, 10);
+      }
+    },
+
+    establish: function () {
+      return this.data.designDocs.fetch({reset: true});
+    }
+  });
+
+  return CoreIndexRouteObj;
+
+});

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f1cbc269/app/addons/indexes/routes-filter.js
----------------------------------------------------------------------
diff --git a/app/addons/indexes/routes-filter.js b/app/addons/indexes/routes-filter.js
deleted file mode 100644
index 492b014..0000000
--- a/app/addons/indexes/routes-filter.js
+++ /dev/null
@@ -1,47 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-define([
-  "app",
-  "api",
-  "addons/databases/base",
-  "addons/indexes/views",
-  "addons/documents/views",
-  "addons/indexes/resources"
-],
-
-function (app, FauxtonAPI, Databases, Views, Documents, Resources) {
-
-  var FilterIndexes = FauxtonAPI.RouteObject.extend({
-    layout: "two_pane",
-    routes: {
-      "database/:database/_design/:ddoc/_filters/:fn": {
-        route: "tempFn",
-        roles: ['_admin']
-      },
-      "database/:database/new_filter": "newFilterEditor",
-      "database/:database/new_filter/:designDoc": "newFilterEditor"
-    },
-    newFilterEditor: function(){
-      return false;
-    },
-    tempFn:  function(databaseName, ddoc, fn){
-      this.setView("#dashboard-upper-content", new Documents.Views.temp({}));
-      this.crumbs = function () {
-        return [
-          {"name": this.data.database.id, "link": Databases.databaseUrl(this.data.database)},
-        ];
-      };
-    }
-  });
-
-  return FilterIndexes;
-});

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f1cbc269/app/addons/indexes/routes-list.js
----------------------------------------------------------------------
diff --git a/app/addons/indexes/routes-list.js b/app/addons/indexes/routes-list.js
index 10141b7..5ef430b 100644
--- a/app/addons/indexes/routes-list.js
+++ b/app/addons/indexes/routes-list.js
@@ -15,26 +15,35 @@ define([
   "addons/databases/base",
   "addons/indexes/views",
   "addons/documents/views",
-  "addons/indexes/resources"
+  "addons/indexes/resources",
+  "addons/indexes/routes-core"
 ],
 
-function (app, FauxtonAPI, Databases, Views, Documents, Resources) {
+function (app, FauxtonAPI, Databases, Views, Documents, Resources, RouteCore) {
 
-  var ListIndexes = FauxtonAPI.RouteObject.extend({
-    layout: "two_pane",
+  var ListIndexes = RouteCore.extend({
     routes: {
       "database/:database/_design/:ddoc/_lists/:fn": {
         route: "tempFn",
         roles: ['_admin']
       },
-      "database/:database/new_lists": "newListsEditor",
-      "database/:database/new_lists/:designDoc": "newListsEditor"
+      "database/:database/new_list": "newListsEditor",
+      "database/:database/new_list/:designDoc": "newListsEditor"
     },
     newListsEditor: function(){
-      return false;
+      this.setView("#left-content", new Views.EditorPlaceholder({}));
+
+      this.setView("#right-content", new Views.NewIndexPlaceholder({}));
+      this.crumbs = function () {
+        return [
+          {"name": this.data.database.id, "link": Databases.databaseUrl(this.data.database)},
+        ];
+      };
     },
     tempFn:  function(databaseName, ddoc, fn){
-      this.setView("#dashboard-upper-content", new Documents.Views.temp({}));
+      this.setView("#left-content", new Views.EditorPlaceholder({}));
+
+      this.setView("#right-content", new Views.NewIndexPlaceholder({}));
       this.crumbs = function () {
         return [
           {"name": this.data.database.id, "link": Databases.databaseUrl(this.data.database)},

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f1cbc269/app/addons/indexes/routes-show.js
----------------------------------------------------------------------
diff --git a/app/addons/indexes/routes-show.js b/app/addons/indexes/routes-show.js
index 1861fd1..56af33e 100644
--- a/app/addons/indexes/routes-show.js
+++ b/app/addons/indexes/routes-show.js
@@ -15,13 +15,13 @@ define([
   "addons/databases/base",
   "addons/indexes/views",
   "addons/documents/views",
-  "addons/indexes/resources"
+  "addons/indexes/resources",
+  "addons/indexes/routes-core"
 ],
 
-function (app, FauxtonAPI, Databases, Views, Documents, Resources) {
+function (app, FauxtonAPI, Databases, Views, Documents, Resources, RouteCore) {
 
-  var ShowIndexes = FauxtonAPI.RouteObject.extend({
-    layout: "two_pane",
+  var ShowIndexes = RouteCore.extend({
     routes: {
       "database/:database/_design/:ddoc/_show/:fn": {
         route: "tempFn",
@@ -31,10 +31,19 @@ function (app, FauxtonAPI, Databases, Views, Documents, Resources) {
       "database/:database/new_show/:designDoc": "newShowEditor"
     },
     newShowEditor: function(){
-      return false;
+      this.setView("#left-content", new Views.EditorPlaceholder({}));
+
+      this.setView("#right-content", new Views.NewIndexPlaceholder({}));
+      this.crumbs = function () {
+        return [
+          {"name": this.data.database.id, "link": Databases.databaseUrl(this.data.database)},
+        ];
+      };
     },
     tempFn:  function(databaseName, ddoc, fn){
-      this.setView("#dashboard-upper-content", new Documents.Views.temp({}));
+      this.setView("#left-content", new Views.EditorPlaceholder({}));
+
+      this.setView("#right-content", new Views.NewIndexPlaceholder({}));
       this.crumbs = function () {
         return [
           {"name": this.data.database.id, "link": Databases.databaseUrl(this.data.database)},

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f1cbc269/app/addons/indexes/routes-viewindexes.js
----------------------------------------------------------------------
diff --git a/app/addons/indexes/routes-viewindexes.js b/app/addons/indexes/routes-viewindexes.js
index 9577cbb..6e24b53 100644
--- a/app/addons/indexes/routes-viewindexes.js
+++ b/app/addons/indexes/routes-viewindexes.js
@@ -15,123 +15,26 @@ define([
   "addons/databases/base",
   "addons/indexes/views",
   "addons/documents/views",
-  "addons/indexes/resources"
+  "addons/indexes/resources",
+  "addons/indexes/routes-core"
 ],
 
-function (app, FauxtonAPI, Databases, Views, Documents, Resources) {
+function (app, FauxtonAPI, Databases, Views, Documents, Resources, RouteCore) {
 
-  var ViewIndexes = FauxtonAPI.RouteObject.extend({
-    layout: "two_pane",
+  var ViewIndexes = RouteCore.extend({
     routes: {
       "database/:database/_design/:ddoc/_view/:view": {
         route: "viewFn",
         roles: ['_admin']
       },
       "database/:database/new_view": "newViewEditor",
-      "database/:database/new_view/:designDoc": "newViewEditor"
-    },
-    initialize: function (route, masterLayout, options) {
-      this.databaseName = options[0];
-
-      this.data = {
-        database: new Databases.Model({id:this.databaseName})
-      };
-
-      this.data.designDocs = new Documents.AllDocs(null, {
-        database: this.data.database,
-        paging: {
-          pageSize: 500
-        },
-        params: {
-          startkey: '_design',
-          endkey: '_design1',
-          include_docs: true,
-          limit: 500
-        }
-      });
-    },
-
-
-    createViewDocumentsView: function (options) {
-      return this.setView("#right-content", new Documents.Views.AllDocsList({
-        database: options.database,
-        collection: options.indexedDocs,
-        nestedView: Documents.Views.Row,
-        viewList: true,
-        ddocInfo: this.ddocInfo(options.designDoc, options.designDocs, options.view),
-        docParams: options.docParams,
-        params: options.urlParams
-      }));
-    },
-
-    ddocInfo: function (designDoc, designDocs, view) {
-      return {
-        id: "_design/" + designDoc,
-        currView: view,
-        designDocs: designDocs
-      };
-    },
-
-    createParams: function (options) {
-      var urlParams = app.getParams(options);
-      var params = Documents.QueryParams.parse(urlParams);
-
-      return {
-        urlParams: urlParams,
-        docParams: _.extend(params, {limit: this.getDocPerPageLimit(params, 20)})
-      };
-    },
-
-    getDocPerPageLimit: function (urlParams, perPage) {
-      var storedPerPage = perPage;
-
-      if (window.localStorage) {
-        storedPerPage = window.localStorage.getItem('fauxton:perpage');
-
-        if (!storedPerPage) {
-          this.setDocPerPageLimit(perPage);
-          storedPerPage = perPage;
-        } else {
-          storedPerPage = parseInt(storedPerPage, 10);
-        }
-      }
-
-      if (!urlParams.limit || urlParams.limit > storedPerPage) {
-        return parseInt(storedPerPage, 10);
-      } else {
-        return parseInt(urlParams.limit, 10);
-      }
-    },
-
-    establish: function () {
-      return this.data.designDocs.fetch({reset: true});
-    },
-
-    updateAllDocsFromPreview: function (event) {
-      var view = event.view,
-      rows = event.rows,
-      ddoc = event.ddoc;
-
-      this.data.indexedDocs = new Documents.PouchIndexCollection(null, {
-        database: this.data.database,
-        design: ddoc,
-        view: view,
-        rows: rows
-      });
-
-      // this.documentsView = this.setView("#dashboard-lower-content", new Documents.Views.AllDocsList({
-      //   database: this.data.database,
-      //   collection: this.data.indexedDocs,
-      //   nestedView: Documents.Views.Row,
-      //   viewList: true
-      // }));
+      "database/:database/_design/:designDoc/new_view": "newViewEditor"
     },
 
     newViewEditor: function (database, designDoc) {
       var params = app.getParams();
 
-      this.toolsView && this.toolsView.remove();
-      this.documentsView && this.documentsView.remove();
+      this.setView("#right-content", new Views.NewIndexPlaceholder({}));
 
       this.viewEditor = this.setView("#left-content", new Views.ViewEditor({
         currentddoc: "_design/"+designDoc || "",
@@ -141,7 +44,6 @@ function (app, FauxtonAPI, Databases, Views, Documents, Resources) {
         newView: true
       }));
 
-      this.sidebar.setSelectedTab('new-view');
       this.crumbs = function () {
         return [
           {"name": this.data.database.id, "link": Databases.databaseUrl(this.data.database)},

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f1cbc269/app/addons/indexes/routes.js
----------------------------------------------------------------------
diff --git a/app/addons/indexes/routes.js b/app/addons/indexes/routes.js
index 52771d6..90c9aac 100644
--- a/app/addons/indexes/routes.js
+++ b/app/addons/indexes/routes.js
@@ -14,12 +14,11 @@ define([
   "api",
   "addons/indexes/views",
   "addons/indexes/routes-viewindexes",
-  "addons/indexes/routes-filter",
   "addons/indexes/routes-show",
   "addons/indexes/routes-list",
 ],
 
-function (app, FauxtonAPI, Views, ViewIndex, Filter, Show, List) {
-  Views.RouteObjects = [ViewIndex, Filter, Show, List];
+function (app, FauxtonAPI, Views, ViewIndex, Show, List) {
+  Views.RouteObjects = [ViewIndex, Show, List];
   return Views;
 });

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f1cbc269/app/addons/indexes/templates/index_editor.html
----------------------------------------------------------------------
diff --git a/app/addons/indexes/templates/index_editor.html b/app/addons/indexes/templates/index_editor.html
new file mode 100644
index 0000000..8644909
--- /dev/null
+++ b/app/addons/indexes/templates/index_editor.html
@@ -0,0 +1,18 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License"); you may not
+use this file except in compliance with the License. You may obtain a copy of
+the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+License for the specific language governing permissions and limitations under
+the License.
+-->
+
+<form>
+  <label> A FORM</label>
+
+</form>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f1cbc269/app/addons/indexes/templates/new_placeholder.html
----------------------------------------------------------------------
diff --git a/app/addons/indexes/templates/new_placeholder.html b/app/addons/indexes/templates/new_placeholder.html
new file mode 100644
index 0000000..1fcf6d9
--- /dev/null
+++ b/app/addons/indexes/templates/new_placeholder.html
@@ -0,0 +1,16 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License"); you may not
+use this file except in compliance with the License. You may obtain a copy of
+the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+License for the specific language governing permissions and limitations under
+the License.
+-->
+
+<h3>No Index Created Yet!</h3>
+<p> Run <a href="#/preview" class="btn btn-success save"> Preview</a> To
query result</p>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f1cbc269/app/addons/indexes/views.js
----------------------------------------------------------------------
diff --git a/app/addons/indexes/views.js b/app/addons/indexes/views.js
index 42a9066..109e76d 100644
--- a/app/addons/indexes/views.js
+++ b/app/addons/indexes/views.js
@@ -34,6 +34,16 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
 
   var Views = {};
 
+  Views.NewIndexPlaceholder = FauxtonAPI.View.extend({
+    template: "addons/indexes/templates/new_placeholder",
+    className: "watermark-logo"
+  });
+
+  Views.EditorPlaceholder = FauxtonAPI.View.extend({
+    template: "addons/indexes/templates/index_editor",
+  });
+
+
   Views.ViewEditor = FauxtonAPI.View.extend({
     template: "addons/indexes/templates/view_editor",
     builtinReduces: ['_sum', '_count', '_stats'],

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f1cbc269/app/templates/layouts/two_pane.html
----------------------------------------------------------------------
diff --git a/app/templates/layouts/two_pane.html b/app/templates/layouts/two_pane.html
index 031ad12..f9ad35c 100644
--- a/app/templates/layouts/two_pane.html
+++ b/app/templates/layouts/two_pane.html
@@ -14,12 +14,11 @@ the License.
 
 
 <div id="primary-navbar"></div>
-<div id="dashboard" class="container-fluid">
-  <div class="fixed-header">
+<div id="dashboard" class="container-fluid two-pane">
+  <header class="fixed-header">
     <div id="breadcrumbs"></div>
     <div id="api-navbar"></div>
-  </div>
-
+  </header>
 
   <div class="row-fluid content-area">
     <div id="left-content" class="span6"></div>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f1cbc269/assets/img/couchWatermark.png
----------------------------------------------------------------------
diff --git a/assets/img/couchWatermark.png b/assets/img/couchWatermark.png
new file mode 100644
index 0000000..9d22465
Binary files /dev/null and b/assets/img/couchWatermark.png differ

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/f1cbc269/assets/less/fauxton.less
----------------------------------------------------------------------
diff --git a/assets/less/fauxton.less b/assets/less/fauxton.less
index a9ff31b..6045bf8 100644
--- a/assets/less/fauxton.less
+++ b/assets/less/fauxton.less
@@ -550,6 +550,17 @@ table.databases {
     margin-top: 0;
     overflow-x: hidden;
   }
+  &.two-pane{
+    width: 100%;
+    margin-top: 0;
+    overflow-x: hidden;
+    #left-content, #right-content {
+      margin-top:60px;
+    }
+    #right-content {
+      margin-left: 0;
+    }
+  }
 }
 
 /*dashboard content can be in multiple templates*/
@@ -947,8 +958,8 @@ div.spinner {
     .copying {
       background-color: #999;
     }
-    .zeroclipboard-is-hover { 
-      background-color: #cbcbcb; 
+    .zeroclipboard-is-hover {
+      background-color: #cbcbcb;
     }
     .icon {
       vertical-align: bottom;


Mime
View raw message