- 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
279 lines
9.0 KiB
PHP
279 lines
9.0 KiB
PHP
@extends('layouts.app')
|
|
|
|
@section('title', 'Edit ' . $video->title . ' | TAKEONE')
|
|
|
|
@section('extra_styles')
|
|
<style>
|
|
.edit-container {
|
|
max-width: 600px;
|
|
margin: 0 auto;
|
|
}
|
|
|
|
.form-group {
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
.form-label {
|
|
display: block;
|
|
margin-bottom: 8px;
|
|
font-weight: 500;
|
|
}
|
|
|
|
.form-input, .form-select, .form-textarea {
|
|
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, .form-select:focus, .form-textarea:focus {
|
|
outline: none;
|
|
border-color: var(--brand-red);
|
|
}
|
|
|
|
.form-textarea {
|
|
resize: vertical;
|
|
min-height: 100px;
|
|
}
|
|
|
|
/* Visibility Options */
|
|
.visibility-options {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 12px;
|
|
}
|
|
|
|
.visibility-option {
|
|
display: block;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.visibility-option input {
|
|
display: none;
|
|
}
|
|
|
|
.visibility-content {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 16px;
|
|
padding: 16px;
|
|
background: #1a1a1a;
|
|
border: 2px solid var(--border-color);
|
|
border-radius: 12px;
|
|
transition: all 0.2s;
|
|
}
|
|
|
|
.visibility-option:hover .visibility-content {
|
|
border-color: var(--text-secondary);
|
|
}
|
|
|
|
.visibility-option.active .visibility-content {
|
|
border-color: var(--brand-red);
|
|
background: rgba(230, 30, 30, 0.1);
|
|
}
|
|
|
|
.visibility-content i {
|
|
font-size: 24px;
|
|
color: var(--text-secondary);
|
|
}
|
|
|
|
.visibility-option.active .visibility-content i {
|
|
color: var(--brand-red);
|
|
}
|
|
|
|
.visibility-title {
|
|
display: block;
|
|
font-weight: 500;
|
|
font-size: 16px;
|
|
}
|
|
|
|
.visibility-desc {
|
|
display: block;
|
|
color: var(--text-secondary);
|
|
font-size: 14px;
|
|
}
|
|
|
|
/* Thumbnail Preview */
|
|
.thumbnail-preview {
|
|
width: 160px;
|
|
height: 90px;
|
|
object-fit: cover;
|
|
border-radius: 8px;
|
|
margin-bottom: 12px;
|
|
}
|
|
|
|
/* Buttons */
|
|
.btn-group {
|
|
display: flex;
|
|
gap: 12px;
|
|
margin-top: 24px;
|
|
}
|
|
|
|
.btn-primary {
|
|
flex: 1;
|
|
background: var(--brand-red);
|
|
color: white;
|
|
border: none;
|
|
padding: 14px 24px;
|
|
border-radius: 8px;
|
|
font-size: 16px;
|
|
font-weight: 500;
|
|
cursor: pointer;
|
|
transition: background 0.2s;
|
|
text-decoration: none;
|
|
text-align: center;
|
|
}
|
|
|
|
.btn-primary:hover {
|
|
background: #cc1a1a;
|
|
}
|
|
|
|
.btn-secondary {
|
|
padding: 14px 24px;
|
|
background: var(--bg-secondary);
|
|
color: var(--text-primary);
|
|
border: 1px solid var(--border-color);
|
|
border-radius: 8px;
|
|
font-size: 16px;
|
|
font-weight: 500;
|
|
cursor: pointer;
|
|
text-decoration: none;
|
|
transition: background 0.2s;
|
|
}
|
|
|
|
.btn-secondary:hover {
|
|
background: var(--border-color);
|
|
}
|
|
|
|
.btn-danger {
|
|
margin-top: 16px;
|
|
width: 100%;
|
|
background: #7f1d1d;
|
|
color: white;
|
|
border: none;
|
|
padding: 14px 24px;
|
|
border-radius: 8px;
|
|
font-size: 16px;
|
|
font-weight: 500;
|
|
cursor: pointer;
|
|
transition: background 0.2s;
|
|
}
|
|
|
|
.btn-danger:hover {
|
|
background: #991b1b;
|
|
}
|
|
|
|
/* Edit Page Layout */
|
|
.edit-page .yt-main {
|
|
display: block;
|
|
margin-left: 0;
|
|
}
|
|
|
|
@media (min-width: 992px) {
|
|
.edit-page .yt-main {
|
|
margin-left: 240px;
|
|
}
|
|
}
|
|
|
|
@media (max-width: 576px) {
|
|
.btn-group {
|
|
flex-direction: column;
|
|
}
|
|
}
|
|
</style>
|
|
@endsection
|
|
|
|
@section('content')
|
|
<div class="edit-container">
|
|
<h1 style="font-size: 24px; font-weight: 500; margin-bottom: 24px;">Edit Video</h1>
|
|
|
|
<form action="{{ route('videos.update', $video->id) }}" method="POST" enctype="multipart/form-data">
|
|
@csrf
|
|
@method('PUT')
|
|
|
|
<div class="form-group">
|
|
<label class="form-label">Title</label>
|
|
<input type="text" name="title" value="{{ $video->title }}" required class="form-input">
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label class="form-label">Description</label>
|
|
<textarea name="description" rows="3" class="form-textarea">{{ $video->description }}</textarea>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label class="form-label">Privacy</label>
|
|
<div class="visibility-options">
|
|
<label class="visibility-option {{ ($video->visibility ?? 'public') == 'public' ? 'active' : '' }}">
|
|
<input type="radio" name="visibility" value="public" {{ ($video->visibility ?? 'public') == 'public' ? 'checked' : '' }}>
|
|
<div class="visibility-content">
|
|
<i class="bi bi-globe"></i>
|
|
<div>
|
|
<span class="visibility-title">Public</span>
|
|
<span class="visibility-desc">Everyone can see this video</span>
|
|
</div>
|
|
</div>
|
|
</label>
|
|
<label class="visibility-option {{ $video->visibility == 'unlisted' ? 'active' : '' }}">
|
|
<input type="radio" name="visibility" value="unlisted" {{ $video->visibility == 'unlisted' ? 'checked' : '' }}>
|
|
<div class="visibility-content">
|
|
<i class="bi bi-link-45deg"></i>
|
|
<div>
|
|
<span class="visibility-title">Unlisted</span>
|
|
<span class="visibility-desc">Only people with the link can see</span>
|
|
</div>
|
|
</div>
|
|
</label>
|
|
<label class="visibility-option {{ $video->visibility == 'private' ? 'active' : '' }}">
|
|
<input type="radio" name="visibility" value="private" {{ $video->visibility == 'private' ? 'checked' : '' }}>
|
|
<div class="visibility-content">
|
|
<i class="bi bi-lock"></i>
|
|
<div>
|
|
<span class="visibility-title">Private</span>
|
|
<span class="visibility-desc">Only you can see this video</span>
|
|
</div>
|
|
</div>
|
|
</label>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label class="form-label">Thumbnail</label>
|
|
@if($video->thumbnail)
|
|
<img src="{{ asset('storage/thumbnails/' . $video->thumbnail) }}" class="thumbnail-preview" alt="Thumbnail">
|
|
@endif
|
|
<input type="file" name="thumbnail" accept="image/*" class="form-input">
|
|
</div>
|
|
|
|
<div class="btn-group">
|
|
<button type="submit" class="btn-primary">Save Changes</button>
|
|
<a href="{{ route('videos.show', $video->id) }}" class="btn-secondary">Cancel</a>
|
|
</div>
|
|
</form>
|
|
|
|
<form action="{{ route('videos.destroy', $video->id) }}" method="POST" onsubmit="return confirm('Delete this video? This cannot be undone.');">
|
|
@csrf
|
|
@method('DELETE')
|
|
<button type="submit" class="btn-danger">Delete Video</button>
|
|
</form>
|
|
</div>
|
|
@endsection
|
|
|
|
@section('scripts')
|
|
<script>
|
|
// Visibility option handling
|
|
const visibilityOptions = document.querySelectorAll('.visibility-option');
|
|
visibilityOptions.forEach(option => {
|
|
const radio = option.querySelector('input[type="radio"]');
|
|
radio.addEventListener('change', function() {
|
|
visibilityOptions.forEach(opt => opt.classList.remove('active'));
|
|
option.classList.add('active');
|
|
});
|
|
});
|
|
</script>
|
|
@endsection
|
|
|