set admin3
This commit is contained in:
parent
13ecc12812
commit
3207bbddac
|
|
@ -208,6 +208,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- System Notifications Column -->
|
||||||
<div class="col-lg-5" id="notifications-section">
|
<div class="col-lg-5" id="notifications-section">
|
||||||
<div class="card border-0 shadow-sm rounded-3 h-100">
|
<div class="card border-0 shadow-sm rounded-3 h-100">
|
||||||
<div class="card-header bg-white py-3 border-0 d-flex justify-content-between align-items-center">
|
<div class="card-header bg-white py-3 border-0 d-flex justify-content-between align-items-center">
|
||||||
|
|
@ -217,15 +218,16 @@
|
||||||
</h5>
|
</h5>
|
||||||
<span class="badge bg-danger rounded-pill">{{ $unreadNotifications ?? 0 }} Unread</span>
|
<span class="badge bg-danger rounded-pill">{{ $unreadNotifications ?? 0 }} Unread</span>
|
||||||
</div>
|
</div>
|
||||||
<button class="btn btn-sm btn-primary rounded-3 edit-only" data-bs-toggle="modal" data-bs-target="#addNotificationModal">
|
<button class="btn btn-sm btn-primary rounded-3" data-bs-toggle="modal" data-bs-target="#addNotificationModal">
|
||||||
<i class="fa-solid fa-plus me-1"></i> Add
|
<i class="fa-solid fa-plus me-1"></i> Add
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="card-body p-0" style="max-height: 450px; overflow-y: auto;">
|
<div class="card-body p-0" style="max-height: 450px; overflow-y: auto;">
|
||||||
<ul class="list-group list-group-flush">
|
<ul class="list-group list-group-flush">
|
||||||
@forelse($notifications ?? [] as $notification)
|
@forelse($notifications ?? [] as $notification)
|
||||||
<li class="list-group-item p-3 border-bottom {{ $notification->is_read ? 'bg-light text-muted' : 'bg-white' }}">
|
<li class="list-group-item p-3 border-bottom {{ $notification->is_read ? 'bg-light text-muted' : 'bg-white' }}">
|
||||||
<div class="d-flex justify-content-between align-items-start">
|
<div class="d-flex justify-content-between align-items-start gap-2">
|
||||||
<div class="me-2">
|
<div class="me-2">
|
||||||
@if($notification->type == 'success')
|
@if($notification->type == 'success')
|
||||||
<span class="badge bg-success mb-1">Success</span>
|
<span class="badge bg-success mb-1">Success</span>
|
||||||
|
|
@ -238,14 +240,14 @@
|
||||||
<h6 class="fw-bold mb-1 {{ $notification->is_read ? 'text-secondary' : 'text-dark' }}">
|
<h6 class="fw-bold mb-1 {{ $notification->is_read ? 'text-secondary' : 'text-dark' }}">
|
||||||
{{ $notification->title }}
|
{{ $notification->title }}
|
||||||
</h6>
|
</h6>
|
||||||
<p class="mb-1 text-muted small">{{ $notification->message }}</p>
|
<p class="mb-1 text-muted small text-break">{{ $notification->message }}</p>
|
||||||
|
|
||||||
<small class="text-secondary opacity-75 d-block" style="font-size: 11px;">
|
<small class="text-secondary opacity-75 d-block" style="font-size: 11px;">
|
||||||
<i class="fa-regular fa-clock me-1"></i>{{ $notification->created_at ? $notification->created_at->diffForHumans() : '' }}
|
<i class="fa-regular fa-clock me-1"></i>{{ $notification->created_at ? $notification->created_at->diffForHumans() : '' }}
|
||||||
</small>
|
</small>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="d-flex gap-1 align-items-center edit-only">
|
<div class="d-flex gap-1 align-items-center flex-shrink-0">
|
||||||
@if(!$notification->is_read)
|
@if(!$notification->is_read)
|
||||||
<form action="{{ route('admin.notifications.read', $notification->id) }}" method="POST" class="d-inline">
|
<form action="{{ route('admin.notifications.read', $notification->id) }}" method="POST" class="d-inline">
|
||||||
@csrf
|
@csrf
|
||||||
|
|
@ -272,6 +274,7 @@
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
<!-- Modal: Edit Notification -->
|
||||||
<div class="modal fade" id="editNotificationModal{{ $notification->id }}" tabindex="-1" aria-hidden="true">
|
<div class="modal fade" id="editNotificationModal{{ $notification->id }}" tabindex="-1" aria-hidden="true">
|
||||||
<div class="modal-dialog modal-dialog-centered">
|
<div class="modal-dialog modal-dialog-centered">
|
||||||
<div class="modal-content border-0 shadow">
|
<div class="modal-content border-0 shadow">
|
||||||
|
|
@ -320,6 +323,43 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Modal: Add New Notification -->
|
||||||
|
<div class="modal fade" id="addNotificationModal" tabindex="-1" aria-hidden="true">
|
||||||
|
<div class="modal-dialog modal-dialog-centered">
|
||||||
|
<div class="modal-content border-0 shadow">
|
||||||
|
<div class="modal-header bg-primary text-white">
|
||||||
|
<h5 class="modal-title fw-bold"><i class="fa-solid fa-bell me-2"></i>Add New Notification</h5>
|
||||||
|
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"></button>
|
||||||
|
</div>
|
||||||
|
<form action="{{ route('admin.notifications.store') }}" method="POST">
|
||||||
|
@csrf
|
||||||
|
<div class="modal-body p-4">
|
||||||
|
<div class="mb-3">
|
||||||
|
<label class="form-label fw-bold">Notification Type</label>
|
||||||
|
<select name="type" class="form-select" required>
|
||||||
|
<option value="info">Info</option>
|
||||||
|
<option value="success">Success</option>
|
||||||
|
<option value="warning">Warning</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="mb-3">
|
||||||
|
<label class="form-label fw-bold">Title</label>
|
||||||
|
<input type="text" name="title" class="form-control" placeholder="Enter title" required>
|
||||||
|
</div>
|
||||||
|
<div class="mb-3">
|
||||||
|
<label class="form-label fw-bold">Message</label>
|
||||||
|
<textarea name="message" class="form-control" rows="3" placeholder="Enter notification content" required></textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer bg-light">
|
||||||
|
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
|
||||||
|
<button type="submit" class="btn btn-primary"><i class="fa-solid fa-plus me-1"></i> Save Notification</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<!-- Registered Users Table -->
|
<!-- Registered Users Table -->
|
||||||
<div class="row g-4 mb-4">
|
<div class="row g-4 mb-4">
|
||||||
|
|
@ -628,41 +668,5 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Add Notification Modal -->
|
|
||||||
<div class="modal fade" id="addNotificationModal" tabindex="-1" aria-hidden="true">
|
|
||||||
<div class="modal-dialog modal-dialog-centered">
|
|
||||||
<div class="modal-content border-0 shadow">
|
|
||||||
<div class="modal-header bg-primary text-white">
|
|
||||||
<h5 class="modal-title fw-bold"><i class="fa-solid fa-plus-circle me-2"></i>Create New Notification</h5>
|
|
||||||
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"></button>
|
|
||||||
</div>
|
|
||||||
<form action="{{ route('admin.notifications.store') }}" method="POST">
|
|
||||||
@csrf
|
|
||||||
<div class="modal-body p-4">
|
|
||||||
<div class="mb-3">
|
|
||||||
<label class="form-label fw-bold">Notification Type</label>
|
|
||||||
<select name="type" class="form-select" required>
|
|
||||||
<option value="info">Info</option>
|
|
||||||
<option value="success">Success</option>
|
|
||||||
<option value="warning">Warning</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
<div class="mb-3">
|
|
||||||
<label class="form-label fw-bold">Title</label>
|
|
||||||
<input type="text" name="title" class="form-control" placeholder="Enter title" required>
|
|
||||||
</div>
|
|
||||||
<div class="mb-3">
|
|
||||||
<label class="form-label fw-bold">Message</label>
|
|
||||||
<textarea name="message" class="form-control" rows="3" placeholder="Enter notification message..." required></textarea>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="modal-footer bg-light">
|
|
||||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
|
|
||||||
<button type="submit" class="btn btn-primary"><i class="fa-solid fa-paper-plane me-1"></i> Send Notification</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
@endsection
|
@endsection
|
||||||
Loading…
Reference in New Issue