playing with extensible fields

This commit is contained in:
2024-10-11 16:04:44 +03:00
parent dfe4576725
commit b19a84b6ba
32 changed files with 675 additions and 109 deletions
+5
View File
@@ -0,0 +1,5 @@
document.addEventListener("DOMContentLoaded", onReady);
function onReady(){
console.log("ready yo")
}
+1
View File
@@ -6,6 +6,7 @@
<meta name="csrf-token" content="{{ csrf_token() }}">
<title>@yield('title') - {{ config("lucent.name") }}</title>
@include("lucent::includes.assets")
@stack("scripts")
<link rel="icon" type="image/x-icon" href="/favicon.ico">
</head>
+25
View File
@@ -0,0 +1,25 @@
@extends("lucent::layouts.channel")
@pushonce("scripts")
<script type="module" src="/vendor/lucent/public/js/editor.js"></script>
@endpushonce
@section("title")
Edit Record
@endsection
@section("content")
<script type="application/json" id="edit-data">{!! json_encode($record)!!}</script>
@foreach($schema->groups as $group)
<div>{{$group}}</div>
@foreach($schema->fields as $field)
@php
$fieldId = "field-".$field->data->name."-".$record->id;
@endphp
<div class="editor-field">
@include("lucent::new.edit.field-header" ,["id" => $fieldId])
{!! $field->renderForm($record, $fieldId) !!}
</div>
@endforeach
@endforeach
@endsection
@@ -0,0 +1,11 @@
<div class="field-header">
<div class="labels">
<div class="label-and-help">
<label for={{$id}}>{{$field->data->label}}</label>
@if($field->data->help)
<small class="help-text light-text">{{$field->data->help}}</small>
@endif
</div>
<span tabindex="-1"><code class="field-id">{{$field->data->name}}</code></span>
</div>
</div>
@@ -0,0 +1,8 @@
@pushonce("scripts")
<script>
console.log("cool");
</script>
@endpushonce
yo
@@ -0,0 +1,8 @@
@pushonce("scripts")
<script>
console.log("cool");
</script>
@endpushonce
yo
@@ -0,0 +1,8 @@
@pushonce("scripts")
<script>
console.log("cool");
</script>
@endpushonce
yo
@@ -0,0 +1,8 @@
@pushonce("scripts")
<script>
console.log("cool");
</script>
@endpushonce
yo
@@ -0,0 +1,15 @@
@pushonce("scripts")
<script>
console.log("cool");
</script>
@endpushonce
<input
id="{{$fieldId}}"
name="{{$data->name}}"
type="text"
class="form-control"
autocomplete="off"
value="{{$record->data[$data->name]}}"
/>