* refactor(routes): remove unused sitemap route * style(comments): enforce consistent comment style * style(exports): enforce consistent export style * chore: Add jsDoc for contentful service * chore: Add jsDoc for contentful service \n \n closes #23 * refactor(app): move query parameter comment to right position and mention comment route middleware * test(npm): add temporary test script * refactor(middlewares): split up bootstrap middleware - fixes #23759 * refactor(cookies): use constances to give context the maxAge cookie setting * refactor(variables): use more descriptive names for variables * space became spaceId when it was just the id not the full space instance * all (access) token variable name variants became [api-type]Token * all clients are now called deliveryClient or previewClient * cpa and cda only remain when they are used as actual API id * env variables names adjusted * perf(helpers): only run marked when content is not empty * refactor(comments): fix typos * refactor(comments): add hint why error is logged to console in settings * chore: Add comments to routes and services * refactor(requires): order and group requires * fix(settings): add validation for wrong preview token * chore: Add comments to routes * chore: fix typo * chore: console.error -> throw * chore: move cookie name to a constant * chore: Fix app.js comment * typo: removing t * chore: typos * chore: removed unnecessary comment line sign * chore: newline for readabillity * chore: remove dangling `t` * chore: remove `t`, add `l` * chore: typos * Fleshed out title * build(npm): remove unused dependencies * build(npm): upgrade to latest stable contentful sdk * chore: Addressing David feedbak * fix(credentials): update to match the new space * chore: Addressing code review comments * chore: Addressing code review comments * chore: res -> response, req-> request * chore: include exactly what we need * chore: Address JPs comments * chore: Address JPs comments * chore: Address Fredericks comments * chore: Address Fredericks comments * fixup! chore: Address Fredericks comments * fixup! fixup! chore: Address Fredericks comments * fixup! fixup! fixup! chore: Address Fredericks comments * fixup! fixup! fixup! fixup! chore: Address Fredericks comments * fixup! fixup! fixup! fixup! fixup! chore: Address Fredericks comments * fixup! fixup! fixup! fixup! fixup! fixup! chore: Address Fredericks comments
73 lines
3.1 KiB
Plaintext
73 lines
3.1 KiB
Plaintext
extends layout
|
|
|
|
include mixins/_breadcrumb
|
|
|
|
mixin renderErrors (errors)
|
|
each message in errors
|
|
.form-item__error-wrapper
|
|
svg.form-item__error-icon
|
|
use(xlink:href='/icons/icons.svg#error')
|
|
.form-item__error-message= message
|
|
|
|
block content
|
|
.layout-centered-small
|
|
+breadcrumb
|
|
h1= title
|
|
p To query and get content using the APIs, client applications need to authenticate with both the Space ID and an access token.
|
|
|
|
if success
|
|
.status-block.status-block--success
|
|
svg.status-block__icon.status-block__icon--success
|
|
use(xlink:href='/icons/icons.svg#success')
|
|
.status-block__content
|
|
.status-block__title Changes saved successfully!
|
|
|
|
if hasErrors
|
|
.status-block.status-block--error
|
|
svg.status-block__icon.status-block__icon--error
|
|
use(xlink:href='/icons/icons.svg#error')
|
|
.status-block__content
|
|
.status-block__title Error occurred
|
|
.status-block__message Some errors occurred. Please check the error messages next to the fields.
|
|
|
|
if space && !hasErrors
|
|
.status-block.status-block--info
|
|
svg.status-block__icon.status-block__icon--info
|
|
use(xlink:href='/icons/icons.svg#info')
|
|
.status-block__content
|
|
.status-block__message Connected to space “#{space.name}”
|
|
|
|
form(action=`/settings` method="POST" class="form")
|
|
.form-item
|
|
label(for="input-space-id") Space ID
|
|
input(type="text" name="spaceId" id="input-space-id" value=settings.spaceId)
|
|
if 'spaceId' in errors
|
|
+renderErrors(errors.spaceId)
|
|
.form-item__help-text The Space ID is a unique identifier for your space.
|
|
|
|
.form-item
|
|
label(for="input-delivery-token") Content Delivery API - access token
|
|
input(type="text" name="deliveryToken" id="input-delivery-token" value=settings.deliveryToken)
|
|
if 'deliveryToken' in errors
|
|
+renderErrors(errors.deliveryToken)
|
|
.form-item__help-text
|
|
| View published content using this API.
|
|
a(href='https://www.contentful.com/developers/docs/references/content-delivery-api/' target='_blank' rel='noopener') Content Delivery API.
|
|
|
|
.form-item
|
|
label(for="input-preview-token") Content Preview API - access token
|
|
input(type="text" name="previewToken" id="input-preview-token" value=settings.previewToken)
|
|
if 'previewToken' in errors
|
|
+renderErrors(errors.previewToken)
|
|
.form-item__help-text
|
|
| Preview unpublished content using this API (i.e. content with “Draft” status).
|
|
a(href='https://www.contentful.com/developers/docs/references/content-preview-api/' target='_blank' rel='noopener') Content Preview API.
|
|
|
|
.form-item
|
|
input(type="checkbox" name="editorialFeatures" id="input-editorial-features" checked=settings.editorialFeatures)
|
|
label(for="input-editorial-features") Enable editorial features
|
|
.form-item__help-text Enable to display an edit link and other contextual helpers for authors. You need to have access to the connected space to make this work.
|
|
|
|
.form-item
|
|
input.cta(type="submit" value="Save settings")
|