From 0942319fa86ccdb676b5bfede92c4e226556a4bf Mon Sep 17 00:00:00 2001 From: Meutel Date: Thu, 10 Jul 2014 10:51:05 +0200 Subject: [PATCH] add footer to layout add app name, version, url in footer --- bouquins.js | 4 ++++ views/author.jade | 1 - views/book.jade | 1 - views/footer.jade | 1 + views/home.jade | 1 - views/layout.jade | 1 + views/serie.jade | 1 - 7 files changed, 6 insertions(+), 4 deletions(-) diff --git a/bouquins.js b/bouquins.js index 9f46d3d..833bfc2 100644 --- a/bouquins.js +++ b/bouquins.js @@ -27,6 +27,10 @@ app.set('view engine', 'jade'); // load config _.extend(app.locals, require('./config/'+app.get('env')+'.json')); +var appPackage = require('./package.json'); +app.locals.appname = appPackage.name; +app.locals.appversion = appPackage.version; +app.locals.appurl = appPackage.url; // nginx app.enable('trust proxy'); diff --git a/views/author.jade b/views/author.jade index fdcd083..0ca2c1e 100644 --- a/views/author.jade +++ b/views/author.jade @@ -38,4 +38,3 @@ block content ul each author in coauthors li: a(href='/author/'+author.id)= author.name - include footer.jade diff --git a/views/book.jade b/views/book.jade index a01d23f..89fbbe5 100644 --- a/views/book.jade +++ b/views/book.jade @@ -44,4 +44,3 @@ block content div.col-md-7 if has_cover == 1 img.img-rounded.img-responsive(src='/calibre/'+path+'/cover.jpg',alt=t('bouquins.book.nocover')) - include footer.jade diff --git a/views/footer.jade b/views/footer.jade index d79dbcd..0eb258a 100644 --- a/views/footer.jade +++ b/views/footer.jade @@ -1,6 +1,7 @@ footer.footer .container ul.list-inline + li: a(href=appurl) #{appname} #{appversion} li: p.text-muted Copyright (c) 2014, Julien Guillot <meutel+github@meutel.net> li: a(href="/LICENSE.txt") View license li: a(href="http://calibre-ebook.com/",title="calibre"): img(src="/images/calibre.png") diff --git a/views/home.jade b/views/home.jade index 554ca0a..28fddca 100644 --- a/views/home.jade +++ b/views/home.jade @@ -48,7 +48,6 @@ block content div.btn-group.center-block each p in [10,20,50,100] button.btn.btn-default.perpage(type="button",value=p)= p - include footer.jade script | $(function() { | $.i18n.init().done(function() { diff --git a/views/layout.jade b/views/layout.jade index 78c9084..e13f946 100644 --- a/views/layout.jade +++ b/views/layout.jade @@ -15,3 +15,4 @@ html(lang=lang) script(src="/js/home.js") body block content + include footer.jade diff --git a/views/serie.jade b/views/serie.jade index 04e3b7e..edf9976 100644 --- a/views/serie.jade +++ b/views/serie.jade @@ -28,4 +28,3 @@ block content ul each author in authors li: a(href='/author/'+author.id)= author.name - include footer.jade