WIP uploading files

This commit is contained in:
2026-04-29 19:40:37 +03:00
parent e058ceadee
commit bd01e5c32c
15 changed files with 506 additions and 362 deletions
+49 -66
View File
@@ -4,7 +4,7 @@
import Icon from "../../common/Icon.svelte";
import SortFields from "./SortFields.svelte";
import AppliedFilter from "./AppliedFilter.svelte";
import {createEventDispatcher, getContext} from "svelte";
import { createEventDispatcher, getContext } from "svelte";
import Dropdown from "../../common/Dropdown.svelte";
import AppliedFilterNotLinked from "./AppliedFilterNotLinked.svelte";
@@ -41,7 +41,6 @@
} else {
window.location = url;
}
}
function uploadComplete(e) {
@@ -51,110 +50,94 @@
<div class="toolbar">
<div class="toolbar-filters">
<SortFields
{schema}
{sortParam}
{sortField}
{systemFields}
{inModal}
{modalUrl}
on:refresh
{schema}
{sortParam}
{sortField}
{systemFields}
{inModal}
{modalUrl}
on:refresh
/>
<FilterFields
bind:schema
{systemFields}
{operators}
{filter}
{inModal}
{modalUrl}
on:refresh
bind:schema
{systemFields}
{operators}
{filter}
{inModal}
{modalUrl}
on:refresh
/>
<form method="GET" on:submit={search}>
<input type="search" name="filter[search_regex]" placeholder="Search"
class="search" required>
<input
type="search"
name="filter[search_regex]"
placeholder="Search"
class="search"
required
/>
</form>
</div>
<div style="display:flex;align-items: center;gap:4px">
{#if schema.type === "collection"}
{#if !inModal && isWritable}
<a
href="{channel.lucentUrl}/records/new?schema={schema.name}"
class="button"
>
New Record
</a>
{/if}
{:else }
<div>
<Uploader {schema} on:uploadComplete={uploadComplete}/>
</div>
{#if !inModal && isWritable}
<a
href="{channel.lucentUrl}/records/new?schema={schema.name}"
class="button"
>
New Record
</a>
{/if}
{#if !inModal}
<Dropdown orientation="right">
<div slot="button">
<Icon icon="ellipsis-vertical"/>
<Icon icon="ellipsis-vertical" />
</div>
{#if filter["status_in"] === "trashed"}
{#if isWritable}
<a
class="dropdown-item"
href="{channel.lucentUrl}/content/{schema.name}/emptyTrash"
class="dropdown-item"
href="{channel.lucentUrl}/content/{schema.name}/emptyTrash"
>
Empty trash
</a>
{/if}
{:else}
<a class="dropdown-item" href={csvUrl}>Export to CSV</a>
<a
class="dropdown-item"
href={csvUrl}
>Export to CSV</a
class="dropdown-item"
href="{channel.lucentUrl}/content/{schema.name}?filter[status_in]=trashed"
>View trashed records</a
>
<a
class="dropdown-item"
href="{channel.lucentUrl}/content/{schema.name}?filter[status_in]=trashed"
>View trashed records</a
>
<a
class="dropdown-item"
href="{channel.lucentUrl}/content/{schema.name}?notlinked=*"
>View unlinked records</a
class="dropdown-item"
href="{channel.lucentUrl}/content/{schema.name}?notlinked=*"
>View unlinked records</a
>
{/if}
</Dropdown>
{/if}
</div>
</div>
<div class="applied-filters">
<AppliedFilterNotLinked
{inModal}
{modalUrl}
on:refresh
<AppliedFilterNotLinked {inModal} {modalUrl} on:refresh
></AppliedFilterNotLinked>
{#if Object.entries(filter).length > 0}
{#each Object.entries(filter) as [k, v]}
<AppliedFilter
{schema}
{operators}
key={k}
value={v}
{inModal}
{modalUrl}
{graph}
on:refresh
{schema}
{operators}
key={k}
value={v}
{inModal}
{modalUrl}
{graph}
on:refresh
/>
{/each}
{/if}
</div>