This commit is contained in:
2023-10-15 23:40:34 +03:00
parent 8d3e8373c0
commit 5ebf3311e4
15 changed files with 393 additions and 240 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,6 +1,6 @@
{
"main.js": {
"file": "assets/main.a36ff043.js",
"file": "assets/main.48f7042c.js",
"src": "main.js",
"isEntry": true,
"css": [
+33 -19
View File
@@ -4,7 +4,7 @@
import Icon from "../../common/Icon.svelte";
import SortFields from "./SortFields.svelte";
import AppliedFilter from "./AppliedFilter.svelte";
import {getContext,createEventDispatcher} from "svelte";
import {getContext, createEventDispatcher} from "svelte";
const channel = getContext("channel");
@@ -23,7 +23,7 @@
let csvUrl = url.pathname + "/csv?" + url.searchParams.toString();
function search(e){
function search(e) {
e.preventDefault();
const data = new FormData(e.target);
let filterKey = data.keys().next().value;
@@ -38,6 +38,7 @@
}
}
function uploadComplete(e) {
records = e.detail;
}
@@ -66,14 +67,14 @@
on:refresh
/>
<form method="GET" on:submit={search}>
<form method="GET" on:submit={search}>
{#if schema.fields[0]?.name}
<input type="search" name="filter[data.{schema.fields[0].name }_regex]" placeholder="Search"
class="form-control" required>
{:else}
{:else}
<input type="search" name="filter[_file.originalName_regex]" placeholder="Search"
class="form-control" required>
{/if}
{/if}
</form>
@@ -107,20 +108,33 @@
</button>
<ul class="dropdown-menu">
<li>
<a
class="dropdown-item"
href={csvUrl}
>Export to CSV</a
>
</li>
<li>
<a
class="dropdown-item"
href="{channel.lucentUrl}/content/{schema.name}?filter[status_in]=trashed"
>View trashed records</a
>
</li>
{#if filter["status_in"] === "trashed"}
<li>
<a
class="dropdown-item"
href="{channel.lucentUrl}/content/{schema.name}/emptyTrash"
>
Empty trash
</a>
</li>
{:else}
<li>
<a
class="dropdown-item"
href={csvUrl}
>Export to CSV</a
>
</li>
<li>
<a
class="dropdown-item"
href="{channel.lucentUrl}/content/{schema.name}?filter[status_in]=trashed"
>View trashed records</a
>
</li>
{/if}
</ul>
</div>
{/if}