fields renamed

pull/46/head
unknown 2019-03-14 12:41:50 -04:00
parent c5d05eb89c
commit ea5265694f
7 changed files with 32 additions and 17 deletions

View File

@ -23,7 +23,7 @@ module.exports = {
if (!body.metadata['@type'] || body.metadata['@type'] !== 'http://schema.org/Book') throw new HttpError(400, 'Invalid \'@type\': expected \'http://schema.org/Book\'')
const query = {
source: host,
hostname: host,
title: body.metadata.title,
author: body.metadata.author,
publisher: body.metadata.publisher,

View File

@ -57,10 +57,10 @@ module.exports = {
currentPage: page
},
links: [
{ rel: 'self', href: `new?page=${page}`, type: 'application/opds+json' },
{ rel: 'prev', href: `new?page=${page > 1 ? page - 1 : page}`, type: 'application/opds+json' },
{ rel: 'next', href: `new?page=${page + 1}`, type: 'application/opds+json' },
{ 'rel': 'search', 'href': 'all{?title,author,version,isbn}', 'type': 'application/opds+json', 'templated': true }
{ rel: 'self', href: `all?page=${page}`, type: 'application/opds+json' },
{ rel: 'prev', href: `all?page=${page > 1 ? page - 1 : page}`, type: 'application/opds+json' },
{ rel: 'next', href: `all?page=${page + 1}`, type: 'application/opds+json' },
{ rel: 'search', href: 'all{?title,author,version,isbn}', type: 'application/opds+json', templated: true }
],
publications: books
})

View File

@ -20,10 +20,10 @@ module.exports = {
title: { type: 'string', required: true },
author: { type: 'string' },
publisher: { type: 'string' },
isbn: { type: 'string' },
identifier: { type: 'string' },
version: { type: 'string' },
hostname: { type: 'string' },
storage: { type: 'string' }
opds: { type: 'json' }
// ╔═╗╔╦╗╔╗ ╔═╗╔╦╗╔═╗
// ║╣ ║║║╠╩╗║╣ ║║╚═╗

View File

@ -107,7 +107,7 @@
line-height: 40px;
height: 40px;
margin: 5px 20px 5px 0;
background: $accent-1;
background: $accent-2;
color: $text-light-1;
border-radius: 3px;
}
@ -131,7 +131,7 @@
}
}
}
main {
.paper {
background: white;
width: 85%;
max-width: 900px;

View File

@ -73,7 +73,7 @@ module.exports.http = {
publishLimit: publishLimiter,
passportInit: require('passport').initialize(),
passportSession: require('passport').session(),
allowCrossDomain: allowCrossDomain
allowCrossDomain: allowCrossDomain,
/***************************************************************************
* *
@ -83,10 +83,10 @@ module.exports.http = {
* *
***************************************************************************/
// bodyParser: (function _configureBodyParser(){
// var skipper = require('skipper');
// var middlewareFn = skipper({ strict: true });
// return middlewareFn;
// })(),
bodyParser: (function _configureBodyParser () {
const skipper = require('skipper')
const middlewareFn = skipper({ strict: true })
return middlewareFn
})()
}
}

View File

@ -0,0 +1,15 @@
exports.up = function (knex, Promise) {
return Promise.all([
knex.schema.table('book', t => {
t.dropColumns('source')
})
])
}
exports.down = function (knex, Promise) {
return Promise.all([
knex.schema.table('book', t => {
t.string('source')
})
])
}

View File

@ -10,9 +10,9 @@
<body class='home flex-container flex-vertical'>
<%- partial('../shared/header.html') %>
<main class="flex">
<% if (content) { %>
<section class="paper">
<%- content %>
<% } %>
</section>
</main>
<%- partial('../shared/footer.html') %>
</body>