first
This commit is contained in:
117
resources/views/user/dashboard.blade.php
Normal file
117
resources/views/user/dashboard.blade.php
Normal file
@@ -0,0 +1,117 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('title', 'Dashboard')
|
||||
|
||||
@section('content')
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<h4 class="fw-bold mb-0"><i class="bi bi-house me-2 text-primary"></i>Dashboard</h4>
|
||||
<a href="{{ route('user.projects.create') }}" class="btn btn-primary">
|
||||
<i class="bi bi-plus-circle me-1"></i>Projek Baru
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{{-- Owned Projects --}}
|
||||
<div class="card mb-4">
|
||||
<div class="card-header bg-white fw-semibold">
|
||||
<i class="bi bi-folder-fill me-2 text-primary"></i>Projek Saya
|
||||
<span class="badge bg-primary ms-1">{{ $ownedProjects->total() }}</span>
|
||||
</div>
|
||||
<div class="card-body p-0">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover mb-0">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th>Tajuk</th>
|
||||
<th>Status</th>
|
||||
<th>Saiz Fail</th>
|
||||
<th>Tempoh</th>
|
||||
<th>Tarikh Cipta</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse($ownedProjects as $project)
|
||||
<tr>
|
||||
<td class="fw-semibold">{{ $project->title }}</td>
|
||||
<td>
|
||||
@php $statusClasses = ['pending'=>'secondary','processing'=>'warning','completed'=>'success','failed'=>'danger']; @endphp
|
||||
<span class="badge bg-{{ $statusClasses[$project->transcription_status] ?? 'secondary' }}">
|
||||
{{ ucfirst($project->transcription_status) }}
|
||||
</span>
|
||||
</td>
|
||||
<td>{{ $project->fileSizeForHumans() }}</td>
|
||||
<td>{{ $project->durationForHumans() ?? '—' }}</td>
|
||||
<td class="small text-muted">{{ $project->created_at->format('d/m/Y') }}</td>
|
||||
<td>
|
||||
<a href="{{ route('user.projects.show', $project) }}" class="btn btn-sm btn-outline-primary">
|
||||
<i class="bi bi-arrow-right"></i>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="6" class="text-center text-muted py-5">
|
||||
<i class="bi bi-mic fs-1 d-block mb-2 text-muted"></i>
|
||||
<p class="mb-2">Belum ada projek transkripsi.</p>
|
||||
<a href="#" class="btn btn-primary btn-sm">
|
||||
<i class="bi bi-plus-circle me-1"></i>Muat Naik Audio Pertama
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@if($ownedProjects->hasPages())
|
||||
<div class="card-footer bg-white">{{ $ownedProjects->links() }}</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
{{-- Shared Projects --}}
|
||||
@if($sharedProjects->count() > 0)
|
||||
<div class="card">
|
||||
<div class="card-header bg-white fw-semibold">
|
||||
<i class="bi bi-people-fill me-2 text-info"></i>Projek Dikongsi Bersama Saya
|
||||
<span class="badge bg-info ms-1">{{ $sharedProjects->total() }}</span>
|
||||
</div>
|
||||
<div class="card-body p-0">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover mb-0">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th>Tajuk</th>
|
||||
<th>Pemilik</th>
|
||||
<th>Status</th>
|
||||
<th>Tarikh Cipta</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($sharedProjects as $project)
|
||||
<tr>
|
||||
<td class="fw-semibold">{{ $project->title }}</td>
|
||||
<td>{{ $project->owner->name }}</td>
|
||||
<td>
|
||||
<span class="badge bg-{{ $statusClasses[$project->transcription_status] ?? 'secondary' }}">
|
||||
{{ ucfirst($project->transcription_status) }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="small text-muted">{{ $project->created_at->format('d/m/Y') }}</td>
|
||||
<td>
|
||||
<a href="#" class="btn btn-sm btn-outline-info">
|
||||
<i class="bi bi-arrow-right"></i>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@if($sharedProjects->hasPages())
|
||||
<div class="card-footer bg-white">{{ $sharedProjects->links() }}</div>
|
||||
@endif
|
||||
</div>
|
||||
@endif
|
||||
@endsection
|
||||
Reference in New Issue
Block a user