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

View File

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

View File

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

View File

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

View File

@ -73,7 +73,7 @@ module.exports.http = {
publishLimit: publishLimiter, publishLimit: publishLimiter,
passportInit: require('passport').initialize(), passportInit: require('passport').initialize(),
passportSession: require('passport').session(), passportSession: require('passport').session(),
allowCrossDomain: allowCrossDomain allowCrossDomain: allowCrossDomain,
/*************************************************************************** /***************************************************************************
* * * *
@ -83,10 +83,10 @@ module.exports.http = {
* * * *
***************************************************************************/ ***************************************************************************/
// bodyParser: (function _configureBodyParser(){ bodyParser: (function _configureBodyParser () {
// var skipper = require('skipper'); const skipper = require('skipper')
// var middlewareFn = skipper({ strict: true }); const middlewareFn = skipper({ strict: true })
// return middlewareFn; 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'> <body class='home flex-container flex-vertical'>
<%- partial('../shared/header.html') %> <%- partial('../shared/header.html') %>
<main class="flex"> <main class="flex">
<% if (content) { %> <section class="paper">
<%- content %> <%- content %>
<% } %> </section>
</main> </main>
<%- partial('../shared/footer.html') %> <%- partial('../shared/footer.html') %>
</body> </body>