Skip to content

Commit

Permalink
Merge pull request #43 from lara-zeus/improvements
Browse files Browse the repository at this point in the history
Improvements
  • Loading branch information
atmonshi authored Jun 2, 2023
2 parents a9d387a + a45a07b commit 4d6f592
Show file tree
Hide file tree
Showing 31 changed files with 463 additions and 216 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"codeat3/blade-clarity-icons": "^1.7",
"filament/notifications": "^2.0",
"filament/spatie-laravel-translatable-plugin": "^2.0",
"guava/filament-icon-picker": "^1.3",
"lara-zeus/core": "^2.4"
},
"require-dev": {
Expand Down
60 changes: 59 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 34 additions & 0 deletions database/migrations/add_fields_to_sections_table.php.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('sections', function (Blueprint $table) {
$table->integer('section_column')->default(1);
$table->text('section_descriptions')->nullable();
$table->string('section_icon')->nullable();
$table->boolean('section_aside')->default(0);
});
}

/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('sections', function (Blueprint $table) {
$table->dropColumn('section_column');
$table->dropColumn('section_descriptions');
$table->dropColumn('section_icon');
$table->dropColumn('section_aside');
});
}
};
2 changes: 1 addition & 1 deletion database/seeders/BoltSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function run()
'slug' => 'feedback',
'options' => json_encode([
'confirmation-message' => 'Thank you for your feedback',
'show-as-wizard' => false,
'show-as' => 'page',
'require-login' => false,
'emails-notification' => null,
'web-hook' => null,
Expand Down
34 changes: 31 additions & 3 deletions resources/lang/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@
"Display & Access": "العرض والصلاحيات",
"Activate the form and let users start submissions": "تفعيل النموذج والسماح بارسال الإدخالات",
"Show As Wizard": "عرض كمعالج",
"instead of showing all section in one page, separate them in multiple steps": "بدلا من عرض كافة الأقسام بشكلل متتالي، يمكنك عرض النموذج كخطوات متعددة",
"require Login": "يتطلب تسيجل الدخول",
"User must be logged in or create an account before can submit a new entry": "يتوجب على المستخدمين الدخول أو انشاء حساب جديد قبل استخدام النموذج",
"One Entry Per User": "ادخال واحد فقط لكل مستخدم",
Expand All @@ -104,9 +103,38 @@
"Field Description": "وصف الحقل",
"Field Type": "النوع",
"Field Options": "خيارات الحقل",
"Brows Entries": "عرض السجلات",
"Type & title": "النص والنوع",
"Options": "خيارات",
"Brows Entries": "تصفح السجلات",
"New": "جديد",
"closed": "مغلق",
"Inactive": "غير مفعل",
"Active": "مفعل"
"Active": "مفعل",
"Section Column": "عدد الأعمدة",
"Section Descriptions": "وصف القسم",
"Section Info": "القسم",
"Section Details": "خيارات",
"From 1-12": "من 1-12",
"Section icon": "الأيقونة",
"show as aside": "عرض جانبي",
"Show As Tabs": "عرض كعلامات تبويب",
"Show the Form as Tabs": "عرض اقسام النموذج كعلامات تبويب",
"Show the form as": "طريقة عرض النموذج",
"Show on one page": "عرض كافة الأقسام في صفحة واحدة",
"separate each section in steps": "فصل كل قسم في خطوة منفصلة",
"My Responses": "السجلات الخاصة بي",
"Updated At": "آخر تحديث بتاريخ",
"view": "عرض",
"Response Details": "تفاصيل السجل",
"Set Status": "تغيير الحالة",
"Browse Entries": "تصفح السجلات",
"Form Dates": "تواريخ النموذج",
"Date type": "نوع التحقق",
"text": "نص",
"email": "بريد إلكتروني",
"numeric": "ارقام",
"tel": "هاتف",
"url": "رابط إلكتروني",
"prefix": "السابقة",
"suffix": "اللاحقة"
}
32 changes: 30 additions & 2 deletions resources/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@
"Display & Access": "Display & Access",
"Activate the form and let users start submissions": "Activate the form and let users start submissions",
"Show As Wizard": "Show As Wizard",
"instead of showing all section in one page, separate them in multiple steps": "instead of showing all section in one page, separate them in multiple steps",
"require Login": "require Login",
"User must be logged in or create an account before can submit a new entry": "User must be logged in or create an account before can submit a new entry",
"One Entry Per User": "One Entry Per User",
Expand All @@ -108,5 +107,34 @@
"New": "New",
"closed": "closed",
"Inactive": "Inactive",
"Active": "Active"
"Active": "Active",
"Section Column": "Section Column",
"Section Descriptions": "Section Descriptions",
"Section Info": "Section Info",
"Section Details": "Section Details",
"From 1-12": "From 1-12",
"Section icon": "Section icon",
"show as aside": "show as aside",
"Show As Tabs": "Show As Tabs",
"Show the Form as Tabs": "Show the Form as Tabs",
"Show the form as": "Show the form as",
"Show on one page": "Show on one page",
"separate each section in steps": "separate each section in steps",
"My Responses": "My Responses",
"Updated At": "Updated At",
"view": "view",
"Response Details": "Response Details",
"Set Status": "Set Status",
"Browse Entries": "Browse Entries",
"Form Dates": "Form Dates",
"Date type": "Date type",
"text": "text",
"email": "email",
"numeric": "numeric",
"tel": "tel",
"url": "url",
"prefix": "prefix",
"suffix": "suffix",
"Type & title": "Type & title",
"Options": "Options"
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,80 @@
:required="$isRequired()"
:state-path="$getStatePath()"
>
<div class="space-y-4" x-data="{ state: $wire.entangle('{{ $getStatePath() }}') }">
<div x-data="{ state: $wire.entangle('{{ $getStatePath() }}') }" class="space-y-4 my-6 mx-4 ">

<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>:
@if($getRecord()->user_id === null)
{{ __('Visitor') }}
@else
{{ ($getRecord()->user->name) ?? '' }}
@endif
</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-slot name="header">
<h2>{{ __('Show Entry Details') }}</h2>
</x-slot>

<x-slot name="breadcrumps">
<li class="flex items-center">
<a href="{{ route('bolt.entries.list') }}">{{ __('My Entries') }}</a>
<x-iconpark-rightsmall-o class="fill-current w-4 h-4 mx-3" />
</li>

<li class="flex items-center">
{{ __('Show entry') }} # {{ $getRecord()->id }}
</li>
</x-slot>

<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
<div class="md:col-span-2 space-y-4">
<x-filament::card>
<div class="grid grid-cols-1">
@foreach($getRecord()->fieldsResponses as $resp)
<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>
<x-filament::hr/>
</div>
@endforeach
</div>
</x-filament::card>
</div>
<div class="md:col-span-1 space-y-4">
<x-filament::card class="w-full">
<x-filament::card.heading class="text-secondary-500">
{{ __('User Details') }}
</x-filament::card.heading>
<p>
<span class="text-base font-light">{{ __('By') }}</span>:
@if($getRecord()->user_id === null)
{{ __('Visitor') }}
@else
{{ ($getRecord()->user->name) ?? '' }}
@endif
</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>
<div>
<div class="space-y-2">
<x-filament::card>
<x-filament::card.heading class="text-primary-600">
<p class="my-3 mx-1 text-secondary-600 font-semibold">{{ __('Entry Details') }}</p>
</x-filament::card.heading>

<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">{!! ( new $resp->field->type )->getResponse($resp->field, $resp) !!}</p>
<x-filament::hr/>
<div>
<span class="text-gray-600">{{ __('Form') }}:</span>
{{ $getRecord()->form->name ?? '' }}
</div>

<div>
<span>{{ __('status') }}</span>
@php $getStatues = config('zeus-bolt.models.FormsStatus')::where('key',$getRecord()->status)->first() @endphp
<span class="{{ $getStatues->class }}" x-tooltip.raw="{{ __('status') }}">
@svg($getStatues->icon,'w-4 h-4 inline')
{{ $getStatues->label }}
</span>
</div>

</x-filament::card>
</div>
</div>
@endforeach
</x-filament::card>
</div>
</div>
</div>
</x-forms::field-wrapper>
Original file line number Diff line number Diff line change
@@ -1,32 +1,6 @@
<x-filament::page>
@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">{!! ( new $resp->field->type )->getResponse($resp->field, $resp) !!}</p>
</x-filament::card>
@endforeach
</div>
@include('zeus-bolt::themes.zeus.show-entry',['response'=>$row])
@empty
<div class="flex justify-center items-center space-x-2">
<x-clarity-data-cluster-line class="h-8 w-8 text-gray-400"/>
Expand All @@ -35,6 +9,7 @@
@endforelse

@if ($rows->hasPages())
{{ $rows->links() }}
<x-tables::pagination :paginator="$rows"/>
@endif

</x-filament::page>
Loading

0 comments on commit 4d6f592

Please sign in to comment.