Skip to content

Commit 0a5f416

Browse files
committed
Improve movie page (move details to left below image, movie set next to it)
1 parent 8df78e7 commit 0a5f416

5 files changed

Lines changed: 44 additions & 24 deletions

File tree

src/main/resources/assets/style/main.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,10 @@ html {
168168
}
169169
}
170170

171+
#movie-set .card {
172+
flex: 0 0 200px;
173+
}
174+
171175
#nav-searchbar {
172176
width: 100%;
173177
max-width: 700px;

src/main/resources/lang/messages+intl-icu.de.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ movies:
140140
runtime: "Filmlänge"
141141
playCount: "Anzahl gesehen"
142142
lastPlayed: "Zuletzt gesehen"
143+
details:
144+
title: "Details"
143145

144146
views:
145147
views: "{count} mal gesehen"

src/main/resources/lang/messages+intl-icu.en.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ movies:
138138
runtime: "Runtime"
139139
playCount: "Play count"
140140
lastPlayed: "Last played"
141+
details:
142+
title: "Details"
141143

142144
views:
143145
views: >-

templates/components/movie-card-small.twig

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@
1414

1515
<small class="d-block text-body-secondary"><i class="fa-solid fa-calendar"></i> {{ movie.year }}</small>
1616

17-
{% set itemWatchStats = watchStatsProvider.getItemStats(movie) %}
18-
{% if itemWatchStats %}
19-
<small class="d-block text-body-secondary"><i class="fa-regular fa-eye"></i> {{ "views.views"|trans({"%count%": itemWatchStats.count}) }}</small>
20-
<small class="d-block text-body-secondary"><i class="fa-regular fa-eye"></i> {{ itemWatchStats.lastWatched|format_datetime }}</small>
17+
{% if showWatchStats ?? true %}
18+
{% set itemWatchStats = watchStatsProvider.getItemStats(movie) %}
19+
{% if itemWatchStats %}
20+
<small class="d-block text-body-secondary"><i class="fa-regular fa-eye"></i> {{ "views.views"|trans({"%count%": itemWatchStats.count}) }}</small>
21+
<small class="d-block text-body-secondary"><i class="fa-regular fa-eye"></i> {{ itemWatchStats.lastWatched|format_datetime }}</small>
22+
{% endif %}
2123
{% endif %}
2224
</div>
2325
</div>

templates/movie.twig

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,6 @@
1616
{% if movie.tagline is not null %}
1717
<small class="d-block text-body-secondary fst-italic my-2">{{ movie.tagline }}</small>
1818
{% endif %}
19-
20-
<div class="my-2">
21-
{% if movie.tmdbId %}
22-
<a href="https://www.themoviedb.org/movie/{{ movie.tmdbId }}" class="badge text-bg-secondary" target="_blank">TMDB</a>
23-
{% endif %}
24-
{% if movie.tvdbId %}
25-
<a href="https://www.thetvdb.com/dereferrer/movie/{{ movie.tvdbId }}" class="badge text-bg-secondary" target="_blank">TVDB</a>
26-
{% endif %}
27-
</div>
28-
29-
{% if movie.runtime is not null %}
30-
<small class="d-block text-body-secondary"><i class="fa-solid fa-clock"></i> {{ "runtime"|trans({"%runtime%": movie.runtime}) }}</small>
31-
{% endif %}
32-
33-
<small class="d-block text-body-secondary"><i class="fa-solid fa-calendar"></i> {{ movie.year }}</small>
3419
</div>
3520

3621
{% include "components/view-buttons.twig" with {"type": "movie", "item": movie} only %}
@@ -44,11 +29,36 @@
4429
</div>
4530
</div>
4631

47-
{% if movie.movieSet %}
48-
<div class="mt-4">
49-
<h2>{{ movie.movieSet.title }}</h2>
32+
<div class="row mt-3">
33+
<div class="col-lg-3 col-12">
34+
<h3 class="mb-3">{{ "movies.details.title"|trans }}</h3>
5035

51-
{% include "components/movie-list-small.twig" with {"movies": movie.movieSet.movies} %}
36+
<div class="vstack gap-2 mx-auto">
37+
{% if movie.tmdbId %}
38+
<a href="https://www.themoviedb.org/movie/{{ movie.tmdbId }}" class="badge text-bg-secondary" target="_blank">TMDB</a>
39+
{% endif %}
40+
{% if movie.tvdbId %}
41+
<a href="https://www.thetvdb.com/dereferrer/movie/{{ movie.tvdbId }}" class="badge text-bg-secondary" target="_blank">TVDB</a>
42+
{% endif %}
43+
44+
{% if movie.runtime is not null %}
45+
<small class="d-block text-body-secondary"><i class="fa-solid fa-clock"></i> {{ "runtime"|trans({"%runtime%": movie.runtime}) }}</small>
46+
{% endif %}
47+
48+
<small class="d-block text-body-secondary"><i class="fa-solid fa-calendar"></i> {{ movie.year }}</small>
49+
</div>
5250
</div>
53-
{% endif %}
51+
52+
<div class="col-lg-9 col-12">
53+
{% if movie.movieSet %}
54+
<h3 class="mb-3">{{ movie.movieSet.title }}</h3>
55+
56+
<div class="overflow-x-auto d-flex flex-nowrap gap-3 pb-3" id="movie-set">
57+
{% for thisMovie in movie.movieSet.movies %}
58+
{% include "components/movie-card-small.twig" with {"movie": thisMovie, "showWatchStats": false} %}
59+
{% endfor %}
60+
</div>
61+
{% endif %}
62+
</div>
63+
</div>
5464
{% endblock %}

0 commit comments

Comments
 (0)