wip content index

This commit is contained in:
2024-10-01 22:31:07 +03:00
parent 39e7a3aed4
commit fa388ea302
21 changed files with 356 additions and 22 deletions
+36
View File
@@ -0,0 +1,36 @@
<div class="">
<div class="{{$inModal ? 'mt-0' : 'mt-5'}}">
<h3 class="header-normal mb-5 ">
{{$schema->label}}
</h3>
{{-- {#if selected.length > 0 && !inModal && isWritable}--}}
{{-- <ActionsOnSelected {schema} {selected} {filter}/>--}}
{{-- {:else}--}}
{{-- <Tools--}}
{{-- bind:schema--}}
{{-- bind:records--}}
{{-- {systemFields}--}}
{{-- {sortParam}--}}
{{-- {sortField}--}}
{{-- {operators}--}}
{{-- {filter}--}}
{{-- {graph}--}}
{{-- {inModal}--}}
{{-- {modalUrl}--}}
{{-- {isWritable}--}}
{{-- on:refresh={refresh}--}}
{{-- />--}}
{{-- {/if}--}}
@include("lucent::records.table")
</div>
{{-- <Pagination--}}
{{-- {limit}--}}
{{-- {skip}--}}
{{-- {total}--}}
{{-- on:refresh={refresh}--}}
{{-- {inModal}--}}
{{-- {modalUrl}--}}
{{-- />--}}
</div>
+7
View File
@@ -0,0 +1,7 @@
@extends("lucent::layouts.channel")
@section("content")
@include("lucent::records.index")
@endsection
+14
View File
@@ -0,0 +1,14 @@
@foreach($schema->visible as $visibleColumn)
@php
$schemaField = $schema->fields->firstWhere("name", $visibleColumn);
@endphp
<td class="field-ui-{{$schemaField->info->name ?? $visibleColumn}} {{$visibleColumn === $sortField->name ? "is-sort" : ""}}">
@if(in_array($visibleColumn ,["_sys.createdBy","_sys.updatedBy"]))
<x-lucent::avatar side="24" :user="$users->firstWhere('id',$record->_sys->createdBy)"></x-lucent::avatar>
@elseif($visibleColumn === "_sys.status")
@include("lucent::records-editor.status",[ "status" => $record->status])
@else
{!! $viewModel->renderRow($record,$schemaField)!!}
@endif
</td>
@endforeach
+91
View File
@@ -0,0 +1,91 @@
@php
@endphp
<div class="table mt-5 ">
<table>
<thead>
<tr>
@if($isWritable)
<th>
<x-lucent::checkbox value=""></x-lucent::checkbox>
</th>
@endif
@foreach($schema->visible as $visibleColumn)
@php
$schemaField = $schema->fields->firstWhere("name", $visibleColumn);
if(empty($schemaField)){
$schemaField = collect($systemFields)->firstWhere("name", str_replace("_sys.", "",$visibleColumn) );
}
@endphp
<th
class="field-ui-{{$schemaField->info->name ?? $schemaField->ui}} {{$schemaField->name === $sortField->name ? "is-sort" : ""}}"
scope="col"
title={{$schemaField->help ?? ""}}
>{{$schemaField->label}}</th
>
@endforeach
<th></th>
</tr>
</thead>
<tbody>
@foreach($records as $record)
<tr>
<td class="title-td">
<div
class="title-td-contents"
>
@if($isWritable)
<x-lucent::checkbox :value="$record->id"></x-lucent::checkbox>
@endif
@if($record->_file?->path)
<div class="file-table-row">
@include("lucent::records-editor.fields.file.thumb", ["size" => "small"])
<div>
@if($record->status === "draft")
<span style="text-transform: uppercase;font-size:10px">{{$record->status}}</span>
@endif
<a
href="{{lucent_url("records")}}/{{$record->id}}"
target={{$inModal ? "_blank" : "_self"}}
>
{{ $viewModel->getRecordName($record)}}
</a>
<span>{{ (int)($record->_file->size / 1024) }}kB</span>
@if($record->_file->width > 0)
<span>{{$record->_file->width . "x" . $record->_file->height}}</span>
@endif
<a
href="{{lucent_file($record)}}"
target="_blank"
>
Download
</a>
</div>
</div>
@else
<a
href="{{lucent_url("records")}}/{{$record->id}}"
target={{$inModal ? "_blank" : "_self"}}
>
@if($record->status === "draft")
<span style="text-transform: uppercase;font-size:10px">{{$record->status}}</span>
@endif
{{$viewModel->getRecordName($record)}}
</a>
@endif
</div>
</td>
@include("lucent::records.row")
<td>
<x-lucent::avatar side="24"
:user="$users->firstWhere('id',$record->_sys->createdBy)"></x-lucent::avatar>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>