You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by de...@apache.org on 2013/12/08 20:53:41 UTC
[2/2] git commit: updated refs/heads/Document-Extensions to cd722d6
extensions added for sidebar
Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/cd722d6f
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/cd722d6f
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/cd722d6f
Branch: refs/heads/Document-Extensions
Commit: cd722d6fd000cfcbcb3fda472307e4c73d52b27a
Parents: c23257b
Author: suelockwood <de...@apache.org>
Authored: Thu Dec 5 15:46:28 2013 -0500
Committer: suelockwood <de...@apache.org>
Committed: Thu Dec 5 17:02:44 2013 -0500
----------------------------------------------------------------------
src/fauxton/app/modules/documents/views.js | 17 +++++++++++++++--
src/fauxton/app/templates/documents/sidebar.html | 8 ++++++--
2 files changed, 21 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb/blob/cd722d6f/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 1fe4cb7..27224e4 100644
--- a/src/fauxton/app/modules/documents/views.js
+++ b/src/fauxton/app/modules/documents/views.js
@@ -1625,7 +1625,9 @@ function(app, FauxtonAPI, Components, Documents, pouchdb, resizeColumns) {
},
serialize: function() {
- var docLinks = FauxtonAPI.getExtensions('docLinks');
+ var docLinks = FauxtonAPI.getExtensions('docLinks'),
+ addLinks = FauxtonAPI.getExtensions('sidebar:links'),
+ extensionList = FauxtonAPI.getExtensions('sidebar:list');
return {
changes_url: '#' + this.database.url('changes'),
permissions_url: '#' + this.database.url('app') + '/permissions',
@@ -1633,7 +1635,9 @@ function(app, FauxtonAPI, Components, Documents, pouchdb, resizeColumns) {
database: this.collection.database,
database_url: '#' + this.database.url('app'),
docLinks: docLinks,
- showNewView: this.showNewView
+ showNewView: this.showNewView,
+ addLinks: addLinks,
+ extensionList: extensionList > 0
};
},
@@ -1650,6 +1654,15 @@ function(app, FauxtonAPI, Components, Documents, pouchdb, resizeColumns) {
},
beforeRender: function(manage) {
+
+ var sidebarListViews = FauxtonAPI.getExtensions('sidebar:list');
+ _.each(sidebarListViews, function (view) {
+ var extension = this.insertView('#extension-navs', view);
+ extension.update(this.database, this.collection, this.viewName);
+ extension.render();
+ }, this);
+
+
this.collection.each(function(design) {
if (design.has('doc')){
var ddoc = design.id.split('/')[1];
http://git-wip-us.apache.org/repos/asf/couchdb/blob/cd722d6f/src/fauxton/app/templates/documents/sidebar.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/templates/documents/sidebar.html b/src/fauxton/app/templates/documents/sidebar.html
index cd6dedc..6147bea 100644
--- a/src/fauxton/app/templates/documents/sidebar.html
+++ b/src/fauxton/app/templates/documents/sidebar.html
@@ -38,7 +38,7 @@ the License.
<button class="btn dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
</button>
- <ul class="dropdown-menu">
+ <ul class="dropdown-menu" >
<!-- dropdown menu links -->
<li>
<a id="doc" href="#<%= database.url('app') %>/new">New doc</a>
@@ -48,6 +48,9 @@ the License.
<a href="#<%= database.url('app') %>/new_view">New view</a>
</li>
<% } %>
+ <% _.each(addLinks, function (link) { %>
+ <li><a class="<%= link.icon %>" href="#<%= database.url('app') %>/<%=link.url %>"><%= link.title %></a></li>
+ <% });%>
</ul>
</div>
</div>
@@ -65,7 +68,8 @@ the License.
<li class="nav-header">Secondary Indices</li>
<% if (showNewView) { %>
<li><a id="new-view" href="#<%= database.url('app') %>/new_view" class="new"><i class="icon-plus"></i> New</a></li>
- <% } %>
+ <% } %>
</ul>
+ <div id="extension-navs"></div>
</nav>
</div>