Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
andreiio committed Oct 4, 2024
1 parent 45412f5 commit 7e2cef7
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 86 deletions.
2 changes: 1 addition & 1 deletion lang/ro/report.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
'location' => 'Locații',
'category' => 'Fișă raportare',
'period' => 'Perioada de raportare',
'status' => 'Stare',
'status' => 'Status',
],

'type' => [
Expand Down
2 changes: 1 addition & 1 deletion resources/views/components/forms/report/content.blade.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<div @if ($shouldPoll) wire:poll.5s.visible @endif>
<div @if ($shouldPoll()) wire:poll.5s.visible @endif>
{{ $getChildComponentContainer() }}
</div>
96 changes: 49 additions & 47 deletions resources/views/components/reports/table/list.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,58 +4,60 @@
'actions' => null,
])

<table class="min-w-full border-collapse table-fixed text-start">
@if (null !== $columns)
<thead class="text-base bg-gray-500/5">
<x-tables::row>
@foreach ($columns as $column)
<x-tables::header-cell :name="$column['name']">
{{ $column['label'] }}
</x-tables::header-cell>
@endforeach
<div class="w-full overflow-x-scroll">
<table class="min-w-full border-collapse table-fixed text-start">
@if (null !== $columns)
<thead class="text-base bg-gray-500/5">
<x-tables::row>
@foreach ($columns as $column)
<x-tables::header-cell :name="$column['name']">
{{ $column['label'] }}
</x-tables::header-cell>
@endforeach

@if (filled(data_get($data, '0.actions')))
<x-tables::header-cell name="actions" />
@endif
</x-tables::row>
</thead>
@endif
@if (filled(data_get($data, '0.actions')))
<x-tables::header-cell name="actions" />
@endif
</x-tables::row>
</thead>
@endif

<tbody class="divide-y border-y">
@foreach ($data as $row)
<x-tables::row>
@foreach ($columns as $column)
@php
$cell = data_get($row, $column['name']);
@endphp
<tbody class="divide-y border-y">
@foreach ($data as $row)
<x-tables::row>
@foreach ($columns as $column)
@php
$cell = data_get($row, $column['name']);
@endphp

@if (is_array($cell))
@foreach ($cell as $d)
@if (is_array($cell))
@foreach ($cell as $d)
<x-tables::cell class="px-4 py-2">
{{ $d ?? '' }}
</x-tables::cell>
@endforeach
@else
<x-tables::cell class="px-4 py-2">
{{ $d ?? '' }}
{{ $cell ?? '' }}
</x-tables::cell>
@endforeach
@else
@endif
@endforeach

@if (filled($actions = data_get($row, 'actions')))
<x-tables::cell class="px-4 py-2">
{{ $cell ?? '' }}
<div class="flex justify-end w-full gap-4">
@foreach ($actions as $url => $label)
<x-tables::link :href="$url" target="_blank">
<span class="whitespace-nowrap">{{ $label }}</span>

<x-heroicon-s-external-link class="w-4 h-4 shrink-0" />
</x-tables::link>
@endforeach
</div>
</x-tables::cell>
@endif
@endforeach

@if (filled($actions = data_get($row, 'actions')))
<x-tables::cell class="px-4 py-2">
<div class="flex justify-end w-full gap-4">
@foreach ($actions as $url => $label)
<x-tables::link :href="$url" target="_blank">
<span>{{ $label }}</span>

<x-heroicon-s-external-link class="w-4 h-4" />
</x-tables::link>
@endforeach
</div>
</x-tables::cell>
@endif
</x-tables::row>
@endforeach
</tbody>
</table>
</x-tables::row>
@endforeach
</tbody>
</table>
</div>
78 changes: 41 additions & 37 deletions resources/views/components/reports/table/statistic.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,44 +3,48 @@
'data' => null,
])

<table class="min-w-full border-collapse table-fixed text-start">
@if (null !== $columns)
<thead class="text-base bg-gray-500/5">
<tr>
<th scope="col" class="sticky left-0 bg-white border-r"></th>
<div class="w-full overflow-x-scroll">
<table class="min-w-full border-collapse table-fixed text-start">
@if (null !== $columns)
<thead class="text-base bg-gray-500/5">
<tr>
<th scope="col" class="sticky left-0 bg-white border-r"></th>

@foreach ($columns as $key => $label)
<th scope="col" class="px-2 py-3">
{{ $label }}
</th>
@endforeach
</tr>
</thead>
@endif
@foreach ($columns as $key => $label)
<th scope="col" class="px-2 py-3">
{{ $label }}
</th>
@endforeach
</tr>
</thead>
@endif

<tbody class="divide-y border-y">
@foreach ($data as $label => $columns)
<tr>
<th
class="sticky left-0 px-4 py-3 text-left bg-gray-100 border-r"
scope="row">
{{ $label }}
</th>
<tbody class="divide-y border-y">
@foreach ($data as $label => $columns)
<tr>
<th
class="sticky left-0 px-4 py-3 text-left bg-gray-100 border-r"
scope="row">
<span class="block w-64">
{{ $label }}
</span>
</th>

@foreach ($columns as $data)
@if (is_array($data))
@foreach ($data as $d)
<td class="px-2 py-3 text-center">
{{ $d }}
@foreach ($columns as $data)
@if (is_array($data))
@foreach ($data as $d)
<td class="p-4 text-center">
{{ $d }}
</td>
@endforeach
@else
<td class="p-4 text-center">
{{ $data }}
</td>
@endforeach
@else
<td class="px-2 py-3 text-center">
{{ $data }}
</td>
@endif
@endforeach
</tr>
@endforeach
</tbody>
</table>
@endif
@endforeach
</tr>
@endforeach
</tbody>
</table>
</div>

0 comments on commit 7e2cef7

Please sign in to comment.