-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Group action buttons
- Loading branch information
Showing
8 changed files
with
165 additions
and
40 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
@php | ||
$crudActions = collect($actions)->filter(function($action) { | ||
return Str::is([ | ||
'*DeleteAction', | ||
'*RestoreAction', | ||
'*EditAction', | ||
'*ViewAction', | ||
'*ExportAction', | ||
], get_class($action)); | ||
}); | ||
$otherActions = collect($actions)->filter(function($action) { | ||
return !Str::is([ | ||
'*DeleteAction', | ||
'*RestoreAction', | ||
'*EditAction', | ||
'*ViewAction', | ||
'*ExportAction', | ||
], get_class($action)); | ||
}); | ||
@endphp | ||
<div class="btn-group group-actions"> | ||
@foreach($crudActions as $action) | ||
@if (method_exists($action, 'massAction')) | ||
@include('voyager::bread.partials.actions', ['action' => $action, 'dataType' => $dataType, 'data' => null]) | ||
@endif | ||
@endforeach | ||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> | ||
<span class="caret"></span> | ||
<span class="sr-only">Toggle Dropdown</span> | ||
</button> | ||
<ul class="dropdown-menu"> | ||
@foreach($otherActions as $action) | ||
@if (method_exists($action, 'massAction')) | ||
<li> | ||
@include('voyager::bread.partials.actions', ['action' => $action, 'dataType' => $dataType, 'data' => null]) | ||
</li> | ||
@endif | ||
@endforeach | ||
</ul> | ||
</ul> | ||
</div> |
42 changes: 42 additions & 0 deletions
42
resources/views/bread/partials/single-group-actions.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,42 @@ | ||
@php | ||
$crudActions = collect($actions)->filter(function($action) { | ||
return Str::is([ | ||
'*DeleteAction', | ||
'*RestoreAction', | ||
'*EditAction', | ||
'*ViewAction', | ||
'*ExportAction', | ||
], get_class($action)); | ||
}); | ||
$otherActions = collect($actions)->filter(function($action) { | ||
return !Str::is([ | ||
'*DeleteAction', | ||
'*RestoreAction', | ||
'*EditAction', | ||
'*ViewAction', | ||
'*ExportAction', | ||
], get_class($action)); | ||
}); | ||
@endphp | ||
<div class="btn-group single-group-actions btn-group-xs pull-right"> | ||
<button type="button" class="btn btn-default dropdown-toggle pull-right" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> | ||
<span class="caret"></span> | ||
<span class="sr-only">Toggle Dropdown</span> | ||
</button> | ||
<ul class="dropdown-menu dropdown-menu-left pull-right"> | ||
<li class="pull-right"> | ||
<div class="btn-group pull-right"> | ||
@foreach($otherActions as $action) | ||
@if (!method_exists($action, 'massAction')) | ||
@include('voyager::bread.partials.actions', ['action' => $action, 'dataType' => $dataType, 'data' => $data]) | ||
@endif | ||
@endforeach | ||
</div> | ||
</li> | ||
</ul> | ||
@foreach($crudActions as $action) | ||
@if (!method_exists($action, 'massAction')) | ||
@include('voyager::bread.partials.actions', ['action' => $action, 'dataType' => $dataType, 'data' => $data]) | ||
@endif | ||
@endforeach | ||
</div> |
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 |
---|---|---|
@@ -1,9 +1,11 @@ | ||
@foreach($dataTypes as $dataType) | ||
<x-joy-voyager-datatable | ||
:slug="$dataType->slug" | ||
:data-id="($dataId ?? 'tables') . '-' . $dataType->slug" | ||
:with-label="$withLabel" | ||
:auto-width="$autoWidth" | ||
:column-defs="$columnDefs" | ||
:without-checkbox="$withoutCheckbox" | ||
:without-actions="$withoutActions" | ||
:with-label="$withLabel" | ||
:data-id="($dataId ?? 'tables') . '-' . $dataType->slug" | ||
/> | ||
@endforeach |
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