From: Vincent Vanwaelscappel Date: Wed, 29 Mar 2023 17:29:38 +0000 (+0200) Subject: wait #5835 @1 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=3c8eea062c3a12df94818dced9b6560579a5dc3b;p=fluidbook-toolbox.git wait #5835 @1 --- diff --git a/app/Widgets.php b/app/Widgets.php index 3507109ed..b6c90ce7b 100644 --- a/app/Widgets.php +++ b/app/Widgets.php @@ -57,4 +57,21 @@ class Widgets ]); } } + + public static function notificationsWidget($wrapper = null, $class = '', $heading = '') + { + $notifications = backpack_user()->notifications->slice(0, 10); + if (count($notifications)) { + + Widget::add([ + 'type' => 'view', + 'view' => 'tasks.list', + 'wrapper' => $wrapper, + 'class' => $class, + 'heading' => $heading, + 'notifications' => $notifications, + ]); + + } + } } diff --git a/public/packages/fluidbook/toolbox/css/style.less b/public/packages/fluidbook/toolbox/css/style.less index 7bd94ff22..8810e810b 100644 --- a/public/packages/fluidbook/toolbox/css/style.less +++ b/public/packages/fluidbook/toolbox/css/style.less @@ -465,6 +465,14 @@ body.embeded { } } +.dashboard-wrapper { + background-color: #ffffff; + padding: 20px; + border-radius: 2px; + margin: 15px 0; + box-shadow: 0 0 4px rgba(0, 0, 0, 0.1); +} + @import "context-menu"; @import "loader"; diff --git a/resources/views/tasks/index.blade.php b/resources/views/tasks/index.blade.php index 23fc162fc..9e7dc7557 100644 --- a/resources/views/tasks/index.blade.php +++ b/resources/views/tasks/index.blade.php @@ -1,91 +1,10 @@ -{{-- __('!! Équipe') --}} +{{-- __('!! Notifications') --}} @extends(backpack_view('blank')) -@push('after_scripts') - -@endpush -@section('content') - - {{--

{{__('Tâches en cours')}}

--}} -

{{__('Notifications')}}

- - {{-- --}} - {{-- --}} - {{-- --}} - {{-- --}} - {{-- --}} - {{-- --}} - {{-- --}} - {{-- --}} - - - @if(!$notifications || !count($notifications)) - {{__('Aucune notification')}} - @endif - @foreach($notifications as $id=>$notification) - read_at===null) class="unread" @endif> - - - - - - - @endforeach - -
{{__('Bulletin')}}{{__('Date')}}
{{$notification->data['subject']}}
-
    - @foreach($notification->data['actions'] as $label=>$url) -
  • {{$label}} : {{$url}}
  • - @endforeach -
-
{{$notification->created_at}} - -
+@section('content') + @include('tasks.list') @endsection diff --git a/resources/views/tasks/list.blade.php b/resources/views/tasks/list.blade.php new file mode 100644 index 000000000..c8799bc49 --- /dev/null +++ b/resources/views/tasks/list.blade.php @@ -0,0 +1,95 @@ +@php + if(isset($widget['notifications'])){ + $notifications=$widget['notifications']; + } +@endphp + +@push('after_scripts') + +@endpush + + + +{{--

{{__('Tâches en cours')}}

--}} +@if(isset($widget)) +

{{__('Notifications')}}

+@else +

{{__('Notifications')}}

+@endif + + {{-- --}} + {{-- --}} + {{-- --}} + {{-- --}} + {{-- --}} + {{-- --}} + {{-- --}} + {{-- --}} + + + @if(!$notifications || !count($notifications)) + {{__('Aucune notification')}} + @endif + @foreach($notifications as $id=>$notification) + read_at===null) class="unread" @endif> + + + + + + + @endforeach + +
{{__('Bulletin')}}{{__('Date')}}
{{$notification->data['subject']}}
+
    + @foreach($notification->data['actions'] as $label=>$url) +
  • {{$label}} : {{$url}}
  • + @endforeach +
+
{{$notification->created_at}} + +
diff --git a/resources/views/vendor/backpack/base/dashboard.blade.php b/resources/views/vendor/backpack/base/dashboard.blade.php index 89b72e3da..db8e3d162 100644 --- a/resources/views/vendor/backpack/base/dashboard.blade.php +++ b/resources/views/vendor/backpack/base/dashboard.blade.php @@ -3,7 +3,8 @@ @php \App\Widgets::fluidbookQuoteWidgets(); - \App\Widgets::teamWidgets(['class' => 'col-sm-4 leave-calendar-wrapper'],'dashboard',__('Planning de l\'équipe')); + \App\Widgets::notificationsWidget(['class' => 'col-sm-8 dashboard-wrapper'],'dashboard',__('Notifications')); + \App\Widgets::teamWidgets(['class' => 'col-sm-4 dashboard-wrapper'],'dashboard',__('Planning de l\'équipe')); @endphp