feat: new Discover section shows watch providers for results
This commit is contained in:
17
templates/discover/browse.html.twig
Normal file
17
templates/discover/browse.html.twig
Normal file
@@ -0,0 +1,17 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
{% block title %}Discover {{ media_type|capitalize }} — {{ parent() }}{% endblock %}
|
||||
{% block h2 %}Discover {{ media_type|capitalize }}{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<div class="p-4 flex flex-col gap-4">
|
||||
{% for genreTitle, genreId in genres %}
|
||||
<twig:Turbo:Frame id="genre_{{ media_type }}_{{ genreId }}" src="{{ path('api.tmdb.genre', {
|
||||
mediaType: media_type,
|
||||
genreId: genreId,
|
||||
block: 'genre_results',
|
||||
target: 'genre_' ~ media_type~ '_' ~ genreId
|
||||
}) }}">
|
||||
</twig:Turbo:Frame>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
11
templates/discover/browse_genre.html.twig
Normal file
11
templates/discover/browse_genre.html.twig
Normal file
@@ -0,0 +1,11 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
{% block title %}Discover {{ genre }} {{ media_type|capitalize }} — {{ parent() }}{% endblock %}
|
||||
{% block h2 %}Discover {{ genre }} {{ media_type|capitalize }}{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<div class="p-4 flex flex-col gap-4">
|
||||
<twig:Card title="{{ genre }}" class="w-full">
|
||||
<twig:PosterContainer tease="'false'" genreId="{{ genre_id }}" mediaType="{{ media_type }}" media="{{ media }}"></twig:PosterContainer>
|
||||
</twig:Card>
|
||||
</div>
|
||||
{% endblock %}
|
||||
25
templates/discover/fragments.html.twig
Normal file
25
templates/discover/fragments.html.twig
Normal file
@@ -0,0 +1,25 @@
|
||||
{% block watch_providers %}
|
||||
{% if result.providers %}
|
||||
<turbo-stream action="replace" targets="#{{ target }}">
|
||||
<template>
|
||||
<div class="flex flex-row justify-start items-end gap-1 mt-2">
|
||||
{% for provider in result.providers %}
|
||||
<a href="#">
|
||||
<img class="w-10 h-10 rounded-lg" src="{{ provider.logo }}" alt="{{ provider.name }}" title="{{ provider.name }}" />
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</template>
|
||||
</turbo-stream>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block genre_results %}
|
||||
<turbo-stream action="replace" targets="#{{ target }}">
|
||||
<template>
|
||||
<twig:Card title="{{ result.result.genre }}" class="w-full">
|
||||
<twig:PosterContainer genreId="{{ result.result.genre_id }}" mediaType="{{ result.result.media_type }}" media="{{ result.result.media }}"></twig:PosterContainer>
|
||||
</twig:Card>
|
||||
</template>
|
||||
</turbo-stream>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,17 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Discover — {{ parent() }}{% endblock %}
|
||||
|
||||
{% block h2 %}Discover New Media{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<div class="p-4 flex flex-col gap-4">
|
||||
<twig:Card title="Popular Movies" class="w-full">
|
||||
<twig:PosterContainer mediaType="movies" media="{{ movies }}" />
|
||||
</twig:Card>
|
||||
|
||||
<twig:Card title="Popular Shows" class="w-full">
|
||||
<twig:PosterContainer mediaType="tvshows" media="{{ shows }}" />
|
||||
</twig:Card>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user