improve: Add Welcome card in role petugas, adjust table riwayat offline, remove header section, adjust book card offline dashboard

This commit is contained in:
zhadaarsita 2025-11-02 13:23:57 +07:00
parent b01655adaf
commit 532988128b
10 changed files with 60 additions and 40 deletions

View File

@ -34,8 +34,9 @@ public function ringkasan(int $id): View
return view('katalog.ringkasan', [
'buku' => $book,
'pageTitle' => 'Ringkasan Buku',
'pageTitle' => 'Baca Buku Online',
'actionRoute' => 'baca.request_code',
'previousRoute' => 'baca.index',
'actionButtonText' => 'Baca Sekarang',
'actionButtonIcon' => 'bi-book-half',
]);

View File

@ -32,8 +32,9 @@ public function ringkasan($id)
return view('katalog.ringkasan', [
'user' => $user,
'buku' => $buku,
'pageTitle' => 'Ringkasan Buku',
'pageTitle' => 'Peminjaman Buku Offline',
'actionRoute' => 'peminjaman.form',
'previousRoute' => 'peminjaman.index',
'actionButtonText' => 'Lanjutkan ke Form Peminjaman',
'actionButtonIcon' => 'bi-file-earmark-text-fill',
]);

View File

@ -1,9 +1,19 @@
<x-app-layout>
@section('page-title', 'Dashboard Admin')
<div class="mb-4">
<h3>Selamat Datang, {{ $user->nama_lengkap }}!</h3>
<p class="text-muted">Berikut adalah ringkasan aktivitas perpustakaan hari ini.</p>
{{-- Welcome card Section --}}
<div class="card border-0 shadow-sm rounded-4 my-4 p-4 position-relative" style="background-color: #CEDEFF;">
<div class="row">
<div class="col-12 col-md-8 p-4 p-md-5" style="z-index: 2;">
<h2 class="fw-bold text-dark mb-2">{{ $greeting }}, {{ $user->nama_lengkap }}!</h2>
<p class="fs-5 mb-0" style="color: #696E82;">Berikut adalah ringkasan aktivitas perpustakaan hari ini.</p>
</div>
</div>
<div class="position-absolute d-none d-md-block"
style="top: -35px; right: 40px; width: 30%; max-width: 300px; z-index: 1;">
<img src="{{ asset('images/assets/vector-dashboard.svg') }}" alt="Ilustrasi Dashboard" class="img-fluid">
</div>
</div>
{{-- Kartu Statistik --}}

View File

@ -20,6 +20,7 @@
</div>
</div>
{{-- Statistic Card --}}
<div class="row g-4 mb-4">
@foreach ($stats as $stat)
<div class="col-xl-3 col-lg-6 col-md-6">
@ -38,6 +39,7 @@
@endforeach
</div>
{{-- Chart Statistic --}}
<div class="row g-4 mb-4">
<div class="col-lg-7">
<div class="card border-0 shadow-sm h-100">
@ -85,6 +87,7 @@
</div>
</div>
{{-- Section Pemberitahuan dan Pengumuman --}}
<div class="row g-4 mb-4">
<div class="col-lg-6">
<div class="card border-0 shadow-sm h-100">
@ -167,6 +170,7 @@ class="badge bg-{{ $item['type'] }}-soft text-{{ $item['type'] }} rounded-pill p
</div>
</div>
{{-- Section Buku Pinjam Offline --}}
<div class="card border-0 shadow-sm mb-4" x-data="{ expanded: {{ count($bukuPinjamOffline) <= 2 ? 'true' : 'false' }} }">
<div class="card-header bg-white border-0 py-3 d-flex justify-content-between align-items-center">
<h6 class="mb-0 fw-bold text-dark">
@ -186,7 +190,7 @@ class="badge bg-{{ $item['type'] }}-soft text-{{ $item['type'] }} rounded-pill p
<div class="card-body">
<div class="row g-4">
@forelse($bukuPinjamOffline as $buku)
<div class="col-xl-4 col-md-6" x-show="expanded || {{ $loop->index }} < 2" x-transition>
<div class="col-xl-4 col-md-6" x-show="expanded || {{ $loop->index }} < 3" x-transition>
<x-book-card :buku="$buku">
<div class="alert alert-danger border-0 py-2 px-3 mb-0 d-flex align-items-center">
<i class="bi bi-clock-fill me-2"></i>
@ -206,6 +210,7 @@ class="badge bg-{{ $item['type'] }}-soft text-{{ $item['type'] }} rounded-pill p
</div>
</div>
{{-- Section Baca Buku Online --}}
<div class="card border-0 shadow-sm" x-data="{ expanded: {{ count($bacaBukuOnline) <= 3 ? 'true' : 'false' }} }">
<div class="card-header bg-white border-0 py-3 d-flex justify-content-between align-items-center">
<h6 class="mb-0 fw-bold text-dark">
@ -251,6 +256,7 @@ class="badge bg-{{ $item['type'] }}-soft text-{{ $item['type'] }} rounded-pill p
</div>
</div>
{{-- Section Rekomendasi Pembelajaran (Role Guru) --}}
@if (Auth::user()->role == 'guru')
<div class="card border-0 shadow-sm mt-4">
<div class="card-header bg-white border-0 d-flex justify-content-between align-items-center py-3">
@ -283,7 +289,6 @@ class="d-flex gap-3 text-decoration-none text-dark mb-3">
</div>
@endif
<!-- Modals untuk Pengumuman-->
<div class="modal fade" id="pengumumanModal" tabindex="-1" aria-labelledby="pengumumanModalLabel"
aria-hidden="true">

View File

@ -1,8 +1,5 @@
@section('page-title', $pageTitle)
<x-app-layout>
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pb-2 mb-3 border-bottom">
<h1 class="h2">{{ $pageTitle }}</h1>
</div>
{{-- Filter Section --}}
<div class="card mb-4">

View File

@ -3,7 +3,7 @@
<div class="d-flex flex-column" style="min-height: calc(100vh - 110px);">
<div class="d-flex align-items-center mb-4">
<a href="{{ url()->previous() }}" class="btn btn-outline-secondary me-3">
<a href="{{ route($previousRoute) }}" class="btn btn-outline-secondary me-3">
<i class="bi bi-arrow-left"></i>
</a>
<h1 class="h2 mb-0">Ringkasan Buku</h1>

View File

@ -1,4 +1,4 @@
<nav class="navbar navbar-expand-lg navbar-light bg-white shadow-sm">
<nav class="navbar navbar-expand-lg navbar-light bg-white shadow-sm sticky-top">
<div class="container-fluid">
{{-- Tombol Sidebar Toggle --}}
<button class="btn btn-light me-1" type="button" id="sidebarToggle">

View File

@ -13,15 +13,12 @@ class="sidebar-title">
</div>
{{-- ======================================================= --}}
{{-- Info User di Bagian ATAS (Hanya Muncul di Mobile) --}}
{{-- Info User di Bagian atas (Hanya Muncul di Mobile) --}}
{{-- ======================================================= --}}
<div class="p-3 d-lg-none">
{{-- Menggunakan warna primer versi subtle/halus --}}
<div class="bg-primary-subtle p-3 rounded-2">
{{-- Teks nama dibuat lebih tegas dengan warna primer --}}
<h6 class="nav-text mb-0 fw-bold text-truncate d-block text-primary-emphasis">{{ Auth::user()->name }}</h6>
{{-- Teks email menggunakan warna gelap standar --}}
<small class="nav-text text-dark text-truncate d-block">{{ Auth::user()->email }}</small>
</div>
</div>
@ -32,7 +29,7 @@ class="sidebar-title">
{{-- ================= MENU PENJAGA PERPUSTAKAAN ================= --}}
<li class="nav-item"><a href="{{ route('admin.dashboard') }}"
class="nav-link {{ request()->routeIs('admin.dashboard') ? 'active' : '' }}"><i
class="bi bi-grid-1x2-fill"></i><span class="nav-text ms-2">Dashboard</span></a>
class="bi bi-grid-1x2-fill"></i><span class="nav-text ms-2">Beranda</span></a>
</li>
<li class="nav-item"><a href="{{ route('admin.buku.index') }}"
class="nav-link {{ request()->routeIs('admin.buku.*') ? 'active' : '' }}"><i
@ -56,7 +53,7 @@ class="nav-link {{ request()->routeIs('admin.rekomendasi.*') ? 'active' : '' }}"
{{-- ================= MENU GURU (Siswa + Fitur Khusus) ================= --}}
<li class="nav-item"><a href="{{ route('dashboard') }}"
class="nav-link {{ request()->routeIs('dashboard') ? 'active' : '' }}"><i
class="bi bi-grid-1x2-fill"></i><span class="nav-text ms-2">Dashboard</span></a>
class="bi bi-grid-1x2-fill"></i><span class="nav-text ms-2">Beranda</span></a>
</li>
<li class="nav-item"><a href="{{ route('katalog.index') }}"
class="nav-link {{ request()->routeIs('katalog.*') ? 'active' : '' }}"><i
@ -94,7 +91,7 @@ class="nav-link py-1 {{ request()->routeIs('riwayat.online') ? 'active' : '' }}"
{{-- ================= MENU SISWA ================= --}}
<li class="nav-item"><a href="{{ route('dashboard') }}"
class="nav-link {{ request()->routeIs('dashboard') ? 'active' : '' }}"><i
class="bi bi-grid-1x2-fill"></i><span class="nav-text ms-2">Dashboard</span></a>
class="bi bi-grid-1x2-fill"></i><span class="nav-text ms-2">Beranda</span></a>
</li>
<li class="nav-item"><a href="{{ route('katalog.index') }}"
class="nav-link {{ request()->routeIs('katalog.*') ? 'active' : '' }}"><i

View File

@ -1,10 +1,9 @@
@section('page-title', 'Form Peminjaman Buku')
@section('page-title', 'Peminjaman Buku offline')
<x-app-layout>
<div class="d-flex align-items-center mb-4">
<div class="d-flex align-items-center">
<a href="{{ route('peminjaman.ringkasan', $buku['id']) }}" class="btn btn-outline-secondary me-3">
<i class="bi bi-arrow-left"></i>
</a>
<h1 class="h2 mb-0">Form Peminjaman Offline</h1>
</div>
<div class="row justify-content-center">
@ -12,6 +11,8 @@
<div class="card border-0 shadow-sm">
<div class="card-body p-4 p-md-5">
<h1 class="h2 fw-semibold mb-5 text-center">Form Peminjaman Offline</h1>
{{-- Informasi Peminjam --}}
<div class="mb-5">
<div class="card border-0 shadow-sm">

View File

@ -83,20 +83,28 @@ class="bi bi-book-half me-2 text-primary"></i>Detail Riwayat</h5>
const riwayatOfflineData = @json($riwayatOffline);
$(document).ready(function() {
$('#riwayatOfflineTable').DataTable({
responsive: true,
searching: false,
pageLength: 10,
order: [[0, 'asc']],
columnDefs: [
{ responsivePriority: 1, targets: 2 },
{ responsivePriority: 2, targets: 6 },
{ responsivePriority: 3, targets: 0 },
{ targets: [1, 3, 4, 5], className: 'none' }
]
});
});
$('#riwayatOfflineTable').DataTable({
responsive: true,
searching: false,
pageLength: 10,
order: [
[0, 'asc']
],
columnDefs: [{
responsivePriority: 1,
targets: 2
},
{
responsivePriority: 2,
targets: 6
},
{
responsivePriority: 3,
targets: 0
},
]
});
});
// Modal Detail
@ -120,7 +128,7 @@ class="bi bi-book-half me-2 text-primary"></i>Detail Riwayat</h5>
const keteranganHtml = buku.keterangan ?
`
<tr>
<td class="fw-bold align-text-top">Keterangan</td>
<td class="fw-bold align-text-top text-start">Keterangan</td>
<td class="align-text-top">:</td>
<td class="text-start">${buku.keterangan}</td>
</tr>
@ -139,17 +147,17 @@ class="bi bi-book-half me-2 text-primary"></i>Detail Riwayat</h5>
<table class="table table-borderless table-sm">
<tbody>
<tr>
<td class="fw-bold" style="width: 35%;">ID Peminjaman</td>
<td class="fw-bold text-start" style="width: 35%;">ID Peminjaman</td>
<td style="width: 5%;">:</td>
<td class="text-start">${transaksiItem.id_peminjaman}</td>
</tr>
<tr>
<td class="fw-bold">Kategori Buku</td>
<td class="fw-bold text-start">Kategori Buku</td>
<td>:</td>
<td class="text-start"><span class="badge bg-primary-subtle text-primary-emphasis rounded-pill px-3 py-2">${buku.kategori}</span></td>
</tr>
<tr>
<td class="fw-bold">Tahun Terbit</td>
<td class="fw-bold text-start">Tahun Terbit</td>
<td>:</td>
<td class="text-start">${buku.tahun}</td>
</tr>