aboutsummaryrefslogtreecommitdiff
path: root/templates/album.qtpl
blob: 246c77c1d193cf0d767a9c55f520bf9e6f9d3e90 (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
29
30
31
32
33
34
35
36
37
38
{% import "git.sr.ht/~gabrielgio/img/pkg/database/repository" %}

{% code
type AlbumPage struct {
	Medias   []*repository.Media
	Next     *repository.Pagination
	Settings *repository.Settings
	Albums   []*repository.Album
    Name     string
}

func (m *AlbumPage) PreloadAttr() string {
    if m.Settings.PreloadVideoMetadata {
        return "metadata"
    }
    return "none"
}
%}

{% func (p *AlbumPage) Title() %}Media{% endfunc %}

{% func (p *AlbumPage) Content() %}
<section class="section">
    <h1 class="title text-size-1">{%s p.Name %}</h1>
    <div class="tags are-large">
    {% for _, a := range p.Albums %}
      <a href="/album?albumId={%s FromUInttoString(&a.ID) %}" class="tag text-size-2">{%s a.Name %}</a>
    {% endfor %}
    </div>
</section>
{%= Mosaic(p.Medias, p.PreloadAttr()) %}
<div>
    <a href="/album?albumId={%s FromUInttoString(p.Next.AlbumID) %}&page={%d p.Next.Page %}" class="button is-pulled-right">next</a>
</div>
{% endfunc %}

{% func (p *AlbumPage) Script() %}
{% endfunc %}