-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
25 changed files
with
705 additions
and
268 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
return [ | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| Pagination Language Lines | ||
|-------------------------------------------------------------------------- | ||
| | ||
| Used for submitting the form on the table index. | ||
| | ||
| @see \Playground\Blade\View\Components\Table\Data | ||
*/ | ||
|
||
'previous' => '« Previous', | ||
'next' => 'Next »', | ||
|
||
'go' => 'Go', | ||
|
||
'form.label' => 'Pagination Options', | ||
|
||
'show' => 'Showing page :currentPage of :lastPage with :perPage per page.', | ||
|
||
'row.actions.label' => 'Record Controls and Actions', | ||
|
||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
@if(empty($fkModelData)) | ||
{{$value}} | ||
@else | ||
@php | ||
$withInitials = !empty($columnMeta['with-initials']) && is_bool($columnMeta['with-initials']); | ||
$withName = !empty($columnMeta['with-name']) && is_bool($columnMeta['with-name']); | ||
$hasAvatar = !empty($fkModelData['avatar']) && is_string($fkModelData['avatar']); | ||
$hasImage = !empty($fkModelData['image']) && is_string($fkModelData['image']); | ||
$property = !empty($columnMeta['property']) && is_string($columnMeta['property']) ? $columnMeta['property'] : ''; | ||
$width = 36; | ||
$image = ''; | ||
$initials = ''; | ||
$name = !empty($fkModelData[$property]) && is_string($fkModelData[$property]) ? $fkModelData[$property] : ''; | ||
if ($name) { | ||
$initials = preg_filter('/[^A-Z]/', '', $name); | ||
if (mb_strlen($initials) > 2) { | ||
$initials = mb_substr($initials, 0, 1).mb_substr($initials, -1); | ||
} | ||
} | ||
if ($hasAvatar) { | ||
$image = $fkModelData['avatar']; | ||
} elseif ($hasImage) { | ||
$image = $fkModelData['image']; | ||
} | ||
@endphp | ||
@if($image) | ||
<img src="{{$image}}" class="rounded-circle" alt="Avatar" width="{{$width}}" height="{{$width}}"> | ||
@elseif($initials) | ||
<span class="rounded-circle" width="{{$width}}"> | ||
{{$initials}} | ||
</span> | ||
@endif | ||
|
||
@if($withName && $name) | ||
<span data-model-id="{{$value}}">{{$name}}</span> | ||
@endif | ||
|
||
@endif |
53 changes: 53 additions & 0 deletions
53
resources/views/components/table/data-form-filter-columns.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?php | ||
$columns = [ | ||
'all' => [ | ||
'label' => 'All', | ||
], | ||
'standard' => [ | ||
'label' => 'Standard', | ||
], | ||
'mobile' => [ | ||
'label' => 'Mobile', | ||
], | ||
]; | ||
$viewableColumns = 'standard'; | ||
if (!empty($validated) | ||
&& !empty($validated['columns']) | ||
&& is_string($validated['columns']) | ||
&& in_array($validated['columns'], array_keys($columns)) | ||
) { | ||
$viewableColumns = $validated['columns']; | ||
} | ||
// dd([ | ||
// '$viewableColumns' => $viewableColumns, | ||
// '$validated' => $validated, | ||
// '$columns' => $columns, | ||
// '$meta' => $meta, | ||
// ]) | ||
?> | ||
<fieldset class="mb-3" id="{{ $id }}-fieldset-filter-columns"> | ||
<legend> | ||
Filter Columns | ||
</legend> | ||
|
||
<div class="container collapse show"> | ||
<div class="row"> | ||
|
||
<div class="col"> | ||
<div class="input-group mb-3"> | ||
|
||
@foreach($columns as $column => $columnMeta) | ||
<div class="form-check me-2"> | ||
<input class="form-check-input" type="radio" name="columns" id="filter_columns_{{$column}}" | ||
{{ $column === $viewableColumns ? 'checked' : '' }} value="{{$column}}"> | ||
<label class="form-check-label" for="filter_columns_{{$column}}"> | ||
{{$columnMeta['label'] ?? 'view' }} | ||
</label> | ||
</div> | ||
@endforeach | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</fieldset> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.