@@ -15,60 +15,82 @@ class="data-synchronize-export-form"
1515 <x-core::card .title >
1616 {{ $exporter -> getHeading () } }
1717 </x-core::card .title >
18- <x-core::card .subtitle class =" ms-3" >
19- {{ trans (' packages/data-synchronize::data-synchronize.export.form.total' , [' total' => $exporter -> getTotal (), ' name' => $exporter -> getLabel ()]) } }
20- </x-core::card .subtitle >
2118 </x-core::card .header >
2219 @endif
2320
2421 <x-core::card .body >
25- <div >
26- @if ($exporter -> allColumnsIsDisabled () )
27- <x-core::form .label >
28- {!! BaseHelper:: clean (trans (
29- ' packages/data-synchronize::data-synchronize.export.form.all_columns_disabled' ,
30- [' columns' => Arr:: join (array_map (fn ($column ) => " <strong>{$column -> getLabel ()}</strong>" , $exporter -> getColumns ()), ' , ' )]
31- )) ! !}
32- </x-core::form .label >
33- @else
34- <x-core::form .label >
35- {{ trans (' packages/data-synchronize::data-synchronize.export.form.columns' ) } }
36- <a href =" javascript:void(0)" class =" ms-2 text-primary" data-bb-toggle =" check-all" data-bb-target =" .export-column" >Check all</a >
37- </x-core::form .label >
22+ @if ($exporter -> hasDataToExport () )
23+ @php
24+ $countersCount = count ($exporter -> getCounters ());
25+ @endphp
3826
39- <div @class ([' row row-cols-1' , ' row-cols-sm-2 row-cols-lg-3' => count ($exporter -> getColumns ()) > 6 ] )>
40- @foreach ($exporter -> getColumns () as $column )
41- <x-core::form-group >
42- <x-core::form .checkbox
43- class =" export-column"
44- name =" columns[]"
45- :value =" $column->getName()"
46- :label =" $column->getLabel()"
47- :disabled =" $column->isDisabled()"
48- checked
49- />
50- </x-core::form-group >
51- @endforeach
27+ @if ($countersCount )
28+ <div class =" mb-5" >
29+ <div @class ([' row g-3' , ' row-cols-2' => $countersCount > 1 , ' row-cols-sm-3' => $countersCount > 2 , ' row-cols-lg-4' => $countersCount > 3 ] )>
30+ @foreach ($exporter -> getCounters () as $counter )
31+ <div class =" col" >
32+ <div class =" text-center bg-body-tertiary rounded p-3" >
33+ <h3 class =" text-muted mb-2" >{{ $counter -> getLabel () } } </h3 >
34+ <div class =" fs-1 fw-bold" >{{ $counter -> getValue () } } </div >
35+ </div >
36+ </div >
37+ @endforeach
38+ </div >
5239 </div >
5340 @endif
54- </div >
5541
56- <x-core::form .radio-list
57- :label =" trans('packages/data-synchronize::data-synchronize.export.form.format')"
58- name =" format"
59- :options =" [
42+ <div >
43+ @if ($exporter -> allColumnsIsDisabled () )
44+ <x-core::form .label >
45+ {!! BaseHelper:: clean (trans (
46+ ' packages/data-synchronize::data-synchronize.export.form.all_columns_disabled' ,
47+ [' columns' => Arr:: join (array_map (fn ($column ) => " <strong>{$column -> getLabel ()}</strong>" , $exporter -> getColumns ()), ' , ' )]
48+ )) ! !}
49+ </x-core::form .label >
50+ @else
51+ <x-core::form .label >
52+ {{ trans (' packages/data-synchronize::data-synchronize.export.form.columns' ) } }
53+ <a href =" javascript:void(0)" class =" ms-2 text-primary" data-bb-toggle =" check-all" data-bb-target =" .export-column" >Check all</a >
54+ </x-core::form .label >
55+
56+ <div @class ([' row row-cols-1' , ' row-cols-sm-2 row-cols-lg-3' => count ($exporter -> getColumns ()) > 6 ] )>
57+ @foreach ($exporter -> getColumns () as $column )
58+ <x-core::form-group >
59+ <x-core::form .checkbox
60+ class =" export-column"
61+ name =" columns[]"
62+ :value =" $column->getName()"
63+ :label =" $column->getLabel()"
64+ :disabled =" $column->isDisabled()"
65+ checked
66+ />
67+ </x-core::form-group >
68+ @endforeach
69+ </div >
70+ @endif
71+ </div >
72+
73+ <x-core::form .radio-list
74+ :label =" trans('packages/data-synchronize::data-synchronize.export.form.format')"
75+ name =" format"
76+ :options =" [
6077 'csv' => 'CSV',
6178 'xlsx' => 'Excel',
6279 ]"
63- value =" csv"
64- >
65- </x-core::form .radio-list >
80+ value =" csv"
81+ >
82+ </x-core::form .radio-list >
83+ @else
84+ {!! $exporter -> getEmptyStateContent () ! !}
85+ @endif
6686 </x-core::card .body >
67- <x-core::card .footer >
68- <x-core::button type =" submit" color =" primary" :disabled =" $exporter->getTotal() === 0" >
69- {{ trans (' packages/data-synchronize::data-synchronize.export.form.export_button' ) } }
70- </x-core::button >
71- </x-core::card .footer >
87+ @if ($exporter -> hasDataToExport () )
88+ <x-core::card .footer >
89+ <x-core::button type =" submit" color =" primary" >
90+ {{ trans (' packages/data-synchronize::data-synchronize.export.form.export_button' ) } }
91+ </x-core::button >
92+ </x-core::card .footer >
93+ @endif
7294 </x-core::card >
7395 </x-core::form >
7496@stop
0 commit comments