singleton and embed records
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<script>
|
||||
import {createEventDispatcher, getContext, onMount} from "svelte";
|
||||
import {getContext} from "svelte";
|
||||
import Icon from "../common/Icon.svelte";
|
||||
import Folder from "./Folder.svelte";
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<div class="sidebar-folder">
|
||||
{#if folder.name !== ""}
|
||||
<button class="sidebar-header" tabindex="0" on:click={toggleExpand}>
|
||||
{folder.name.replaceAll("_"," ") ?? "Main"}
|
||||
{folder.name.replaceAll("_", " ") ?? "Main"}
|
||||
{#if expanded}
|
||||
<Icon icon="circle-chevron-up"></Icon>
|
||||
{:else}
|
||||
@@ -25,7 +25,7 @@
|
||||
{/if}
|
||||
{#if expanded}
|
||||
{#each folder.folders as aFolder}
|
||||
<Folder folder={aFolder} schema={schema} ></Folder>
|
||||
<Folder folder={aFolder} schema={schema}></Folder>
|
||||
{/each}
|
||||
|
||||
{#each folder.files as aSchema}
|
||||
|
||||
@@ -21,12 +21,7 @@
|
||||
</Dropdown>
|
||||
|
||||
{/if}
|
||||
<!-- <div>-->
|
||||
<!-- <form method="GET">-->
|
||||
<!-- <input type="search" name="filter[search_regex]" placeholder="Search"-->
|
||||
<!-- class="form-control" required/>-->
|
||||
<!-- </form>-->
|
||||
<!-- </div>-->
|
||||
|
||||
<a href="{channel.lucentUrl}/profile">
|
||||
<Avatar side="28" name={user.name}/>
|
||||
</a>
|
||||
|
||||
@@ -31,10 +31,6 @@
|
||||
carry = addToFolder(carry, schema.folder,schema)
|
||||
return carry;
|
||||
}, {name: "", files: [], folders: [], shoudlExpand:true});
|
||||
|
||||
// const fileSchemas = readableSchemas.filter((sc) => sc.type === "files");
|
||||
// const otherSchemas = readableSchemas.filter((sc) => !sc.isEntry && sc.type === "collection");
|
||||
|
||||
</script>
|
||||
<div class="sidebar-top">
|
||||
<a class="logo" href="{channel.lucentUrl}">{channel.name}</a>
|
||||
@@ -42,27 +38,5 @@
|
||||
</a>
|
||||
</div>
|
||||
<div class="sidebar">
|
||||
|
||||
|
||||
<Folder folder={schemaTree} {schema} ></Folder>
|
||||
|
||||
|
||||
<!-- <NavbarMenu-->
|
||||
<!-- title="Content"-->
|
||||
<!-- schemas={ readableSchemas.filter((sc) => sc.isEntry)}-->
|
||||
<!-- schema={schema}-->
|
||||
<!-- expanded={true}-->
|
||||
<!-- />-->
|
||||
|
||||
<!-- <NavbarMenu-->
|
||||
<!-- title="Files"-->
|
||||
<!-- schemas={ fileSchemas}-->
|
||||
<!-- schema={schema}-->
|
||||
<!-- />-->
|
||||
|
||||
<!-- <NavbarMenu-->
|
||||
<!-- title="Other"-->
|
||||
<!-- schemas={ otherSchemas}-->
|
||||
<!-- schema={schema}-->
|
||||
<!-- />-->
|
||||
</div>
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
<script>
|
||||
import {getContext} from "svelte";
|
||||
import Icon from "../common/Icon.svelte";
|
||||
|
||||
const channel = getContext("channel");
|
||||
export let folder;
|
||||
export let schema;
|
||||
export let expanded = false;
|
||||
|
||||
if(schemas.find(s => s.name === schema?.name)){
|
||||
expanded = true;
|
||||
}
|
||||
|
||||
function toggleExpand(){
|
||||
expanded = !expanded;
|
||||
}
|
||||
</script>
|
||||
|
||||
<button class="sidebar-header" tabindex="0" on:click={toggleExpand}>
|
||||
{title}
|
||||
{#if expanded}
|
||||
<Icon icon="circle-chevron-up"></Icon>
|
||||
{:else}
|
||||
<Icon icon="circle-chevron-down"></Icon>
|
||||
{/if}
|
||||
</button>
|
||||
{#if expanded}
|
||||
{#each schemas as aschema}
|
||||
<a class="sidebar-item" class:active={aschema.name === schema?.name}
|
||||
aria-current="page"
|
||||
href="{channel.lucentUrl}/content/{aschema.name}">{aschema.label}</a>
|
||||
{/each}
|
||||
|
||||
{#each schemas as aschema}
|
||||
<a class="sidebar-item" class:active={aschema.name === schema?.name}
|
||||
aria-current="page"
|
||||
href="{channel.lucentUrl}/content/{aschema.name}">{aschema.label}</a>
|
||||
{/each}
|
||||
{/if}
|
||||
Reference in New Issue
Block a user