Display book details (publisher)
This commit is contained in:
parent
0942319fa8
commit
40dc219c45
@ -33,7 +33,12 @@
|
|||||||
"serie": "Serie",
|
"serie": "Serie",
|
||||||
"language": "Language",
|
"language": "Language",
|
||||||
"tags": "Tag(s)",
|
"tags": "Tag(s)",
|
||||||
"nocover": "No cover"
|
"nocover": "No cover",
|
||||||
|
"details": "Details",
|
||||||
|
"detail": {
|
||||||
|
"pubdate": "Publication date",
|
||||||
|
"pubname": "Publisher"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"author": {
|
"author": {
|
||||||
"books": "Books",
|
"books": "Books",
|
||||||
|
@ -33,7 +33,12 @@
|
|||||||
"serie": "Série",
|
"serie": "Série",
|
||||||
"language": "Langue",
|
"language": "Langue",
|
||||||
"tags": "Tag(s)",
|
"tags": "Tag(s)",
|
||||||
"nocover": "Pas de couverture"
|
"nocover": "Pas de couverture",
|
||||||
|
"details": "Détails",
|
||||||
|
"detail": {
|
||||||
|
"pubdate": "Date de publication",
|
||||||
|
"pubname": "Editeur"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"author": {
|
"author": {
|
||||||
"books": "Livres",
|
"books": "Livres",
|
||||||
|
@ -150,12 +150,13 @@ router.post('/', function(req,res) {
|
|||||||
|
|
||||||
/* Single book */
|
/* Single book */
|
||||||
router.get('/:id', function(req, res) {
|
router.get('/:id', function(req, res) {
|
||||||
var book, authors, tags;
|
var book, authors, tags, details;
|
||||||
var queries = 3;
|
var queries = 4;
|
||||||
var callback = function() {
|
var callback = function() {
|
||||||
if (queries == 0) {
|
if (queries == 0) {
|
||||||
book.authors = authors;
|
book.authors = authors;
|
||||||
book.tags = tags;
|
book.tags = tags;
|
||||||
|
book.custom = custom;
|
||||||
res.format({
|
res.format({
|
||||||
html: function(){
|
html: function(){
|
||||||
res.render('book', book);
|
res.render('book', book);
|
||||||
@ -207,6 +208,18 @@ router.get('/:id', function(req, res) {
|
|||||||
callback();
|
callback();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
// details
|
||||||
|
custom = new Array();
|
||||||
|
req.db.each('SELECT publishers.name as pubname FROM publishers, books_publishers_link WHERE books_publishers_link.publisher = publishers.id AND books_publishers_link.book = ?', req.params.id,
|
||||||
|
function(err, publisher) {
|
||||||
|
custom.push({name:'pubname',value:publisher.pubname});
|
||||||
|
},
|
||||||
|
function(err) {
|
||||||
|
if (err) console.log('ERR tags: '+err);
|
||||||
|
queries--;
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
@ -12,6 +12,7 @@ block content
|
|||||||
h1
|
h1
|
||||||
span.glyphicon.glyphicon-book
|
span.glyphicon.glyphicon-book
|
||||||
| #{title}
|
| #{title}
|
||||||
|
if format
|
||||||
a.btn.btn-success(href='/calibre/'+path+'/'+data_name+'.'+format.toLowerCase())
|
a.btn.btn-success(href='/calibre/'+path+'/'+data_name+'.'+format.toLowerCase())
|
||||||
span.glyphicon.glyphicon-download-alt
|
span.glyphicon.glyphicon-download-alt
|
||||||
| #{t('bouquins.book.download')} #{format}
|
| #{t('bouquins.book.download')} #{format}
|
||||||
@ -41,6 +42,17 @@ block content
|
|||||||
each tag in tags
|
each tag in tags
|
||||||
span.label.label-info= tag.name
|
span.label.label-info= tag.name
|
||||||
|
|
|
|
||||||
|
h2 #{t('bouquins.book.details')}
|
||||||
|
ul
|
||||||
|
if pubdate
|
||||||
|
li
|
||||||
|
strong #{t('bouquins.book.detail.pubdate')}
|
||||||
|
| #{new Date(pubdate).getMonth()}-#{new Date(pubdate).getFullYear()}
|
||||||
|
if custom
|
||||||
|
each item in custom
|
||||||
|
li
|
||||||
|
strong #{t('bouquins.book.detail.'+item.name)}
|
||||||
|
| #{item.value}
|
||||||
div.col-md-7
|
div.col-md-7
|
||||||
if has_cover == 1
|
if has_cover == 1
|
||||||
img.img-rounded.img-responsive(src='/calibre/'+path+'/cover.jpg',alt=t('bouquins.book.nocover'))
|
img.img-rounded.img-responsive(src='/calibre/'+path+'/cover.jpg',alt=t('bouquins.book.nocover'))
|
||||||
|
Loading…
Reference in New Issue
Block a user