104 lines
4.8 KiB
Plaintext
104 lines
4.8 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 #{translate('settingsIntroLabel', currentLocale.code)}
|
|
|
|
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 #{translate('changesSavedLabel', currentLocale.code)}
|
|
|
|
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 #{translate('errorOccurredTitleLabel', currentLocale.code)}
|
|
.status-block__message #{translate('errorOccurredMessageLabel', currentLocale.code)}
|
|
|
|
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
|
|
if !helpers.isCustomCredentials(settings)
|
|
p
|
|
em #{translate('usingServerCredentialsLabel', currentLocale.code)}
|
|
p
|
|
strong #{translate('connectedToSpaceLabel', currentLocale.code)}:
|
|
br
|
|
span #{space.name} (#{settings.spaceId})
|
|
p
|
|
strong #{translate('credentialSourceLabel', currentLocale.code)}:
|
|
br
|
|
span #{translate('loadedFromLocalFileLabel', currentLocale.code)}
|
|
a(href="https://github.com/contentful/the-example-app.nodejs/blob/master/variables.env" target="_blank" rel="noopener") variable.env
|
|
p
|
|
em #{translate('overrideConfigLabel', currentLocale.code)}
|
|
else
|
|
p
|
|
em #{translate('usingSessionCredentialsLabel', currentLocale.code)}
|
|
p
|
|
strong #{translate('connectedToSpaceLabel', currentLocale.code)}:
|
|
br
|
|
span #{space.name} (#{settings.spaceId})
|
|
|
|
form(action='/settings?reset=true' method='POST')
|
|
p
|
|
strong #{translate('applicationCredentialsLabel', currentLocale.code)}:
|
|
br
|
|
button(type="submit") #{translate('resetCredentialsLabel', currentLocale.code)}
|
|
br
|
|
a(href=`${baseUrl}/${queryStringSettings}` class="status-block__sharelink") #{translate('copyLinkLabel', currentLocale.code)}
|
|
p
|
|
em #{translate('overrideConfigLabel', currentLocale.code)}
|
|
|
|
form(action=`/settings${queryString}` method="POST" class="form")
|
|
.form-item
|
|
label(for="input-space-id") #{translate('spaceIdLabel', currentLocale.code)}
|
|
input(type="text" name="spaceId" id="input-space-id" value=settings.spaceId required)
|
|
if 'spaceId' in errors
|
|
+renderErrors(errors.spaceId)
|
|
.form-item__help-text #{translate('spaceIdHelpText', currentLocale.code)}
|
|
|
|
.form-item
|
|
label(for="input-delivery-token") #{translate('cdaAccessTokenLabel', currentLocale.code)}
|
|
input(type="text" name="deliveryToken" id="input-delivery-token" value=settings.deliveryToken required)
|
|
if 'deliveryToken' in errors
|
|
+renderErrors(errors.deliveryToken)
|
|
.form-item__help-text
|
|
| #{translate('contentDeliveryApiHelpText', currentLocale.code)}
|
|
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") #{translate('cpaAccessTokenLabel', currentLocale.code)}
|
|
input(type="text" name="previewToken" id="input-preview-token" value=settings.previewToken required)
|
|
if 'previewToken' in errors
|
|
+renderErrors(errors.previewToken)
|
|
.form-item__help-text
|
|
| #{translate('contentPreviewApiHelpText', currentLocale.code)}
|
|
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") #{translate('enableEditorialFeaturesLabel', currentLocale.code)}
|
|
.form-item__help-text #{translate('enableEditorialFeaturesHelpText', currentLocale.code)}
|
|
|
|
.form-item
|
|
input.cta(type="submit" value=translate('saveSettingsButtonLabel', currentLocale.code))
|