diff --git a/src/static/pictures/ndla-logo.svg b/src/static/pictures/ndla-logo.svg new file mode 100644 index 0000000..6da3086 --- /dev/null +++ b/src/static/pictures/ndla-logo.svg @@ -0,0 +1,10 @@ + + + + + + + + + diff --git a/src/static/pictures/ndla_header_bg.jpg b/src/static/pictures/ndla_header_bg.jpg deleted file mode 100644 index 38e7248..0000000 Binary files a/src/static/pictures/ndla_header_bg.jpg and /dev/null differ diff --git a/src/utils/htmlTemplates.js b/src/utils/htmlTemplates.js index 3ee5fa2..ad8aced 100644 --- a/src/utils/htmlTemplates.js +++ b/src/utils/htmlTemplates.js @@ -1,12 +1,15 @@ - import httpStaus from 'http-status'; - import config from '../config'; +import httpStaus from 'http-status'; +import config from '../config'; - const bodyInfo = isAdvanced => ` +/* eslint arrow-body-style: 0 */ +/* eslint arrow-parens: 0 */ + +const bodyInfo = (isAdvanced) => `
APIs from NDLA
- +

Open Educational Resources For Secondary Schools

@@ -17,10 +20,10 @@

NDLA provides a rich set of endpoints to extract articles and specific components of our content. \\ - All content is made available based on content licenses and the specific licence is included in metadata and can be used to filter the result. + All content is made available based on content licenses and the specific licence is included in metadata and can be used to filter the result.

- In addition, we provide a search-api for all our content based on Elasticsearch simple search language. + In addition, we provide a search-api for all our content based on Elasticsearch simple search language.

This is a beta level service, with no liability for the quality of the content and what the content is used for. @@ -28,7 +31,7 @@

`; - export const htmlTemplate = (isAdvanced, body) => +export const htmlTemplate = (isAdvanced, body) => `\n @@ -43,39 +46,48 @@ `; - export const apiDocsUri = (apiObj) => { - for (const uri of apiObj.paths) { - if (config.apiDocPath.test(uri)) { - return uri; - } - } - return undefined; - }; +export const apiDocsUri = (apiObj) => { + for (const uri of apiObj.paths) { + if (config.apiDocPath.test(uri)) { + return uri; + } + } + return undefined; +}; - export const apiListTemplate = (path, routes) => { - let filtered = routes.sort((a, b) => a.name.localeCompare(b.name)); - if (path === '/') { - filtered = routes.filter(route => config.whitelist.includes(route.name)); - } +export const apiListTemplate = (path, routes) => { + let filtered = routes.sort((a, b) => a.name.localeCompare(b.name)); + if (path === '/') { + filtered = routes.filter((route) => config.whitelist.includes(route.name)); + } - const listItems = filtered.map(route => - `
  • ${route.name}
  • ` - ); - const isAdvanced = path !== '/'; - return htmlTemplate(isAdvanced, listItems.join('')); - }; + const listItems = filtered.map( + (route) => + `
  • ${route.name}
  • `, + ); + const isAdvanced = path !== '/'; + return htmlTemplate(isAdvanced, listItems.join('')); +}; - export const htmlErrorTemplate = ({ status, message, description, stacktrace }) => { - const statusMsg = httpStaus[status]; - return htmlTemplate('/', ` +export const htmlErrorTemplate = ({ + status, + message, + description, + stacktrace, +}) => { + const statusMsg = httpStaus[status]; + return htmlTemplate( + '/', + `

    ${status} ${statusMsg}

    Message: ${message}
    Description: ${description}
    ${stacktrace}
    - `); - }; + `, + ); +}; - const documentHead = isAdvanced => ` +const documentHead = (isAdvanced) => ` Swagger UI @@ -86,19 +98,23 @@ - - ${!isAdvanced ? ` + + ${ + !isAdvanced + ? ` ` : ''} + ` + : '' + } `; - const bodyLogic = personalClientId => ` +const bodyLogic = (personalClientId) => ` `; - const documentBody = (personalClientId, isAdvanced) => ` +const documentBody = (personalClientId, isAdvanced) => ` ${bodyInfo(isAdvanced)}
    @@ -142,7 +158,7 @@ `; - export const index = (personalClientId, isAdvanced) => ` +export const index = (personalClientId, isAdvanced) => ` ${documentHead(isAdvanced)}