mirror of
https://gitlab.com/TheGamecraft/c-cms.git
synced 2026-04-21 10:49:10 -04:00
update notification
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
||||
<!-- CSRF Token -->
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||
<meta name="user-id" content="{{ Auth::user()->id }}">
|
||||
|
||||
<!-- Favicon, Icon and Font -->
|
||||
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Roboto+Slab:400,700|Material+Icons" />
|
||||
|
||||
@@ -1,9 +1,3 @@
|
||||
<?php
|
||||
$nbOfNotification = 0;
|
||||
foreach (Auth::user()->unreadNotifications as $notification) {
|
||||
$nbOfNotification = $nbOfNotification + 1;
|
||||
}
|
||||
?>
|
||||
<nav class="navbar navbar-expand-lg navbar-transparent navbar-absolute fixed-top ">
|
||||
<div class="container-fluid">
|
||||
<div class="navbar-wrapper">
|
||||
@@ -43,20 +37,50 @@ foreach (Auth::user()->unreadNotifications as $notification) {
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link" href="http://example.com" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<i class="material-icons">notifications</i>
|
||||
@if ($nbOfNotification != 0)
|
||||
<span class="notification">{{ $nbOfNotification }}</span>
|
||||
@endif
|
||||
<span id="notification-number" number="{{count(Auth::user()->unreadNotifications)}}" class="notification @if (count(Auth::user()->unreadNotifications) == 0) d-none @endif">{{ count(Auth::user()->unreadNotifications) }}</span>
|
||||
<p class="d-lg-none d-md-block">
|
||||
Notifications
|
||||
</p>
|
||||
</a>
|
||||
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdownMenuLink">
|
||||
@foreach (Auth::user()->unreadNotifications as $notification)
|
||||
<a class="dropdown-item" href="#">{{$notification->data['msg']}}</a>
|
||||
<div class="dropdown-menu dropdown-menu-right dropdown-notification" aria-labelledby="navbarDropdownMenuLink">
|
||||
<div class="card-header">
|
||||
<h6 class="text-center m-0">Notification</h6>
|
||||
</div>
|
||||
<div class="card-body pt-2" style="max-height: 450px;overflow: auto">
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
|
||||
</div>
|
||||
<div class="col-6 text-right">
|
||||
<a class="btn btn-sm btn-outline-info text-info" onclick="markAllNotificationAsRead()">Tous lu</a>
|
||||
</div>
|
||||
</div>
|
||||
@foreach(Auth::user()->getNotificationForUI() as $key => $notificationGroup)
|
||||
<small class="text">{{$key}}</small>
|
||||
<div class="card mb-3 mt-1" style="width: 18rem;">
|
||||
<ul id="notification-container" class="list-group list-group-flush">
|
||||
@foreach($notificationGroup as $notification)
|
||||
<li id="{{$notification->id}}" class="list-group-item @if($notification->read_at == null)cursor notification-success @endif" style="border-bottom: solid 1px lightgrey" @if($notification->read_at == null) onclick="markNotificationAsRead('{{$notification->id}}')" @endif>
|
||||
<div class="d-flex">
|
||||
<div style="min-width: 2rem">
|
||||
@if(isset($notification->data['icon']))
|
||||
{!! $notification->data['icon'] !!}
|
||||
@endif
|
||||
</div>
|
||||
<div>
|
||||
<b class="mb-1">{{$notification->data['name']}}</b>
|
||||
<p class="text-muted m-0">{{$notification->data['msg']}}</p>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endforeach
|
||||
@if ($nbOfNotification == 0)
|
||||
<a class="dropdown-item">Aucune notification</a>
|
||||
@endif
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<a href="/admin/profil/notifications" class="btn btn-outline-info text-info">Afficher toutes mes notifications</a>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="nav-item dropdown">
|
||||
|
||||
@@ -6,7 +6,9 @@
|
||||
|
||||
<script src="/js/core/bootstrap-material-design.min.js"></script>
|
||||
<script src="/js/material-dashboard.js"></script>
|
||||
<script type="module" src="/js/bootstrap.js"></script>
|
||||
<script src="/js/app.js"></script>
|
||||
|
||||
<!-- Plugin for the momentJs -->
|
||||
<script src="/js/plugins/moment.min.js"></script>
|
||||
<!-- Plugin for Sweet Alert -->
|
||||
|
||||
Reference in New Issue
Block a user