mirror of
https://git.maid.zone/stuff/soundcloak.git
synced 2025-12-31 16:09:39 +05:00
29 lines
787 B
Plaintext
29 lines
787 B
Plaintext
package templates
|
|
|
|
import (
|
|
"github.com/maid-zone/soundcloak/lib/sc"
|
|
"net/url"
|
|
"strconv"
|
|
"strings"
|
|
)
|
|
|
|
templ SearchPlaylists(p *sc.Paginated[*sc.Playlist]) {
|
|
<span>Found { strconv.FormatInt(p.Total, 10) } playlists</span>
|
|
<br/>
|
|
<br/>
|
|
for _, playlist := range p.Collection {
|
|
<a class="listing" href={ templ.URL("/" + playlist.Author.Permalink + "/sets/" + playlist.Permalink) }>
|
|
if playlist.Artwork != "" {
|
|
<img src={ playlist.Artwork }/>
|
|
} else {
|
|
<img src="/placeholder.jpg"/>
|
|
}
|
|
<div class="meta">
|
|
<h3>{ playlist.Title }</h3>
|
|
<span>{ playlist.Author.Username }</span>
|
|
</div>
|
|
</a>
|
|
}
|
|
<a class="btn" href={ templ.URL("?type=playlists&pagination=" + url.QueryEscape(strings.Split(p.Next, "/playlists")[1])) } rel="noreferrer">More playlists</a>
|
|
}
|