package templates import ( "fmt" "mal/internal/db" "mal/web/shared/layout" ) templ AdminPage(users []database.User) { @layout.Layout("mal - admin", true) {

Admin Panel

Add New User

Users

@AdminUsersList(users)
} } templ AdminUsersList(users []database.User) {
for _, user := range users {
{ user.Username }
ID: { user.ID }
Created: { user.CreatedAt.Format("2006-01-02") }
View
}
} templ AdminImpersonatePage(user database.User) { @layout.Layout("mal - admin - user view", true) {

Viewing User

{ user.Username }

← Back to Admin

Watchlist

View user's anime watchlist

Continue Watching

View user's watch progress

Read-only mode: You are viewing this user's data. Changes cannot be made from this view.
} } templ AdminUserWatchlist(entries []database.GetUserWatchListRow) { @layout.Layout("mal - admin - watchlist", true) {

User Watchlist

← Back to Admin
if len(entries) == 0 {
No watchlist entries
} else {
for _, entry := range entries {
if entry.ImageUrl != "" { { } else {
No image
}
{ entry.TitleOriginal }
Status: { entry.Status }
if entry.CurrentEpisode.Valid {
Episode: { fmt.Sprintf("%d", entry.CurrentEpisode.Int64) }
}
}
}
Read-only mode: You are viewing this user's data. Changes cannot be made from this view.
} } templ AdminUserContinueWatching(entries []database.GetContinueWatchingEntriesRow) { @layout.Layout("mal - admin - continue watching", true) {

Continue Watching

← Back to Admin
if len(entries) == 0 {
No continue watching entries
} else {
for _, entry := range entries {
if entry.ImageUrl != "" { { } else {
No image
}
{ entry.TitleOriginal }
if entry.CurrentEpisode.Valid {
Episode: { fmt.Sprintf("%d", entry.CurrentEpisode.Int64) }
} if entry.CurrentTimeSeconds > 0 {
Time: { fmt.Sprintf("%.0fs", entry.CurrentTimeSeconds) }
}
}
}
Read-only mode: You are viewing this user's data. Changes cannot be made from this view.
} }