-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #83 from digearthworks/development
Development
- Loading branch information
Showing
6 changed files
with
106 additions
and
47 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
|
||
namespace App\Http\Livewire; | ||
|
||
use App\Http\Livewire\Concerns\InteractsWithDialog; | ||
use App\Models\Menu; | ||
use Livewire\Component; | ||
|
||
class DashboardGrid extends Component | ||
{ | ||
use InteractsWithDialog; | ||
|
||
public $listeners = [ | ||
'refreshMenuGrid' => '$refresh', | ||
'designerView' => 'designerView', | ||
]; | ||
|
||
public $designerView = false; | ||
|
||
public function designerView() | ||
{ | ||
$this->designerView = ! $this->designerView; | ||
} | ||
|
||
public function updateSort($list) | ||
{ | ||
if ($this->designerView) { | ||
foreach ($list as $item) { | ||
Menu::find($item['value'])->update(['sort' => $item['order']]); | ||
} | ||
} | ||
} | ||
|
||
public function render() | ||
{ | ||
return view('includes.dashboard-grid'); | ||
} | ||
} |
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,36 @@ | ||
<div> | ||
<x-app-grid wire:sortable="updateSort" > | ||
@forelse($logged_in_user->all_menus->where('name', '!=', 'Dashboard')->sortBy('sort') as $item) | ||
<x-article-stacked :href="$designerView ? 'javascript:void(0)': $item->link" wire:sortable.item="{{ $item->id }}" wire:key="item-{{ $item->uuid }}" :target="($item->type == 'external_link') ? '_blank' : null" > | ||
|
||
<div class="w-24 h-24 ml-auto mr-auto picture-box"> | ||
{!! $item->icon->art !!} | ||
</div> | ||
|
||
<x-slot name="caption"> | ||
<p class="ml-auto mr-auto overflow-hidden leading-none tracking-tighter"> | ||
{{ $item->name ?? $item->link }} | ||
</p> | ||
</x-slot> | ||
|
||
@if($logged_in_user->isAdmin()) | ||
<div class="flex"> | ||
<x-edit-button-live class="z-50 -ml-24 bg-opacity-90" wire:model="designerView" wire:click="dialog('edit', {{ $item->id }})" id="editMenuButton_{{ $item->id }}" /> | ||
<x-delete-button-live class="z-50 bg-opacity-90 -ml-14 " wire:model="designerView" wire:click="confirm('delete', {{ $item->id }})" /> | ||
</div> | ||
@endif | ||
</x-article-stacked> | ||
|
||
|
||
@empty | ||
<x-article-stacked> | ||
|
||
<svg class="h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg> | ||
|
||
<x-slot name="caption"> | ||
{{__('No Items')}} | ||
</x-slot> | ||
</x-article-stacked> | ||
@endforelse | ||
</x-app-grid> | ||
</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