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

Merge branch '12-improve-layout-add-artists-playlists-images' into 'master'

Resolve "Improve layout, add artists/playlists images"

Closes #12

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