WIP moving to vanilla js from svelte
Editing record edit and i am in the middle of creating the dropdown component
This commit is contained in:
@@ -0,0 +1,3 @@
|
|||||||
|
export function init(){
|
||||||
|
|
||||||
|
}
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
<div style="display: flex;align-items: center; gap:10px;">
|
<div style="display: flex;align-items: center; gap:10px;">
|
||||||
{#if !isCreateMode}
|
{#if !isCreateMode}
|
||||||
<Dropdown >
|
<Dropdown>
|
||||||
<div slot="button">
|
<div slot="button">
|
||||||
<Icon icon="ellipsis"/>
|
<Icon icon="ellipsis"/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
<div class="dropdown">
|
||||||
|
<button
|
||||||
|
class="button dropdown-button"
|
||||||
|
type="button"
|
||||||
|
aria-expanded="false"
|
||||||
|
>
|
||||||
|
{{$slot}}
|
||||||
|
</button>
|
||||||
|
<div class="dropdown-menu hide orientation-{orientation}">
|
||||||
|
{{$items}}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
@extends("lucent::layouts.channel")
|
||||||
|
|
||||||
|
@section("content")
|
||||||
|
|
||||||
|
<div class="record-edit">
|
||||||
|
<div class="tools-header">
|
||||||
|
@include("lucent::records-editor.header")
|
||||||
|
{{-- <EditHeader {schema} bind:record {isCreateMode} bind:activeContentTab/>--}}
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@endsection
|
||||||
|
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
@php
|
||||||
|
$createMode = $createMode ?? false;
|
||||||
|
@endphp
|
||||||
|
|
||||||
|
<div style="display: flex;align-items: center; gap:10px;">
|
||||||
|
@if(!$createMode)
|
||||||
|
<x-lucent::dropdown>
|
||||||
|
icon
|
||||||
|
<x-slot:items>
|
||||||
|
<h6 class="dropdown-header">Record Actions</h6>
|
||||||
|
<a
|
||||||
|
class="dropdown-item"
|
||||||
|
href="{channel.lucentUrl}/records/new?schema={schema.name}"
|
||||||
|
>Create new</a
|
||||||
|
>
|
||||||
|
@if($createMode)
|
||||||
|
<a
|
||||||
|
class="dropdown-item"
|
||||||
|
on:click={clone}
|
||||||
|
href={channel.lucentUrl}
|
||||||
|
>
|
||||||
|
Clone
|
||||||
|
</a>
|
||||||
|
@endif
|
||||||
|
<a
|
||||||
|
class="dropdown-item"
|
||||||
|
href="{channel.lucentUrl}">Revisions</a
|
||||||
|
>
|
||||||
|
</x-slot>
|
||||||
|
</x-lucent::dropdown>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
</div>
|
||||||
@@ -239,6 +239,17 @@ class RecordController extends Controller
|
|||||||
|
|
||||||
$schema = $this->channelService->getSchema($record->schema)->get();
|
$schema = $this->channelService->getSchema($record->schema)->get();
|
||||||
$recordHistory = $this->recordManager->fromSession($request->session())->push($rid)->getRecords($rid);
|
$recordHistory = $this->recordManager->fromSession($request->session())->push($rid)->getRecords($rid);
|
||||||
|
|
||||||
|
return view("lucent::records-editor.edit",[
|
||||||
|
"schema" => $schema,
|
||||||
|
"graph" => toArray($graph),
|
||||||
|
"record" => toArray($record),
|
||||||
|
"users" => $this->accountService->all(),
|
||||||
|
"recordHistory" => $recordHistory,
|
||||||
|
"isWritable" => in_array($record->schema, $this->accountService->currentWritableSchemas())
|
||||||
|
]);
|
||||||
|
|
||||||
|
|
||||||
return $this->svelte->render(
|
return $this->svelte->render(
|
||||||
layout: "channel",
|
layout: "channel",
|
||||||
view: "recordEdit",
|
view: "recordEdit",
|
||||||
|
|||||||
Reference in New Issue
Block a user