-
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from lara-zeus/trans
imporvments
- Loading branch information
Showing
27 changed files
with
673 additions
and
492 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
resources/views/filament/resources/response-resource/components/view-responses.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<x-forms::field-wrapper | ||
:id="$getId()" | ||
:label="$getLabel()" | ||
:label-sr-only="$isLabelHidden()" | ||
:helper-text="$getHelperText()" | ||
:hint="$getHint()" | ||
:hint-icon="$getHintIcon()" | ||
:required="$isRequired()" | ||
:state-path="$getStatePath()" | ||
> | ||
<div class="space-y-4" x-data="{ state: $wire.entangle('{{ $getStatePath() }}') }"> | ||
|
||
<div class="flex justify-between gap-4"> | ||
<x-filament::card class="w-full"> | ||
<x-filament::card.heading>User Details</x-filament::card.heading> | ||
<p> | ||
<span class="text-base font-light">{{ __('By') }}</span>: | ||
{{ ($getRecord()->user->name) ?? '' }} | ||
</p> | ||
<p> | ||
<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::card> | ||
<x-filament::card class="w-full"> | ||
<x-filament::card.heading>Form Details</x-filament::card.heading> | ||
<p>{{ ($getRecord()->form->name) ?? '' }}</p> | ||
<p>{{ ($getRecord()->form->desc) ?? '' }}</p> | ||
</x-filament::card> | ||
</div> | ||
|
||
<x-filament::card> | ||
<x-filament::card.heading>Respons Details</x-filament::card.heading> | ||
@foreach($getRecord()->fieldsResponses as $resp) | ||
<div class="py-2"> | ||
<p>{{ $resp->field->name }}</p> | ||
<p class="font-semibold mb-2">{{ $resp->response ?? ''}}</p> | ||
<x-filament::hr /> | ||
</div> | ||
@endforeach | ||
</x-filament::card> | ||
</div> | ||
</x-forms::field-wrapper> |
87 changes: 37 additions & 50 deletions
87
resources/views/filament/resources/response-resource/pages/browse-responses.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,40 @@ | ||
<x-filament::page> | ||
<x-filament::card> | ||
@forelse ($rows as $row) | ||
<x-slot name="header"> | ||
<div> | ||
<p> | ||
<span class="text-base font-light">{{ __('From') }}</span>: | ||
{{ ($row->user->name) ?? '' }} | ||
</p> | ||
<p> | ||
<span class="text-base font-light">{{ __('created at') }}</span>: | ||
<span class="font-semibold">{{ $row->created_at->format('Y.m/d') }}-{{ $row->created_at->format('h:i a') }}</span> | ||
</p> | ||
</div> | ||
</x-slot> | ||
@forelse ($rows as $row) | ||
<div class="flex justify-between gap-4"> | ||
<x-filament::card class="w-full"> | ||
<x-filament::card.heading>User Details</x-filament::card.heading> | ||
<p> | ||
<span class="text-base font-light">{{ __('By') }}</span>: | ||
{{ ($row->user->name) ?? '' }} | ||
</p> | ||
<p> | ||
<span class="text-base font-light">{{ __('created at') }}</span>: | ||
<span class="font-semibold">{{ $row->created_at->format('Y.m/d') }}-{{ $row->created_at->format('h:i a') }}</span> | ||
</p> | ||
</x-filament::card> | ||
<x-filament::card class="w-full"> | ||
<x-filament::card.heading>Form Details</x-filament::card.heading> | ||
<p>{{ ($row->form->name) ?? '' }}</p> | ||
<p>{{ ($row->form->desc) ?? '' }}</p> | ||
</x-filament::card> | ||
</div> | ||
<x-filament::card.heading>Respons Details</x-filament::card.heading> | ||
<div class="grid grid-cols-1 grid-cols-2 gap-4"> | ||
@foreach($row->fieldsResponses as $resp) | ||
<x-filament::card> | ||
<p>{{ $resp->field->name }}</p> | ||
<p class="font-semibold mb-2">{{ $resp->response ?? ''}}</p> | ||
</x-filament::card> | ||
@endforeach | ||
</div> | ||
@empty | ||
<div class="flex justify-center items-center space-x-2"> | ||
<x-clarity-data-cluster-line class="h-8 w-8 text-gray-400"/> | ||
<span class="font-medium py-8 text-gray-400 text-xl">No responses found...</span> | ||
</div> | ||
@endforelse | ||
|
||
<div wire:key="row-{{ $row->id }}"> | ||
<div class="divide-y divide-gray-200 flex flex-col"> | ||
@foreach($fields->where('inShow',true) as $field) | ||
<div class="py-2"> | ||
{{ $field['label'] }}: | ||
@if(\Illuminate\Support\Str::contains($field['id'],'.')) | ||
{{ ($flattenedRows[$loop->parent->index.'.'.$field['id']]) ?? '' }} | ||
@elseif(isset($field['listAtt'])) | ||
{!! $row->{$field['listAtt']} !!} | ||
@elseif(isset($row->{$field['id']})) | ||
{{ $row->{$field['id']} }} | ||
@else | ||
{{ $field['id'] ?? '' }} | ||
@endif | ||
</div> | ||
@endforeach | ||
@foreach($row->fieldsResponses as $resp) | ||
<div class="py-2"> | ||
{{ $resp->field->name }}:<span class="font-semibold">{{ $resp->response ?? ''}}</span> | ||
</div> | ||
@endforeach | ||
</div> | ||
</div> | ||
@empty | ||
<div class="flex justify-center items-center space-x-2"> | ||
<x-clarity-data-cluster-line class="h-8 w-8 text-gray-400"/> | ||
<span class="font-medium py-8 text-gray-400 text-xl">No responses found...</span> | ||
</div> | ||
@endforelse | ||
|
||
@if ($rows->hasPages()) | ||
<x-slot name="footer"> | ||
{{ $rows->links() }} | ||
</x-slot> | ||
@endif | ||
</x-filament::card> | ||
@if ($rows->hasPages()) | ||
{{ $rows->links() }} | ||
@endif | ||
</x-filament::page> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
namespace LaraZeus\Bolt\Filament\Resources; | ||
|
||
use Filament\Resources\Concerns\Translatable; | ||
use Filament\Resources\Resource; | ||
|
||
class BoltResource extends Resource | ||
{ | ||
use Translatable; | ||
|
||
public static function getTranslatableLocales(): array | ||
{ | ||
return config('zeus-bolt.translatable_Locales'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.