2024-03-04 14:59:47 +01:00
|
|
|
package views
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"github.com/rramiachraf/dumb/data"
|
|
|
|
)
|
|
|
|
|
|
|
|
templ AlbumPage(a data.Album) {
|
|
|
|
@layout(fmt.Sprintf("%s - %s", a.Artist, a.Name)) {
|
2024-06-09 21:29:17 +01:00
|
|
|
<div id="container" class="trio-split">
|
2024-03-04 14:59:47 +01:00
|
|
|
<div id="metadata">
|
2024-05-01 22:22:54 +01:00
|
|
|
<img id="album-artwork" src={ data.ExtractImageURL(a.Image) } alt="Album image"/>
|
2024-05-02 13:09:09 +01:00
|
|
|
<div id="metadata-info">
|
2024-06-08 15:16:13 +02:00
|
|
|
<a href={ templ.URL(a.Artist.URL) } id="album-artist"><h2>{ a.Artist.Name }</h2></a>
|
2024-05-02 13:09:09 +01:00
|
|
|
<h1>{ a.Name }</h1>
|
|
|
|
</div>
|
2024-03-04 14:59:47 +01:00
|
|
|
</div>
|
|
|
|
<div id="album-tracklist">
|
|
|
|
for _, t := range a.Tracks {
|
2024-05-02 13:09:09 +01:00
|
|
|
<a href={ templ.URL(t.Url) } id="album-single-track">
|
|
|
|
<small>{ fmt.Sprintf("%d", t.Number) }</small>
|
2024-03-04 14:59:47 +01:00
|
|
|
<p>{ t.Title }</p>
|
|
|
|
</a>
|
|
|
|
}
|
|
|
|
</div>
|
2024-05-11 23:56:55 -06:00
|
|
|
if a.About[0] != "" {
|
|
|
|
<div id="info">
|
2024-06-09 21:29:17 +01:00
|
|
|
<div id="description" dir="auto">
|
2024-05-11 23:56:55 -06:00
|
|
|
<h1 id="title">About</h1>
|
2024-06-09 21:29:17 +01:00
|
|
|
<p class="hidden" id="full">{ a.About[0] }</p>
|
2024-05-11 23:56:55 -06:00
|
|
|
<p id="summary">{ a.About[1] }</p>
|
|
|
|
</div>
|
2024-03-04 14:59:47 +01:00
|
|
|
</div>
|
2024-05-11 23:56:55 -06:00
|
|
|
}
|
2024-03-04 14:59:47 +01:00
|
|
|
</div>
|
|
|
|
}
|
|
|
|
}
|