refactor: remove admin panel and multi-user features

This commit is contained in:
2026-04-25 21:13:57 +02:00
parent e1b3825da3
commit 6af90a740d
5 changed files with 0 additions and 520 deletions

View File

@@ -1,22 +0,0 @@
package admin
import (
"mal/internal/db"
)
const AdminEmail = "mikkelelvers@outlook.com"
func IsAdmin(user *database.User) bool {
if user == nil {
return false
}
return user.Username == AdminEmail
}
func IsAdminFromContext(ctx interface {
Value(key interface{}) interface{}
}) bool {
const userKey = "mal:user"
user, _ := ctx.Value(userKey).(*database.User)
return IsAdmin(user)
}

View File

@@ -2,7 +2,6 @@ package layout
import (
"mal/web/components/icons"
"mal/web/shared/admin"
)
templ Layout(title string, showHeader bool) {
@@ -63,14 +62,6 @@ templ Layout(title string, showHeader bool) {
>
Watchlist
</a>
if admin.IsAdminFromContext(ctx) {
<a
class="text-(--accent) no-underline hover:text-(--accent) hover:no-underline"
href="/admin"
>
Admin
</a>
}
</div>
</div>
<div