Skip to content

Commit

Permalink
Merge pull request #223 from lara-zeus/sub-nav
Browse files Browse the repository at this point in the history
use sub nav in forms nav
  • Loading branch information
atmonshi authored Jan 8, 2024
2 parents 0f4819f + 1f1d822 commit cbb0afc
Show file tree
Hide file tree
Showing 24 changed files with 363 additions and 515 deletions.
1 change: 0 additions & 1 deletion docs/getting-started/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ available resources:
- CategoryResource,
- CollectionResource,
- FormResource,
- ResponseResource,

## Frontend Configuration

Expand Down
2 changes: 1 addition & 1 deletion resources/lang/ckb.json
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@
"Conditional Visibility" :"بینینی مەرجدار",
"show when the field:" :"نیشان بدە کەی بەشەکە:",
"has the value:" :"بەهای هەیە:",
"Embed" :"جێگیرکردن:",
"Embed" :"جێگیرکردن",
"Hint Text" :"دەقی ئاماژە",
"Hint Icon" :"ئایکۆنی ئاماژە",
"Hint Color" :"ڕەنگی ئاماژە",
Expand Down
2 changes: 1 addition & 1 deletion resources/lang/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@
"Conditional Visibility" :"Conditional Visibility",
"show when the field:" :"show when the field:",
"has the value:" :"has the value:",
"Embed" :"Embed:",
"Embed" :"Embed",
"Hint Text" :"Hint Text",
"Hint Icon" :"Hint Icon",
"Hint Color" :"Hint Color",
Expand Down
2 changes: 1 addition & 1 deletion resources/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@
"Conditional Visibility" :"Conditional Visibility",
"show when the field:" :"show when the field:",
"has the value:" :"has the value:",
"Embed" :"Embed:",
"Embed" :"Embed",
"Hint Text" :"Hint Text",
"Hint Icon" :"Hint Icon",
"Hint Color" :"Hint Color",
Expand Down
2 changes: 1 addition & 1 deletion resources/lang/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@
"Conditional Visibility" :"Conditional Visibility",
"show when the field:" :"show when the field:",
"has the value:" :"has the value:",
"Embed" :"Embed:",
"Embed" :"Embed",
"Hint Text" :"Hint Text",
"Hint Icon" :"Hint Icon",
"Hint Color" :"Hint Color",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<div x-data class="space-y-4 my-6 mx-4 w-full">
@php
$getRecord = $getRecord();
@endphp
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
<div class="md:col-span-2">
<x-filament::section>
@foreach($getRecord->fieldsResponses as $resp)
@if($resp->field !== null)
<div class="py-2 text-ellipsis overflow-auto">
<p>{{ $resp->field->name ?? '' }}</p>
<p class="font-semibold mb-2">
{!! ( new $resp->field->type )->getResponse($resp->field, $resp) !!}
</p>
<hr/>
</div>
@endif
@endforeach
</x-filament::section>
</div>
<div class="space-y-4">
<x-filament::section>
<x-slot name="heading" class="text-primary-600">
{{ __('User Details') }}
</x-slot>
@if($getRecord->user_id === null)
<span>{{ __('By') }} {{ __('Visitor') }}</span>
@else
<div class="flex gap-2 items-center">
<x-filament::avatar
class="rounded-full"
size="lg"
:src="$getRecord->user->avatar"
:alt="($getRecord->user->name) ?? ''"
/>
<p class="flex flex-col gap-1">
<span>{{ ($getRecord->user->name) ?? '' }}</span>
<span>{{ ($getRecord->user->email) ?? '' }}</span>
</p>
</div>
@endif
<p class="flex flex-col my-1 gap-1">
<span class="text-base font-light">{{ __('created at') }}:</span>
<span class="font-semibold">{{ $getRecord->created_at->format('Y.m/d') }}-{{ $getRecord->created_at->format('h:i a') }}</span>
</p>
</x-filament::section>
<x-filament::section>
<x-slot name="heading" class="text-primary-600">
<p class="text-primary-600 font-semibold">{{ __('Entry Details') }}</p>
</x-slot>

<div class="flex flex-col mb-4">
<span class="text-gray-600">{{ __('Form') }}:</span>
<span>{{ $getRecord->form->name ?? '' }}</span>
</div>

<div class="mb-4">
<span>{{ __('status') }}</span>
@php $getStatues = $getRecord->statusDetails() @endphp
<span class="{{ $getStatues['class']}}" x-tooltip.raw="{{ __('status') }}">
@svg($getStatues['icon'],'w-4 h-4 inline')
{{ $getStatues['label'] }}
</span>
</div>

<div class="flex flex-col">
<span>{{ __('Notes') }}:</span>
{!! nl2br($getRecord->notes) !!}
</div>
</x-filament::section>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<div x-data class="space-y-4 my-6 mx-4 w-full">
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
<div class="md:col-span-2 space-y-4">
<x-filament::section>
<div class="grid grid-cols-1">
@foreach($getRecord()->fieldsResponses as $resp)
<x-filament::page>
<div x-data class="space-y-4 my-6 mx-4 w-full">
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
<div class="md:col-span-2">
<x-filament::section>
@foreach($response->fieldsResponses as $resp)
@if($resp->field !== null)
<div class="py-2 text-ellipsis overflow-auto">
<p>{{ $resp->field->name ?? '' }}</p>
Expand All @@ -14,72 +14,59 @@
</div>
@endif
@endforeach
</div>
</x-filament::section>
</div>
<div class="md:col-span-1 space-y-4">
@if(isset($this->table))
<x-filament-tables::actions
:actions="$this->table->getActions()"
alignment="start md:end"
:record="$getRecord()"
wrap="-sm"
/>
@endif
<x-filament::section class="w-full">
<x-slot name="heading" class="text-primary-600">
{{ __('User Details') }}
</x-slot>
@if($getRecord()->user_id === null)
<span>{{ __('By') }} {{ __('Visitor') }}</span>
@else
<div class="flex gap-2 items-center">
<x-filament::avatar
class="rounded-full"
size="lg"
:src="$getRecord()->user->avatar"
:alt="($getRecord()->user->name) ?? ''"
/>
<p class="flex flex-col gap-1">
<span>{{ ($getRecord()->user->name) ?? '' }}</span>
<span>{{ ($getRecord()->user->email) ?? '' }}</span>
</p>
</div>
@endif
<p class="flex flex-col my-1 gap-1">
<span class="text-base font-light">{{ __('created at') }}:</span>
<span class="font-semibold">{{ $getRecord()->created_at->format('Y.m/d') }}-{{ $getRecord()->created_at->format('h:i a') }}</span>
</p>
</x-filament::section>
<div>
<div class="space-y-2">
<x-filament::section>
<x-slot name="heading" class="text-primary-600">
<p class="text-primary-600 font-semibold">{{ __('Entry Details') }}</p>
</x-slot>

<div class="flex flex-col mb-4">
<span class="text-gray-600">{{ __('Form') }}:</span>
<span>{{ $getRecord()->form->name ?? '' }}</span>
</x-filament::section>
</div>
<div class="space-y-4">
<x-filament::section>
<x-slot name="heading" class="text-primary-600">
{{ __('User Details') }}
</x-slot>
@if($response->user_id === null)
<span>{{ __('By') }} {{ __('Visitor') }}</span>
@else
<div class="flex gap-2 items-center">
<x-filament::avatar
class="rounded-full"
size="lg"
:src="$response->user->avatar"
:alt="($response->user->name) ?? ''"
/>
<p class="flex flex-col gap-1">
<span>{{ ($response->user->name) ?? '' }}</span>
<span>{{ ($response->user->email) ?? '' }}</span>
</p>
</div>
@endif
<p class="flex flex-col my-1 gap-1">
<span class="text-base font-light">{{ __('created at') }}:</span>
<span class="font-semibold">{{ $response->created_at->format('Y.m/d') }}-{{ $response->created_at->format('h:i a') }}</span>
</p>
</x-filament::section>
<x-filament::section>
<x-slot name="heading" class="text-primary-600">
<p class="text-primary-600 font-semibold">{{ __('Entry Details') }}</p>
</x-slot>

<div class="flex flex-col mb-4">
<span class="text-gray-600">{{ __('Form') }}:</span>
<span>{{ $response->form->name ?? '' }}</span>
</div>

<div class="mb-4">
<span>{{ __('status') }}</span>
@php $getStatues = $getRecord()->statusDetails() @endphp
<div class="mb-4">
<span>{{ __('status') }}</span>
@php $getStatues = $response->statusDetails() @endphp
<span class="{{ $getStatues['class']}}" x-tooltip.raw="{{ __('status') }}">
@svg($getStatues['icon'],'w-4 h-4 inline')
@svg($getStatues['icon'],'w-4 h-4 inline')
{{ $getStatues['label'] }}
</span>
</div>

<div class="flex flex-col">
<span>{{ __('Notes') }}:</span>
{!! nl2br($getRecord()->notes) !!}
</div>
</span>
</div>

</x-filament::section>
</div>
<div class="flex flex-col">
<span>{{ __('Notes') }}:</span>
{!! nl2br($response->notes) !!}
</div>
</x-filament::section>
</div>
</div>
</div>
</div>
</x-filament::page>
12 changes: 6 additions & 6 deletions resources/views/themes/zeus/bolt/fill-forms.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,27 @@

@include($boltTheme.'.loading')

@if(class_exists(\LaraZeus\Bolt\BoltProServiceProvider::class) && optional($zeusForm->options)['logo'] !== null && optional($zeusForm)->options['cover'] !== null)
@if(class_exists(\LaraZeus\BoltPro\BoltProServiceProvider::class) && optional($zeusForm->options)['logo'] !== null && optional($zeusForm)->options['cover'] !== null)
<div style="background-image: url('{{ \Illuminate\Support\Facades\Storage::disk(config('zeus-bolt.uploadDisk'))->url($zeusForm->options['cover']) }}')"
class="flex justify-start items-center px-4 py-6 gap-4 rounded-lg bg-clip-border bg-origin-border bg-cover bg-center">
<div>
<img
class="bg-white rounded-full shadow-md shadow-primary-100 sm:h-24 sm:w-24 object-cover"
class="bg-white rounded-full shadow-md shadow-custom-100 sm:w-24 object-cover"
src="{{ \Illuminate\Support\Facades\Storage::disk(config('zeus-bolt.uploadDisk'))->url($zeusForm->options['logo']) }}"
alt="logo"
/>
</div>
<div class="bg-white/40 p-4 space-y-1 rounded-lg w-full text-left">
<h4 class="text-primary-600 text-2xl font-bold dark:text-white">
<h4 class="text-custom-600 text-2xl font-bold dark:text-white">
{{ $zeusForm->name ?? '' }}
</h4>
@if(filled($zeusForm->description))
<h5 class="text-primary-600 font-normal">
<h5 class="text-custom-600 font-normal">
{{ $zeusForm->description ?? '' }}
</h5>
@endif
@if($zeusForm->start_date !== null)
<div class="text-primary-800 flex items-center justify-start gap-2 text-sm">
<div class="text-custom-800 flex items-center justify-start gap-2 text-sm">
@svg('heroicon-o-calendar','h-5 w-5 inline-flex')
<span class="flex items-center justify-center gap-1">
<span>{{ __('Available from') }}:</span>
Expand All @@ -43,7 +43,7 @@ class="bg-white rounded-full shadow-md shadow-primary-100 sm:h-24 sm:w-24 object
@endif

@if(!$inline)
@if(!class_exists(\LaraZeus\Bolt\BoltProServiceProvider::class) || (optional($zeusForm->options)['logo'] === null && optional($zeusForm->options)['cover'] === null))
@if(!class_exists(\LaraZeus\BoltPro\BoltProServiceProvider::class) || (optional($zeusForm->options)['logo'] === null && optional($zeusForm->options)['cover'] === null))
<x-slot name="header">
<h2>{{ $zeusForm->name ?? '' }}</h2>
<p class="text-gray-400 text-mdd my-2">{{ $zeusForm->description ?? '' }}</p>
Expand Down
2 changes: 0 additions & 2 deletions src/BoltPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use LaraZeus\Bolt\Filament\Resources\CategoryResource;
use LaraZeus\Bolt\Filament\Resources\CollectionResource;
use LaraZeus\Bolt\Filament\Resources\FormResource;
use LaraZeus\Bolt\Filament\Resources\ResponseResource;

final class BoltPlugin implements Plugin
{
Expand All @@ -26,7 +25,6 @@ public function register(Panel $panel): void
->resources([
CollectionResource::class,
FormResource::class,
ResponseResource::class,
CategoryResource::class,
]);
}
Expand Down
44 changes: 0 additions & 44 deletions src/Concerns/EntriesAction.php

This file was deleted.

4 changes: 2 additions & 2 deletions src/Concerns/Schemata.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,10 @@ public static function getTabsSchema(): array

Tabs\Tab::make('design')
->label(__('Design'))
->visible(fn (
): bool => class_exists(\LaraZeus\BoltPro\BoltProServiceProvider::class) && config('zeus-bolt.allow_design'))
->visible(class_exists(\LaraZeus\BoltPro\BoltProServiceProvider::class) && config('zeus-bolt.allow_design'))
->schema([
ViewField::make('options.primary_color')
->hiddenLabel()
->view('zeus::filament.components.color-picker'),
FileUpload::make('options.logo')
->disk(config('zeus-bolt.uploadDisk'))
Expand Down
Loading

0 comments on commit cbb0afc

Please sign in to comment.