Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
spotify
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
web
spotify
Commits
77a13566
Commit
77a13566
authored
3 years ago
by
Benoît Harrault
Browse files
Options
Downloads
Patches
Plain Diff
Improve layout, add artists/playlists images
parent
f11f8eef
No related branches found
No related tags found
1 merge request
!10
Resolve "Improve layout, add artists/playlists images"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
public/index.php
+2
-2
2 additions, 2 deletions
public/index.php
template.php
+8
-2
8 additions, 2 deletions
template.php
with
10 additions
and
4 deletions
public/index.php
+
2
−
2
View file @
77a13566
...
...
@@ -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'
;
This diff is collapsed.
Click to expand it.
template.php
+
8
−
2
View file @
77a13566
...
...
@@ -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>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment