customizable url to try send after a download

This commit is contained in:
rb 2022-11-21 16:24:02 +01:00
parent 5b4c0d2540
commit b26cdd546e
4 changed files with 9 additions and 1 deletions

View file

@ -2,6 +2,7 @@ const html = require('choo/html');
const assets = require('../../common/assets');
module.exports = function(state) {
const WEB_UI = state.WEB_UI;
const btnText = state.user.loggedIn ? 'okButton' : 'sendYourFilesLink';
return html`
<div
@ -23,7 +24,7 @@ module.exports = function(state) {
${state.translate('trySendDescription')}
</p>
<p class="my-5">
<a href="/" class="btn rounded-lg flex items-center mt-4" role="button"
<a href="${WEB_UI.TRY_SEND_URL}" class="btn rounded-lg flex items-center mt-4" role="button"
>${state.translate(btnText)}</a
>
</p>

View file

@ -99,6 +99,7 @@ See the table below for the variables and their default values.
| UI_CUSTOM_CSS | | Allows you to define a custom CSS file for custom styling |
| CUSTOM_FOOTER_TEXT | | Allows you to define a custom footer |
| CUSTOM_FOOTER_URL | | Allows you to define a custom URL in your footer |
| TRY_SEND_URL | | Allows you to define a custom URL to link to after a successful download |
Side note: If you define a custom URL and a custom footer, only the footer text will display, but will be hyperlinked to the URL.

View file

@ -15,6 +15,7 @@ module.exports = {
FOOTER_SOURCE_URL: config.footer_source_url,
CUSTOM_FOOTER_TEXT: config.custom_footer_text,
CUSTOM_FOOTER_URL: config.custom_footer_url,
TRY_SEND_URL: config.try_send_url,
COLORS: {
PRIMARY: config.ui_color_primary,
ACCENT: config.ui_color_accent

View file

@ -263,6 +263,11 @@ const conf = convict({
default: '',
env: 'CUSTOM_FOOTER_URL'
},
try_send_url: {
format: String,
default: '/',
env: 'TRY_SEND_URL'
},
ui_color_primary: {
format: String,
default: '#0a84ff',