playing with extensible fields
This commit is contained in:
@@ -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]}}"
|
||||
/>
|
||||
Reference in New Issue
Block a user