1{% import "git.sr.ht/~gabrielgio/img/pkg/database/repository" %}
2
3{% code
4type MediaPage struct {
5 Medias []*repository.Media
6 Next *repository.Pagination
7 Settings *repository.Settings
8}
9
10func (m *MediaPage) PreloadAttr() string {
11 if m.Settings.PreloadVideoMetadata {
12 return "metadata"
13 }
14 return "none"
15}
16%}
17
18{% func (p *MediaPage) Title() %}Media{% endfunc %}
19
20{% func (p *MediaPage) Content() %}
21{%= Mosaic(p.Medias, p.PreloadAttr()) %}
22<div>
23 <a href="/media?page={%d p.Next.Page %}" class="button is-pulled-right">next</a>
24</div>
25{% endfunc %}
26
27{% func (p *MediaPage) Script() %}
28{% endfunc %}