From 34ee983becfa088d0c39c4f0d9b35f038b351a78 Mon Sep 17 00:00:00 2001 From: Developer Date: Sat, 27 Jun 2026 02:47:40 +0200 Subject: feat: add cinema module for browsing movies from hncrawler DB - Add 'cinema' database connection (hncrawler DB) to config/database.php - Create CinemaController with cinema(), show(), search() methods - Add /cinema, /cinema/movie/{imdb_id}, /cinema/search routes - Create cinema.blade.php (grid listing with posters, ratings, pagination) - Create cinema-show.blade.php (detail page with cast, genres, synopsis) - Add Cinema link to navbar - Update page title logic for cinema routes --- resources/views/cinema.blade.php | 174 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 174 insertions(+) create mode 100644 resources/views/cinema.blade.php (limited to 'resources/views/cinema.blade.php') diff --git a/resources/views/cinema.blade.php b/resources/views/cinema.blade.php new file mode 100644 index 0000000..baa0802 --- /dev/null +++ b/resources/views/cinema.blade.php @@ -0,0 +1,174 @@ +@extends('layouts.app') + +@section('styles') +@include ('layouts.footer-style') + +html { + height: inherit; +} + +.movie-grid { + display: flex; + flex-wrap: wrap; + gap: 20px; + margin-top: 20px; +} + +.movie-card { + flex: 1 1 280px; + min-width: 250px; + max-width: 320px; +} + +.movie-card .poster { + width: 100%; + aspect-ratio: 2 / 3; + object-fit: cover; + background-color: #333; + border-radius: 4px 4px 0 0; +} + +.movie-card .year { + color: #868e96; + font-size: 0.85rem; +} + +.movie-card .rating { + font-size: 0.9rem; + color: #868e96; +} + +.movie-card .synopsis { + font-size: 0.875rem; + color: #6c757d; + display: -webkit-box; + -webkit-line-clamp: 4; + -webkit-box-orient: vertical; + overflow: hidden; +} + +.movie-card h1 { + font-size: 1rem; + padding: 10px 12px 4px; + margin: 0; +} + +.movie-card h1 a { + color: inherit; + text-decoration: none; +} + +.movie-card h1 a:hover { + text-decoration: underline; +} + +.movie-card .card-body { + padding: 0 12px 12px; +} + +.no-poster { + display: flex; + align-items: center; + justify-content: center; + width: 100%; + aspect-ratio: 2 / 3; + background-color: #495057; + color: #adb5bd; + font-size: 3rem; + border-radius: 4px 4px 0 0; +} + +.permalink:hover { + text-decoration: none; +} + +@endsection + +@section('content') +
+
+ +
+

+ @if ( isset($search_query) && $search_query != '' ) + Movies matching "{{ $search_query }}" + @if ( "1" != $movies->currentPage() ) + (Page {{ $movies->currentPage() }}) + @endif + @else + Movies + @if ( "1" != $movies->currentPage() ) + (Page {{ $movies->currentPage() }}) + @endif + @endif +

+
+

+ @if ( isset($search_query) && $search_query != '' ) + Found {{ $count }} movies matching "{{ $search_query }}". + @else + Browse {{ number_format($count) }} movies from the database, ranked by rating and popularity. + @endif +

+
+ + +
+
+
+ + @if ( 0 != $movies->count() ) +
+ @foreach( $movies as $movie) +
+ + @if ( ! is_null($movie->poster_url) ) + {{ $movie->primary_title }} poster + @else +
🎬
+ @endif +
+

+ + {{ $movie->primary_title }} + +

+
+
+ @if ( ! is_null($movie->start_year) ) + {{ $movie->start_year }} + @endif + @if ( ! is_null($movie->runtime_minutes) ) + @if ( ! is_null($movie->start_year) ) + · + @endif + {{ $movie->runtime_minutes }} min + @endif +
+
+ @if ( ! is_null($movie->average_rating) ) + ⭐ {{ number_format($movie->average_rating, 1) }} + @if ( ! is_null($movie->num_votes) ) + ({{ number_format($movie->num_votes) }} votes) + @endif + @endif +
+ @if ( ! empty($movie->synopsis) ) +

+ {{ strip_tags($movie->synopsis) }} +

+ @endif +
+
+ @endforeach +
+ +
+ {{ $movies->appends(Request::input())->links() }} + @endif +
+@endsection + +@section('footer') + @include ('layouts.footer') +@endsection -- cgit v1.2.3