Add the build version to the primary nav, instead of the footer
Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/f6a1dc5f Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/f6a1dc5f Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/f6a1dc5f Branch: refs/heads/Update-Sidebar-Ui Commit: f6a1dc5f29c327712e31c9b47c47dcffd3fcefea Parents: c97b453 Author: suelockwood <deathb...@apache.org> Authored: Thu Apr 17 11:37:30 2014 -0400 Committer: suelockwood <deathb...@apache.org> Committed: Thu Apr 17 11:37:54 2014 -0400 ---------------------------------------------------------------------- .../addons/auth/templates/nav_link_title.html | 14 +-- src/fauxton/app/addons/fauxton/base.js | 21 +++-- .../app/addons/fauxton/templates/footer.html | 2 +- .../app/addons/fauxton/templates/nav_bar.html | 7 +- src/fauxton/assets/less/fauxton.less | 96 +++++++++++--------- 5 files changed, 76 insertions(+), 64 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb/blob/f6a1dc5f/src/fauxton/app/addons/auth/templates/nav_link_title.html ---------------------------------------------------------------------- diff --git a/src/fauxton/app/addons/auth/templates/nav_link_title.html b/src/fauxton/app/addons/auth/templates/nav_link_title.html index 863955c..1ec9bf4 100644 --- a/src/fauxton/app/addons/auth/templates/nav_link_title.html +++ b/src/fauxton/app/addons/auth/templates/nav_link_title.html @@ -12,20 +12,20 @@ License for the specific language governing permissions and limitations under the License. --> <% if (admin_party) { %> - <a id="user-create-admin" class="alert_nav" href="#createAdmin"> + <a id="user-create-admin" class="alert_nav" href="#createAdmin"> <span class="fonticon-user fonticon"></span> - Admin Party! [FIX THIS] + Admin Party! <br>[FIX THIS]<br> <small>Everyone is an admin.</small> </a> <% } else if (user) { %> <a href="#changePassword" > - <span class="fonticon-user fonticon"></span> - <%= user.name %> + <span class="fonticon-user fonticon"></span> + <%= user.name %> </a> <% } else { %> - <a href="#login" > - <span class="fonticon-user fonticon"></span> - Login + <a href="#login" > + <span class="fonticon-user fonticon"></span> + Login </a> <% } %> http://git-wip-us.apache.org/repos/asf/couchdb/blob/f6a1dc5f/src/fauxton/app/addons/fauxton/base.js ---------------------------------------------------------------------- diff --git a/src/fauxton/app/addons/fauxton/base.js b/src/fauxton/app/addons/fauxton/base.js index 3a6a428..861c544 100644 --- a/src/fauxton/app/addons/fauxton/base.js +++ b/src/fauxton/app/addons/fauxton/base.js @@ -46,17 +46,15 @@ function(app, FauxtonAPI, resizeColumns) { }); Fauxton.initialize = function () { - app.footer = new Fauxton.Footer({el: "#footer-content"}), + // app.footer = new Fauxton.Footer({el: "#footer-content"}), app.navBar = new Fauxton.NavBar(); app.apiBar = new Fauxton.ApiBar(); - FauxtonAPI.when.apply(null, app.footer.establish()).done(function() { + FauxtonAPI.when.apply(null, app.navBar.establish()).done(function() { FauxtonAPI.masterLayout.setView("#primary-navbar", app.navBar, true); FauxtonAPI.masterLayout.setView("#api-navbar", app.apiBar, true); app.navBar.render(); app.apiBar.render(); - - app.footer.render(); }); FauxtonAPI.masterLayout.navBar = app.navBar; @@ -114,6 +112,7 @@ function(app, FauxtonAPI, resizeColumns) { }); Fauxton.Footer = FauxtonAPI.View.extend({ + tagName: "p", template: "addons/fauxton/templates/footer", initialize: function() { @@ -134,17 +133,17 @@ function(app, FauxtonAPI, resizeColumns) { Fauxton.NavBar = FauxtonAPI.View.extend({ className:"navbar", template: "addons/fauxton/templates/nav_bar", - + events: { "click .burger" : "toggleMenu" }, - + toggleMenu: function(){ var $selectorList = $('body'); $selectorList.toggleClass('closeMenu'); this.resizeColumns.onResizeHandler(); }, - + // TODO: can we generate this list from the router? navLinks: [ {href:"#/_all_dbs", title:"Databases", icon: "fonticon-database", className: 'databases'} @@ -158,9 +157,10 @@ function(app, FauxtonAPI, resizeColumns) { //resizeAnimation app.resizeColumns = this.resizeColumns = new resizeColumns({}); this.resizeColumns.onResizeHandler(); - + FauxtonAPI.extensions.on('add:navbar:addHeaderLink', this.addLink); FauxtonAPI.extensions.on('removeItem:navbar:addHeaderLink', this.removeLink); + this.versionFooter = new Fauxton.Footer({}); }, serialize: function() { @@ -171,6 +171,10 @@ function(app, FauxtonAPI, resizeColumns) { }; }, + establish: function(){ + return [this.versionFooter.establish()]; + }, + addLink: function(link) { // link.top means it gets pushed to the top of the array, // link.bottomNav means it goes to the additional bottom nav @@ -230,6 +234,7 @@ function(app, FauxtonAPI, resizeColumns) { }, beforeRender: function () { + this.insertView(".version", this.versionFooter); this.addLinkViews(); }, http://git-wip-us.apache.org/repos/asf/couchdb/blob/f6a1dc5f/src/fauxton/app/addons/fauxton/templates/footer.html ---------------------------------------------------------------------- diff --git a/src/fauxton/app/addons/fauxton/templates/footer.html b/src/fauxton/app/addons/fauxton/templates/footer.html index 593c11f..781ffce 100644 --- a/src/fauxton/app/addons/fauxton/templates/footer.html +++ b/src/fauxton/app/addons/fauxton/templates/footer.html @@ -12,4 +12,4 @@ License for the specific language governing permissions and limitations under the License. --> -<p>Fauxton on <a href="http://couchdb.apache.org/">Apache CouchDB</a> <%=version%></p> +Fauxton on <a href="http://couchdb.apache.org/">Apache CouchDB</a><br> v. <%=version%> http://git-wip-us.apache.org/repos/asf/couchdb/blob/f6a1dc5f/src/fauxton/app/addons/fauxton/templates/nav_bar.html ---------------------------------------------------------------------- diff --git a/src/fauxton/app/addons/fauxton/templates/nav_bar.html b/src/fauxton/app/addons/fauxton/templates/nav_bar.html index 877c9d5..255ebd4 100644 --- a/src/fauxton/app/addons/fauxton/templates/nav_bar.html +++ b/src/fauxton/app/addons/fauxton/templates/nav_bar.html @@ -30,7 +30,7 @@ the License. </li> <% }); %> </ul> - + <div id="bottom-nav"> <ul id="bottom-nav-links" class="nav"> <li data-nav-name= "Documentation"> @@ -39,7 +39,7 @@ the License. Documentation </a> </li> - + <% _.each(bottomNavLinks, function(link) { %> <% if (link.view) {return;} %> <li data-nav-name= "<%= link.title %>"> @@ -70,4 +70,5 @@ the License. <% }); %> </ul> </div> -</div> \ No newline at end of file + <div class="version"></div> +</div> http://git-wip-us.apache.org/repos/asf/couchdb/blob/f6a1dc5f/src/fauxton/assets/less/fauxton.less ---------------------------------------------------------------------- diff --git a/src/fauxton/assets/less/fauxton.less b/src/fauxton/assets/less/fauxton.less index dc6435b..ba80b5b 100644 --- a/src/fauxton/assets/less/fauxton.less +++ b/src/fauxton/assets/less/fauxton.less @@ -338,6 +338,11 @@ table.databases { bottom: 0; background-color: @primaryNav; overflow-y: scroll; + .version { + color: #fff; + font-size: 10px; + padding-left: 10px; + } #footer-links{ position: absolute; bottom: 0; @@ -388,7 +393,7 @@ table.databases { background: url(../img/couchdb-site.png) no-repeat 0 0; display: block; height: 100%; - width: 100%; + width: 100%; } .closeMenu & { .icon { @@ -410,7 +415,7 @@ table.databases { text-decoration: underline; } } - } + } } } nav { @@ -489,7 +494,7 @@ table.databases { color: @red; } } - + } ul#bottom-nav-links{ margin-top: 0; @@ -499,7 +504,7 @@ table.databases { background-color: @bottomNav; &.active{ background-color:@linkRed; - } + } &:hover{ background-color: @navBGHover; } @@ -507,6 +512,7 @@ table.databases { &.fonticon { position: relative; &:before { + top: -5px; left: -40px; font-size: 22px; } @@ -780,14 +786,14 @@ table.databases { .custom-inputs{ - input[type=radio], - input[type=checkbox] { - display: none; - } + input[type=radio], + input[type=checkbox] { + display: none; + } - .checkbox label:before { - border-radius: 3px; - } + .checkbox label:before { + border-radius: 3px; + } .controls > .radio:first-child, .controls > .checkbox:first-child { padding-top: 15px; @@ -800,42 +806,42 @@ table.databases { vertical-align: middle; } - input[type=checkbox]:checked + label:before { + input[type=checkbox]:checked + label:before { /*content: "\2713"; */ - content: "\00d7"; - text-shadow: 1px 1px 1px rgba(0, 0, 0, .2); + content: "\00d7"; + text-shadow: 1px 1px 1px rgba(0, 0, 0, .2); font-size: 16px; - background-color: @red; - color: white; - text-align: center; - line-height: 15px; - } - - label:before { - content: ""; - display: inline-block; - - width: 16px; - height: 16px; - - margin-right: 10px; - position: absolute; - left: 0; - bottom: 1px; - background-color: #aaa; - box-shadow: inset 0px 2px 3px 0px rgba(0, 0, 0, .3), 0px 1px 0px 0px rgba(255, 255, 255, .8); - } - - .radio label:before { - border-radius: 8px; - } - - input[type=radio]:checked + label:before { - content: "\2022"; - color: #f3f3f3; - font-size: 30px; - text-align: center; - line-height: 18px; + background-color: @red; + color: white; + text-align: center; + line-height: 15px; + } + + label:before { + content: ""; + display: inline-block; + + width: 16px; + height: 16px; + + margin-right: 10px; + position: absolute; + left: 0; + bottom: 1px; + background-color: #aaa; + box-shadow: inset 0px 2px 3px 0px rgba(0, 0, 0, .3), 0px 1px 0px 0px rgba(255, 255, 255, .8); + } + + .radio label:before { + border-radius: 8px; + } + + input[type=radio]:checked + label:before { + content: "\2022"; + color: #f3f3f3; + font-size: 30px; + text-align: center; + line-height: 18px; } label.drop-down{