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 2014/08/06 21:31:27 UTC
[20/26] fauxton commit: updated refs/heads/secondary-indexes to
7a446d8
Fixes for the header
Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/6e343fa3
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/6e343fa3
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/6e343fa3
Branch: refs/heads/secondary-indexes
Commit: 6e343fa39b7643979ab0600aa284b8d982e6518e
Parents: 00cd32e
Author: deathbearbrown <de...@gmail.com>
Authored: Tue Aug 5 16:57:41 2014 -0400
Committer: deathbearbrown <de...@gmail.com>
Committed: Wed Aug 6 12:24:47 2014 -0400
----------------------------------------------------------------------
app/addons/documents/routes.js | 14 +++++++-----
.../documents/templates/header_alldocs.html | 23 ++++----------------
app/addons/documents/views.js | 13 +++++++++--
3 files changed, 23 insertions(+), 27 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/6e343fa3/app/addons/documents/routes.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/routes.js b/app/addons/documents/routes.js
index aff92f1..ccb5d71 100644
--- a/app/addons/documents/routes.js
+++ b/app/addons/documents/routes.js
@@ -171,12 +171,12 @@ function(app, FauxtonAPI, Components, Documents, Changes, DocEditor, Databases,
limit: 500
}
});
-
- this.header = this.setView("#breadcrumbs", new Documents.Views.AllDocsHeader({
+ //The header has 2 parts now
+ //the right side will have api bar, search, query options etc
+ this.headerRight = this.setView("#api-navbar", new Documents.Views.RightAllDocsHeader({
database: this.data.database
}));
-
this.sidebar = this.setView("#sidebar-content", new Documents.Views.Sidebar({
collection: this.data.designDocs,
database: this.data.database
@@ -202,7 +202,7 @@ function(app, FauxtonAPI, Components, Documents, Changes, DocEditor, Databases,
];
};
- this.apiUrl = [designDocInfo.url('apiurl'), designDocInfo.documentation() ];
+ this.headerRight.updateApiUrl([designDocInfo.url('apiurl'), designDocInfo.documentation()]);
},
@@ -260,7 +260,9 @@ function(app, FauxtonAPI, Components, Documents, Changes, DocEditor, Databases,
{"name": this.data.database.id, "link": Databases.databaseUrl(this.data.database)}
];
- this.apiUrl = [this.data.database.allDocs.urlRef("apiurl", urlParams), this.data.database.allDocs.documentation() ];
+
+ //needs to be added back
+ this.headerRight.updateApiUrl([this.data.database.allDocs.urlRef("apiurl", urlParams), this.data.database.allDocs.documentation()]);
},
@@ -309,7 +311,7 @@ function(app, FauxtonAPI, Components, Documents, Changes, DocEditor, Databases,
this.documentsView.setParams(docParams, urlParams);
this.documentsView.forceRender();
- this.apiUrl = [collection.urlRef("apiurl", urlParams), "docs"];
+ this.headerRight.updateApiUrl([collection.urlRef("apiurl", urlParams), "docs"]);
},
perPageChange: function (perPage) {
http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/6e343fa3/app/addons/documents/templates/header_alldocs.html
----------------------------------------------------------------------
diff --git a/app/addons/documents/templates/header_alldocs.html b/app/addons/documents/templates/header_alldocs.html
index dfdfc03..d83cb08 100644
--- a/app/addons/documents/templates/header_alldocs.html
+++ b/app/addons/documents/templates/header_alldocs.html
@@ -12,29 +12,14 @@ License for the specific language governing permissions and limitations under
the License.
-->
-<div class="header-left">
- <!--back arrow-->
-
- <!--title with dropdown DB search-->
- <h2><%-database%></h2>
-
- <!-- Menu gear-->
-</div>
-
-
-<div class="header-right">
<!-- Select all -->
-
+
<!-- search (jump to doc)-->
<div id="header-search" class="js-search searchbox-container"></div>
-
+
<!-- Query Options-->
<div class="header-query-options">
<!-- Insert the query options here :) -->
- <div id="query-options">
- </div>
+ <div id="query-options"></div>
+ <div id="header-api-bar"></div>
</div>
-
-</div>
-
-<!--right margin for api bar-->
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/6e343fa3/app/addons/documents/views.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/views.js b/app/addons/documents/views.js
index 88a79c8..b26e17c 100644
--- a/app/addons/documents/views.js
+++ b/app/addons/documents/views.js
@@ -39,8 +39,9 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
});
}
- //Header for alldocs with search, back, Menu, Query options, select etc
- Views.AllDocsHeader = FauxtonAPI.View.extend({
+ //Header for alldocs with search, Query options,& api bar
+ Views.RightAllDocsHeader = FauxtonAPI.View.extend({
+ className: "header-right",
template: "addons/documents/templates/header_alldocs",
events: {
'select .selectAllDocs': 'selectAllDocs'
@@ -52,6 +53,11 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
selectAllDocs: function(){
//trigger event to select all in other view
},
+ updateApiUrl: function(api){
+ //this will update the api bar when the route changes
+ //you can find the method that updates it in components.js Components.ApiBar()
+ this.apiBar && this.apiBar.update(api);
+ },
serialize: function() {
//basically if you want something in a template, You can define it here
return {
@@ -97,6 +103,9 @@ function(app, FauxtonAPI, Components, Documents, Databases, Views, QueryOptions,
showPreview: false,
}));
+ //Moved the apibar view into the components file so you can include it in your views
+ this.apiBar = this.insertView("#header-api-bar", new Components.ApiBar({}));
+
},
//moved from alldocs layout
updateAllDocs: function (event, paramInfo) {