lens @ 417041797674319485bea96cb38489670ff3b2ef

 1{% import "git.sr.ht/~gabrielgio/img/pkg/database/repository" %}
 2
 3{% code
 4type AlbumPage struct {
 5	Medias   []*repository.Media
 6	Next     *repository.Pagination
 7	Settings *repository.Settings
 8	Albums   []*repository.Album
 9    Name     string
10}
11
12func (m *AlbumPage) PreloadAttr() string {
13    if m.Settings.PreloadVideoMetadata {
14        return "metadata"
15    }
16    return "none"
17}
18%}
19
20{% func (p *AlbumPage) Title() %}Media{% endfunc %}
21
22{% func (p *AlbumPage) Content() %}
23<section class="section">
24    <h1 class="title text-size-1">{%s p.Name %}</h1>
25    <div class="tags are-large">
26    {% for _, a := range p.Albums %}
27      <a href="/album?albumId={%s FromUInttoString(&a.ID) %}" class="tag text-size-2">{%s a.Name %}</a>
28    {% endfor %}
29    </div>
30</section>
31{%= Mosaic(p.Medias, p.PreloadAttr()) %}
32<div>
33    <a href="/album?albumId={%s FromUInttoString(p.Next.AlbumID) %}&page={%d p.Next.Page %}" class="button is-pulled-right">next</a>
34</div>
35{% endfunc %}
36
37{% func (p *AlbumPage) Script() %}
38{% endfunc %}