content and edit record
This commit is contained in:
@@ -35,47 +35,47 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="d-flex align-items-center mb-3">
|
||||
<div style="display: flex;align-items: center; gap: 8px">
|
||||
<span class="me-2">{selected.length} records selected</span>
|
||||
<div class="btn-group " role="group" aria-label="Basic example">
|
||||
<button
|
||||
on:click|preventDefault={(e) => changeStatus(e, "published")}
|
||||
type="button"
|
||||
class="btn btn-sm btn-outline-primary">Publish
|
||||
class="button">Publish
|
||||
</button
|
||||
>
|
||||
<button
|
||||
on:click|preventDefault={(e) => changeStatus(e, "draft")}
|
||||
type="button"
|
||||
class="btn btn-sm btn-outline-primary">Make Draft
|
||||
class="button">Make Draft
|
||||
</button
|
||||
>
|
||||
{#if filter["status_in"] === "trashed"}
|
||||
<button
|
||||
on:click|preventDefault={(e) => changeStatus(e, "published")}
|
||||
type="button"
|
||||
class="btn btn-sm btn-outline-primary">Publish
|
||||
class="button">Publish
|
||||
</button
|
||||
>
|
||||
{#if schema.hasDrafts}
|
||||
<button
|
||||
on:click|preventDefault={(e) => changeStatus(e, "draft")}
|
||||
type="button"
|
||||
class="btn btn-sm btn-outline-primary">Make Draft
|
||||
class="button">Make Draft
|
||||
</button
|
||||
>
|
||||
{/if}
|
||||
<button
|
||||
on:click|preventDefault={deleteRecords}
|
||||
type="button"
|
||||
class="btn btn-sm btn-outline-primary">Delete forever
|
||||
class="button">Delete forever
|
||||
</button
|
||||
>
|
||||
{:else}
|
||||
<button
|
||||
type="button"
|
||||
on:click|preventDefault={(e) => changeStatus(e, "trashed")}
|
||||
class="btn btn-sm btn-outline-primary">Move to trash
|
||||
class="button">Move to trash
|
||||
</button
|
||||
>
|
||||
{/if}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
import {getContext} from "svelte";
|
||||
import Avatar from "../account/Avatar.svelte";
|
||||
import {selectRecord, toggleAll} from "./functions/recordSelect.js";
|
||||
import Checkbox from "../common/Checkbox.svelte";
|
||||
|
||||
const channel = getContext("channel");
|
||||
|
||||
@@ -20,7 +21,7 @@
|
||||
export let selected = [];
|
||||
|
||||
function eventToggleAll(e) {
|
||||
selected = toggleAll(e,records,selected)
|
||||
selected = toggleAll(e, records, selected)
|
||||
}
|
||||
|
||||
function select(record) {
|
||||
@@ -31,20 +32,18 @@
|
||||
|
||||
</script>
|
||||
|
||||
<div class="table">
|
||||
<table class="">
|
||||
<thead class="table-light">
|
||||
<div class="table mt-5 ">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
{#if isWritable}
|
||||
<th>
|
||||
<input
|
||||
on:change|preventDefault={eventToggleAll}
|
||||
indeterminate={selected.length > 0 &&
|
||||
selected.length < records.length}
|
||||
checked={selected.length == records.length}
|
||||
class="form-check-input"
|
||||
type="checkbox"
|
||||
/>
|
||||
<Checkbox
|
||||
on:change={eventToggleAll}
|
||||
indeterminate={selected.length > 0 && selected.length < records.length}
|
||||
checked={selected.length === records.length}
|
||||
>
|
||||
</Checkbox>
|
||||
</th>
|
||||
{/if}
|
||||
|
||||
@@ -54,13 +53,13 @@
|
||||
class:is-sort={field.name === sortField.name}
|
||||
scope="col"
|
||||
title={field.help}
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-placement="top">{field.label}</th
|
||||
>{field.label}</th
|
||||
>
|
||||
{/each}
|
||||
{#each systemFields.filter(c => schema.visible.includes(c.name)) as sysField}
|
||||
<th>{sysField.label}</th>
|
||||
<th class:is-sort={sysField.name === sortField.name}>{sysField.label}</th>
|
||||
{/each}
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -68,44 +67,26 @@
|
||||
<tr>
|
||||
<td class="title-td">
|
||||
<div
|
||||
class="title-td-contents d-inline-flex justify-content-between w-100 align-items-center"
|
||||
class="title-td-contents"
|
||||
>
|
||||
<div class="d-flex align-items-center ">
|
||||
{#if isWritable}
|
||||
<div class="form-check">
|
||||
<input
|
||||
on:change={() => select(record)}
|
||||
class="form-check-input "
|
||||
type="checkbox"
|
||||
checked={selected.find(
|
||||
(r) => r.id === record.id
|
||||
)}
|
||||
value={record}
|
||||
/>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<a
|
||||
|
||||
class="me-2 text-decoration-none text-dark fs-6"
|
||||
href="{channel.lucentUrl}/records/{record.id}"
|
||||
target={inModal ? "_blank" : "_self"}
|
||||
title={previewTitle(channel.schemas, record, graph)}
|
||||
data-bs-toggle="tooltip" data-bs-placement="left"
|
||||
|
||||
{#if isWritable}
|
||||
<Checkbox
|
||||
on:change={() => select(record)}
|
||||
checked={selected.find((r) => r.id === record.id)}
|
||||
value={record}
|
||||
>
|
||||
{previewTitle(channel.schemas, record, graph)}
|
||||
</a>
|
||||
</div>
|
||||
<div>
|
||||
<Avatar
|
||||
name={usernameById(
|
||||
users,
|
||||
record._sys.updatedBy
|
||||
)}
|
||||
side={24}
|
||||
/>
|
||||
</div>
|
||||
</Checkbox>
|
||||
|
||||
{/if}
|
||||
|
||||
<a
|
||||
class="me-2 text-decoration-none text-dark fs-6"
|
||||
href="{channel.lucentUrl}/records/{record.id}"
|
||||
target={inModal ? "_blank" : "_self"}
|
||||
>
|
||||
{previewTitle(channel.schemas, record, graph)}
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
<RecordRow
|
||||
@@ -117,6 +98,13 @@
|
||||
{sortField}
|
||||
{users}
|
||||
/>
|
||||
<td> <Avatar
|
||||
name={usernameById(
|
||||
users,
|
||||
record._sys.updatedBy
|
||||
)}
|
||||
side={24}
|
||||
/></td>
|
||||
</tr>
|
||||
{/each}
|
||||
</tbody>
|
||||
|
||||
@@ -28,8 +28,8 @@
|
||||
</script>
|
||||
|
||||
{#each pages as i}
|
||||
<li class="page-item">
|
||||
{#if currentPage == i}
|
||||
<li class="page-item" class:active={currentPage === i}>
|
||||
{#if currentPage === i}
|
||||
<span class="page-link active">{i}</span>
|
||||
{:else}
|
||||
<a class="page-link" on:click={(e) => goto(e, i)} href={url(i)}
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
</script>
|
||||
|
||||
<nav>
|
||||
<ul class="pagination justify-content-center">
|
||||
<ul class="pagination">
|
||||
{#if totalPages > 1}
|
||||
<li class="page-item disabled" class:disabled={currentPage === 1}>
|
||||
<a on:click={first} href="/" class="page-link"> First </a>
|
||||
@@ -69,7 +69,7 @@
|
||||
{/if}
|
||||
</ul>
|
||||
</nav>
|
||||
<p class="text-muted text-center">
|
||||
<p style="display: flex;justify-content: center; gap: 4px">
|
||||
Showing
|
||||
<span class="font-medium">{+skip + 1}</span>
|
||||
to
|
||||
|
||||
@@ -74,13 +74,13 @@
|
||||
|
||||
<form method="GET" on:submit={search}>
|
||||
<input type="search" name="filter[search_regex]" placeholder="Search"
|
||||
class="form-control" required>
|
||||
class="search" required>
|
||||
</form>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div style="display:flex;align-items: center">
|
||||
<div style="display:flex;align-items: center;gap:4px">
|
||||
{#if schema.type === "collection"}
|
||||
{#if !inModal && isWritable}
|
||||
<a
|
||||
|
||||
Reference in New Issue
Block a user