From 7ff83424592cd5a3c58fe2e6d7e67aeef5144caf Mon Sep 17 00:00:00 2001 From: horus Date: Sat, 27 Jun 2026 05:40:45 +0200 Subject: merge --- resources/views/cinema.blade.php | 194 ++++++++++++++++++++++++++++++++ resources/views/cinema_show.blade.php | 199 +++++++++++++++++++++++++++++++++ resources/views/genre_movies.blade.php | 156 ++++++++++++++++++++++++++ resources/views/genres.blade.php | 42 +++++++ resources/views/layouts/app.blade.php | 29 ++++- 5 files changed, 619 insertions(+), 1 deletion(-) create mode 100644 resources/views/cinema.blade.php create mode 100644 resources/views/cinema_show.blade.php create mode 100644 resources/views/genre_movies.blade.php create mode 100644 resources/views/genres.blade.php (limited to 'resources/views') diff --git a/resources/views/cinema.blade.php b/resources/views/cinema.blade.php new file mode 100644 index 0000000..bc08fc8 --- /dev/null +++ b/resources/views/cinema.blade.php @@ -0,0 +1,194 @@ +@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, mentioned on Hacker News, ranked by rating or popularity. + @endif +

+
+ + +
+
+ Sort by: + @foreach ([ + ['ref_count', 'Hacker News Mentions'], + ['score', 'Rating'], + ['num_votes', 'Number of Votes'], + ['num_accolades', 'Accolades'], + ['start_year', 'Release Date'], + ] as [$key, $label]) + @if ( (isset($order) ? $order : 'ref_count') == $key ) + @if ( (isset($direction) ? $direction : 'desc') == 'desc' ) + {{ $label }} ▲ + @else + {{ $label }} ▼ + @endif + @else + {{ $label }} + @endif + @endforeach +
+
+
+ + @if ( 0 != $movies->count() ) +
+ @foreach( $movies as $movie) +
+ + @if ( ! empty($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 diff --git a/resources/views/cinema_show.blade.php b/resources/views/cinema_show.blade.php new file mode 100644 index 0000000..d8ff794 --- /dev/null +++ b/resources/views/cinema_show.blade.php @@ -0,0 +1,199 @@ +@extends('layouts.app') + +@section('styles') +@include ('layouts.footer-style') + +.poster-detail { + width: 100%; + max-width: 350px; + border-radius: 4px; +} + +.year { + color: #868e96; +} + +.rating { + color: #868e96; + font-size: 0.9rem; +} + +.movie-credits { + columns: 2; + column-gap: 20px; +} + +.hn-comment { + font-size: 0.875rem; + color: #868e96; + display: -webkit-box; + -webkit-line-clamp: 1; + -webkit-box-orient: vertical; + overflow: hidden; + text-overflow: ellipsis; +} + +@media (max-width: 768px) { + .movie-credits { + columns: 1; + } + .poster-detail { + max-width: 200px; + margin: 0 auto; + } +} + +@endsection + +@section('content') +
+
+ + @if ( ! is_null($movie) ) +
+

+ ← All Movies +

+
+
+
+ @if ( ! empty($movie->poster_url) ) + {{ $movie->primary_title }} poster + @else +
🎬
+ @endif +
+
+

+ @if ( ! is_null($movie->wiki_article) ) + + {{ $movie->primary_title }} + + @else + {{ $movie->primary_title }} + @endif + @if ( ! is_null($movie->original_title) && $movie->original_title != $movie->primary_title ) + ({{ $movie->original_title }}) + @endif +

+
+ @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->title_type) ) + @if ( ! is_null($movie->start_year) || ! is_null($movie->runtime_minutes) ) + · + @endif + {{ $movie->title_type }} + @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($genres) ) +
+ @foreach( $genres as $genre ) + {{ $genre }} + @endforeach +
+ @endif + + @if ( ! empty($movie->synopsis) ) +

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

+ @endif + + @if ( ! empty($directors) ) +
+

Directed by

+
+ @foreach( $directors as $person ) +
{{ $person->name }}
+ @endforeach +
+
+ @endif + + @if ( ! empty($actors) ) +
+

Starring

+
+ @foreach( $actors as $person ) +
{{ $person->name }}
+ @endforeach +
+
+ @endif + + @if ( ! is_null($movie->imdb_id) || ! is_null($movie->wiki_article) ) +
+ @if ( ! is_null($movie->wiki_article) ) + View on Wikipedia + @endif + @if ( ! is_null($movie->imdb_id) ) + View on IMDb + @endif +
+ @endif + + @if ( ! empty($hnStories) ) +
+

Mentions on Hacker News

+ +
+ @endif +
+
+
+
+ @else +
+

Movie Not Found

+
+

The requested movie could not be found.

+ Back to Movies +
+
+ @endif + +
+
+@endsection + +@section('footer') + @include ('layouts.footer') +@endsection diff --git a/resources/views/genre_movies.blade.php b/resources/views/genre_movies.blade.php new file mode 100644 index 0000000..a8a4585 --- /dev/null +++ b/resources/views/genre_movies.blade.php @@ -0,0 +1,156 @@ +@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; +} + +@endsection + +@section('content') +
+
+ +
+

+ Genre: {{ $genre_name }} + @if ( "1" != $movies->currentPage() ) + (Page {{ $movies->currentPage() }}) + @endif +

+
+

+ Browse {{ number_format($count) }} movies in the {{ $genre_name }} genre. +

+ All Genres +
+
+ + @if ( 0 != $movies->count() ) +
+ @foreach( $movies as $movie) +
+ + @if ( ! empty($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 diff --git a/resources/views/genres.blade.php b/resources/views/genres.blade.php new file mode 100644 index 0000000..1fff8d2 --- /dev/null +++ b/resources/views/genres.blade.php @@ -0,0 +1,42 @@ +@extends('layouts.app') + +@section('styles') +@include ('layouts.footer-style') +html { + height: inherit; +} +@endsection + +@section('content') + +
+ +
+
+

+ Genres +

+
+

+ Browse movies by genre. Each genre shows all movies that have been categorized. +

+
+
+
+ +
+
+ @foreach ($genres as $genre) + @if ( "" != $genre->name ) + {{ $genre->name }} ({{ $genre->count }} Movies) + @endif + @endforeach +
+
+ +
+@endsection + +@section('footer') + @include ('layouts.footer') +@endsection diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index 5179be1..e3fe561 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -11,7 +11,9 @@ {{ config('app.name', 'Laravel') }} - @if( ("index" != Request::route()->getName()) && ("show" != Request::route()->getName()) ) + @if( str_starts_with(Request::route()->getName(), 'cinema') ) + - Movies + @elseif( ("index" != Request::route()->getName()) && ("show" != Request::route()->getName()) ) - {{ ucwords(Request::route()->getName()) }} Articles @elseif ( "show" == Request::route()->getName() ) - {{ ucwords( $page_title) }} @@ -70,6 +72,22 @@ <style> @yield('styles') + .nav-bar-divider { + display: inline; + padding: 0 8px; + color: #fff; + opacity: 0.5; + user-select: none; + } + .btn-outline-secondary { + color: #868e96; + border-color: #868e96; + } + .btn-outline-secondary:hover { + color: #fff; + background-color: #868e96; + border-color: #868e96; + } </style> @if ( "new" == Request::route()->getName() || "popular" == Request::route()->getName() ) {!! Rumenx\Feed\Feed::link( url('feed/' . Request::route()->getName()), 'atom', 'RSS-Feed for ' . Request::route()->getName() . ' Articles'); !!} @@ -136,6 +154,15 @@ <li class="nav-item"> <a class="nav-link" href="{{ route('random') }}">{{ __('Random') }}</a> </li> + <li class="nav-item nav-bar-divider"> + <span class="nav-link" style="pointer-events: none;">|</span> + </li> + <li class="nav-item"> + <a class="nav-link" href="{{ route('cinema.index') }}">{{ __('Movies') }}</a> + </li> + <li class="nav-item"> + <a class="nav-link" href="{{ route('cinema.genres') }}">{{ __('Genres') }}</a> + </li> @else <li class="nav-item dropdown"> <a id="navbarDropdown" class="nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" v-pre> -- cgit v1.2.3