diff options
author | Simon Metson <metson@apache.org> | 2013-04-04 13:08:21 +0100 |
---|---|---|
committer | Simon Metson <metson@apache.org> | 2013-04-04 13:09:15 +0100 |
commit | 88c3171dc1d33979e51cdb18e96a2d333e440376 (patch) | |
tree | 8591222007cea540a30c27bb9870b3ff4beb63a4 | |
parent | 203ac897ec4b3e34dc795cb2ab2cec6146b7810b (diff) | |
download | couchdb-88c3171dc1d33979e51cdb18e96a2d333e440376.tar.gz |
footer as view
-rw-r--r-- | src/fauxton/app/app.js | 3 | ||||
-rw-r--r-- | src/fauxton/app/modules/fauxton/base.js | 9 | ||||
-rw-r--r-- | src/fauxton/app/router.js | 4 | ||||
-rw-r--r-- | src/fauxton/app/templates/fauxton/footer.html | 1 | ||||
-rw-r--r-- | src/fauxton/assets/index.underscore | 4 |
5 files changed, 17 insertions, 4 deletions
diff --git a/src/fauxton/app/app.js b/src/fauxton/app/app.js index 504609631..e754c5f81 100644 --- a/src/fauxton/app/app.js +++ b/src/fauxton/app/app.js @@ -23,7 +23,8 @@ function($, _, Backbone, Helpers) { // creation. var app = { // The root path to run the application. - root: "/" + root: "/", + version: "0.0.1" }; // Localize or create a new JavaScript Template object. diff --git a/src/fauxton/app/modules/fauxton/base.js b/src/fauxton/app/modules/fauxton/base.js index a8bf43051..0297dac63 100644 --- a/src/fauxton/app/modules/fauxton/base.js +++ b/src/fauxton/app/modules/fauxton/base.js @@ -36,6 +36,15 @@ function(app, Backbone) { } }); + Fauxton.Footer = Backbone.View.extend({ + template: "templates/fauxton/footer", + serialize: function() { + return { + version: app.version + }; + } + }); + Fauxton.NavBar = Backbone.View.extend({ template: "templates/fauxton/nav_bar", // TODO: can we generate this list from the router? diff --git a/src/fauxton/app/router.js b/src/fauxton/app/router.js index 2e994e547..77cc36b86 100644 --- a/src/fauxton/app/router.js +++ b/src/fauxton/app/router.js @@ -140,10 +140,12 @@ function(req, app, Initialize, FauxtonAPI, Fauxton, Layout, Databases, Documents }, initialize: function() { + //TODO: It would be nice to handle this with a router this.navBar = app.navBar = new Fauxton.NavBar(); this.apiBar = app.apiBar = new Fauxton.ApiBar(); app.masterLayout = this.masterLayout = new Layout(this.navBar, this.apiBar); + app.footer = new Fauxton.Footer({el: "#footer-content"}); // NOTE: This must be below creation of the layout // FauxtonAPI header links and others depend on existence of the layout @@ -152,6 +154,8 @@ function(req, app, Initialize, FauxtonAPI, Fauxton, Layout, Databases, Documents $("#app-container").html(this.masterLayout.el); this.masterLayout.render(); + + app.footer.render(); } }); diff --git a/src/fauxton/app/templates/fauxton/footer.html b/src/fauxton/app/templates/fauxton/footer.html new file mode 100644 index 000000000..6af1bcf66 --- /dev/null +++ b/src/fauxton/app/templates/fauxton/footer.html @@ -0,0 +1 @@ +<p>Fauxton <%=version%> on <a href="http://couchdb.apache.org/">Apache CouchDB</a></p>
\ No newline at end of file diff --git a/src/fauxton/assets/index.underscore b/src/fauxton/assets/index.underscore index 8a620062b..2b5c00997 100644 --- a/src/fauxton/assets/index.underscore +++ b/src/fauxton/assets/index.underscore @@ -43,9 +43,7 @@ <hr> <footer> - <div id="footer-content" class="container"> - <p>© Project Fauxton 2012</p> - </div> + <div id="footer-content" class="container"></div> </footer> </div> |