Implement custom HTML placement (#78)

This commit is contained in:
Wingy 2023-01-30 10:55:40 -05:00 committed by GitHub
parent 014bd271b4
commit ae50a8b11d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 2 deletions

View file

@ -105,6 +105,12 @@ TABLE=true
SMILE=true SMILE=true
# Allow Markdown in item notes. Does not work with TABLE=false. Defaults to false. # Allow Markdown in item notes. Does not work with TABLE=false. Defaults to false.
MARKDOWN=false MARKDOWN=false
## Custom HTML Snippets
# These are inserted into specific locations in the relevant page
# HTML is not escaped. Don't put untrusted data here.
# CUSTOM_HTML_LOGIN=<p style="margin-top: 1em;">Some custom text for the Login page</p>
# CUSTOM_HTML_WISHLISTS=
``` ```
## Default Profile Pictures ## Default Profile Pictures

View file

@ -16,7 +16,11 @@ module.exports = {
bulmaswatch: (process.env.BULMASWATCH || 'default').toLowerCase(), bulmaswatch: (process.env.BULMASWATCH || 'default').toLowerCase(),
pfp: process.env.PFP !== 'false', pfp: process.env.PFP !== 'false',
language: process.env.LANGUAGE?.toLowerCase() || 'en-us', language: process.env.LANGUAGE?.toLowerCase() || 'en-us',
guestPassword: process.env.GUEST_PASSWORD guestPassword: process.env.GUEST_PASSWORD,
customHtml: {
wishlists: process.env.CUSTOM_HTML_WISHLISTS,
login: process.env.CUSTOM_HTML_LOGIN
}
} }
if (module.exports.guestPassword) module.exports.wishlist.public = false if (module.exports.guestPassword) module.exports.wishlist.public = false

View file

@ -17,4 +17,5 @@ block content
.field .field
.control .control
input.button.is-primary(type='submit' value=lang('LOGIN_BUTTON')) input.button.is-primary(type='submit' value=lang('LOGIN_BUTTON'))
if _CC.config.customHtml.login
div!= _CC.config.customHtml.login

View file

@ -44,6 +44,9 @@ block content
display: inline-block; display: inline-block;
} }
if _CC.config.customHtml.wishlists
div!= _CC.config.customHtml.wishlists
ul.noStyle.noLeftMargin ul.noStyle.noLeftMargin
if req.user._id !== '_CCUNKNOWN' if req.user._id !== '_CCUNKNOWN'
li li