Skip to content

Commit

Permalink
Merge pull request #228 from lara-zeus/revert-223-sub-nav
Browse files Browse the repository at this point in the history
Revert "use sub nav in forms nav"
  • Loading branch information
atmonshi authored Jan 8, 2024
2 parents cbb0afc + 7dbd10d commit eeb4f49
Show file tree
Hide file tree
Showing 24 changed files with 515 additions and 363 deletions.
1 change: 1 addition & 0 deletions docs/getting-started/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ 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

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<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)
<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)
@if($resp->field !== null)
<div class="py-2 text-ellipsis overflow-auto">
<p>{{ $resp->field->name ?? '' }}</p>
Expand All @@ -14,59 +14,72 @@
</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($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>
</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>
</div>

<div class="mb-4">
<span>{{ __('status') }}</span>
@php $getStatues = $response->statusDetails() @endphp
<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')
@svg($getStatues['icon'],'w-4 h-4 inline')
{{ $getStatues['label'] }}
</span>
</div>
</span>
</div>

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

</x-filament::section>
</div>
</div>
</div>
</div>
</x-filament::page>
</div>
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\BoltPro\BoltProServiceProvider::class) && optional($zeusForm->options)['logo'] !== null && optional($zeusForm)->options['cover'] !== null)
@if(class_exists(\LaraZeus\Bolt\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-custom-100 sm:w-24 object-cover"
class="bg-white rounded-full shadow-md shadow-primary-100 sm:h-24 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-custom-600 text-2xl font-bold dark:text-white">
<h4 class="text-primary-600 text-2xl font-bold dark:text-white">
{{ $zeusForm->name ?? '' }}
</h4>
@if(filled($zeusForm->description))
<h5 class="text-custom-600 font-normal">
<h5 class="text-primary-600 font-normal">
{{ $zeusForm->description ?? '' }}
</h5>
@endif
@if($zeusForm->start_date !== null)
<div class="text-custom-800 flex items-center justify-start gap-2 text-sm">
<div class="text-primary-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-custom-100 sm:w-24 object-cover"
@endif

@if(!$inline)
@if(!class_exists(\LaraZeus\BoltPro\BoltProServiceProvider::class) || (optional($zeusForm->options)['logo'] === null && optional($zeusForm->options)['cover'] === null))
@if(!class_exists(\LaraZeus\Bolt\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: 2 additions & 0 deletions src/BoltPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
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 @@ -25,6 +26,7 @@ public function register(Panel $panel): void
->resources([
CollectionResource::class,
FormResource::class,
ResponseResource::class,
CategoryResource::class,
]);
}
Expand Down
44 changes: 44 additions & 0 deletions src/Concerns/EntriesAction.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php

namespace LaraZeus\Bolt\Concerns;

use Filament\Actions\Action;
use Filament\Actions\ActionGroup;
use LaraZeus\Bolt\Filament\Resources\ResponseResource;

/**
* @property int $form_id.
*/
trait EntriesAction
{
public function getEntriesActions(?int $formId = null): array
{
$formId = $formId ?? $this->form_id;

return [
ActionGroup::make([
Action::make('brows')
->icon('heroicon-o-eye')
->visible($formId !== 0)
->label(__('Brows Entries'))
->url(fn (): string => ResponseResource::getUrl('brows') . '?form_id=' . $formId),
Action::make('list')
->icon('heroicon-o-bars-4')
->visible($formId !== 0)
->label(__('List Entries'))
->url(fn (): string => ResponseResource::getUrl() . '?form_id=' . $formId),
Action::make('report')
->icon('heroicon-o-document-chart-bar')
->visible($formId !== 0)
->label(__('Entries Report'))
->url(fn (): string => ResponseResource::getUrl('report') . '?form_id=' . $formId),
])
->button()
->color('info')
->label(__('Entries'))
->tooltip(__('view all entries'))
->icon('clarity-data-cluster-line')
->tooltip(__('view all entries')),
];
}
}
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(class_exists(\LaraZeus\BoltPro\BoltProServiceProvider::class) && config('zeus-bolt.allow_design'))
->visible(fn (
): bool => 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 eeb4f49

Please sign in to comment.