This commit is contained in:
2023-10-08 02:02:59 +03:00
parent 956b8dc4e3
commit bac0d183c9
+47 -38
View File
@@ -27,50 +27,42 @@
</script>
<div class="mb-3 d-flex align-items-center justify-content-between">
<div class=" d-flex">
<div class=" d-flex align-items-center">
<SortFields
{schema}
{sort}
{systemFields}
{inModal}
{modalUrl}
on:refresh
{schema}
{sort}
{systemFields}
{inModal}
{modalUrl}
on:refresh
/>
<FilterFields
bind:schema
{systemFields}
{operators}
{filter}
{inModal}
{modalUrl}
on:refresh
bind:schema
{systemFields}
{operators}
{filter}
{inModal}
{modalUrl}
on:refresh
/>
{#if Object.entries(filter).length > 0}
{#each Object.entries(filter) as [k, v]}
<AppliedFilter
{schema}
{operators}
key={k}
value={v}
{inModal}
{modalUrl}
{systemFields}
on:refresh
/>
{/each}
{/if}
<form method="GET">
<input type="search" name="filter[data.{schema.fields[0].name}_regex]" placeholder="Search"
class="form-control" required>
</form>
</div>
<div class="d-flex align-items-center ">
{#if schema.type === "collection"}
{#if !inModal}
<a
href="{channel.lucentUrl}/records/new?schema={schema.name}"
class="btn btn-sm btn-primary"
href="{channel.lucentUrl}/records/new?schema={schema.name}"
class="btn btn-sm btn-primary"
>
New Record
</a>
@@ -83,10 +75,10 @@
{#if !inModal}
<div class="dropdown d-inline-block">
<button
class="btn btn-link btn-sm"
type="button"
data-bs-toggle="dropdown"
aria-expanded="false"
class="btn btn-link btn-sm"
type="button"
data-bs-toggle="dropdown"
aria-expanded="false"
>
<Icon icon="ellipsis-vertical"/>
</button>
@@ -94,15 +86,15 @@
<ul class="dropdown-menu">
<li>
<a
class="dropdown-item"
href={csvUrl}
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"
class="dropdown-item"
href="{channel.lucentUrl}/content/{schema.name}?filter[status_in]=trashed"
>View trashed records</a
>
</li>
@@ -113,3 +105,20 @@
</div>
{#if Object.entries(filter).length > 0}
<div class=" d-flex mb-3">
{#each Object.entries(filter) as [k, v]}
<AppliedFilter
{schema}
{operators}
key={k}
value={v}
{inModal}
{modalUrl}
{systemFields}
on:refresh
/>
{/each}
</div>
{/if}