generathor-laravel 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +419 -0
- package/dist/configuration.d.ts +25 -0
- package/dist/configuration.js +43 -0
- package/dist/helpers/handlebars.d.ts +3 -0
- package/dist/helpers/handlebars.js +20 -0
- package/dist/helpers/naming.d.ts +18 -0
- package/dist/helpers/naming.js +98 -0
- package/dist/helpers/string.d.ts +27 -0
- package/dist/helpers/string.js +120 -0
- package/dist/helpers/type.d.ts +4 -0
- package/dist/helpers/type.js +41 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +18 -0
- package/dist/template.d.ts +20 -0
- package/dist/template.js +284 -0
- package/dist/transformers/collection/attachForm.d.ts +4 -0
- package/dist/transformers/collection/attachForm.js +55 -0
- package/dist/transformers/collection/attachRequest.d.ts +5 -0
- package/dist/transformers/collection/attachRequest.js +92 -0
- package/dist/transformers/collection/base.d.ts +20 -0
- package/dist/transformers/collection/base.js +54 -0
- package/dist/transformers/collection/baseController.d.ts +4 -0
- package/dist/transformers/collection/baseController.js +14 -0
- package/dist/transformers/collection/belongsToRelation.d.ts +5 -0
- package/dist/transformers/collection/belongsToRelation.js +86 -0
- package/dist/transformers/collection/controller.d.ts +8 -0
- package/dist/transformers/collection/controller.js +163 -0
- package/dist/transformers/collection/createRelationForm.d.ts +4 -0
- package/dist/transformers/collection/createRelationForm.js +163 -0
- package/dist/transformers/collection/filterRelationForm.d.ts +4 -0
- package/dist/transformers/collection/filterRelationForm.js +164 -0
- package/dist/transformers/collection/hasManyRelation.d.ts +5 -0
- package/dist/transformers/collection/hasManyRelation.js +91 -0
- package/dist/transformers/collection/menu.d.ts +4 -0
- package/dist/transformers/collection/menu.js +25 -0
- package/dist/transformers/collection/route.d.ts +5 -0
- package/dist/transformers/collection/route.js +123 -0
- package/dist/transformers/item/base.d.ts +19 -0
- package/dist/transformers/item/base.js +33 -0
- package/dist/transformers/item/edit.d.ts +4 -0
- package/dist/transformers/item/edit.js +21 -0
- package/dist/transformers/item/eloquent.d.ts +4 -0
- package/dist/transformers/item/eloquent.js +158 -0
- package/dist/transformers/item/filter.d.ts +5 -0
- package/dist/transformers/item/filter.js +41 -0
- package/dist/transformers/item/forms.d.ts +4 -0
- package/dist/transformers/item/forms.js +226 -0
- package/dist/transformers/item/laravel.d.ts +15 -0
- package/dist/transformers/item/laravel.js +36 -0
- package/dist/transformers/item/list.d.ts +4 -0
- package/dist/transformers/item/list.js +36 -0
- package/dist/transformers/item/requests.d.ts +4 -0
- package/dist/transformers/item/requests.js +125 -0
- package/dist/transformers/item/show.d.ts +5 -0
- package/dist/transformers/item/show.js +54 -0
- package/package.json +46 -0
- package/templates/eloquent/child.handlebars +13 -0
- package/templates/eloquent/filter.handlebars +88 -0
- package/templates/eloquent/parent.handlebars +64 -0
- package/templates/others/base-controller.handlebars +46 -0
- package/templates/others/controller.handlebars +185 -0
- package/templates/others/pk-trait.handlebars +157 -0
- package/templates/others/request.handlebars +32 -0
- package/templates/others/routes.handlebars +16 -0
- package/templates/views/breadcrumbs.handlebars +21 -0
- package/templates/views/edit.handlebars +41 -0
- package/templates/views/form.handlebars +103 -0
- package/templates/views/icons/check-circle.handlebars +3 -0
- package/templates/views/icons/chevron-down.handlebars +3 -0
- package/templates/views/icons/chevron-right.handlebars +3 -0
- package/templates/views/icons/computer.handlebars +3 -0
- package/templates/views/icons/eye.handlebars +4 -0
- package/templates/views/icons/funnel.handlebars +3 -0
- package/templates/views/icons/home.handlebars +3 -0
- package/templates/views/icons/link.handlebars +3 -0
- package/templates/views/icons/list-bullet.handlebars +3 -0
- package/templates/views/icons/pencil.handlebars +3 -0
- package/templates/views/icons/plus.handlebars +3 -0
- package/templates/views/icons/trash.handlebars +3 -0
- package/templates/views/icons/unlink.handlebars +3 -0
- package/templates/views/icons/x-circle.handlebars +3 -0
- package/templates/views/icons/x.handlebars +3 -0
- package/templates/views/index.handlebars +181 -0
- package/templates/views/loader.handlebars +6 -0
- package/templates/views/menu.handlebars +39 -0
- package/templates/views/modal.handlebars +36 -0
- package/templates/views/record-input.handlebars +90 -0
- package/templates/views/relation-item.handlebars +180 -0
- package/templates/views/relation-list.handlebars +199 -0
- package/templates/views/show.handlebars +134 -0
- package/templates/views/tabs.handlebars +16 -0
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
<x-{{layout}}>
|
|
2
|
+
<x-slot name="header">
|
|
3
|
+
<h2 class="font-semibold text-xl text-gray-800 dark:text-gray-200 leading-tight">
|
|
4
|
+
\{{__('{{header}}')}}
|
|
5
|
+
</h2>
|
|
6
|
+
</x-slot>
|
|
7
|
+
<div class="w-full bg-white dark:bg-gray-800 border-t border-gray-200 dark:border-gray-700">
|
|
8
|
+
<div class="max-w-7xl mx-auto overflow-hidden py-2">
|
|
9
|
+
<x-generathor.breadcrumbs :breadcrumbs="[
|
|
10
|
+
[
|
|
11
|
+
'label' => __('Home'),
|
|
12
|
+
'icon' => 'generathor.icon-home',
|
|
13
|
+
'url' => route('{{homeRoute}}')
|
|
14
|
+
],
|
|
15
|
+
[
|
|
16
|
+
'label' => __('Manage'),
|
|
17
|
+
'icon' => 'generathor.icon-computer',
|
|
18
|
+
'url' => route('generathor.menu')
|
|
19
|
+
],
|
|
20
|
+
[
|
|
21
|
+
'label' => __('{{listLabel}}'),
|
|
22
|
+
'url' => route('generathor.{{context}}.index')
|
|
23
|
+
],
|
|
24
|
+
[
|
|
25
|
+
'label' => ${{record}}->getRecordLabel(),
|
|
26
|
+
'url' => route('generathor.{{context}}.show', ['{{record}}' => ${{record}}->getRouteKey()])
|
|
27
|
+
],
|
|
28
|
+
[
|
|
29
|
+
'label' => ${{record}}->{{relationAttribute}} ? ${{record}}->{{relationAttribute}}->getRecordLabel() : __('{{relationLabel}}'),
|
|
30
|
+
]
|
|
31
|
+
]" />
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
<div class="max-w-7xl py-12 mx-auto sm:px-6 lg:px-8">
|
|
35
|
+
<div class="bg-white dark:bg-gray-800 shadow-xl sm:rounded-lg">
|
|
36
|
+
<div class="p-6 lg:p-8 bg-white dark:bg-gray-800 dark:bg-gradient-to-bl dark:from-gray-700/50 dark:via-transparent border-b border-gray-200 dark:border-gray-700">
|
|
37
|
+
<div class="w-full flex justify-end space-x-2">
|
|
38
|
+
@if(!isset(${{record}}->{{relationAttribute}}))
|
|
39
|
+
<x-generathor.modal :opened="$errors->create->any()">
|
|
40
|
+
<x-slot name="trigger">
|
|
41
|
+
<div class="relative">
|
|
42
|
+
<button type="button" class="focus:outline-none text-white bg-green-700 hover:bg-green-800 focus:ring-4 focus:ring-green-300 font-medium rounded-lg text-sm p-2.5 dark:bg-green-600 dark:hover:bg-green-700 dark:focus:ring-green-800 peer">
|
|
43
|
+
<x-generathor.icon-plus />
|
|
44
|
+
</button>
|
|
45
|
+
<div class="absolute -top-9 left-1/2 -translate-x-1/2 z-10 opacity-0 transition-all ease-out peer-hover:opacity-100 px-3 py-2 text-xs font-medium text-white bg-gray-900 rounded-lg shadow-sm">\{{ __('New') }}</div>
|
|
46
|
+
</div>
|
|
47
|
+
</x-slot>
|
|
48
|
+
<div class="mb-4 text-center">
|
|
49
|
+
<span class="text-xl text-gray-900 dark:text-white">\{{ __('Create') }}</span>
|
|
50
|
+
</div>
|
|
51
|
+
<x-generathor.{{context}}.create-{{relationContext}}-form :{{record}}="${{record}}"/>
|
|
52
|
+
</x-generathor.modal>
|
|
53
|
+
<x-generathor.modal :opened="$errors->attach->any()">
|
|
54
|
+
<x-slot name="trigger">
|
|
55
|
+
<div class="relative">
|
|
56
|
+
<button @click="fullscreenModal=true" type="button" class="focus:outline-none text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm p-2.5 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800 peer">
|
|
57
|
+
<x-generathor.icon-link />
|
|
58
|
+
</button>
|
|
59
|
+
<div class="absolute -top-9 left-1/2 -translate-x-1/2 z-10 opacity-0 transition-all ease-out peer-hover:opacity-100 px-3 py-2 text-xs font-medium text-white bg-gray-900 rounded-lg shadow-sm">\{{ __('Attach') }}</div>
|
|
60
|
+
</div>
|
|
61
|
+
</x-slot>
|
|
62
|
+
<div class="mb-4 text-center">
|
|
63
|
+
<span class="text-xl text-gray-900 dark:text-white">\{{ __('Attach') }}</span>
|
|
64
|
+
</div>
|
|
65
|
+
<x-generathor.{{context}}.attach-{{relationContext}}-form :{{record}}="${{record}}"/>
|
|
66
|
+
</x-generathor.modal>
|
|
67
|
+
@else
|
|
68
|
+
<div class="relative">
|
|
69
|
+
<a href="\{{route('generathor.{{routeRelationContext}}.show' , ['{{routeRelationRecordName}}' => ${{record}}->{{relationAttribute}}->getRouteKey()])}}" type="button" class="focus:outline-none text-white bg-green-700 hover:bg-green-800 focus:ring-4 focus:ring-green-300 font-medium rounded-lg text-sm p-2.5 dark:bg-green-600 dark:hover:bg-green-700 dark:focus:ring-green-800 inline-flex peer">
|
|
70
|
+
<x-generathor.icon-eye class="!w-4 !h-4" />
|
|
71
|
+
</a>
|
|
72
|
+
<div class="absolute -top-9 left-1/2 -translate-x-1/2 z-10 opacity-0 transition-all ease-out peer-hover:opacity-100 px-3 py-2 text-xs font-medium text-white bg-gray-900 rounded-lg shadow-sm">\{{ __('Details') }}</div>
|
|
73
|
+
</div>
|
|
74
|
+
<form method="POST" action="\{{route('generathor.{{context}}.detach{{capitalizedRelationAttribute}}', ['{{record}}' => ${{record}}->getRouteKey()])}}" x-data="{
|
|
75
|
+
deleteAlert() {
|
|
76
|
+
return window.Swal.fire({
|
|
77
|
+
title: '\{{ __('Are you sure?') }}',
|
|
78
|
+
icon: 'warning',
|
|
79
|
+
showCancelButton: true,
|
|
80
|
+
confirmButtonText: '\{{ __('Yes') }}',
|
|
81
|
+
cancelButtonText: '\{{ __('Cancel') }}',
|
|
82
|
+
reverseButtons: true
|
|
83
|
+
});
|
|
84
|
+
},
|
|
85
|
+
deleteRecord: async function() {
|
|
86
|
+
const result = await this.deleteAlert();
|
|
87
|
+
if (result.isConfirmed) {
|
|
88
|
+
$root.submit();
|
|
89
|
+
window.showLoading();
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}">
|
|
93
|
+
@csrf
|
|
94
|
+
<div class="relative">
|
|
95
|
+
<button type="button" @click="deleteRecord()" class="focus:outline-none text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:ring-red-300 font-medium rounded-lg text-sm p-2.5 dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-80 peer">
|
|
96
|
+
<x-generathor.icon-unlink />
|
|
97
|
+
</button>
|
|
98
|
+
<div class="absolute -top-9 left-1/2 -translate-x-1/2 z-10 opacity-0 transition-all ease-out peer-hover:opacity-100 px-3 py-2 text-xs font-medium text-white bg-gray-900 rounded-lg shadow-sm">\{{ __('Detach') }}</div>
|
|
99
|
+
</div>
|
|
100
|
+
</form>
|
|
101
|
+
<div class="relative">
|
|
102
|
+
<a href="\{{route('generathor.{{routeRelationContext}}.edit' , ['{{routeRelationRecordName}}' => ${{record}}->{{relationAttribute}}->getRouteKey(), '_url' => request()->fullUrl()])}}" type="button" class="focus:outline-none text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm p-2.5 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800 inline-flex peer">
|
|
103
|
+
<x-generathor.icon-pencil class="!w-4 !h-4" />
|
|
104
|
+
</a>
|
|
105
|
+
<div class="absolute -top-9 left-1/2 -translate-x-1/2 z-10 opacity-0 transition-all ease-out peer-hover:opacity-100 px-3 py-2 text-xs font-medium text-white bg-gray-900 rounded-lg shadow-sm">\{{ __('Update') }}</div>
|
|
106
|
+
</div>
|
|
107
|
+
@endif
|
|
108
|
+
<div class="relative">
|
|
109
|
+
<a href="\{{route('generathor.{{routeRelationContext}}.index')}}" class="focus:outline-none text-white bg-gray-700 hover:bg-gray-800 focus:ring-4 focus:ring-gray-300 font-medium rounded-lg text-sm p-2.5 dark:bg-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-800 inline-flex peer">
|
|
110
|
+
<x-generathor.icon-list-bullet />
|
|
111
|
+
</a>
|
|
112
|
+
<div class="absolute -top-9 left-1/2 -translate-x-1/2 text-nowrap z-10 opacity-0 transition-all ease-out peer-hover:opacity-100 px-3 py-2 text-xs font-medium text-white bg-gray-900 rounded-lg shadow-sm">\{{__('{{relationListLabel}}')}}</div>
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
115
|
+
<x-generathor.tabs class="mt-4" :tabs="[{{#each tabs}}
|
|
116
|
+
[
|
|
117
|
+
'label' => __('{{label}}'),{{#if route}}
|
|
118
|
+
'url' => route('{{route}}'{{#if routeRecord}}, ['{{routeRecord}}' => ${{routeRecord}}->getRouteKey()]{{/if}}),{{/if}}
|
|
119
|
+
],{{/each}}
|
|
120
|
+
]"/>
|
|
121
|
+
<div class="overflow-x-auto shadow-md mb-4 relative">
|
|
122
|
+
@if(isset(${{record}}->{{relationAttribute}}))
|
|
123
|
+
<table class="w-full text-sm text-left text-gray-500 dark:text-gray-400">
|
|
124
|
+
{{#each columns}}
|
|
125
|
+
<tr class="bg-white border-b dark:bg-gray-800 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600">
|
|
126
|
+
<td class="px-6 py-4 text-left font-semibold">\{{__('{{label}}')}}</td>
|
|
127
|
+
<td class="px-6 py-4 text-right">
|
|
128
|
+
{{#if (eq type "bool")}}
|
|
129
|
+
{{#if nullable}}
|
|
130
|
+
@if(!isset(${{../record}}->{{../relationAttribute}}->{{name}}))
|
|
131
|
+
<span class="text-red-400">\{{__('Not defined')}}</span>
|
|
132
|
+
@elseif(${{../record}}->{{../relationAttribute}}->{{name}})
|
|
133
|
+
<x-generathor.icon-check-circle class="float-right" />
|
|
134
|
+
@else
|
|
135
|
+
<x-generathor.icon-x-circle class="float-right" />
|
|
136
|
+
@endif
|
|
137
|
+
{{else}}
|
|
138
|
+
@if(${{../record}}->{{../relationAttribute}}->{{name}})
|
|
139
|
+
<x-generathor.icon-check-circle class="float-right" />
|
|
140
|
+
@else
|
|
141
|
+
<x-generathor.icon-x-circle class="float-right" />
|
|
142
|
+
@endif
|
|
143
|
+
{{/if}}
|
|
144
|
+
{{else if (eq type "record")}}
|
|
145
|
+
{{#if nullable}}
|
|
146
|
+
@if(isset(${{../record}}->{{../relationAttribute}}->{{name}}))
|
|
147
|
+
<a href="\{{route('generathor.{{data.context}}.show' , ['{{data.routeRecordName}}' => ${{../record}}->{{../relationAttribute}}->{{data.relationAttribute}}->getRouteKey()])}}" class="font-medium text-blue-600 dark:text-blue-500 hover:underline">\{{ ${{../record}}->{{../relationAttribute}}->{{data.relationAttribute}}->getRouteKey() }} - \{{ ${{../record}}->{{../relationAttribute}}->{{data.relationAttribute}}->getRecordLabel() }}</a>
|
|
148
|
+
@else
|
|
149
|
+
<span class="text-red-400">\{{__('Not defined')}}</span>
|
|
150
|
+
@endif
|
|
151
|
+
{{else}}
|
|
152
|
+
<a href="\{{route('generathor.{{data.context}}.show' , ['{{data.routeRecordName}}' => ${{../record}}->{{../relationAttribute}}->{{data.relationAttribute}}->getRouteKey()])}}" class="font-medium text-blue-600 dark:text-blue-500 hover:underline">\{{ ${{../record}}->{{../relationAttribute}}->{{data.relationAttribute}}->getRouteKey() }} - \{{ ${{../record}}->{{../relationAttribute}}->{{data.relationAttribute}}->getRecordLabel() }}</a>
|
|
153
|
+
{{/if}}
|
|
154
|
+
{{else}}
|
|
155
|
+
{{#if nullable}}
|
|
156
|
+
@if(isset(${{../record}}->{{../relationAttribute}}->{{name}}))
|
|
157
|
+
\{{ ${{../record}}->{{../relationAttribute}}->{{name}} }}
|
|
158
|
+
@else
|
|
159
|
+
<span class="text-red-400">\{{__('Not defined')}}</span>
|
|
160
|
+
@endif
|
|
161
|
+
{{else}}
|
|
162
|
+
\{{ ${{../record}}->{{../relationAttribute}}->{{name}} }}
|
|
163
|
+
{{/if}}
|
|
164
|
+
{{/if}}
|
|
165
|
+
</td>
|
|
166
|
+
</tr>
|
|
167
|
+
{{/each}}
|
|
168
|
+
</table>
|
|
169
|
+
@else
|
|
170
|
+
<table class="w-full text-sm text-left text-gray-500 dark:text-gray-400">
|
|
171
|
+
<tr class="bg-white border-b dark:bg-gray-800 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600">
|
|
172
|
+
<td class="px-6 py-4 text-left font-semibold">\{{ __('There are no records') }}</td>
|
|
173
|
+
</tr>
|
|
174
|
+
</table>
|
|
175
|
+
@endif
|
|
176
|
+
</div>
|
|
177
|
+
</div>
|
|
178
|
+
</div>
|
|
179
|
+
</div>
|
|
180
|
+
</x-{{layout}}>
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
<x-{{layout}}>
|
|
2
|
+
<x-slot name="header">
|
|
3
|
+
<h2 class="font-semibold text-xl text-gray-800 dark:text-gray-200 leading-tight">
|
|
4
|
+
\{{__('{{header}}')}}
|
|
5
|
+
</h2>
|
|
6
|
+
</x-slot>
|
|
7
|
+
<div class="w-full bg-white dark:bg-gray-800 border-t border-gray-200 dark:border-gray-700">
|
|
8
|
+
<div class="max-w-7xl mx-auto overflow-hidden py-2">
|
|
9
|
+
<x-generathor.breadcrumbs :breadcrumbs="[
|
|
10
|
+
[
|
|
11
|
+
'label' => __('Home'),
|
|
12
|
+
'icon' => 'generathor.icon-home',
|
|
13
|
+
'url' => route('{{homeRoute}}')
|
|
14
|
+
],
|
|
15
|
+
[
|
|
16
|
+
'label' => __('Manage'),
|
|
17
|
+
'icon' => 'generathor.icon-computer',
|
|
18
|
+
'url' => route('generathor.menu')
|
|
19
|
+
],
|
|
20
|
+
[
|
|
21
|
+
'label' => __('{{listLabel}}'),
|
|
22
|
+
'url' => route('generathor.{{context}}.index')
|
|
23
|
+
],
|
|
24
|
+
[
|
|
25
|
+
'label' => ${{record}}->getRecordLabel(),
|
|
26
|
+
'url' => route('generathor.{{context}}.show', ['{{record}}' => ${{record}}->getRouteKey()])
|
|
27
|
+
],
|
|
28
|
+
[
|
|
29
|
+
'label' => __('{{relationLabel}}'),
|
|
30
|
+
]
|
|
31
|
+
]" />
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
<div class="max-w-7xl py-12 mx-auto sm:px-6 lg:px-8">
|
|
35
|
+
<div class="bg-white dark:bg-gray-800 shadow-xl sm:rounded-lg">
|
|
36
|
+
<div class="p-6 lg:p-8 bg-white dark:bg-gray-800 dark:bg-gradient-to-bl dark:from-gray-700/50 dark:via-transparent border-b border-gray-200 dark:border-gray-700">
|
|
37
|
+
<div class="w-full flex justify-end space-x-2">
|
|
38
|
+
<x-generathor.modal :opened="$errors->create->any()">
|
|
39
|
+
<x-slot name="trigger">
|
|
40
|
+
<div class="relative">
|
|
41
|
+
<button type="button" class="focus:outline-none text-white bg-green-700 hover:bg-green-800 focus:ring-4 focus:ring-green-300 font-medium rounded-lg text-sm p-2.5 dark:bg-green-600 dark:hover:bg-green-700 dark:focus:ring-green-800 peer">
|
|
42
|
+
<x-generathor.icon-plus />
|
|
43
|
+
</button>
|
|
44
|
+
<div class="absolute -top-9 left-1/2 -translate-x-1/2 z-10 opacity-0 transition-all ease-out peer-hover:opacity-100 px-3 py-2 text-xs font-medium text-white bg-gray-900 rounded-lg shadow-sm">\{{ __('New') }}</div>
|
|
45
|
+
</div>
|
|
46
|
+
</x-slot>
|
|
47
|
+
<div class="mb-4 text-center">
|
|
48
|
+
<span class="text-xl text-gray-900 dark:text-white">\{{ __('Create') }}</span>
|
|
49
|
+
</div>
|
|
50
|
+
<x-generathor.{{context}}.create-{{relationContext}}-form :{{record}}="${{record}}"/>
|
|
51
|
+
</x-generathor.modal>
|
|
52
|
+
<div class="relative">
|
|
53
|
+
<a href="\{{route('generathor.{{routeRelationContext}}.index')}}" class="focus:outline-none text-white bg-gray-700 hover:bg-gray-800 focus:ring-4 focus:ring-gray-300 font-medium rounded-lg text-sm p-2.5 dark:bg-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-800 inline-flex peer">
|
|
54
|
+
<x-generathor.icon-list-bullet />
|
|
55
|
+
</a>
|
|
56
|
+
<div class="absolute -top-9 left-1/2 -translate-x-1/2 text-nowrap z-10 opacity-0 transition-all ease-out peer-hover:opacity-100 px-3 py-2 text-xs font-medium text-white bg-gray-900 rounded-lg shadow-sm">\{{__('{{relationListLabel}}')}}</div>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
<x-generathor.tabs class="mt-4" :tabs="[{{#each tabs}}
|
|
60
|
+
[
|
|
61
|
+
'label' => __('{{label}}'),{{#if route}}
|
|
62
|
+
'url' => route('{{route}}'{{#if routeRecord}}, ['{{routeRecord}}' => ${{routeRecord}}->getRouteKey()]{{/if}}),{{/if}}
|
|
63
|
+
],{{/each}}
|
|
64
|
+
]"/>
|
|
65
|
+
<div class="mb-2 shadow-md" x-data="{ expanded: \{{ $errors->filter->any() ? 'true' : 'false' }} }">
|
|
66
|
+
<button type="button" class="w-full bg-gray-50 px-6 py-3 text-left text-sm text-gray-700 dark:bg-gray-700 dark:text-gray-400" @click="expanded = !expanded">
|
|
67
|
+
<div class="flex items-center justify-between">
|
|
68
|
+
<div class="flex items-center gap-2">
|
|
69
|
+
<x-generathor.icon-funnel />
|
|
70
|
+
<span>\{{__('Filter')}}</span>
|
|
71
|
+
</div>
|
|
72
|
+
<x-generathor.icon-chevron-down />
|
|
73
|
+
</div>
|
|
74
|
+
</button>
|
|
75
|
+
<div x-cloak x-show="expanded" class="border border-gray-50 dark:border-gray-700" x-collapse>
|
|
76
|
+
<div class="p-4">
|
|
77
|
+
<x-generathor.{{context}}.filter-{{relationContext}}-form />
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
<div class="overflow-x-auto shadow-md mb-4 relative">
|
|
82
|
+
<table class="w-full text-sm text-left text-gray-500 dark:text-gray-400">
|
|
83
|
+
<thead class="text-xs text-gray-700 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-400">
|
|
84
|
+
<tr>{{#each columns}}
|
|
85
|
+
<th scope="col" class="px-6 py-3">
|
|
86
|
+
<div class="flex items-center space-x-1">
|
|
87
|
+
@sortablelink('{{name}}', __('{{label}}'))
|
|
88
|
+
</div>
|
|
89
|
+
</th>{{/each}}
|
|
90
|
+
<th scope="col" class="px-6 py-3">
|
|
91
|
+
<div class="flex items-center">
|
|
92
|
+
\{{ __('Actions') }}
|
|
93
|
+
</div>
|
|
94
|
+
</th>
|
|
95
|
+
</tr>
|
|
96
|
+
</thead>
|
|
97
|
+
<tbody>
|
|
98
|
+
@forelse($list->items() as $item)
|
|
99
|
+
<tr class="bg-white border-b dark:bg-gray-800 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600">
|
|
100
|
+
{{#each columns}}
|
|
101
|
+
<td class="px-6 py-4">
|
|
102
|
+
{{#if (eq type "bool")}}
|
|
103
|
+
{{#if nullable}}
|
|
104
|
+
@if(!isset($item->{{name}}))
|
|
105
|
+
<span class="text-red-400">\{{__('Not defined')}}</span>
|
|
106
|
+
@elseif($item->{{name}})
|
|
107
|
+
<x-generathor.icon-check-circle />
|
|
108
|
+
@else
|
|
109
|
+
<x-generathor.icon-x-circle />
|
|
110
|
+
@endif
|
|
111
|
+
{{else}}
|
|
112
|
+
@if($item->{{name}})
|
|
113
|
+
<x-generathor.icon-check-circle />
|
|
114
|
+
@else
|
|
115
|
+
<x-generathor.icon-x-circle />
|
|
116
|
+
@endif
|
|
117
|
+
{{/if}}
|
|
118
|
+
{{else if (eq type "record")}}
|
|
119
|
+
{{#if nullable}}
|
|
120
|
+
@if(isset($item->{{name}}))
|
|
121
|
+
<a href="\{{route('generathor.{{data.context}}.show' , ['{{data.routeRecordName}}' => $item->{{data.relationAttribute}}->getRouteKey()])}}" class="font-medium text-blue-600 dark:text-blue-500 hover:underline">\{{ $item->{{data.relationAttribute}}->getRouteKey() }} - \{{ $item->{{data.relationAttribute}}->getRecordLabel() }}</a>
|
|
122
|
+
@else
|
|
123
|
+
<span class="text-red-400">\{{__('Not defined')}}</span>
|
|
124
|
+
@endif
|
|
125
|
+
{{else}}
|
|
126
|
+
<a href="\{{route('generathor.{{data.context}}.show' , ['{{data.routeRecordName}}' => $item->{{data.relationAttribute}}->getRouteKey()])}}" class="font-medium text-blue-600 dark:text-blue-500 hover:underline">\{{ $item->{{data.relationAttribute}}->getRouteKey() }} - \{{ $item->{{data.relationAttribute}}->getRecordLabel() }}</a>
|
|
127
|
+
{{/if}}
|
|
128
|
+
{{else}}
|
|
129
|
+
{{#if nullable}}
|
|
130
|
+
@if(isset($item->{{name}}))
|
|
131
|
+
\{{ $item->{{name}} }}
|
|
132
|
+
@else
|
|
133
|
+
<span class="text-red-400">\{{__('Not defined')}}</span>
|
|
134
|
+
@endif
|
|
135
|
+
{{else}}
|
|
136
|
+
\{{ $item->{{name}} }}
|
|
137
|
+
{{/if}}
|
|
138
|
+
{{/if}}
|
|
139
|
+
</td>
|
|
140
|
+
{{/each}}
|
|
141
|
+
<td class="px-6 py-4">
|
|
142
|
+
<div class="w-full flex">
|
|
143
|
+
<div class="relative">
|
|
144
|
+
<a href="\{{route('generathor.{{routeRelationContext}}.show', ['{{routeRelationRecordName}}' => $item->getRouteKey()])}}" class="peer">
|
|
145
|
+
<x-generathor.icon-eye />
|
|
146
|
+
</a>
|
|
147
|
+
<div class="absolute -top-9 left-1/2 -translate-x-1/2 z-10 opacity-0 transition-all ease-out peer-hover:opacity-100 px-3 py-2 text-xs font-medium text-white bg-gray-900 rounded-lg shadow-sm">\{{ __('Details') }}</div>
|
|
148
|
+
</div>
|
|
149
|
+
<div class="relative">
|
|
150
|
+
<a href="\{{route('generathor.{{routeRelationContext}}.edit', ['{{routeRelationRecordName}}' => $item->getRouteKey(), '_url' => request()->fullUrl()])}}" class="peer">
|
|
151
|
+
<x-generathor.icon-pencil />
|
|
152
|
+
</a>
|
|
153
|
+
<div class="absolute -top-9 left-1/2 -translate-x-1/2 z-10 opacity-0 transition-all ease-out peer-hover:opacity-100 px-3 py-2 text-xs font-medium text-white bg-gray-900 rounded-lg shadow-sm">\{{ __('Update') }}</div>
|
|
154
|
+
</div>
|
|
155
|
+
<form method="POST" action="\{{route('generathor.{{routeRelationContext}}.destroy' , ['{{routeRelationRecordName}}' => $item->getRouteKey()])}}" x-data="{
|
|
156
|
+
deleteAlert() {
|
|
157
|
+
return window.Swal.fire({
|
|
158
|
+
title: '\{{ __('Are you sure?') }}',
|
|
159
|
+
text: '\{{ __('You will not be able to revert this!') }}',
|
|
160
|
+
icon: 'warning',
|
|
161
|
+
showCancelButton: true,
|
|
162
|
+
confirmButtonText: '\{{ __('Yes') }}',
|
|
163
|
+
cancelButtonText: '\{{ __('Cancel') }}',
|
|
164
|
+
reverseButtons: true
|
|
165
|
+
});
|
|
166
|
+
},
|
|
167
|
+
deleteRecord: async function() {
|
|
168
|
+
const result = await this.deleteAlert();
|
|
169
|
+
if (result.isConfirmed) {
|
|
170
|
+
$root.submit();
|
|
171
|
+
window.showLoading();
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}">
|
|
175
|
+
@method('DELETE')
|
|
176
|
+
@csrf
|
|
177
|
+
<div class="relative">
|
|
178
|
+
<button type="button" class="peer" @click="deleteRecord()">
|
|
179
|
+
<x-generathor.icon-trash />
|
|
180
|
+
</button>
|
|
181
|
+
<div class="absolute -top-9 left-1/2 -translate-x-1/2 z-10 opacity-0 transition-all ease-out peer-hover:opacity-100 px-3 py-2 text-xs font-medium text-white bg-gray-900 rounded-lg shadow-sm">\{{ __('Delete') }}</div>
|
|
182
|
+
</div>
|
|
183
|
+
</form>
|
|
184
|
+
</div>
|
|
185
|
+
</td>
|
|
186
|
+
</tr>
|
|
187
|
+
@empty
|
|
188
|
+
<tr class="bg-white border-b dark:bg-gray-800 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600">
|
|
189
|
+
<td class="px-6 py-4" colspan="100%">\{{ __('There are no records') }}</td>
|
|
190
|
+
</tr>
|
|
191
|
+
@endforelse
|
|
192
|
+
</tbody>
|
|
193
|
+
</table>
|
|
194
|
+
</div>
|
|
195
|
+
\{{ $list->appends(request()->query())->links() }}
|
|
196
|
+
</div>
|
|
197
|
+
</div>
|
|
198
|
+
</div>
|
|
199
|
+
</x-{{layout}}>
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
<x-{{layout}}>
|
|
2
|
+
<x-slot name="header">
|
|
3
|
+
<h2 class="font-semibold text-xl text-gray-800 dark:text-gray-200 leading-tight">
|
|
4
|
+
\{{__('{{header}}')}}
|
|
5
|
+
</h2>
|
|
6
|
+
</x-slot>
|
|
7
|
+
<div class="w-full bg-white dark:bg-gray-800 border-t border-gray-200 dark:border-gray-700">
|
|
8
|
+
<div class="max-w-7xl mx-auto overflow-hidden py-2">
|
|
9
|
+
<x-generathor.breadcrumbs :breadcrumbs="[
|
|
10
|
+
[
|
|
11
|
+
'label' => __('Home'),
|
|
12
|
+
'icon' => 'generathor.icon-home',
|
|
13
|
+
'url' => route('{{homeRoute}}')
|
|
14
|
+
],
|
|
15
|
+
[
|
|
16
|
+
'label' => __('Manage'),
|
|
17
|
+
'icon' => 'generathor.icon-computer',
|
|
18
|
+
'url' => route('generathor.menu')
|
|
19
|
+
],
|
|
20
|
+
[
|
|
21
|
+
'label' => __('{{listLabel}}'),
|
|
22
|
+
'url' => route('generathor.{{context}}.index')
|
|
23
|
+
],
|
|
24
|
+
[
|
|
25
|
+
'label' => ${{recordName}}->getRecordLabel(),
|
|
26
|
+
],
|
|
27
|
+
]" />
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
<div class="max-w-7xl py-12 mx-auto sm:px-6 lg:px-8">
|
|
31
|
+
<div class="bg-white dark:bg-gray-800 shadow-xl sm:rounded-lg">
|
|
32
|
+
<div class="p-6 lg:p-8 bg-white dark:bg-gray-800 dark:bg-gradient-to-bl dark:from-gray-700/50 dark:via-transparent border-b border-gray-200 dark:border-gray-700">
|
|
33
|
+
<div class="w-full flex justify-end space-x-2">
|
|
34
|
+
<form method="POST" action="\{{route('generathor.{{context}}.destroy' , ['{{recordName}}' => ${{recordName}}->getRouteKey()])}}" x-data="{
|
|
35
|
+
deleteAlert() {
|
|
36
|
+
return window.Swal.fire({
|
|
37
|
+
title: '\{{ __('Are you sure?') }}',
|
|
38
|
+
text: '\{{ __('You will not be able to revert this!') }}',
|
|
39
|
+
icon: 'warning',
|
|
40
|
+
showCancelButton: true,
|
|
41
|
+
confirmButtonText: '\{{ __('Yes') }}',
|
|
42
|
+
cancelButtonText: '\{{ __('Cancel') }}',
|
|
43
|
+
reverseButtons: true
|
|
44
|
+
});
|
|
45
|
+
},
|
|
46
|
+
deleteRecord: async function() {
|
|
47
|
+
const result = await this.deleteAlert();
|
|
48
|
+
if (result.isConfirmed) {
|
|
49
|
+
$root.submit();
|
|
50
|
+
window.showLoading();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}">
|
|
54
|
+
@method('DELETE')
|
|
55
|
+
@csrf
|
|
56
|
+
<input type="hidden" name="_url" value="\{{route('generathor.{{context}}.index')}}">
|
|
57
|
+
<div class="relative">
|
|
58
|
+
<button type="button" @click="deleteRecord()" class="focus:outline-none text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:ring-red-300 font-medium rounded-lg text-sm p-2.5 dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-80 peer">
|
|
59
|
+
<x-generathor.icon-trash class="!w-4 !h-4" />
|
|
60
|
+
</button>
|
|
61
|
+
<div class="absolute -top-9 left-1/2 -translate-x-1/2 z-10 opacity-0 transition-all ease-out peer-hover:opacity-100 px-3 py-2 text-xs font-medium text-white bg-gray-900 rounded-lg shadow-sm">\{{ __('Delete') }}</div>
|
|
62
|
+
</div>
|
|
63
|
+
</form>
|
|
64
|
+
<div class="relative">
|
|
65
|
+
<a href="\{{route('generathor.{{context}}.edit' , ['{{recordName}}' => ${{recordName}}->getRouteKey()])}}" type="button" class="focus:outline-none text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm p-2.5 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800 inline-flex peer">
|
|
66
|
+
<x-generathor.icon-pencil class="!w-4 !h-4" />
|
|
67
|
+
</a>
|
|
68
|
+
<div class="absolute -top-9 left-1/2 -translate-x-1/2 z-10 opacity-0 transition-all ease-out peer-hover:opacity-100 px-3 py-2 text-xs font-medium text-white bg-gray-900 rounded-lg shadow-sm">\{{ __('Update') }}</div>
|
|
69
|
+
</div>
|
|
70
|
+
<div class="relative">
|
|
71
|
+
<a href="\{{route('generathor.{{context}}.index')}}" class="focus:outline-none text-white bg-gray-700 hover:bg-gray-800 focus:ring-4 focus:ring-gray-300 font-medium rounded-lg text-sm p-2.5 dark:bg-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-800 inline-flex peer">
|
|
72
|
+
<x-generathor.icon-list-bullet />
|
|
73
|
+
</a>
|
|
74
|
+
<div class="absolute -top-9 left-1/2 -translate-x-1/2 text-nowrap z-10 opacity-0 transition-all ease-out peer-hover:opacity-100 px-3 py-2 text-xs font-medium text-white bg-gray-900 rounded-lg shadow-sm">\{{__('{{listLabel}}')}}</div>
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
<x-generathor.tabs class="mt-4" :tabs="[{{#each tabs}}
|
|
78
|
+
[
|
|
79
|
+
'label' => __('{{label}}'),{{#if route}}
|
|
80
|
+
'url' => route('{{route}}'{{#if routeRecord}}, ['{{routeRecord}}' => ${{routeRecord}}->getRouteKey()]{{/if}}),{{/if}}
|
|
81
|
+
],{{/each}}
|
|
82
|
+
]"/>
|
|
83
|
+
<div class="overflow-x-auto shadow-md mb-4 relative">
|
|
84
|
+
<table class="w-full text-sm text-left text-gray-500 dark:text-gray-400">
|
|
85
|
+
{{#each columns}}
|
|
86
|
+
<tr class="bg-white border-b dark:bg-gray-800 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600">
|
|
87
|
+
<td class="px-6 py-4 text-left font-semibold">\{{__('{{label}}')}}</td>
|
|
88
|
+
<td class="px-6 py-4 text-right">
|
|
89
|
+
{{#if (eq type "bool")}}
|
|
90
|
+
{{#if nullable}}
|
|
91
|
+
@if(!isset(${{../recordName}}->{{name}}))
|
|
92
|
+
<span class="text-red-400">\{{__('Not defined')}}</span>
|
|
93
|
+
@elseif(${{../recordName}}->{{name}})
|
|
94
|
+
<x-generathor.icon-check-circle class="float-right" />
|
|
95
|
+
@else
|
|
96
|
+
<x-generathor.icon-x-circle class="float-right" />
|
|
97
|
+
@endif
|
|
98
|
+
{{else}}
|
|
99
|
+
@if(${{../recordName}}->{{name}})
|
|
100
|
+
<x-generathor.icon-check-circle class="float-right" />
|
|
101
|
+
@else
|
|
102
|
+
<x-generathor.icon-x-circle class="float-right" />
|
|
103
|
+
@endif
|
|
104
|
+
{{/if}}
|
|
105
|
+
{{else if (eq type "record")}}
|
|
106
|
+
{{#if nullable}}
|
|
107
|
+
@if(isset(${{../recordName}}->{{name}}))
|
|
108
|
+
<a href="\{{route('generathor.{{data.context}}.show' , ['{{data.routeRecordName}}' => ${{../recordName}}->{{data.relationAttribute}}->getRouteKey()])}}" class="font-medium text-blue-600 dark:text-blue-500 hover:underline">\{{ ${{../recordName}}->{{data.relationAttribute}}->getRouteKey() }} - \{{ ${{../recordName}}->{{data.relationAttribute}}->getRecordLabel() }}</a>
|
|
109
|
+
@else
|
|
110
|
+
<span class="text-red-400">\{{__('Not defined')}}</span>
|
|
111
|
+
@endif
|
|
112
|
+
{{else}}
|
|
113
|
+
<a href="\{{route('generathor.{{data.context}}.show' , ['{{data.routeRecordName}}' => ${{../recordName}}->{{data.relationAttribute}}->getRouteKey()])}}" class="font-medium text-blue-600 dark:text-blue-500 hover:underline">\{{ ${{../recordName}}->{{data.relationAttribute}}->getRouteKey() }} - \{{ ${{../recordName}}->{{data.relationAttribute}}->getRecordLabel() }}</a>
|
|
114
|
+
{{/if}}
|
|
115
|
+
{{else}}
|
|
116
|
+
{{#if nullable}}
|
|
117
|
+
@if(isset(${{../recordName}}->{{name}}))
|
|
118
|
+
\{{ ${{../recordName}}->{{name}} }}
|
|
119
|
+
@else
|
|
120
|
+
<span class="text-red-400">\{{__('Not defined')}}</span>
|
|
121
|
+
@endif
|
|
122
|
+
{{else}}
|
|
123
|
+
\{{ ${{../recordName}}->{{name}} }}
|
|
124
|
+
{{/if}}
|
|
125
|
+
{{/if}}
|
|
126
|
+
</td>
|
|
127
|
+
</tr>
|
|
128
|
+
{{/each}}
|
|
129
|
+
</table>
|
|
130
|
+
</div>
|
|
131
|
+
</div>
|
|
132
|
+
</div>
|
|
133
|
+
</div>
|
|
134
|
+
</x-{{layout}}>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<ul {!! $attributes->only('class')->merge(['class' => 'flex flex-wrap text-sm font-medium text-center text-gray-500 border-b border-gray-200 dark:border-gray-700 dark:text-gray-400 space-x-2']) !!}>
|
|
2
|
+
@foreach($tabs as $tab)
|
|
3
|
+
<li>
|
|
4
|
+
@if (empty($tab['url']))
|
|
5
|
+
<span class="inline-block p-4 text-blue-600 bg-gray-100 rounded-t-lg active dark:bg-gray-800 dark:text-blue-500">\{{$tab['label']}}</span>
|
|
6
|
+
@else
|
|
7
|
+
<a
|
|
8
|
+
class="inline-block p-4 rounded-t-lg hover:text-gray-600 hover:bg-gray-50 dark:hover:bg-gray-800 dark:hover:text-gray-300"
|
|
9
|
+
href="\{{$tab['url']}}"
|
|
10
|
+
>
|
|
11
|
+
\{{$tab['label']}}
|
|
12
|
+
</a>
|
|
13
|
+
@endif
|
|
14
|
+
</li>
|
|
15
|
+
@endforeach
|
|
16
|
+
</ul>
|