Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
ammarbahtiarasli committed Oct 24, 2023
1 parent 18c1de6 commit 8f3ab12
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 66 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/MasyarakatController.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class MasyarakatController extends Controller
{
public function index()
{
$masyarakat = Masyarakat::all();
$masyarakat = Masyarakat::latest()->paginate(10);
return view('masyarakat.index', compact('masyarakat'));
}

Expand Down
3 changes: 3 additions & 0 deletions resources/views/components/detail-long-button.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<a {{ $attributes->merge(['class' => 'px-3.5 w-full h-9 mt-4 items-center justify-center rounded-full inline-flex items-center px-4 py-2 bg-gray-200 border border-transparent rounded-md font-medium text-xs text-gray-800 uppercase tracking-widest hover:bg-gray-200/80 active:bg-gray-200 focus:outline-none focus:ring-2 focus:ring-gray-200 focus-visible:ring-offset-2 focus:ring-offset-2 dark:focus:ring-offset-gray-800 transition ease-in-out duration-150']) }}>
{{ $slot }}
</a>
2 changes: 1 addition & 1 deletion resources/views/components/nav-link.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

@php
$classes = ($active ?? false)
? 'inline-flex items-center px-1 pt-1 border-b-2 border-indigo-400 dark:border-indigo-600 text-sm font-medium leading-5 text-gray-900 dark:text-gray-100 focus:outline-none focus:border-indigo-700 transition duration-150 ease-in-out'
? 'inline-flex items-center px-1 pt-1 border-b-2 border-green-400 dark:border-green-600 text-sm font-medium leading-5 text-gray-900 dark:text-gray-100 focus:outline-none focus:border-green-700 transition duration-150 ease-in-out'
: 'inline-flex items-center px-1 pt-1 border-b-2 border-transparent text-sm font-medium leading-5 text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300 hover:border-gray-300 dark:hover:border-gray-700 focus:outline-none focus:text-gray-700 dark:focus:text-gray-300 focus:border-gray-300 dark:focus:border-gray-700 transition duration-150 ease-in-out';
@endphp

Expand Down
2 changes: 1 addition & 1 deletion resources/views/components/responsive-nav-link.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

@php
$classes = ($active ?? false)
? 'block w-full pl-3 pr-4 py-2 border-l-4 border-indigo-400 dark:border-indigo-600 text-left text-base font-medium text-indigo-700 dark:text-indigo-300 bg-indigo-50 dark:bg-indigo-900/50 focus:outline-none focus:text-indigo-800 dark:focus:text-indigo-200 focus:bg-indigo-100 dark:focus:bg-indigo-900 focus:border-indigo-700 dark:focus:border-indigo-300 transition duration-150 ease-in-out'
? 'block w-full pl-3 pr-4 py-2 border-l-4 border-green-400 dark:border-green-600 text-left text-base font-medium text-green-700 dark:text-green-300 bg-green-50 dark:bg-green-900/50 focus:outline-none focus:text-green-800 dark:focus:text-green-200 focus:bg-green-100 dark:focus:bg-green-900 focus:border-green-700 dark:focus:border-green-300 transition duration-150 ease-in-out'
: 'block w-full pl-3 pr-4 py-2 border-l-4 border-transparent text-left text-base font-medium text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-200 hover:bg-gray-50 dark:hover:bg-gray-700 hover:border-gray-300 dark:hover:border-gray-600 focus:outline-none focus:text-gray-800 dark:focus:text-gray-200 focus:bg-gray-50 dark:focus:bg-gray-700 focus:border-gray-300 dark:focus:border-gray-600 transition duration-150 ease-in-out';
@endphp

Expand Down
66 changes: 31 additions & 35 deletions resources/views/dashboard.blade.php
Original file line number Diff line number Diff line change
@@ -1,47 +1,43 @@
<x-app-layout>
<x-slot name="header">
<h2 class="text-xl font-semibold leading-tight text-gray-800 dark:text-gray-200">
{{ __('Dashboard') }}
{{ __('Overview') }}
</h2>
</x-slot>

<div class="py-12">
<div class="mx-auto max-w-7xl sm:px-6 lg:px-8">
<div class="overflow-hidden bg-white shadow-sm dark:bg-gray-800 sm:rounded-lg">
<div class="p-6 text-gray-900 dark:text-gray-100">
{{ __("Hai," . " " . Auth::user()->name . "! " . "Do anything here, because you're the super admin!")}}
</div>
<div class="pt-6 mx-auto max-w-7xl sm:px-6 lg:px-8">
<div class="overflow-hidden bg-white shadow-sm dark:bg-gray-800 sm:rounded-lg">
<div class="p-6 text-gray-900 dark:text-gray-100">
{{ __('Hai,' . ' ' . Auth::user()->name . '! ') }}
</div>
</div>
</div>

<div class="container mx-auto mt-5">
<div class="grid grid-cols-3 gap-4">
<div class="overflow-hidden bg-white shadow-sm dark:bg-gray-800 sm:rounded-lg">
<div class="p-6 text-gray-900 dark:text-gray-100">
{{ __('Data Mahasiswa') }}
</div>
<div class="p-6 text-gray-900 dark:text-gray-100">
{{ "1000 Data Mahasiswa" }}
</div>
</div>
<div class="overflow-hidden bg-white shadow-sm dark:bg-gray-800 sm:rounded-lg">
<div class="p-6 text-gray-900 dark:text-gray-100">
{{ __('Data Dosen') }}
</div>
<div class="p-6 text-gray-900 dark:text-gray-100">
{{ "69 Data Dosen" }}
</div>
</div>
<div class="overflow-hidden bg-white shadow-sm dark:bg-gray-800 sm:rounded-lg">
<div class="p-6 text-gray-900 dark:text-gray-100">
{{ __('Data Mata Kuliah') }}
</div>
<div class="p-6 text-gray-900 dark:text-gray-100">
{{ "70 Data Mata Kuliah" }}
</div>
</div>
</div>
<div class="px-4 py-4 mx-auto lg:py-12 sm:px-6 md:px-4 lg:max-w-6xl xl:max-w-7xl lg:px-8">
<div class="flex flex-col p-6 px-0 pt-0">
<h3 class="text-xl font-semibold leading-6 tracking-tighter dark:text-gray-200">Dashboard</h3>
<p class="mt-1.5 text-sm text-muted-foreground dark:text-gray-300">Semua statistik yang berhubungan dengan
akun anda</p>
</div>
<div class="grid gap-5 sm:grid-cols-2 lg:grid-cols-3">
<div
class="p-8 text-gray-900 bg-white border rounded-lg shadow-sm dark:text-gray-200 dark:border-0 dark:bg-gray-800">
<h4 class="font-mono text-xl">700</h4><small class="block mt-6 text-sm text-muted-foreground">Daftar Registrasi
Masyarakat</small>
<x-detail-long-button :href="route('masyarakat.index')">Detail</x-detail-long-button>
</div>
<div
class="p-8 text-gray-900 bg-white border rounded-lg shadow-sm dark:text-gray-200 dark:border-0 dark:bg-gray-800">
<h4 class="font-mono text-xl">69</h4><small class="block mt-6 text-sm text-muted-foreground">Daftar Registrasi
Kurir</small>
<x-detail-long-button href="">Detail</x-detail-long-button>
</div>
<div
class="p-8 text-gray-900 bg-white border rounded-lg shadow-sm dark:text-gray-200 dark:border-0 dark:bg-gray-800">
<h4 class="font-mono text-xl">0</h4><small class="block mt-6 text-sm text-muted-foreground">Data
Dropbox</small>
<x-detail-long-button href="">Detail</x-detail-long-button>
</div>

</div>
</div>
</x-app-layout>
3 changes: 2 additions & 1 deletion resources/views/layouts/navigation.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
<!-- Logo -->
<div class="flex items-center shrink-0">
<a href="{{ route('dashboard') }}">
<x-application-logo class="block w-auto text-gray-800 fill-current h-9 dark:text-gray-200" />
<x-application-logo class="block w-auto text-gray-800 fill-current h-9 dark:text-gray-200 me-3" />
</a>
<p class="dark:text-gray-200">{{ __('RecycleMe') }}</p>
</div>

<!-- Navigation Links -->
Expand Down
59 changes: 32 additions & 27 deletions resources/views/masyarakat/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
<div class="py-6">
<div class="mx-auto max-w-7xl sm:px-6 lg:px-8">
<div class="container mb-6">
<x-add-button x-data="" href="{{ route('masyarakat.create') }}">{{ __('Tambah Masyarakat') }}</x-add-button>
<x-add-button x-data=""
href="{{ route('masyarakat.create') }}">{{ __('Tambah Masyarakat') }}</x-add-button>
</div>
<div class="overflow-hidden bg-white shadow-sm dark:bg-gray-800 sm:rounded-lg">
<div class="p-6 text-gray-900 dark:text-gray-100">
Expand All @@ -18,50 +19,55 @@
<table class="table min-w-full">
<thead>
<tr>
<th class="px-6 py-3 text-xs font-medium tracking-wider text-left text-gray-900 uppercase dark:text-gray-100">
<th
class="px-6 py-3 text-xs font-medium tracking-wider text-left text-gray-900 uppercase dark:text-gray-100">
#
</th>
<th class="px-6 py-3 text-xs font-medium tracking-wider text-left text-gray-900 uppercase dark:text-gray-100">
<th
class="px-6 py-3 text-xs font-medium tracking-wider text-left text-gray-900 uppercase dark:text-gray-100">
Nama
</th>
<th class="px-6 py-3 text-xs font-medium tracking-wider text-left text-gray-900 uppercase dark:text-gray-100">
<th
class="px-6 py-3 text-xs font-medium tracking-wider text-left text-gray-900 uppercase dark:text-gray-100">
No HP
</th>
<th class="px-6 py-3 text-xs font-medium tracking-wider text-left text-gray-900 uppercase dark:text-gray-100">
<th
class="px-6 py-3 text-xs font-medium tracking-wider text-left text-gray-900 uppercase dark:text-gray-100">
Alamat
</th>
<th class="px-6 py-3 text-xs font-medium tracking-wider text-left text-gray-900 uppercase dark:text-gray-100">
<th
class="px-6 py-3 text-xs font-medium tracking-wider text-left text-gray-900 uppercase dark:text-gray-100">
Status
</th>
<th class="px-6 py-3 text-xs font-medium tracking-wider text-left text-gray-900 uppercase dark:text-gray-100">
<th
class="px-6 py-3 text-xs font-medium tracking-wider text-left text-gray-900 uppercase dark:text-gray-100">
Aksi
</th>
</tr>
</thead>
<tbody>
@foreach ($masyarakat as $person)
<tr>
<td class="px-6 py-4 text-gray-900 dark:text-gray-100 whitespace-nowrap">
{{ $loop->index + 1 }}</td>
<td class="px-6 py-4 text-gray-900 dark:text-gray-100 whitespace-nowrap">
{{ $person->nama }}</td>
<td class="px-6 py-4 text-gray-900 dark:text-gray-100 whitespace-nowrap">
{{ $person->nohp }}</td>
<td class="px-6 py-4 text-gray-900 dark:text-gray-100 whitespace-nowrap">
{{ $person->alamat }}</td>
<td class="px-6 py-4 whitespace-nowrap">
<tr>
<td class="px-6 py-4 text-gray-900 dark:text-gray-100 whitespace-nowrap">
{{ $loop->index + 1 }}</td>
<td class="px-6 py-4 text-gray-900 dark:text-gray-100 whitespace-nowrap">
{{ $person->nama }}</td>
<td class="px-6 py-4 text-gray-900 dark:text-gray-100 whitespace-nowrap">
{{ $person->nohp }}</td>
<td class="px-6 py-4 text-gray-900 dark:text-gray-100 whitespace-nowrap">
{{ $person->alamat }}</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="{{ $person->status == 'sudah disetujui' ? 'text-green-500' : ($person->status == 'ditolak' ? 'text-red-500' : 'text-gray-500') }}">
<span
class="{{ $person->status == 'sudah disetujui' ? 'text-green-500' : ($person->status == 'ditolak' ? 'text-red-500' : 'text-gray-500') }}">
{{ ucfirst($person->status) }}
</span>
</td>

</td>
<td class="px-6 py-4 text-gray-900 dark:text-gray-100 whitespace-nowrap">
<x-detail-button x-data="" href="{{ route('masyarakat.edit', $person->id) }}">{{ __('Detail') }}</x-detail-button>
</td>
</tr>
@endforeach
<td class="px-6 py-4 text-gray-900 dark:text-gray-100 whitespace-nowrap">
<x-detail-button x-data=""
href="{{ route('masyarakat.edit', $person->id) }}">{{ __('Detail') }}</x-detail-button>
</td>
</tr>
@endforeach
</tbody>
</table>
@else
Expand All @@ -70,10 +76,9 @@
</div>
@endif
<div class="p-6">
{{-- {{ $masyarakat->links() }} --}}
{{ $masyarakat->links() }}
</div>
</div>
</div>
</div>
</x-app-layout>

0 comments on commit 8f3ab12

Please sign in to comment.