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