Some small fixes

This commit is contained in:
2022-02-08 21:05:08 +01:00
parent d232162046
commit dc680f7efd
6 changed files with 24 additions and 8 deletions

View File

@@ -93,7 +93,7 @@ file | file | true | request body | Depends on user subscription |
### Returns ### Returns
HTTP 200: OK HTTP 201: OK
``` ```
{ {
"id": "abc123" // ID of the newly uploaded file "id": "abc123" // ID of the newly uploaded file

View File

@@ -722,6 +722,7 @@ const keyboard_event = evt => {
.file_preview_container.custom_background { .file_preview_container.custom_background {
background-size: cover; background-size: cover;
background-position: center; background-position: center;
background-color: var(--layer_1_color);
} }
/* Toolbars */ /* Toolbars */

View File

@@ -11,7 +11,7 @@ let file = {
</script> </script>
<br/> <br/>
<TextBlock> <TextBlock center={true}>
<h1>Unavailable for legal reasons</h1> <h1>Unavailable for legal reasons</h1>
<p> <p>
This file has received an abuse report and was taken down. This file has received an abuse report and was taken down.

View File

@@ -1,8 +1,9 @@
<script> <script>
export let width = "800px" export let width = "800px"
export let center = false
</script> </script>
<div class="block" style="max-width: {width};"> <div class="block" class:center style="max-width: {width};">
<slot></slot> <slot></slot>
</div> </div>
@@ -17,4 +18,7 @@ export let width = "800px"
border-radius: 16px; border-radius: 16px;
padding: 8px; padding: 8px;
} }
.center {
text-align: center;
}
</style> </style>

View File

@@ -139,7 +139,9 @@ let delete_account = {
return {success: true, message: "Success! Your account has been scheduled for deletion in 7 days"} return {success: true, message: "Success! Your account has been scheduled for deletion in 7 days"}
}, },
} }
let success_message let success_message
let changes_made = false
let file_picker let file_picker
let theme = "" let theme = ""
@@ -169,6 +171,8 @@ let add_file = files => {
} else if (currently_selecting === "footer") { } else if (currently_selecting === "footer") {
footer_image_id = files[0].id footer_image_id = files[0].id
} }
changes_made = true
} }
let save = async () => { let save = async () => {
const form = new FormData() const form = new FormData()
@@ -189,6 +193,7 @@ let save = async () => {
} }
success_message.set(true, "Changes saved") success_message.set(true, "Changes saved")
changes_made = false
} }
onMount(() => { onMount(() => {
@@ -246,7 +251,7 @@ onMount(() => {
theme preference of the person viewing the file. Set to 'None' to let theme preference of the person viewing the file. Set to 'None' to let
the viewer choose their own theme. the viewer choose their own theme.
</p> </p>
<ThemePicker theme={theme} on:theme_change={e => theme = e.detail}></ThemePicker> <ThemePicker theme={theme} on:theme_change={e => {theme = e.detail; changes_made = true}}></ThemePicker>
<h3>Header image</h3> <h3>Header image</h3>
<p> <p>
@@ -307,12 +312,14 @@ onMount(() => {
</div> </div>
{/if} {/if}
<br/> <hr/>
<br/>
<button on:click={save}>
<button on:click={save} class:button_highlight={changes_made}>
<i class="icon">save</i> Save <i class="icon">save</i> Save
</button> </button>
<br/>
<br/>
</section> </section>
<FilePicker bind:this={file_picker} on:files={e => {add_file(e.detail)}} multi_select={false}></FilePicker> <FilePicker bind:this={file_picker} on:files={e => {add_file(e.detail)}} multi_select={false}></FilePicker>

View File

@@ -94,7 +94,11 @@ onMount(() => {
{/if} {/if}
</td> </td>
<td> <td>
{row.file_name} {#if row.event === "file_instance_blocked"}
<a href="/u/{row.file_id}">{row.file_name}</a>
{:else}
{row.file_name}
{/if}
</td> </td>
<td> <td>
{row.file_removal_reason} {row.file_removal_reason}