From 72ddd750230aa532aa9a64e71e3a447b54432be5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Sun, 29 Jul 2018 16:36:49 +0200 Subject: [PATCH] Split table.view to multiple files --- .../views/table/_action-buttons.blade.php | 57 ++++ .../views/table/_panel-metadata.blade.php | 81 ++++++ resources/views/table/_rows.blade.php | 23 ++ resources/views/table/view.blade.php | 252 ++++-------------- 4 files changed, 219 insertions(+), 194 deletions(-) create mode 100644 resources/views/table/_action-buttons.blade.php create mode 100644 resources/views/table/_panel-metadata.blade.php create mode 100644 resources/views/table/_rows.blade.php diff --git a/resources/views/table/_action-buttons.blade.php b/resources/views/table/_action-buttons.blade.php new file mode 100644 index 0000000..10d6a15 --- /dev/null +++ b/resources/views/table/_action-buttons.blade.php @@ -0,0 +1,57 @@ +{{-- + args: $table +--}} + + diff --git a/resources/views/table/_panel-metadata.blade.php b/resources/views/table/_panel-metadata.blade.php new file mode 100644 index 0000000..b08f9b7 --- /dev/null +++ b/resources/views/table/_panel-metadata.blade.php @@ -0,0 +1,81 @@ +{{-- + args: $table +--}} + +
+ + {{-- Description field --}} +
+ Description + @if($table->description) + {!! Widget::collapsible($table->description, 400, '8em') !!} + @if($table->origin) +
{{-- spacer --}} + @endif + @else +

+ No description. +

+ @endif + + @if($table->origin) +

+ Adapted From
+ {!! Widget::tryLink($table->origin) !!} +

+ @endif +
+ + {{-- Info table --}} +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Author + {{ $table->owner->title }} + ({{ $table->owner->handle }}) +
License{{ $table->license ?: 'CC0' }}
Created + + {{ $table->created_at->diffForHumans() }} + +
Updated + + {{ $table->updated_at->diffForHumans() }} + +
Revisions{{ $table->revisions_count }}
Visits{{ $table->visits }}  {!! Widget::help('Visitors counted once per day') !!}
+
+ +
{{-- inner row --}} diff --git a/resources/views/table/_rows.blade.php b/resources/views/table/_rows.blade.php new file mode 100644 index 0000000..3e28d8e --- /dev/null +++ b/resources/views/table/_rows.blade.php @@ -0,0 +1,23 @@ +{{-- + args: $rows, $cols +--}} + + + + + @foreach($columns as $col) + + @endforeach + + + + @foreach($rows as $row) + + @php($rdata = json_decode($row['data'], true)) + @foreach($columns as $col) + + @endforeach + + @endforeach + +
{{ $col->title }}
{{ $rdata[$col->name] }}
diff --git a/resources/views/table/view.blade.php b/resources/views/table/view.blade.php index 86c703e..8f18af0 100644 --- a/resources/views/table/view.blade.php +++ b/resources/views/table/view.blade.php @@ -17,210 +17,74 @@

{{ $table->title }}

- + @include('table._action-buttons')
-
- - {{-- Tab pane --}} -
-
- - {{-- Description field --}} -
- Description - @if($table->description) - {!! Widget::collapsible($table->description, 400, '8em') !!} - @if($table->origin) -
{{-- spacer --}} - @endif - @else -

- No description. -

- @endif - - @if($table->origin) -

- Adapted From
- {!! Widget::tryLink($table->origin) !!} -

- @endif -
- - {{-- Info table --}} -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Author - {{ $table->owner->title }} - ({{ $table->owner->handle }}) -
License{{ $table->license ?: 'CC0' }}
Created - - {{ $table->created_at->diffForHumans() }} - -
Updated - - {{ $table->updated_at->diffForHumans() }} - -
Revisions{{ $table->revisions_count }}
Visits{{ $table->visits }}  {!! Widget::help('Visitors counted once per day') !!}
-
- -
{{-- inner row --}} -
{{-- Tab container --}} - -
- Column toggles, sort, filtering … coming soon -
-
- Export … coming soon -
+ {{-- Tab panels wrapper --}} +
-
{{-- Tab panel --}} - -{{-- Right column with menu --}} -
- - +
+ @include('table._panel-metadata') +
+ +
+ Column toggles, sort, filtering … coming soon +
+ +
+ Export … coming soon +
+ +
{{-- End of tab panels wrapper --}} + + {{-- Right column with menu --}} + + + Columns + + + + Export + + +
+
{{-- end of menu column --}} + +{{-- End of row --}}
-
- -
-
+
+ +
+{{-- End of row --}}
-
- - - - @foreach($columns as $col) - - @endforeach - - - - @foreach($rows as $row) - - @php($rdata = json_decode($row['data'], true)) - @foreach($columns as $col) - - @endforeach - - @endforeach - -
{{ $col->title }}
{{ $rdata[$col->name] }}
-
-
+
+ @include('table._rows') +
+{{-- End of row --}} + +
+
+ +
+
{{-- End of row --}} + @endsection