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