mirror of
https://gitlab.com/timvisee/send.git
synced 2025-12-06 14:10:53 +03:00
Merge branch 'add-thunderbird-sponsor-banner' into 'master'
Add Thunderbird sponsor banner See merge request timvisee/send!37
This commit is contained in:
@@ -171,6 +171,10 @@ footer li a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.d-block {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.main {
|
||||
display: flex;
|
||||
position: relative;
|
||||
|
||||
@@ -578,6 +578,29 @@ module.exports.preview = function(state, emit) {
|
||||
</p>
|
||||
`
|
||||
: '';
|
||||
const sponsor = state.WEB_UI.SHOW_THUNDERBIRD_SPONSOR
|
||||
? html`
|
||||
<a
|
||||
class="w-full mt-5 mb-2 p-2 border-default dark:border-grey-70 rounded-default text-orange-60 bg-yellow-40 text-center leading-normal"
|
||||
href="https://www.thunderbird.net/"
|
||||
>
|
||||
<svg
|
||||
width="30"
|
||||
height="30"
|
||||
class="m-2 mr-3"
|
||||
style="display: inline-block; vertical-align: middle;"
|
||||
>
|
||||
<image
|
||||
xlink:href="${assets.get('thunderbird-icon.svg')}"
|
||||
src="${assets.get('thunderbird-icon.svg')}"
|
||||
width="30"
|
||||
height="30"
|
||||
/>
|
||||
</svg>
|
||||
${state.translate('sponsoredByThunderbird')}
|
||||
</a>
|
||||
`
|
||||
: '';
|
||||
|
||||
return html`
|
||||
<send-archive
|
||||
@@ -594,7 +617,7 @@ module.exports.preview = function(state, emit) {
|
||||
>
|
||||
${state.translate('downloadButtonLabel')}
|
||||
</button>
|
||||
${notice}
|
||||
${notice} ${sponsor}
|
||||
</send-archive>
|
||||
`;
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ const { list } = require('../utils');
|
||||
const archiveTile = require('./archiveTile');
|
||||
const modal = require('./modal');
|
||||
const intro = require('./intro');
|
||||
const assets = require('../../common/assets');
|
||||
|
||||
module.exports = function(state, emit) {
|
||||
const archives = state.storage.files
|
||||
@@ -30,6 +31,30 @@ module.exports = function(state, emit) {
|
||||
|
||||
archives.reverse();
|
||||
|
||||
if (archives.length > 0 && state.WEB_UI.SHOW_THUNDERBIRD_SPONSOR) {
|
||||
archives.push(html`
|
||||
<a
|
||||
class="w-full p-2 border-default dark:border-grey-70 rounded-default text-orange-60 bg-yellow-40 text-center leading-normal d-block"
|
||||
href="https://www.thunderbird.net/"
|
||||
>
|
||||
<svg
|
||||
width="30"
|
||||
height="30"
|
||||
class="m-2 mr-3"
|
||||
style="display: inline-block; vertical-align: middle;"
|
||||
>
|
||||
<image
|
||||
xlink:href="${assets.get('thunderbird-icon.svg')}"
|
||||
src="${assets.get('thunderbird-icon.svg')}"
|
||||
width="30"
|
||||
height="30"
|
||||
/>
|
||||
</svg>
|
||||
Sponsored by Thunderbird
|
||||
</a>
|
||||
`);
|
||||
}
|
||||
|
||||
const right =
|
||||
archives.length === 0
|
||||
? intro(state)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
const html = require('choo/html');
|
||||
const raw = require('choo/html/raw');
|
||||
const assets = require('../../common/assets');
|
||||
|
||||
module.exports = function intro(state) {
|
||||
const notice = state.WEB_UI.MAIN_NOTICE_HTML
|
||||
@@ -12,6 +13,30 @@ module.exports = function intro(state) {
|
||||
`
|
||||
: '';
|
||||
|
||||
const sponsor = state.WEB_UI.SHOW_THUNDERBIRD_SPONSOR
|
||||
? html`
|
||||
<a
|
||||
class="w-full mt-5 mb-2 p-2 border-default dark:border-grey-70 rounded-default text-orange-60 bg-yellow-40 text-center leading-normal"
|
||||
href="https://www.thunderbird.net/"
|
||||
>
|
||||
<svg
|
||||
width="30"
|
||||
height="30"
|
||||
class="m-2 mr-3"
|
||||
style="display: inline-block; vertical-align: middle;"
|
||||
>
|
||||
<image
|
||||
xlink:href="${assets.get('thunderbird-icon.svg')}"
|
||||
src="${assets.get('thunderbird-icon.svg')}"
|
||||
width="30"
|
||||
height="30"
|
||||
/>
|
||||
</svg>
|
||||
Sponsored by Thunderbird
|
||||
</a>
|
||||
`
|
||||
: '';
|
||||
|
||||
return html`
|
||||
<send-intro
|
||||
class="flex flex-col items-center justify-center bg-white px-6 md:py-0 py-6 mb-0 h-full w-full dark:bg-grey-90"
|
||||
@@ -25,6 +50,7 @@ module.exports = function intro(state) {
|
||||
${state.translate('introDescription')}
|
||||
</p>
|
||||
</div>
|
||||
${sponsor}
|
||||
</send-intro>
|
||||
`;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user