From 9b0ba5d668a20fc02bd28453395db9ed3fad3cf2 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Wed, 15 Oct 2014 21:13:01 -0400 Subject: Render footer on client instead of server. * guix-web/view.scm (main-layout): Remove footer. (all-packages): Remove '#guix' div. (librejs): Add container and logo. * js/view/layout.js (guix.withLayout): Render footer. --- js/view/layout.js | 51 ++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 38 insertions(+), 13 deletions(-) (limited to 'js/view') diff --git a/js/view/layout.js b/js/view/layout.js index 310c6c9..1ff641a 100644 --- a/js/view/layout.js +++ b/js/view/layout.js @@ -17,17 +17,42 @@ var guix = guix || {}; -guix.withLayout = function(elem) { - return [ - m("nav.navbar.navbar-default.navbar-static-top", { - role: "navigation" - }, m(".container", [ - m(".navbar-header", m("img.logo", { src: "/images/logo.png" })), - m("ul.nav.navbar-nav", [ - m("li.active", m("a", "Packages")), +guix.withLayout = (function() { + var footer = m("footer", m("small.text-center", [ + m("p", "Copyright 2014 guix-web contributors"), + m("ul.list-inline", [ + m("li", [ + "Guix-web is licensed under the ", + m("a", { + href: "http://www.gnu.org/licenses/agpl-3.0.html" + }, "GNU Affero General Public License version 3 or later") ]), - m("ul.nav.navbar-nav.navbar-right") - ])), - m(".container", elem) - ]; -}; + m("li", [ + m("a", { + href: "https://getbootstrap.com" + }, "Bootstrap CSS"), + " is licensed under the ", + m("a", { + href: "https://directory.fsf.org/wiki/License:Apache2.0" + }, "Apache 2.0 license") + ]), + m("li", + m("a", { href: "/librejs" }, "JavaScript license information")) + ]) + ])); + + return function(elem) { + return [ + m("nav.navbar.navbar-default.navbar-static-top", { + role: "navigation" + }, m(".container", [ + m(".navbar-header", m("img.logo", { src: "/images/logo.png" })), + m("ul.nav.navbar-nav", [ + m("li.active", m("a", "Packages")), + ]), + m("ul.nav.navbar-nav.navbar-right") + ])), + m(".container", elem.concat([footer])) + ]; + }; +})(); -- cgit v1.2.3