From ae10e121875982d6956d6bff453544cc59a75616 Mon Sep 17 00:00:00 2001 From: Gabriel Arakaki Giovanini Date: Tue, 12 Sep 2023 18:37:30 +0200 Subject: feat: Add admin control Now only admins can access settings. --- templates/album.qtpl | 4 ++-- templates/base.qtpl | 12 +++++++----- templates/media.qtpl | 2 +- templates/mosaic.qtpl | 6 +++--- templates/settings.qtpl | 2 +- templates/user.qtpl | 4 ++-- 6 files changed, 16 insertions(+), 14 deletions(-) (limited to 'templates') diff --git a/templates/album.qtpl b/templates/album.qtpl index 835db57..58fc499 100644 --- a/templates/album.qtpl +++ b/templates/album.qtpl @@ -23,14 +23,14 @@ func (m *AlbumPage) PreloadAttr() string {

{%s p.Name %}

{% for _, a := range p.Albums %} - {%s a.Name %} + {%s a.Name %} {% endfor %}
{%= Mosaic(p.Medias, p.PreloadAttr()) %}
- next + next
{% endfunc %} diff --git a/templates/base.qtpl b/templates/base.qtpl index a80803a..30b084e 100644 --- a/templates/base.qtpl +++ b/templates/base.qtpl @@ -21,7 +21,7 @@ Page { Page prints a page implementing Page interface. -{% func PageTemplate(p Page) %} +{% func PageTemplate(p Page, isAdmin bool) %} @@ -33,18 +33,20 @@ Page prints a page implementing Page interface.
diff --git a/templates/media.qtpl b/templates/media.qtpl index 4251deb..737d03d 100644 --- a/templates/media.qtpl +++ b/templates/media.qtpl @@ -22,7 +22,7 @@ func (m *MediaPage) PreloadAttr() string { {%= Mosaic(p.Medias, p.PreloadAttr()) %}
- next + next
{% endfunc %} diff --git a/templates/mosaic.qtpl b/templates/mosaic.qtpl index 3e6ccf8..18dbcba 100644 --- a/templates/mosaic.qtpl +++ b/templates/mosaic.qtpl @@ -8,12 +8,12 @@ {% for _, media := range c %}
{% if media.IsVideo() %} -
diff --git a/templates/settings.qtpl b/templates/settings.qtpl index 4439c77..b720a88 100644 --- a/templates/settings.qtpl +++ b/templates/settings.qtpl @@ -58,7 +58,7 @@ type SettingsPage struct { {% endfor %}
- create + create
{% endfunc %} diff --git a/templates/user.qtpl b/templates/user.qtpl index 6ec783d..6fc3ce6 100644 --- a/templates/user.qtpl +++ b/templates/user.qtpl @@ -13,7 +13,7 @@ type UserPage struct { {% func (p *UserPage) Content() %}

Initial Setup

-
+ {% if p.ID != nil %} {% endif %} @@ -41,7 +41,7 @@ type UserPage struct {
- +
-- cgit v1.2.3