clara/resources/views/layout/partials/sidebar-layout/_toolbar.blade.php
Daeng Deni Mardaeni d0bf4e55be update toolbar
2023-09-20 13:47:58 +07:00

87 lines
4.9 KiB
PHP

@php
$route = explode('.',Route::currentRouteName());
@endphp
@if(file_exists(dirname(__FILE__, 4) . '/Modules/'.ucwords($route[0]).'/Resources/views/partials/_toolbar.blade.php'))
@include(strtolower($route[0]).'::partials._toolbar')
@else
<!--begin::Toolbar-->
<div id="kt_app_toolbar" class="app-toolbar py-3 py-lg-6">
<!--begin::Toolbar container-->
<div id="kt_app_toolbar_container" class="app-container container-fluid d-flex flex-stack">
@include(config('settings.KT_THEME_LAYOUT_DIR').'/partials/sidebar-layout/_page-title')
@if(isset($route[0]) && $route[0]!=='cardboard-detail')
@if(isset($route[1]) && $route[1] == 'index')
@if($route[0]=='document')
@if(!Auth::user()->hasRole(['ad','dd']))
<!--begin::Actions-->
<div class="d-flex align-items-center gap-2 gap-lg-3">
<!--begin::Primary button-->
<a href="{{ route($route[0].'.create') }}" class="btn btn-sm fw-bold btn-primary text-capitalize">Add {{ str_replace('-',' ',$route[0]) }}</a>
<!--end::Primary button-->
</div>
<!--end::Actions-->
@endif
@elseif($route[0]!=='settings' && $route[0]!=='approval' && $route[0]!=='report')
@if(!Auth::user()->hasRole(['ad','eo']))
<!--begin::Actions-->
<div class="d-flex align-items-center gap-2 gap-lg-3">
<!--begin::Primary button-->
<a href="{{ route($route[0].'.create') }}" class="btn btn-sm fw-bold btn-primary text-capitalize" data-bs-toggle="modal" data-bs-target="#kt_modal_{{ $route[0] }}">Add {{ str_replace('-',' ',$route[0]) }}</a>
<!--end::Primary button-->
</div>
<!--end::Actions-->
@endif
@endif
@elseif(isset($route[2]) && $route[2] == 'index')
@if($route[1]!=='users' || $route[0] !=='log')
<!--begin::Actions-->
<div class="d-flex align-items-center gap-2 gap-lg-3">
<!--begin::Primary button-->
<a href="{{ route($route[0].'.'.$route[1].'.create') }}" class="btn btn-sm fw-bold btn-primary text-capitalize" data-bs-toggle="modal" data-bs-target="#kt_modal_{{ $route[0] }}_{{ $route[1] }}">Add {{ str_replace('-',' ',$route[1]) }}</a>
<!--end::Primary button-->
</div>
<!--end::Actions-->
@else
<!--begin::Actions-->
<div class="d-flex align-items-center gap-2 gap-lg-3">
<!--begin::Primary button-->
<a href="{{ route($route[0].'.'.$route[1].'.create') }}" class="btn btn-sm fw-bold btn-primary text-capitalize" data-bs-toggle="modal" data-bs-target="#kt_modal_{{ $route[0] }}_{{ $route[1] }}">Add {{ str_replace('-',' ',$route[1]) }}</a>
<!--end::Primary button-->
</div>
<!--end::Actions-->
@endif
@endif
@elseif($route[0]=='cardboard-detail' && isset($route[1]))
@php
$link = explode('/',url()->current());
$id = end($link);
@endphp
<!--begin::Actions-->
<div class="d-flex align-items-center gap-2 gap-lg-3">
@if($route[1] == 'show')
@if(!Auth::user()->hasRole(['ad','dd']))
<!--begin::Primary button-->
<a href="{{ route($route[0].'.index') }}?id={{ $id }}" class="btn btn-sm fw-bold btn-primary text-capitalize">Add/Edit Odner</a>
<!--end::Primary button-->
@endif
<!--begin::Primary button-->
<a href="{{ route('cardboard.index') }}" class="btn btn-sm fw-bold btn-warning text-capitalize">Back</a>
<!--end::Primary button-->
@else
<!--begin::Primary button-->
<a href="{{ route('cardboard-detail.show',$_GET['id'] ) }}" class="btn btn-sm fw-bold btn-warning text-capitalize">Back</a>
<!--end::Primary button-->
@endif
</div>
<!--end::Actions-->
@endif
</div>
<!--end::Toolbar container-->
</div>
<!--end::Toolbar-->
@endif