update latest
This commit is contained in:
1 parent
b38f1a93bb
commit
eb707c1ee1
7 files changed
+202
-22
No files matched your search
@@ -317,6 +317,41 @@
|
||||
<i class="bi bi-three-dots-vertical"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-dark yt-more-dropdown dropdown-menu-end">
|
||||
@auth
|
||||
@if(Auth::user()->id === $video->user_id)
|
||||
<li>
|
||||
<button class="yt-more-dropdown-item" onclick="openEditVideoModal('{{ $video->id }}')">
|
||||
<i class="bi bi-pencil"></i> Edit
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<button class="yt-more-dropdown-item text-danger" onclick="deleteVideo('{{ $video->id }}', '{{ addslashes($video->title) }}')">
|
||||
<i class="bi bi-trash"></i> Delete
|
||||
</button>
|
||||
</li>
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
@endif
|
||||
@endauth
|
||||
<li>
|
||||
<button class="yt-more-dropdown-item" onclick="addToQueue('{{ $video->id }}')">
|
||||
<i class="bi bi-list-nested"></i> Add to queue
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<button class="yt-more-dropdown-item" onclick="saveToWatchLater('{{ $video->id }}')">
|
||||
<i class="bi bi-clock"></i> Save to Watch later
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<button class="yt-more-dropdown-item" onclick="openPlaylistModal('{{ $video->id }}')">
|
||||
<i class="bi bi-bookmark"></i> Save to playlist
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<a class="yt-more-dropdown-item" href="{{ route('videos.download', $video->id) }}">
|
||||
<i class="bi bi-download"></i> Download
|
||||
</a>
|
||||
</li>
|
||||
@if($video->isShareable())
|
||||
<li>
|
||||
<button class="yt-more-dropdown-item" onclick="openShareModal('{{ $video->share_url }}', '{{ addslashes($video->title) }}')">
|
||||
@@ -324,14 +359,21 @@
|
||||
</button>
|
||||
</li>
|
||||
@endif
|
||||
<li><a class="yt-more-dropdown-item" href="{{ route('videos.edit', $video->id) }}"><i class="bi bi-pencil"></i> Edit</a></li>
|
||||
<li><a class="yt-more-dropdown-item" href="{{ route('videos.show', $video->id) }}"><i class="bi bi-play"></i> Play</a></li>
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
<li>
|
||||
<form action="{{ route('videos.destroy', $video->id) }}" method="POST" onsubmit="return confirm('Delete this video?');" class="m-0">
|
||||
@csrf @method('DELETE')
|
||||
<button type="submit" class="yt-more-dropdown-item text-danger"><i class="bi bi-trash"></i> Delete</button>
|
||||
</form>
|
||||
<button class="yt-more-dropdown-item" onclick="notInterested('{{ $video->id }}')">
|
||||
<i class="bi bi-dash-circle"></i> Not interested
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<button class="yt-more-dropdown-item" onclick="dontRecommendChannel('{{ $video->user_id }}')">
|
||||
<i class="bi bi-x-circle"></i> Don't recommend channel
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<button class="yt-more-dropdown-item" onclick="reportVideo('{{ $video->id }}')">
|
||||
<i class="bi bi-flag"></i> Report
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -367,6 +409,32 @@ function stopVideo(card) {
|
||||
video.classList.remove('active');
|
||||
}
|
||||
}
|
||||
|
||||
function deleteVideo(videoId, videoTitle) {
|
||||
if (confirm('Are you sure you want to delete "' + videoTitle + '"? This action cannot be undone.')) {
|
||||
fetch(`/videos/${videoId}`, {
|
||||
method: 'DELETE',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}',
|
||||
'Accept': 'application/json',
|
||||
'X-Requested-With': 'XMLHttpRequest'
|
||||
}
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
if (data.success || data.redirect) {
|
||||
// Reload the page to show updated video list
|
||||
window.location.reload();
|
||||
} else {
|
||||
alert('Failed to delete video. Please try again.');
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error:', error);
|
||||
alert('Failed to delete video. Please try again.');
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
Reference in new issue
Block a user