Skip to content
Snippets Groups Projects
Commit 77a13566 authored by Benoît Harrault's avatar Benoît Harrault
Browse files

Improve layout, add artists/playlists images

parent f11f8eef
No related branches found
No related tags found
1 merge request!10Resolve "Improve layout, add artists/playlists images"
......@@ -165,8 +165,8 @@ if ($generatePlaylistFromPlaylist) {
$playlistLink = '<a href="'.$newPlaylist->external_urls->spotify.'">'.$newPlaylistName.'</a>';
$templateData['infos'][] = 'Ok created new playlist with '.count($pickedTrackIds).' tracks: '.$playlistLink;
} else {
$templateData['topArtists'] = $api->getMyTop('artists', ['limit' => 16, 'time_range' => 'short_term'])->items;
$templateData['playlists'] = $api->getUserPlaylists($user->id, ['limit' => 30])->items;
$templateData['topArtists'] = $api->getMyTop('artists', ['limit' => 24, 'time_range' => 'short_term'])->items;
$templateData['playlists'] = $api->getUserPlaylists($user->id, ['limit' => 24])->items;
}
require '../template.php';
......@@ -14,7 +14,7 @@
<body class="container mt-2">
<div class="row">
<div class="col-3">
<div class="col-2">
<div class="card">
<?php if (count($templateData['user']->images)) { ?>
......@@ -32,7 +32,7 @@
</div>
</div>
<div class="col-9">
<div class="col-10">
<?php if (count($templateData['errors'])) { ?>
<?php foreach ($templateData['errors'] as $message) { ?>
......@@ -61,6 +61,9 @@
value="<?php echo $artist->id; ?>"
>
<label class="custom-control-label" for="check-top-artist-<?php echo $artist->id; ?>">
<?php if (count($artist->images)) { ?>
<img src="<?php echo $artist->images[count($artist->images) - 1]->url; ?>" style="max-height: 1rem;" />
<?php } ?>
<?php echo $artist->name; ?>
</label>
</div>
......@@ -103,6 +106,9 @@
value="<?php echo $playlist->id; ?>"
>
<label class="custom-control-label" for="check-playlist-<?php echo $playlist->id; ?>">
<?php if (count($playlist->images)) { ?>
<img src="<?php echo $playlist->images[count($playlist->images) - 1]->url; ?>" style="max-height: 1rem;" />
<?php } ?>
<?php echo $playlist->name; ?>
</label>
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment