- Added authentication controllers (Login, Register) - Added UserController for user profile management - Added VideoController with full CRUD operations - Added Video model with relationships (user, likes, views) - Added User model enhancements (avatar, video relationships) - Added database migrations for video_likes, video_views, user_avatar, video_visibility - Added CompressVideoJob for video processing - Added VideoUploaded mail notification - Added authentication routes - Updated web routes with video and user routes - Added layout templates (app, plain, partials) - Added user views (profile, settings, channel, history, liked) - Added video views (create, edit, index, show) - Added email templates
197 lines
5.9 KiB
PHP
197 lines
5.9 KiB
PHP
@extends('layouts.app')
|
|
|
|
@section('title', 'Profile | TAKEONE')
|
|
|
|
@section('extra_styles')
|
|
<style>
|
|
.profile-header {
|
|
background: var(--bg-secondary);
|
|
border-radius: 12px;
|
|
padding: 32px;
|
|
margin-bottom: 24px;
|
|
}
|
|
|
|
.profile-avatar {
|
|
width: 120px;
|
|
height: 120px;
|
|
border-radius: 50%;
|
|
object-fit: cover;
|
|
margin-bottom: 16px;
|
|
}
|
|
|
|
.profile-name {
|
|
font-size: 24px;
|
|
font-weight: 500;
|
|
margin-bottom: 4px;
|
|
}
|
|
|
|
.profile-email {
|
|
color: var(--text-secondary);
|
|
margin-bottom: 16px;
|
|
}
|
|
|
|
.profile-stats {
|
|
display: flex;
|
|
gap: 24px;
|
|
margin-top: 16px;
|
|
}
|
|
|
|
.profile-stat {
|
|
text-align: center;
|
|
}
|
|
|
|
.profile-stat-value {
|
|
font-size: 20px;
|
|
font-weight: 600;
|
|
}
|
|
|
|
.profile-stat-label {
|
|
font-size: 14px;
|
|
color: var(--text-secondary);
|
|
}
|
|
|
|
.form-card {
|
|
background: var(--bg-secondary);
|
|
border-radius: 12px;
|
|
padding: 24px;
|
|
margin-bottom: 24px;
|
|
}
|
|
|
|
.form-title {
|
|
font-size: 18px;
|
|
font-weight: 500;
|
|
margin-bottom: 20px;
|
|
padding-bottom: 12px;
|
|
border-bottom: 1px solid var(--border-color);
|
|
}
|
|
|
|
.form-group {
|
|
margin-bottom: 16px;
|
|
}
|
|
|
|
.form-label {
|
|
display: block;
|
|
margin-bottom: 8px;
|
|
font-weight: 500;
|
|
}
|
|
|
|
.form-input {
|
|
width: 100%;
|
|
background: #121212;
|
|
border: 1px solid var(--border-color);
|
|
border-radius: 8px;
|
|
padding: 12px 16px;
|
|
color: var(--text-primary);
|
|
font-size: 14px;
|
|
}
|
|
|
|
.form-input:focus {
|
|
outline: none;
|
|
border-color: var(--brand-red);
|
|
}
|
|
|
|
.btn-primary {
|
|
background: var(--brand-red);
|
|
color: white;
|
|
border: none;
|
|
padding: 12px 24px;
|
|
border-radius: 8px;
|
|
font-size: 14px;
|
|
font-weight: 500;
|
|
cursor: pointer;
|
|
transition: background 0.2s;
|
|
}
|
|
|
|
.btn-primary:hover {
|
|
background: #cc1a1a;
|
|
}
|
|
|
|
.alert {
|
|
padding: 12px 16px;
|
|
border-radius: 8px;
|
|
margin-bottom: 16px;
|
|
}
|
|
|
|
.alert-success {
|
|
background: rgba(34, 197, 94, 0.2);
|
|
border: 1px solid #22c55e;
|
|
color: #22c55e;
|
|
}
|
|
</style>
|
|
@endsection
|
|
|
|
@section('content')
|
|
<div class="profile-header text-center">
|
|
@if($user->avatar)
|
|
<img src="{{ asset('storage/avatars/' . $user->avatar) }}" alt="{{ $user->name }}" class="profile-avatar">
|
|
@else
|
|
<img src="https://i.pravatar.cc/150?u={{ $user->id }}" alt="{{ $user->name }}" class="profile-avatar">
|
|
@endif
|
|
|
|
<h1 class="profile-name">{{ $user->name }}</h1>
|
|
<p class="profile-email">{{ $user->email }}</p>
|
|
|
|
<div class="profile-stats justify-content-center">
|
|
<div class="profile-stat">
|
|
<div class="profile-stat-value">{{ $user->videos->count() }}</div>
|
|
<div class="profile-stat-label">Videos</div>
|
|
</div>
|
|
<div class="profile-stat">
|
|
<div class="profile-stat-value">{{ $user->likes->count() }}</div>
|
|
<div class="profile-stat-label">Likes</div>
|
|
</div>
|
|
<div class="profile-stat">
|
|
<div class="profile-stat-value">{{ \DB::table('video_views')->whereIn('video_id', $user->videos->pluck('id'))->count() }}</div>
|
|
<div class="profile-stat-label">Total Views</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col-lg-6">
|
|
<div class="form-card">
|
|
<h2 class="form-title">Edit Profile</h2>
|
|
|
|
@if(session('success'))
|
|
<div class="alert alert-success">
|
|
{{ session('success') }}
|
|
</div>
|
|
@endif
|
|
|
|
<form method="POST" action="{{ route('profile.update') }}" enctype="multipart/form-data">
|
|
@csrf
|
|
@method('PUT')
|
|
|
|
<div class="form-group">
|
|
<label class="form-label">Name</label>
|
|
<input type="text" name="name" class="form-input" value="{{ old('name', $user->name) }}" required>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label class="form-label">Avatar</label>
|
|
<input type="file" name="avatar" class="form-input" accept="image/*">
|
|
<small class="text-muted">Max size: 5MB. Supported: JPG, PNG, WebP</small>
|
|
</div>
|
|
|
|
<button type="submit" class="btn-primary">Save Changes</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-lg-6">
|
|
<div class="form-card">
|
|
<h2 class="form-title">Quick Links</h2>
|
|
|
|
<a href="{{ route('channel', $user->id) }}" class="btn-primary d-inline-block text-decoration-none">
|
|
<i class="bi bi-play-btn"></i> View My Channel
|
|
</a>
|
|
|
|
<a href="{{ route('settings') }}" class="btn-primary d-inline-block text-decoration-none ms-2">
|
|
<i class="bi bi-gear"></i> Settings
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endsection
|
|
|