From cfa7947020b18547fddd966e072cda0740235d21 Mon Sep 17 00:00:00 2001 From: Harvey Tindall Date: Sat, 20 Mar 2021 19:23:54 +0000 Subject: [PATCH] wrap items in accounts header fixes mobile layout. --- css/base.css | 1 + html/admin.html | 20 ++++++++++---------- storage.go | 6 ++++++ 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/css/base.css b/css/base.css index 77c19d8..eeae31f 100644 --- a/css/base.css +++ b/css/base.css @@ -448,4 +448,5 @@ a:hover:not(.lang-link):not(.\~urge), a:active:not(.lang-link):not(.\~urge) { .search { max-width: 15rem; + min-width: 10rem; } diff --git a/html/admin.html b/html/admin.html index 51fe119..84f526b 100644 --- a/html/admin.html +++ b/html/admin.html @@ -396,17 +396,17 @@
-
-
- {{ .strings.accounts }} - +
+
+ {{ .strings.accounts }} +
-
- {{ .quantityStrings.addUser.Singular }} - {{ .strings.announce }} - {{ .strings.modifySettings }} - {{ .strings.extendExpiry }} - {{ .quantityStrings.deleteUser.Singular }} +
+ {{ .quantityStrings.addUser.Singular }} + {{ .strings.announce }} + {{ .strings.modifySettings }} + {{ .strings.extendExpiry }} + {{ .quantityStrings.deleteUser.Singular }}
diff --git a/storage.go b/storage.go index 1d4dd51..dc851cb 100644 --- a/storage.go +++ b/storage.go @@ -8,6 +8,7 @@ import ( "path/filepath" "strconv" "strings" + "sync" "time" "github.com/hrfee/jfa-go/mediabrowser" @@ -25,6 +26,7 @@ type Storage struct { policy mediabrowser.Policy configuration mediabrowser.Configuration lang Lang + invitesLock sync.Mutex } type customEmails struct { @@ -402,10 +404,14 @@ func (st *Storage) loadLangEmail(filesystems ...fs.FS) error { type Invites map[string]Invite func (st *Storage) loadInvites() error { + st.invitesLock.Lock() + defer st.invitesLock.Unlock() return loadJSON(st.invite_path, &st.invites) } func (st *Storage) storeInvites() error { + st.invitesLock.Lock() + defer st.invitesLock.Unlock() return storeJSON(st.invite_path, st.invites) }