lens @ f9f627e179b40466cf219cf87793d783611b407e

 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<h1 class="title text-size-1">{%s p.Name %}</h1>
24<div class="tags are-large">
25{% for _, a := range p.Albums %}
26  <a href="/album/?albumId={%s FromUInttoString(&a.ID) %}" class="tag text-size-2">{%s a.Name %}</a>
27{% endfor %}
28</div>
29<div class="columns">
30{%= Mosaic(p.Medias, p.PreloadAttr()) %}
31</div>
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 %}