mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 00:01:21 +00:00
Add movie management to admin area
This commit is contained in:
@@ -13,35 +13,23 @@ class AdminMovieController extends BasePageController
|
||||
/**
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function index(Request $request): void
|
||||
public function index(Request $request)
|
||||
{
|
||||
$this->setAdminPrefs();
|
||||
$lastSearch = $request->input('moviesearch', '');
|
||||
|
||||
if ($request->has('moviesearch')) {
|
||||
$lastSearch = $request->input('moviesearch');
|
||||
$movieList = MovieInfo::getAll($request->input('moviesearch'));
|
||||
$movielist = MovieInfo::getAll($request->input('moviesearch'));
|
||||
} else {
|
||||
$lastSearch = '';
|
||||
$movieList = MovieInfo::getAll();
|
||||
$movielist = MovieInfo::getAll();
|
||||
}
|
||||
|
||||
$this->smarty->assign('lastSearch', $lastSearch);
|
||||
$title = 'Movie List';
|
||||
|
||||
$this->smarty->assign('results', $movieList);
|
||||
|
||||
$meta_title = $title = 'Movie List';
|
||||
|
||||
$this->smarty->assign('movielist', $movieList);
|
||||
|
||||
$content = $this->smarty->fetch('movie-list.tpl');
|
||||
|
||||
$this->smarty->assign(compact('title', 'meta_title', 'content'));
|
||||
|
||||
$this->adminrender();
|
||||
return view('admin.movie-list', compact('title', 'movielist', 'lastSearch'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Http\RedirectResponse|void
|
||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\View\View
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
@@ -50,124 +38,166 @@ class AdminMovieController extends BasePageController
|
||||
if (! \defined('STDOUT')) {
|
||||
\define('STDOUT', fopen('php://stdout', 'wb'));
|
||||
}
|
||||
$this->setAdminPrefs();
|
||||
$movie = new Movie(['Settings' => null]);
|
||||
|
||||
$meta_title = $title = 'Movie Add';
|
||||
$title = 'Movie Add';
|
||||
|
||||
// If no ID provided, show the add form
|
||||
if (!$request->has('id')) {
|
||||
return view('admin.movie-add', compact('title'));
|
||||
}
|
||||
|
||||
// Validate the IMDB ID
|
||||
$id = $request->input('id');
|
||||
|
||||
if ($request->has('id') && is_numeric($request->input('id'))) {
|
||||
$movCheck = $movie->getMovieInfo($id);
|
||||
if (!is_numeric($id)) {
|
||||
return redirect()->back()
|
||||
->with('error', 'Invalid IMDB ID. Please enter only numeric digits (without the "tt" prefix).')
|
||||
->withInput();
|
||||
}
|
||||
|
||||
// Check if movie already exists
|
||||
$movie = new Movie(['Settings' => null]);
|
||||
$movCheck = $movie->getMovieInfo($id);
|
||||
|
||||
if ($movCheck !== null) {
|
||||
return redirect()->to('/admin/movie-edit?id=' . $id)
|
||||
->with('warning', 'Movie already exists in the database. Redirected to edit page.');
|
||||
}
|
||||
|
||||
// Try to fetch and add the movie from TMDB
|
||||
try {
|
||||
$movieInfo = $movie->updateMovieInfo($id);
|
||||
if ($movieInfo && ($movCheck === null || ($request->has('update') && (int) $request->input('update') === 1))) {
|
||||
|
||||
if ($movieInfo) {
|
||||
// Link any existing releases to this movie
|
||||
$forUpdate = Release::query()->where('imdbid', $id)->get(['id']);
|
||||
if ($forUpdate !== null) {
|
||||
if ($forUpdate !== null && $forUpdate->count() > 0) {
|
||||
$movieInfoId = MovieInfo::query()->where('imdbid', $id)->first(['id']);
|
||||
if ($movieInfoId !== null) {
|
||||
foreach ($forUpdate as $movie) {
|
||||
Release::query()->where('id', $movie->id)->update(['movieinfo_id' => $movieInfoId->id]);
|
||||
foreach ($forUpdate as $rel) {
|
||||
Release::query()->where('id', $rel->id)->update(['movieinfo_id' => $movieInfoId->id]);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (($request->has('update') && (int) $request->input('update') === 1)) {
|
||||
return redirect()->back()->withInput();
|
||||
}
|
||||
|
||||
return redirect()->to('/admin/movie-list');
|
||||
return redirect()->to('/admin/movie-list')
|
||||
->with('success', 'Movie successfully added! IMDB ID: ' . $id);
|
||||
} else {
|
||||
return redirect()->back()
|
||||
->with('error', 'Could not fetch movie information from TMDB/IMDB. Please verify the IMDB ID is correct.')
|
||||
->withInput();
|
||||
}
|
||||
|
||||
return redirect()->to('/admin/movie-list');
|
||||
} catch (\Exception $e) {
|
||||
return redirect()->back()
|
||||
->with('error', 'Error adding movie: ' . $e->getMessage())
|
||||
->withInput();
|
||||
}
|
||||
|
||||
$content = $this->smarty->fetch('movie-add.tpl');
|
||||
|
||||
$this->smarty->assign(compact('title', 'meta_title', 'content'));
|
||||
|
||||
$this->adminrender();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Http\RedirectResponse|void
|
||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\View\View
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function edit(Request $request)
|
||||
{
|
||||
$this->setAdminPrefs();
|
||||
|
||||
$movie = new Movie;
|
||||
$meta_title = $title = 'Add Movie';
|
||||
$title = 'Movie Edit';
|
||||
|
||||
// set the current action
|
||||
$action = $request->input('action') ?? 'view';
|
||||
// Check if ID is provided
|
||||
if (!$request->has('id')) {
|
||||
return redirect()->to('admin/movie-list')
|
||||
->with('error', 'No movie ID provided.');
|
||||
}
|
||||
|
||||
if ($request->has('id')) {
|
||||
$id = $request->input('id');
|
||||
$mov = $movie->getMovieInfo($id);
|
||||
$id = $request->input('id');
|
||||
$mov = $movie->getMovieInfo($id);
|
||||
|
||||
if ($mov === null) {
|
||||
abort(404, 'Movie you requested does not exist in database');
|
||||
}
|
||||
if ($mov === null) {
|
||||
return redirect()->to('admin/movie-list')
|
||||
->with('error', 'Movie with IMDB ID ' . $id . ' does not exist in database.');
|
||||
}
|
||||
|
||||
switch ($action) {
|
||||
case 'submit':
|
||||
$coverLoc = storage_path('covers/movies/'.$id.'-cover.jpg');
|
||||
$backdropLoc = storage_path('covers/movies/'.$id.'-backdrop.jpg');
|
||||
// Handle update from TMDB
|
||||
if ($request->has('update') && (int) $request->input('update') === 1) {
|
||||
try {
|
||||
if (! \defined('STDOUT')) {
|
||||
\define('STDOUT', fopen('php://stdout', 'wb'));
|
||||
}
|
||||
|
||||
if ($_FILES['cover']['size'] > 0) {
|
||||
$tmpName = $_FILES['cover']['tmp_name'];
|
||||
$file_info = getimagesize($tmpName);
|
||||
if (! empty($file_info)) {
|
||||
move_uploaded_file($_FILES['cover']['tmp_name'], $coverLoc);
|
||||
}
|
||||
}
|
||||
$movieInfo = $movie->updateMovieInfo($id);
|
||||
|
||||
if ($_FILES['backdrop']['size'] > 0) {
|
||||
$tmpName = $_FILES['backdrop']['tmp_name'];
|
||||
$file_info = getimagesize($tmpName);
|
||||
if (! empty($file_info)) {
|
||||
move_uploaded_file($_FILES['backdrop']['tmp_name'], $backdropLoc);
|
||||
}
|
||||
}
|
||||
|
||||
$request->merge(['cover' => file_exists($coverLoc) ? 1 : 0]);
|
||||
$request->merge(['backdrop' => file_exists($backdropLoc) ? 1 : 0]);
|
||||
|
||||
$movie->update([
|
||||
'actors' => $request->input('actors'),
|
||||
'backdrop' => $request->input('backdrop'),
|
||||
'cover' => $request->input('cover'),
|
||||
'director' => $request->input('director'),
|
||||
'genre' => $request->input('genre'),
|
||||
'imdbid' => $id,
|
||||
'language' => $request->input('language'),
|
||||
'plot' => $request->input('plot'),
|
||||
'rating' => $request->input('rating'),
|
||||
'tagline' => $request->input('tagline'),
|
||||
'title' => $request->input('title'),
|
||||
'year' => $request->input('year'),
|
||||
]);
|
||||
|
||||
$movieInfo = MovieInfo::query()->where('imdbid', $id)->first(['id']);
|
||||
if ($movieInfo !== null) {
|
||||
Release::query()->where('imdbid', $id)->update(['movieinfo_id' => $movieInfo->id]);
|
||||
}
|
||||
|
||||
return redirect()->to('admin/movie-list');
|
||||
break;
|
||||
case 'view':
|
||||
default:
|
||||
$meta_title = $title = 'Movie Edit';
|
||||
$this->smarty->assign('movie', $mov);
|
||||
break;
|
||||
if ($movieInfo) {
|
||||
return redirect()->back()
|
||||
->with('success', 'Movie information updated successfully from TMDB!');
|
||||
} else {
|
||||
return redirect()->back()
|
||||
->with('error', 'Failed to update movie information from TMDB. Please try again.');
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
return redirect()->back()
|
||||
->with('error', 'Error updating movie: ' . $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
$content = $this->smarty->fetch('movie-edit.tpl');
|
||||
// Handle form submission
|
||||
$action = $request->input('action') ?? 'view';
|
||||
|
||||
$this->smarty->assign(compact('title', 'meta_title', 'content'));
|
||||
if ($action === 'submit') {
|
||||
try {
|
||||
$coverLoc = public_path('covers/movies/'.$id.'-cover.jpg');
|
||||
$backdropLoc = public_path('covers/movies/'.$id.'-backdrop.jpg');
|
||||
|
||||
$this->adminrender();
|
||||
// Ensure directory exists
|
||||
if (!file_exists(public_path('covers/movies'))) {
|
||||
mkdir(public_path('covers/movies'), 0755, true);
|
||||
}
|
||||
|
||||
// Handle cover upload
|
||||
if ($request->hasFile('cover') && $request->file('cover')->isValid()) {
|
||||
$coverFile = $request->file('cover');
|
||||
$coverFile->move(public_path('covers/movies'), $id.'-cover.jpg');
|
||||
}
|
||||
|
||||
// Handle backdrop upload
|
||||
if ($request->hasFile('backdrop') && $request->file('backdrop')->isValid()) {
|
||||
$backdropFile = $request->file('backdrop');
|
||||
$backdropFile->move(public_path('covers/movies'), $id.'-backdrop.jpg');
|
||||
}
|
||||
|
||||
$request->merge(['cover' => file_exists($coverLoc) ? 1 : 0]);
|
||||
$request->merge(['backdrop' => file_exists($backdropLoc) ? 1 : 0]);
|
||||
|
||||
$movie->update([
|
||||
'actors' => $request->input('actors'),
|
||||
'backdrop' => $request->input('backdrop'),
|
||||
'cover' => $request->input('cover'),
|
||||
'director' => $request->input('director'),
|
||||
'genre' => $request->input('genre'),
|
||||
'imdbid' => $id,
|
||||
'language' => $request->input('language'),
|
||||
'plot' => $request->input('plot'),
|
||||
'rating' => $request->input('rating'),
|
||||
'tagline' => $request->input('tagline'),
|
||||
'title' => $request->input('title'),
|
||||
'year' => $request->input('year'),
|
||||
]);
|
||||
|
||||
// Link releases to this movie
|
||||
$movieInfo = MovieInfo::query()->where('imdbid', $id)->first(['id']);
|
||||
if ($movieInfo !== null) {
|
||||
Release::query()->where('imdbid', $id)->update(['movieinfo_id' => $movieInfo->id]);
|
||||
}
|
||||
|
||||
return redirect()->to('admin/movie-list')
|
||||
->with('success', 'Movie updated successfully!');
|
||||
} catch (\Exception $e) {
|
||||
return redirect()->back()
|
||||
->with('error', 'Error saving movie: ' . $e->getMessage())
|
||||
->withInput();
|
||||
}
|
||||
}
|
||||
|
||||
return view('admin.movie-edit', compact('title', 'mov'))->with('movie', $mov);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,7 +83,11 @@ class MovieInfo extends Model
|
||||
}
|
||||
$sql = self::query()->select('*');
|
||||
if (! empty($search)) {
|
||||
$sql->whereLike('title', '%'.$search.'%');
|
||||
// Search by both title and IMDB ID
|
||||
$sql->where(function($query) use ($search) {
|
||||
$query->whereLike('title', '%'.$search.'%')
|
||||
->orWhere('imdbid', $search);
|
||||
});
|
||||
}
|
||||
|
||||
$movie = $sql->paginate(config('nntmux.items_per_page'));
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('content')
|
||||
<div class="container mx-auto px-4 py-6">
|
||||
<div class="bg-white dark:bg-gray-800 rounded-lg shadow-sm">
|
||||
<!-- Header -->
|
||||
<div class="px-6 py-4 border-b border-gray-200">
|
||||
<h1 class="text-2xl font-semibold text-gray-800 dark:text-gray-200">
|
||||
<i class="fa fa-film mr-2"></i>{{ $title }}
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
<!-- Success/Error/Warning Messages -->
|
||||
@if(session('success'))
|
||||
<div class="mx-6 mt-4 p-4 bg-green-50 dark:bg-green-900 border border-green-200 dark:border-green-700 rounded-lg">
|
||||
<p class="text-green-800 dark:text-green-200">
|
||||
<i class="fa fa-check-circle mr-2"></i>{{ session('success') }}
|
||||
</p>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if(session('error'))
|
||||
<div class="mx-6 mt-4 p-4 bg-red-50 dark:bg-red-900 border border-red-200 dark:border-red-700 rounded-lg">
|
||||
<p class="text-red-800 dark:text-red-200">
|
||||
<i class="fa fa-exclamation-circle mr-2"></i>{{ session('error') }}
|
||||
</p>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if(session('warning'))
|
||||
<div class="mx-6 mt-4 p-4 bg-yellow-50 dark:bg-yellow-900 border border-yellow-200 dark:border-yellow-700 rounded-lg">
|
||||
<p class="text-yellow-800 dark:text-yellow-200">
|
||||
<i class="fa fa-exclamation-triangle mr-2"></i>{{ session('warning') }}
|
||||
</p>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Info Alert -->
|
||||
<div class="px-6 py-4 bg-blue-50 dark:bg-blue-900 border-b border-blue-100">
|
||||
<div class="flex">
|
||||
<i class="fa fa-info-circle text-blue-500 text-xl mr-3"></i>
|
||||
<div class="text-sm text-blue-700 dark:text-blue-300">
|
||||
<p class="mb-2">
|
||||
Enter an IMDB ID (numeric only, without the 'tt' prefix) to add movie information to the database.
|
||||
</p>
|
||||
<p class="text-xs text-blue-600 dark:text-blue-400">
|
||||
Example: For <code class="px-1 bg-blue-100 dark:bg-blue-800 rounded">https://www.imdb.com/title/tt0111161/</code>, enter <code class="px-1 bg-blue-100 dark:bg-blue-800 rounded">0111161</code>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Add Movie Form -->
|
||||
<form method="GET" action="{{ url('admin/movie-add') }}" class="p-6">
|
||||
<div class="max-w-2xl">
|
||||
<div class="mb-6">
|
||||
<label for="id" class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
|
||||
IMDB ID <span class="text-red-500">*</span>
|
||||
</label>
|
||||
<div class="flex gap-2">
|
||||
<div class="relative flex-1">
|
||||
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
|
||||
<span class="text-gray-500 dark:text-gray-400 font-mono">tt</span>
|
||||
</div>
|
||||
<input type="text"
|
||||
id="id"
|
||||
name="id"
|
||||
required
|
||||
pattern="[0-9]+"
|
||||
placeholder="0111161"
|
||||
class="pl-10 w-full px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:text-white"
|
||||
value="">
|
||||
</div>
|
||||
<button type="submit" class="px-6 py-2 bg-blue-600 dark:bg-blue-700 text-white rounded-lg hover:bg-blue-700 whitespace-nowrap">
|
||||
<i class="fa fa-plus mr-2"></i>Add Movie
|
||||
</button>
|
||||
</div>
|
||||
<p class="mt-2 text-sm text-gray-500 dark:text-gray-400">
|
||||
Enter only the numeric part of the IMDB ID (without 'tt' prefix)
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="mt-6 p-4 bg-gray-50 dark:bg-gray-700 rounded-lg">
|
||||
<h3 class="text-sm font-semibold text-gray-700 dark:text-gray-300 mb-2">
|
||||
<i class="fa fa-lightbulb-o mr-1"></i>How it works:
|
||||
</h3>
|
||||
<ul class="text-sm text-gray-600 dark:text-gray-400 space-y-1 list-disc list-inside">
|
||||
<li>The system will fetch movie information from TMDB (The Movie Database)</li>
|
||||
<li>Movie details, posters, and backdrops will be automatically downloaded</li>
|
||||
<li>Associated releases will be linked to the movie information</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="mt-6 flex gap-3">
|
||||
<a href="{{ url('admin/movie-list') }}" class="px-4 py-2 bg-gray-600 text-white rounded-lg hover:bg-gray-700">
|
||||
<i class="fa fa-arrow-left mr-2"></i>Back to Movie List
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@@ -0,0 +1,392 @@
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('content')
|
||||
<div class="container mx-auto px-4 py-6">
|
||||
<div class="bg-white dark:bg-gray-800 rounded-lg shadow-sm">
|
||||
<!-- Header -->
|
||||
<div class="px-6 py-4 border-b border-gray-200">
|
||||
<h1 class="text-2xl font-semibold text-gray-800 dark:text-gray-200">
|
||||
<i class="fa fa-edit mr-2"></i>{{ $title }}
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
<!-- Success/Error/Warning Messages -->
|
||||
@if(session('success'))
|
||||
<div class="mx-6 mt-4 p-4 bg-green-50 dark:bg-green-900 border border-green-200 dark:border-green-700 rounded-lg">
|
||||
<p class="text-green-800 dark:text-green-200">
|
||||
<i class="fa fa-check-circle mr-2"></i>{{ session('success') }}
|
||||
</p>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if(session('error'))
|
||||
<div class="mx-6 mt-4 p-4 bg-red-50 dark:bg-red-900 border border-red-200 dark:border-red-700 rounded-lg">
|
||||
<p class="text-red-800 dark:text-red-200">
|
||||
<i class="fa fa-exclamation-circle mr-2"></i>{{ session('error') }}
|
||||
</p>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if(session('warning'))
|
||||
<div class="mx-6 mt-4 p-4 bg-yellow-50 dark:bg-yellow-900 border border-yellow-200 dark:border-yellow-700 rounded-lg">
|
||||
<p class="text-yellow-800 dark:text-yellow-200">
|
||||
<i class="fa fa-exclamation-triangle mr-2"></i>{{ session('warning') }}
|
||||
</p>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Edit Movie Form -->
|
||||
<form method="POST" action="{{ url('admin/movie-edit') }}" enctype="multipart/form-data" class="p-6">
|
||||
@csrf
|
||||
<input type="hidden" name="action" value="submit">
|
||||
<input type="hidden" name="id" value="{{ $movie['imdbid'] ?? $movie->imdbid ?? '' }}">
|
||||
|
||||
<div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
|
||||
<!-- Left Column - Movie Images -->
|
||||
<div class="space-y-6">
|
||||
<!-- Cover Image -->
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
|
||||
Cover Image
|
||||
</label>
|
||||
<div class="border-2 border-dashed border-gray-300 dark:border-gray-600 rounded-lg p-4">
|
||||
@php
|
||||
$imdbid = $movie['imdbid'] ?? $movie->imdbid ?? '';
|
||||
$coverPath = public_path('covers/movies/' . $imdbid . '-cover.jpg');
|
||||
$hasCover = file_exists($coverPath);
|
||||
@endphp
|
||||
@if($hasCover)
|
||||
<img src="{{ asset('covers/movies/' . $imdbid . '-cover.jpg') }}"
|
||||
alt="Movie Cover"
|
||||
class="w-full h-auto rounded-lg mb-3">
|
||||
@else
|
||||
<div class="flex flex-col items-center justify-center py-8 text-gray-400">
|
||||
<i class="fa fa-image text-5xl mb-2"></i>
|
||||
<p class="text-sm">No cover image</p>
|
||||
</div>
|
||||
@endif
|
||||
<input type="file"
|
||||
name="cover"
|
||||
accept="image/*"
|
||||
class="w-full text-sm text-gray-500 file:mr-4 file:py-2 file:px-4 file:rounded-lg file:border-0 file:text-sm file:font-semibold file:bg-blue-50 file:text-blue-700 hover:file:bg-blue-100">
|
||||
<p class="mt-2 text-xs text-gray-500">Upload a new cover image (JPG/PNG)</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Backdrop Image -->
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
|
||||
Backdrop Image
|
||||
</label>
|
||||
<div class="border-2 border-dashed border-gray-300 dark:border-gray-600 rounded-lg p-4">
|
||||
@php
|
||||
$backdropPath = public_path('covers/movies/' . $imdbid . '-backdrop.jpg');
|
||||
$hasBackdrop = file_exists($backdropPath);
|
||||
@endphp
|
||||
@if($hasBackdrop)
|
||||
<img src="{{ asset('covers/movies/' . $imdbid . '-backdrop.jpg') }}"
|
||||
alt="Movie Backdrop"
|
||||
class="w-full h-auto rounded-lg mb-3">
|
||||
@else
|
||||
<div class="flex flex-col items-center justify-center py-8 text-gray-400">
|
||||
<i class="fa fa-image text-5xl mb-2"></i>
|
||||
<p class="text-sm">No backdrop image</p>
|
||||
</div>
|
||||
@endif
|
||||
<input type="file"
|
||||
name="backdrop"
|
||||
accept="image/*"
|
||||
class="w-full text-sm text-gray-500 file:mr-4 file:py-2 file:px-4 file:rounded-lg file:border-0 file:text-sm file:font-semibold file:bg-blue-50 file:text-blue-700 hover:file:bg-blue-100">
|
||||
<p class="mt-2 text-xs text-gray-500">Upload a new backdrop image (JPG/PNG)</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Right Column - Movie Details -->
|
||||
<div class="lg:col-span-2 space-y-6">
|
||||
<!-- IMDB ID (Read-only) -->
|
||||
<div>
|
||||
<label for="imdbid" class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">
|
||||
IMDB ID
|
||||
</label>
|
||||
<div class="flex gap-2">
|
||||
<input type="text"
|
||||
id="imdbid"
|
||||
value="{{ $movie['imdbid'] ?? $movie->imdbid ?? '' }}"
|
||||
readonly
|
||||
class="flex-1 px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-gray-100 dark:bg-gray-700 dark:text-gray-300">
|
||||
<a href="https://www.imdb.com/title/tt{{ $movie['imdbid'] ?? $movie->imdbid ?? '' }}"
|
||||
target="_blank"
|
||||
class="px-4 py-2 bg-yellow-500 text-white rounded-md hover:bg-yellow-600">
|
||||
<i class="fa fa-external-link"></i> View on IMDB
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Title -->
|
||||
<div>
|
||||
<label for="title" class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">
|
||||
Title <span class="text-red-500">*</span>
|
||||
</label>
|
||||
<input type="text"
|
||||
id="title"
|
||||
name="title"
|
||||
value="{{ $movie['title'] ?? $movie->title ?? '' }}"
|
||||
required
|
||||
class="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:text-white">
|
||||
</div>
|
||||
|
||||
<!-- Tagline -->
|
||||
<div>
|
||||
<label for="tagline" class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">
|
||||
Tagline
|
||||
</label>
|
||||
<input type="text"
|
||||
id="tagline"
|
||||
name="tagline"
|
||||
value="{{ $movie['tagline'] ?? $movie->tagline ?? '' }}"
|
||||
class="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:text-white">
|
||||
</div>
|
||||
|
||||
<!-- Year and Rating -->
|
||||
<div class="grid grid-cols-2 gap-4">
|
||||
<div>
|
||||
<label for="year" class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">
|
||||
Year
|
||||
</label>
|
||||
<input type="number"
|
||||
id="year"
|
||||
name="year"
|
||||
value="{{ $movie['year'] ?? $movie->year ?? '' }}"
|
||||
min="1800"
|
||||
max="2100"
|
||||
class="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:text-white">
|
||||
</div>
|
||||
<div>
|
||||
<label for="rating" class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">
|
||||
Rating
|
||||
</label>
|
||||
<input type="text"
|
||||
id="rating"
|
||||
name="rating"
|
||||
value="{{ $movie['rating'] ?? $movie->rating ?? '' }}"
|
||||
placeholder="e.g., 8.5"
|
||||
class="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:text-white">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Genre -->
|
||||
<div>
|
||||
<label for="genre" class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">
|
||||
Genre
|
||||
</label>
|
||||
<input type="text"
|
||||
id="genre"
|
||||
name="genre"
|
||||
value="{{ $movie['genre'] ?? $movie->genre ?? '' }}"
|
||||
placeholder="e.g., Action, Drama, Comedy"
|
||||
class="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:text-white">
|
||||
</div>
|
||||
|
||||
<!-- Director -->
|
||||
<div>
|
||||
<label for="director" class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">
|
||||
Director
|
||||
</label>
|
||||
<input type="text"
|
||||
id="director"
|
||||
name="director"
|
||||
value="{{ $movie['director'] ?? $movie->director ?? '' }}"
|
||||
class="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:text-white">
|
||||
</div>
|
||||
|
||||
<!-- Actors -->
|
||||
<div>
|
||||
<label for="actors" class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">
|
||||
Actors
|
||||
</label>
|
||||
<input type="text"
|
||||
id="actors"
|
||||
name="actors"
|
||||
value="{{ $movie['actors'] ?? $movie->actors ?? '' }}"
|
||||
placeholder="Comma-separated list of actors"
|
||||
class="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:text-white">
|
||||
</div>
|
||||
|
||||
<!-- Language -->
|
||||
<div>
|
||||
<label for="language" class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">
|
||||
Language
|
||||
</label>
|
||||
<input type="text"
|
||||
id="language"
|
||||
name="language"
|
||||
value="{{ $movie['language'] ?? $movie->language ?? '' }}"
|
||||
placeholder="e.g., English"
|
||||
class="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:text-white">
|
||||
</div>
|
||||
|
||||
<!-- Plot -->
|
||||
<div>
|
||||
<label for="plot" class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">
|
||||
Plot
|
||||
</label>
|
||||
<textarea id="plot"
|
||||
name="plot"
|
||||
rows="6"
|
||||
class="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:text-white">{{ $movie['plot'] ?? $movie->plot ?? '' }}</textarea>
|
||||
</div>
|
||||
|
||||
<!-- Action Buttons -->
|
||||
<div class="flex gap-3 pt-4 border-t border-gray-200">
|
||||
<button type="submit" class="px-6 py-2 bg-blue-600 dark:bg-blue-700 text-white rounded-lg hover:bg-blue-700">
|
||||
<i class="fa fa-save mr-2"></i>Save Changes
|
||||
</button>
|
||||
<a href="{{ url('admin/movie-list') }}" class="px-6 py-2 bg-gray-600 text-white rounded-lg hover:bg-gray-700">
|
||||
<i class="fa fa-times mr-2"></i>Cancel
|
||||
</a>
|
||||
<a href="{{ url('admin/movie-edit?id=' . ($movie['imdbid'] ?? $movie->imdbid ?? '') . '&update=1') }}"
|
||||
class="ml-auto px-6 py-2 bg-green-600 text-white rounded-lg hover:bg-green-700"
|
||||
onclick="return confirm('This will fetch and update movie data from TMDB. Continue?')">
|
||||
<i class="fa fa-refresh mr-2"></i>Update from TMDB
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('content')
|
||||
<div class="container mx-auto px-4 py-6">
|
||||
<div class="bg-white dark:bg-gray-800 rounded-lg shadow-sm">
|
||||
<!-- Header -->
|
||||
<div class="px-6 py-4 border-b border-gray-200">
|
||||
<div class="flex justify-between items-center">
|
||||
<h1 class="text-2xl font-semibold text-gray-800 dark:text-gray-200">
|
||||
<i class="fa fa-film mr-2"></i>{{ $title }}
|
||||
</h1>
|
||||
<a href="{{ url('admin/movie-add') }}" class="px-4 py-2 bg-blue-600 dark:bg-blue-700 text-white rounded-lg hover:bg-blue-700">
|
||||
<i class="fa fa-plus mr-2"></i>Add Movie
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Search Form -->
|
||||
<div class="px-6 py-4 bg-gray-50 dark:bg-gray-900 border-b border-gray-200">
|
||||
<form method="GET" action="{{ url('admin/movie-list') }}">
|
||||
<div class="flex gap-2">
|
||||
<div class="relative flex-1">
|
||||
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
|
||||
<i class="fa fa-search text-gray-400"></i>
|
||||
</div>
|
||||
<input type="text"
|
||||
name="moviesearch"
|
||||
value="{{ $lastSearch ?? '' }}"
|
||||
placeholder="Search by IMDB ID or movie title..."
|
||||
class="pl-10 w-full px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:text-white">
|
||||
</div>
|
||||
<button type="submit" class="px-4 py-2 bg-blue-600 dark:bg-blue-700 text-white rounded-lg hover:bg-blue-700">
|
||||
Search
|
||||
</button>
|
||||
@if(!empty($lastSearch))
|
||||
<a href="{{ url('admin/movie-list') }}" class="px-4 py-2 bg-gray-600 text-white rounded-lg hover:bg-gray-700">
|
||||
Clear
|
||||
</a>
|
||||
@endif
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- Movie List Table -->
|
||||
@if(!empty($movielist) && count($movielist) > 0)
|
||||
<div class="overflow-x-auto">
|
||||
<table class="min-w-full divide-y divide-gray-200">
|
||||
<thead class="bg-gray-50 dark:bg-gray-700">
|
||||
<tr>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">IMDB ID</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Title</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Year</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Rating</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Genre</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Cover</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Backdrop</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="bg-white dark:bg-gray-800 divide-y divide-gray-200">
|
||||
@foreach($movielist as $movie)
|
||||
<tr class="hover:bg-gray-50 dark:hover:bg-gray-700">
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900 dark:text-gray-200">
|
||||
<a href="https://www.imdb.com/title/tt{{ $movie->imdbid }}" target="_blank" class="text-blue-600 dark:text-blue-400 hover:underline">
|
||||
{{ $movie->imdbid }}
|
||||
</a>
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap">
|
||||
<div class="text-sm font-medium text-gray-900 dark:text-gray-200">{{ $movie->title ?? 'N/A' }}</div>
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-400">
|
||||
{{ $movie->year ?? 'N/A' }}
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-400">
|
||||
{{ $movie->rating ?? 'N/A' }}
|
||||
</td>
|
||||
<td class="px-6 py-4 text-sm text-gray-500 dark:text-gray-400">
|
||||
{{ \Illuminate\Support\Str::limit($movie->genre ?? 'N/A', 30) }}
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm">
|
||||
@if($movie->cover == 1)
|
||||
<span class="px-2 py-1 text-xs font-semibold rounded-full bg-green-100 text-green-800">
|
||||
<i class="fa fa-check"></i> Yes
|
||||
</span>
|
||||
@else
|
||||
<span class="px-2 py-1 text-xs font-semibold rounded-full bg-red-100 text-red-800">
|
||||
<i class="fa fa-times"></i> No
|
||||
</span>
|
||||
@endif
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm">
|
||||
@if($movie->backdrop == 1)
|
||||
<span class="px-2 py-1 text-xs font-semibold rounded-full bg-green-100 text-green-800">
|
||||
<i class="fa fa-check"></i> Yes
|
||||
</span>
|
||||
@else
|
||||
<span class="px-2 py-1 text-xs font-semibold rounded-full bg-red-100 text-red-800">
|
||||
<i class="fa fa-times"></i> No
|
||||
</span>
|
||||
@endif
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium">
|
||||
<a href="{{ url('admin/movie-edit?id=' . $movie->imdbid) }}" class="text-blue-600 dark:text-blue-400 hover:text-blue-900 mr-3">
|
||||
<i class="fa fa-edit"></i> Edit
|
||||
</a>
|
||||
<a href="{{ url('admin/movie-edit?id=' . $movie->imdbid . '&update=1') }}" class="text-green-600 dark:text-green-400 hover:text-green-900" title="Update from TMDB">
|
||||
<i class="fa fa-refresh"></i> Update
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@else
|
||||
<div class="px-6 py-12 text-center">
|
||||
<i class="fa fa-film text-gray-400 text-5xl mb-4"></i>
|
||||
<p class="text-gray-500 dark:text-gray-400 text-lg">
|
||||
@if(!empty($lastSearch))
|
||||
No movies found matching "{{ $lastSearch }}".
|
||||
@else
|
||||
No movies found in the database.
|
||||
@endif
|
||||
</p>
|
||||
<a href="{{ url('admin/movie-add') }}" class="mt-4 inline-block px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700">
|
||||
<i class="fa fa-plus mr-2"></i>Add Your First Movie
|
||||
</a>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@@ -0,0 +1,158 @@
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('content')
|
||||
<div class="container mx-auto px-4 py-6">
|
||||
<div class="bg-white dark:bg-gray-800 rounded-lg shadow-sm">
|
||||
<!-- Header -->
|
||||
<div class="px-6 py-4 border-b border-gray-200">
|
||||
<div class="flex justify-between items-center">
|
||||
<h1 class="text-2xl font-semibold text-gray-800 dark:text-gray-200">
|
||||
<i class="fa fa-film mr-2"></i>{{ $title }}
|
||||
</h1>
|
||||
<a href="{{ url('admin/movie-add') }}" class="px-4 py-2 bg-blue-600 dark:bg-blue-700 text-white rounded-lg hover:bg-blue-700">
|
||||
<i class="fa fa-plus mr-2"></i>Add Movie
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Success/Error/Warning Messages -->
|
||||
@if(session('success'))
|
||||
<div class="mx-6 mt-4 p-4 bg-green-50 dark:bg-green-900 border border-green-200 dark:border-green-700 rounded-lg">
|
||||
<p class="text-green-800 dark:text-green-200">
|
||||
<i class="fa fa-check-circle mr-2"></i>{{ session('success') }}
|
||||
</p>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if(session('error'))
|
||||
<div class="mx-6 mt-4 p-4 bg-red-50 dark:bg-red-900 border border-red-200 dark:border-red-700 rounded-lg">
|
||||
<p class="text-red-800 dark:text-red-200">
|
||||
<i class="fa fa-exclamation-circle mr-2"></i>{{ session('error') }}
|
||||
</p>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if(session('warning'))
|
||||
<div class="mx-6 mt-4 p-4 bg-yellow-50 dark:bg-yellow-900 border border-yellow-200 dark:border-yellow-700 rounded-lg">
|
||||
<p class="text-yellow-800 dark:text-yellow-200">
|
||||
<i class="fa fa-exclamation-triangle mr-2"></i>{{ session('warning') }}
|
||||
</p>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Search Form -->
|
||||
<div class="px-6 py-4 bg-gray-50 dark:bg-gray-900 border-b border-gray-200">
|
||||
<form method="GET" action="{{ url('admin/movie-list') }}">
|
||||
<div class="flex gap-2">
|
||||
<div class="relative flex-1">
|
||||
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
|
||||
<i class="fa fa-search text-gray-400"></i>
|
||||
</div>
|
||||
<input type="text"
|
||||
name="moviesearch"
|
||||
value="{{ $lastSearch ?? '' }}"
|
||||
placeholder="Search by IMDB ID or movie title..."
|
||||
class="pl-10 w-full px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:text-white">
|
||||
</div>
|
||||
<button type="submit" class="px-4 py-2 bg-blue-600 dark:bg-blue-700 text-white rounded-lg hover:bg-blue-700">
|
||||
Search
|
||||
</button>
|
||||
@if(!empty($lastSearch))
|
||||
<a href="{{ url('admin/movie-list') }}" class="px-4 py-2 bg-gray-600 text-white rounded-lg hover:bg-gray-700">
|
||||
Clear
|
||||
</a>
|
||||
@endif
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- Movie List Table -->
|
||||
@if(!empty($movielist) && count($movielist) > 0)
|
||||
<div class="overflow-x-auto">
|
||||
<table class="min-w-full divide-y divide-gray-200">
|
||||
<thead class="bg-gray-50 dark:bg-gray-700">
|
||||
<tr>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">IMDB ID</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Title</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Year</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Rating</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Genre</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Cover</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Backdrop</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="bg-white dark:bg-gray-800 divide-y divide-gray-200">
|
||||
@foreach($movielist as $movie)
|
||||
<tr class="hover:bg-gray-50 dark:hover:bg-gray-700">
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900 dark:text-gray-200">
|
||||
<a href="https://www.imdb.com/title/tt{{ $movie->imdbid }}" target="_blank" class="text-blue-600 dark:text-blue-400 hover:underline">
|
||||
{{ $movie->imdbid }}
|
||||
</a>
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap">
|
||||
<div class="text-sm font-medium text-gray-900 dark:text-gray-200">{{ $movie->title ?? 'N/A' }}</div>
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-400">
|
||||
{{ $movie->year ?? 'N/A' }}
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-400">
|
||||
{{ $movie->rating ?? 'N/A' }}
|
||||
</td>
|
||||
<td class="px-6 py-4 text-sm text-gray-500 dark:text-gray-400">
|
||||
{{ \Illuminate\Support\Str::limit($movie->genre ?? 'N/A', 30) }}
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm">
|
||||
@if($movie->cover == 1)
|
||||
<span class="px-2 py-1 text-xs font-semibold rounded-full bg-green-100 text-green-800">
|
||||
<i class="fa fa-check"></i> Yes
|
||||
</span>
|
||||
@else
|
||||
<span class="px-2 py-1 text-xs font-semibold rounded-full bg-red-100 text-red-800">
|
||||
<i class="fa fa-times"></i> No
|
||||
</span>
|
||||
@endif
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm">
|
||||
@if($movie->backdrop == 1)
|
||||
<span class="px-2 py-1 text-xs font-semibold rounded-full bg-green-100 text-green-800">
|
||||
<i class="fa fa-check"></i> Yes
|
||||
</span>
|
||||
@else
|
||||
<span class="px-2 py-1 text-xs font-semibold rounded-full bg-red-100 text-red-800">
|
||||
<i class="fa fa-times"></i> No
|
||||
</span>
|
||||
@endif
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium">
|
||||
<a href="{{ url('admin/movie-edit?id=' . $movie->imdbid) }}" class="text-blue-600 dark:text-blue-400 hover:text-blue-900 mr-3">
|
||||
<i class="fa fa-edit"></i> Edit
|
||||
</a>
|
||||
<a href="{{ url('admin/movie-edit?id=' . $movie->imdbid . '&update=1') }}" class="text-green-600 dark:text-green-400 hover:text-green-900" title="Update from TMDB">
|
||||
<i class="fa fa-refresh"></i> Update
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@else
|
||||
<div class="px-6 py-12 text-center">
|
||||
<i class="fa fa-film text-gray-400 text-5xl mb-4"></i>
|
||||
<p class="text-gray-500 dark:text-gray-400 text-lg">
|
||||
@if(!empty($lastSearch))
|
||||
No movies found matching "{{ $lastSearch }}".
|
||||
@else
|
||||
No movies found in the database.
|
||||
@endif
|
||||
</p>
|
||||
<a href="{{ url('admin/movie-add') }}" class="mt-4 inline-block px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700">
|
||||
<i class="fa fa-plus mr-2"></i>Add Your First Movie
|
||||
</a>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@@ -52,6 +52,21 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Movies -->
|
||||
<div class="mb-4">
|
||||
<button type="button" class="flex items-center justify-between w-full text-left text-gray-300 dark:text-gray-400 hover:text-white dark:hover:text-white transition" onclick="toggleAdminSubmenu('movies-menu')">
|
||||
<div class="flex items-center space-x-3">
|
||||
<i class="fas fa-film"></i>
|
||||
<span>Movies</span>
|
||||
</div>
|
||||
<i class="fas fa-chevron-down text-sm transform transition-transform" id="movies-menu-icon"></i>
|
||||
</button>
|
||||
<div id="movies-menu" class="hidden mt-2 ml-6 space-y-1">
|
||||
<a href="{{ url('/admin/movie-list') }}" class="block py-2 px-3 text-gray-400 dark:text-gray-500 hover:text-white dark:hover:text-white hover:bg-gray-800 dark:hover:bg-gray-800 rounded transition">Movie List</a>
|
||||
<a href="{{ url('/admin/movie-add') }}" class="block py-2 px-3 text-gray-400 dark:text-gray-500 hover:text-white dark:hover:text-white hover:bg-gray-800 dark:hover:bg-gray-800 rounded transition">Add Movie</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Blacklist -->
|
||||
<div class="mb-4">
|
||||
<button type="button" class="flex items-center justify-between w-full text-left text-gray-300 dark:text-gray-400 hover:text-white dark:hover:text-white transition" onclick="toggleAdminSubmenu('blacklist-menu')">
|
||||
|
||||
Reference in New Issue
Block a user