dynamic style for favs
This commit is contained in:
parent
b8995d8bca
commit
a79e8f0cd6
@ -21,7 +21,7 @@
|
||||
{% set main_artist = album_liked["artists_sort"] %}
|
||||
{% set artists = album_liked["artists"] %}
|
||||
{% set album = album_liked["title"] %}
|
||||
<section class="album">
|
||||
<section class="album fav">
|
||||
<span>
|
||||
<h2>{{album}}</h2>
|
||||
by
|
||||
|
@ -1,20 +1,30 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Welcome to Frutti!{% endblock %}
|
||||
|
||||
{% extends 'base.html.twig' %} {% block title %}Welcome to Frutti!{% endblock %}
|
||||
{% block body %}
|
||||
<style>
|
||||
.example-wrapper { margin: 1em auto; font: 18px/1.5 sans-serif; }
|
||||
.example-wrapper code { background: #F5F5F5; padding: 2px 6px; }
|
||||
</style>
|
||||
|
||||
<div class="example-wrapper">
|
||||
<main>
|
||||
<h1>Welcome to Frutti!</h1>
|
||||
<p>Frutti is an application to create your own fruit record collection.</p>
|
||||
<br />
|
||||
<h2>But what is a fruit record collection? 🤔</h2>
|
||||
<p>A fruit collection is composed of albums which have a link with fruits.</p>
|
||||
<p>Frutti uses <a href="https://www.discogs.com/" title="Visit Discogs website">Discogs</a> to let you find albums of fruits.</p>
|
||||
<p>
|
||||
A fruit collection is composed of albums which have a link with fruits.
|
||||
</p>
|
||||
<p>
|
||||
Frutti uses
|
||||
<a href="https://www.discogs.com/" title="Visit Discogs website"
|
||||
>Discogs</a
|
||||
>
|
||||
to let you find albums of fruits.
|
||||
</p>
|
||||
<br />
|
||||
<h2>Start your fruit collection today!</h2>
|
||||
<p><a href="/register" title="Click to here to create an account">Create an account</a> or to <a href="/login" title="Click here to connect to an existing account">connect to an existing one</a>.</p>
|
||||
</div>
|
||||
<p>
|
||||
<a href="/register" title="Click to here to create an account"
|
||||
>Create an account</a
|
||||
>
|
||||
or to
|
||||
<a href="/login" title="Click here to connect to an existing account"
|
||||
>connect to an existing one</a
|
||||
>.
|
||||
</p>
|
||||
</main>
|
||||
{% endblock %}
|
||||
|
@ -17,7 +17,10 @@ endblock %} {% block body %}
|
||||
<div class="results">
|
||||
{% for result in results %} {% set array = result['title']|split('-') %}
|
||||
{% set artist = array[0] %} {% set album = array[1] %}
|
||||
<section class="album" id="id{{result['id']}}">
|
||||
<section
|
||||
class="album {% if result['isLiked'] == 'true' %}fav{% endif %}"
|
||||
id="id{{result['id']}}"
|
||||
>
|
||||
<span>
|
||||
<h2>{{album}}</h2>
|
||||
by
|
||||
@ -28,9 +31,16 @@ endblock %} {% block body %}
|
||||
src="{{result['cover_image']}}"
|
||||
alt="{{album ~ ' by ' ~ artist}}"
|
||||
/>
|
||||
{% if result['isLiked'] == 'true' %}
|
||||
<p>
|
||||
<b>Already fav</b>, go to
|
||||
<a href="{{url('app_favorite')}}">favorites</a>
|
||||
</p>
|
||||
{% else %}
|
||||
<button onclick="addToFavs({{result['id']}})">
|
||||
Add to favorites
|
||||
</button>
|
||||
{% endif %}
|
||||
</section>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user