Merge branch 'add-custom-upload-download-warnings' into 'master'

Add customizable warnings shown on upload and download pages

See merge request timvisee/send!34
This commit is contained in:
Tim Visée 2025-04-22 21:55:25 +02:00
commit d8456c2c51
3 changed files with 36 additions and 2 deletions

View file

@ -486,6 +486,16 @@ module.exports.empty = function(state, emit) {
})}
</button>
`;
const warning = state.WEB_UI.UPLOAD_AREA_WARNING_HTML
? html`
<p
class="w-full mt-8 p-2 border-default dark:border-grey-70 rounded-default text-orange-60 bg-yellow-40 text-center leading-normal"
>
${raw(state.WEB_UI.UPLOAD_AREA_WARNING_HTML)}
</p>
`
: '';
return html`
<send-upload-area
class="flex flex-col items-center justify-center border-2 border-dashed border-grey-transparent rounded-default px-6 py-16 h-full w-full dark:border-grey-60"
@ -526,7 +536,7 @@ module.exports.empty = function(state, emit) {
>
${state.translate('addFilesButton')}
</label>
${upsell}
${upsell} ${warning}
</send-upload-area>
`;
@ -559,6 +569,16 @@ module.exports.preview = function(state, emit) {
${archiveDetails(state.translate, archive)}
</div>
`;
const warning = state.WEB_UI.DOWNLOAD_WARNING_HTML
? html`
<p
class="w-full mt-4 p-2 border-default dark:border-grey-70 rounded-default text-orange-60 bg-yellow-40 text-center leading-normal"
>
${raw(state.WEB_UI.DOWNLOAD_WARNING_HTML)}
</p>
`
: '';
return html`
<send-archive
class="flex flex-col max-h-full bg-white p-4 w-full md:w-128 dark:bg-grey-90"
@ -574,6 +594,7 @@ module.exports.preview = function(state, emit) {
>
${state.translate('downloadButtonLabel')}
</button>
${warning}
</send-archive>
`;

View file

@ -15,6 +15,8 @@ module.exports = {
FOOTER_SOURCE_URL: config.footer_source_url,
CUSTOM_FOOTER_TEXT: config.custom_footer_text,
CUSTOM_FOOTER_URL: config.custom_footer_url,
UPLOAD_AREA_WARNING_HTML: config.upload_area_warning_html,
DOWNLOAD_WARNING_HTML: config.download_warning_html,
COLORS: {
PRIMARY: config.ui_color_primary,
ACCENT: config.ui_color_accent

View file

@ -175,7 +175,8 @@ const conf = convict({
},
custom_description: {
format: String,
default: 'Encrypt and send files with a link that automatically expires to ensure your important documents dont stay online forever.',
default:
'Encrypt and send files with a link that automatically expires to ensure your important documents dont stay online forever.',
env: 'CUSTOM_DESCRIPTION'
},
detect_base_url: {
@ -263,6 +264,16 @@ const conf = convict({
default: '',
env: 'CUSTOM_FOOTER_URL'
},
upload_area_warning_html: {
format: String,
default: '',
env: 'SEND_UPLOAD_AREA_WARNING_HTML'
},
download_warning_html: {
format: String,
default: '',
env: 'SEND_DOWNLOAD_WARNING_HTML'
},
ui_color_primary: {
format: String,
default: '#0a84ff',