couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gar...@apache.org
Subject [58/59] [abbrv] fauxton commit: updated refs/heads/master to 4e37185
Date Tue, 22 Jul 2014 15:26:49 GMT
Fixes from PR review


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

Branch: refs/heads/master
Commit: 4e371855a7f5749d42b84c4723b01102ed0c6881
Parents: bc4db50
Author: Garren Smith <garren.smith@gmail.com>
Authored: Tue Jul 22 16:49:02 2014 +0200
Committer: Garren Smith <garren.smith@gmail.com>
Committed: Tue Jul 22 17:23:49 2014 +0200

----------------------------------------------------------------------
 app/addons/documents/sidebarviews.js            | 66 +++++++++++---------
 .../documents/templates/attachments_footer.html | 20 ------
 2 files changed, 38 insertions(+), 48 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/4e371855/app/addons/documents/sidebarviews.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/sidebarviews.js b/app/addons/documents/sidebarviews.js
index 38ed119..e3cc629 100644
--- a/app/addons/documents/sidebarviews.js
+++ b/app/addons/documents/sidebarviews.js
@@ -159,41 +159,51 @@ function(app, FauxtonAPI, Components, Documents, Databases) {
         database_encoded: app.utils.safeURLName(this.model.collection.database.id),
       };
     },
-    beforeRender: function(manage) {
-      var ddocDocs = this.model.get("doc"),
-          ddocName = this.model.id.replace(/^_design\//,""),
-          sideBarMenuLinks = [];
-
-      var sidebarListTypes = FauxtonAPI.getExtensions('sidebar:list');
-          if (ddocDocs){
-            this.buildIndexList(ddocDocs, "views", "view");
-            _.each(sidebarListTypes, function (type) {
-              this.buildIndexList(ddocDocs, type);
-            },this);
-          }
-       
-     var docSafe = app.utils.safeURLName(ddocName), 
-         database = this.collection.database,
-         links = _.reduce(FauxtonAPI.getExtensions('sidebar:links'), function (menuLinks,
link) {
-
-          menuLinks.push({
-            title: link.title,
-            url: "#" + database.url('app') + "/" + link.url + "/" + docSafe,
-            icon: 'fonticon-plus-circled'
-          });
-
-         return menuLinks; 
+
+    getSidebarLinks: function () {
+      var ddocName = this.model.id.replace(/^_design\//,""),
+          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,
+          icon: 'fonticon-plus-circled'
+        });
+
+        return menuLinks; 
      }, [{
       title: 'Secondary View',
       url: "#" + database.url('app') + "/new_view/" + docSafe,
       icon: 'fonticon-plus-circled'
      }]);
 
-     sideBarMenuLinks.push({
-       title: 'Add new',
-       links: links
-     });
+    },
+
+    renderIndexLists: function () {
+      var ddocDocs = this.model.get("doc"),
+          sidebarListTypes = FauxtonAPI.getExtensions('sidebar:list');
+
+      if (!ddocDocs){ return; }
+
+      this.buildIndexList(ddocDocs, "views", "view");
+      _.each(sidebarListTypes, function (type) {
+        this.buildIndexList(ddocDocs, type);
+      },this);
+
+    },
+
+    beforeRender: function(manage) {
+      var sideBarMenuLinks = [];
+
+      sideBarMenuLinks.push({
+        title: 'Add new',
+        links: this.getSidebarLinks()
+      });
 
+      this.renderIndexLists();
       this.insertView(".new-button", new Components.MenuDropDown({
         links: sideBarMenuLinks,
       }));

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/4e371855/app/addons/documents/templates/attachments_footer.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/attachments_footer.html b/app/addons/documents/templates/attachments_footer.html
deleted file mode 100644
index 31bd5a5..0000000
--- a/app/addons/documents/templates/attachments_footer.html
+++ /dev/null
@@ -1,20 +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.
--->
-
-<ul>
-	<li> attachment 1</li>
-	<li> attachment 2 </li>
-	<li> attachment 3</li>
-	<li> attachment 4</li>
-</ul>


Mime
View raw message