filters and sidebar

This commit is contained in:
2024-08-15 14:44:53 +03:00
parent 1f3ebafe69
commit f9806f60c9
32 changed files with 584 additions and 456 deletions
+33 -46
View File
@@ -4,7 +4,8 @@
import Icon from "../../common/Icon.svelte";
import SortFields from "./SortFields.svelte";
import AppliedFilter from "./AppliedFilter.svelte";
import {getContext, createEventDispatcher} from "svelte";
import {createEventDispatcher, getContext} from "svelte";
import Dropdown from "../../common/Dropdown.svelte";
const channel = getContext("channel");
@@ -47,8 +48,8 @@
}
</script>
<div class="mb-3 d-flex align-items-center justify-content-between">
<div class=" d-flex align-items-center">
<div class="toolbar">
<div class="toolbar-filters">
<SortFields
{schema}
@@ -72,19 +73,19 @@
/>
<form method="GET" on:submit={search}>
<input type="search" name="filter[search_regex]" placeholder="Search"
class="form-control" required>
<input type="search" name="filter[search_regex]" placeholder="Search"
class="form-control" required>
</form>
</div>
<div class="d-flex align-items-center ">
<div style="display:flex;align-items: center">
{#if schema.type === "collection"}
{#if !inModal && isWritable}
<a
href="{channel.lucentUrl}/records/new?schema={schema.name}"
class="btn btn-sm btn-primary"
class="button"
>
New Record
</a>
@@ -95,48 +96,34 @@
</div>
{/if}
{#if !inModal}
<div class="dropdown d-inline-block">
<button
class="btn btn-link btn-sm"
type="button"
data-bs-toggle="dropdown"
aria-expanded="false"
>
<Dropdown orientation="right">
<div slot="button">
<Icon icon="ellipsis-vertical"/>
</button>
<ul class="dropdown-menu">
{#if filter["status_in"] === "trashed"}
{#if isWritable}
<li>
<a
class="dropdown-item"
href="{channel.lucentUrl}/content/{schema.name}/emptyTrash"
>
Empty trash
</a>
</li>
{/if}
{: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>
</div>
{#if filter["status_in"] === "trashed"}
{#if isWritable}
<a
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="{channel.lucentUrl}/content/{schema.name}?filter[status_in]=trashed"
>View trashed records</a
>
{/if}
</Dropdown>
</ul>
</div>
{/if}
</div>
</div>