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/ddd4a010 Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/ddd4a010 Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/ddd4a010 Branch: refs/heads/secondary-indexes Commit: ddd4a0105699c501367ce6f46f5c498e4ef8d701 Parents: 08eaff7 Author: deathbearbrown <[email protected]> Authored: Tue Aug 5 16:57:41 2014 -0400 Committer: deathbearbrown <[email protected]> Committed: Tue Aug 5 16:57:41 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/ddd4a010/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/ddd4a010/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/ddd4a010/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) {
