Add license information

This commit is contained in:
Luca Bosin
2023-08-28 22:47:55 +02:00
parent ec6d44531b
commit 7dcb27eede
8 changed files with 133 additions and 34 deletions

View File

@ -35,6 +35,20 @@
$str('author'):
"unknown author"):
$str('author');
$: hrefLicense = album && album.license ? (
typeof album.license === 'object' ?
`${base}/license`:
typeof album.license === 'string' ?
`${galleryBase}/license/${album.license}`:
null):
null;
$: displayLicense = album && album.license ? (
typeof album.license === 'object' ?
album.license.title:
typeof album.license === 'string' ?
((l: any) => l ? $strf(l.titleShort || l.title) : album?.license)(licenses.find(l => l.type === album?.license)):
"All rights reserved"):
"All rights reserved";
</script>
<header>
@ -53,12 +67,12 @@
<dt>{displayAuthorsTitle}</dt>
<dd>{displayAuthors}</dd>
<dt>{$str('license')}</dt>
<dd><a href={`${base}/license`} tabindex="0">{album.license}</a></dd>
<dd><a href={hrefLicense} tabindex="0">{displayLicense}</a></dd>
</dl>
<menu>
{#if album.allowDownload !== false}
<li>
<a href={`${base}/download`} tabindex="0">{$str('download-all')}</a>
<a data-sveltekit-reload href={`${base}/download`} tabindex="0">{$str('download-all')}</a>
</li>
{/if}
</menu>