diff --git a/pages/index/userroutes/userroutes.go b/pages/index/userroutes/userroutes.go index 4dea4cc8..60709854 100644 --- a/pages/index/userroutes/userroutes.go +++ b/pages/index/userroutes/userroutes.go @@ -8,9 +8,6 @@ import ( "github.com/animenotifier/notify.moe/pages/compare" "github.com/animenotifier/notify.moe/pages/notifications" "github.com/animenotifier/notify.moe/pages/profile" - "github.com/animenotifier/notify.moe/pages/profile/profilecharacters" - "github.com/animenotifier/notify.moe/pages/profile/profilequotes" - "github.com/animenotifier/notify.moe/pages/profile/profiletracks" "github.com/animenotifier/notify.moe/pages/recommended" "github.com/animenotifier/notify.moe/pages/user" ) @@ -20,19 +17,19 @@ func Register(l *layout.Layout) { // User profiles l.Page("/user", user.Get) l.Page("/user/:nick", profile.Get) - l.Page("/user/:nick/characters/liked", profilecharacters.Liked) - l.Page("/user/:nick/forum/threads", profile.GetThreadsByUser) - l.Page("/user/:nick/forum/posts", profile.GetPostsByUser) - l.Page("/user/:nick/soundtracks/added", profiletracks.Added) - l.Page("/user/:nick/soundtracks/added/from/:index", profiletracks.Added) - l.Page("/user/:nick/soundtracks/liked", profiletracks.Liked) - l.Page("/user/:nick/soundtracks/liked/from/:index", profiletracks.Liked) - l.Page("/user/:nick/quotes/added", profilequotes.Added) - l.Page("/user/:nick/quotes/added/from/:index", profilequotes.Added) - l.Page("/user/:nick/quotes/liked", profilequotes.Liked) - l.Page("/user/:nick/quotes/liked/from/:index", profilequotes.Liked) - l.Page("/user/:nick/stats", profile.GetStatsByUser) - l.Page("/user/:nick/followers", profile.GetFollowers) + // l.Page("/user/:nick/characters/liked", profilecharacters.Liked) + // l.Page("/user/:nick/forum/threads", profile.GetThreadsByUser) + // l.Page("/user/:nick/forum/posts", profile.GetPostsByUser) + // l.Page("/user/:nick/soundtracks/added", profiletracks.Added) + // l.Page("/user/:nick/soundtracks/added/from/:index", profiletracks.Added) + // l.Page("/user/:nick/soundtracks/liked", profiletracks.Liked) + // l.Page("/user/:nick/soundtracks/liked/from/:index", profiletracks.Liked) + // l.Page("/user/:nick/quotes/added", profilequotes.Added) + // l.Page("/user/:nick/quotes/added/from/:index", profilequotes.Added) + // l.Page("/user/:nick/quotes/liked", profilequotes.Liked) + // l.Page("/user/:nick/quotes/liked/from/:index", profilequotes.Liked) + // l.Page("/user/:nick/stats", profile.GetStatsByUser) + // l.Page("/user/:nick/followers", profile.GetFollowers) l.Page("/user/:nick/animelist/anime/:id", animelistitem.Get) l.Page("/user/:nick/recommended/anime", recommended.Anime) l.Page("/user/:nick/notifications", notifications.ByUser) diff --git a/pages/profile/followers.go b/pages/profile/followers.go index b454389b..02c61b16 100644 --- a/pages/profile/followers.go +++ b/pages/profile/followers.go @@ -1,26 +1,26 @@ package profile -import ( - "net/http" +// import ( +// "net/http" - "github.com/aerogo/aero" - "github.com/animenotifier/arn" - "github.com/animenotifier/notify.moe/components" - "github.com/animenotifier/notify.moe/utils" -) +// "github.com/aerogo/aero" +// "github.com/animenotifier/arn" +// "github.com/animenotifier/notify.moe/components" +// "github.com/animenotifier/notify.moe/utils" +// ) -// GetFollowers shows the followers of a particular user. -func GetFollowers(ctx *aero.Context) string { - nick := ctx.Get("nick") - viewUser, err := arn.GetUserByNick(nick) +// // GetFollowers shows the followers of a particular user. +// func GetFollowers(ctx *aero.Context) string { +// nick := ctx.Get("nick") +// viewUser, err := arn.GetUserByNick(nick) - if err != nil { - return ctx.Error(http.StatusNotFound, "User not found", err) - } +// if err != nil { +// return ctx.Error(http.StatusNotFound, "User not found", err) +// } - followers := viewUser.Followers() - arn.SortUsersLastSeenFirst(followers) +// followers := viewUser.Followers() +// arn.SortUsersLastSeenFirst(followers) - return ctx.HTML(components.ProfileFollowers(followers, viewUser, utils.GetUser(ctx), ctx.URI())) +// return ctx.HTML(components.ProfileFollowers(followers, viewUser, utils.GetUser(ctx), ctx.URI())) -} +// } diff --git a/pages/profile/followers.pixy b/pages/profile/followers.pixy index 63a2ccbd..e66180a7 100644 --- a/pages/profile/followers.pixy +++ b/pages/profile/followers.pixy @@ -1,19 +1,19 @@ -component ProfileFollowers(followers []*arn.User, viewUser *arn.User, user *arn.User, uri string) - ProfileHeader(viewUser, user, uri) +//- component ProfileFollowers(followers []*arn.User, viewUser *arn.User, user *arn.User, uri string) +//- ProfileHeader(viewUser, user, uri) - if len(followers) > 0 - UserGrid(followers) - else - p.no-data.mountable= viewUser.Nick + " doesn't have a follower yet." +//- if len(followers) > 0 +//- UserGrid(followers) +//- else +//- p.no-data.mountable= viewUser.Nick + " doesn't have a follower yet." -component UserGrid(users []*arn.User) - .user-avatars - each user in users - if user.Nick != "" - if user.IsActive() - .mountable - Avatar(user) - else - .mountable - .inactive-user - Avatar(user) \ No newline at end of file +//- component UserGrid(users []*arn.User) +//- .user-avatars +//- each user in users +//- if user.Nick != "" +//- if user.IsActive() +//- .mountable +//- Avatar(user) +//- else +//- .mountable +//- .inactive-user +//- Avatar(user) \ No newline at end of file diff --git a/pages/profile/followers.scarlet b/pages/profile/followers.scarlet index adf658da..6dc78b41 100644 --- a/pages/profile/followers.scarlet +++ b/pages/profile/followers.scarlet @@ -1,2 +1,2 @@ -.inactive-user - // opacity 0.25 \ No newline at end of file +// .inactive-user +// // opacity 0.25 \ No newline at end of file diff --git a/pages/profile/posts.go b/pages/profile/posts.go index ffe877e1..ee62c43e 100644 --- a/pages/profile/posts.go +++ b/pages/profile/posts.go @@ -1,32 +1,32 @@ package profile -import ( - "net/http" +// import ( +// "net/http" - "github.com/aerogo/aero" - "github.com/animenotifier/arn" - "github.com/animenotifier/notify.moe/components" - "github.com/animenotifier/notify.moe/utils" -) +// "github.com/aerogo/aero" +// "github.com/animenotifier/arn" +// "github.com/animenotifier/notify.moe/components" +// "github.com/animenotifier/notify.moe/utils" +// ) -const postLimit = 10 +// const postLimit = 10 -// GetPostsByUser shows all forum posts of a particular user. -func GetPostsByUser(ctx *aero.Context) string { - nick := ctx.Get("nick") - viewUser, err := arn.GetUserByNick(nick) +// // GetPostsByUser shows all forum posts of a particular user. +// func GetPostsByUser(ctx *aero.Context) string { +// nick := ctx.Get("nick") +// viewUser, err := arn.GetUserByNick(nick) - if err != nil { - return ctx.Error(http.StatusNotFound, "User not found", err) - } +// if err != nil { +// return ctx.Error(http.StatusNotFound, "User not found", err) +// } - posts := viewUser.Posts() - arn.SortPostsLatestFirst(posts) +// posts := viewUser.Posts() +// arn.SortPostsLatestFirst(posts) - if len(posts) >= postLimit { - posts = posts[:postLimit] - } +// if len(posts) >= postLimit { +// posts = posts[:postLimit] +// } - return ctx.HTML(components.LatestPosts(arn.ToPostables(posts), viewUser, utils.GetUser(ctx), ctx.URI())) +// return ctx.HTML(components.LatestPosts(arn.ToPostables(posts), viewUser, utils.GetUser(ctx), ctx.URI())) -} +// } diff --git a/pages/profile/posts.pixy b/pages/profile/posts.pixy index 29c4f82d..b46bb078 100644 --- a/pages/profile/posts.pixy +++ b/pages/profile/posts.pixy @@ -1,14 +1,14 @@ -component ProfileForumTabs(viewUser *arn.User) - .tabs - Tab("Threads", "list", "/+" + viewUser.Nick + "/forum/threads") - Tab("Posts", "comments", "/+" + viewUser.Nick + "/forum/posts") +//- component ProfileForumTabs(viewUser *arn.User) +//- .tabs +//- Tab("Threads", "list", "/+" + viewUser.Nick + "/forum/threads") +//- Tab("Posts", "comments", "/+" + viewUser.Nick + "/forum/posts") -component LatestPosts(postables []arn.Postable, viewUser *arn.User, user *arn.User, uri string) - ProfileHeader(viewUser, user, uri) - ProfileForumTabs(viewUser) +//- component LatestPosts(postables []arn.Postable, viewUser *arn.User, user *arn.User, uri string) +//- ProfileHeader(viewUser, user, uri) +//- ProfileForumTabs(viewUser) - if len(postables) > 0 - h1.page-title= len(postables), " latest posts by ", postables[0].Creator().Nick - PostableList(postables, user) - else - p.no-data.mountable= viewUser.Nick + " hasn't written any posts yet." \ No newline at end of file +//- if len(postables) > 0 +//- h1.page-title= len(postables), " latest posts by ", postables[0].Creator().Nick +//- PostableList(postables, user) +//- else +//- p.no-data.mountable= viewUser.Nick + " hasn't written any posts yet." \ No newline at end of file diff --git a/pages/profile/profile.go b/pages/profile/profile.go index 507b2062..f5076e04 100644 --- a/pages/profile/profile.go +++ b/pages/profile/profile.go @@ -38,7 +38,8 @@ func Profile(ctx *aero.Context, viewUser *arn.User) string { animeList = animeList.WithoutPrivateItems() } - animeList.SortByRating() + completedList := animeList.FilterStatus(arn.AnimeListStatusCompleted) + completedList.SortByRating() // Genres topGenres := animeList.TopGenres(5) @@ -127,5 +128,5 @@ func Profile(ctx *aero.Context, viewUser *arn.User) string { } ctx.Data = openGraph - return ctx.HTML(components.Profile(viewUser, user, animeList, characters, friends, topGenres, dayToActivityCount, ctx.URI())) + return ctx.HTML(components.Profile(viewUser, user, animeList, completedList, characters, friends, topGenres, dayToActivityCount, ctx.URI())) } diff --git a/pages/profile/profile.pixy b/pages/profile/profile.pixy index b0216622..9b9fc500 100644 --- a/pages/profile/profile.pixy +++ b/pages/profile/profile.pixy @@ -1,6 +1,6 @@ -component Profile(viewUser *arn.User, user *arn.User, animeList *arn.AnimeList, characters []*arn.Character, friends []*arn.User, topGenres []string, dayToActivityCount map[int]int, uri string) +component Profile(viewUser *arn.User, user *arn.User, animeList *arn.AnimeList, completedList *arn.AnimeList, characters []*arn.Character, friends []*arn.User, topGenres []string, dayToActivityCount map[int]int, uri string) .profile - ProfileHeader(viewUser, user, uri) + ProfileHeader(viewUser, animeList, user, uri) .profile-columns //- Favorites @@ -9,11 +9,11 @@ component Profile(viewUser *arn.User, user *arn.User, animeList *arn.AnimeList, .profile-section h3.profile-column-header.mountable(data-mountable-type="favorites") Anime - if len(animeList.Items) == 0 + if len(completedList.Items) == 0 p.no-data.mountable(data-mountable-type="favorites") Nothing here yet. else .profile-favorite-anime-container.mountable(data-mountable-type="favorites") - each item in animeList.Top(6) + each item in completedList.Top(6) a.profile-favorite-anime.tip.mountable(href=item.Anime().Link(), aria-label=item.Anime().Title.ByUser(user), data-mountable-type="anime") img.profile-favorite-anime-image.lazy(data-src=item.Anime().ImageLink("small"), data-webp=true, alt=item.Anime().Title.ByUser(user)) @@ -77,10 +77,10 @@ component Profile(viewUser *arn.User, user *arn.User, animeList *arn.AnimeList, if day == 2 .spacer-box -component ProfileHeader(viewUser *arn.User, user *arn.User, uri string) - ProfileHead(viewUser, user, uri) +component ProfileHeader(viewUser *arn.User, animeList *arn.AnimeList, user *arn.User, uri string) + ProfileHead(viewUser, animeList, user, uri) -component ProfileHead(viewUser *arn.User, user *arn.User, uri string) +component ProfileHead(viewUser *arn.User, animeList *arn.AnimeList, user *arn.User, uri string) .profile-head img.profile-cover.lazy(data-src=viewUser.CoverLink("large"), data-webp="true", alt="Cover image") @@ -95,7 +95,7 @@ component ProfileHead(viewUser *arn.User, user *arn.User, uri string) .profile-tags a.profile-tag.mountable.never-unmount(href="/+" + viewUser.Nick + "/animelist/watching", data-mountable-type="header") Icon("list") - span= fmt.Sprintf("%d anime", len(viewUser.AnimeList().Items)) + span= fmt.Sprintf("%d anime", len(animeList.Items)) if user != nil && viewUser.Settings().Privacy.ShowAge && viewUser.Settings().Privacy.ShowGender && viewUser.AgeInYears() != 0 .profile-tag.mountable.never-unmount(data-mountable-type="header") diff --git a/pages/profile/profilecharacters/characters.pixy b/pages/profile/profilecharacters/characters.pixy index 33d2eaa7..16221826 100644 --- a/pages/profile/profilecharacters/characters.pixy +++ b/pages/profile/profilecharacters/characters.pixy @@ -1,11 +1,10 @@ -component ProfileCharacters(characters []*arn.Character, viewUser *arn.User, user *arn.User, uri string) - ProfileHeader(viewUser, user, uri) +//- component ProfileCharacters(characters []*arn.Character, viewUser *arn.User, user *arn.User, uri string) +//- ProfileHeader(viewUser, user, uri) - if len(characters) == 0 - p.no-data.mountable= viewUser.Nick + " hasn't liked any characters yet." - else - .characters.profile-characters - each character in characters - .mountable - Character(character, user) - \ No newline at end of file +//- if len(characters) == 0 +//- p.no-data.mountable= viewUser.Nick + " hasn't liked any characters yet." +//- else +//- .characters.profile-characters +//- each character in characters +//- .mountable +//- Character(character, user) diff --git a/pages/profile/profilecharacters/characters.scarlet b/pages/profile/profilecharacters/characters.scarlet index a0ee7eb8..dfff787b 100644 --- a/pages/profile/profilecharacters/characters.scarlet +++ b/pages/profile/profilecharacters/characters.scarlet @@ -1,2 +1,2 @@ -.profile-characters - justify-content center \ No newline at end of file +// .profile-characters +// justify-content center \ No newline at end of file diff --git a/pages/profile/profilequotes/quotes.pixy b/pages/profile/profilequotes/quotes.pixy index 002ec310..bd557684 100644 --- a/pages/profile/profilequotes/quotes.pixy +++ b/pages/profile/profilequotes/quotes.pixy @@ -1,21 +1,21 @@ -component ProfileQuotes(quotes []*arn.Quote, viewUser *arn.User, nextIndex int, user *arn.User, uri string) - ProfileHeader(viewUser, user, uri) +//- component ProfileQuotes(quotes []*arn.Quote, viewUser *arn.User, nextIndex int, user *arn.User, uri string) +//- ProfileHeader(viewUser, user, uri) - if strings.Contains(uri, "/added") - h1.page-title= "Quotes added by " + viewUser.Nick - else - h1.page-title= "Quotes liked by " + viewUser.Nick +//- if strings.Contains(uri, "/added") +//- h1.page-title= "Quotes added by " + viewUser.Nick +//- else +//- h1.page-title= "Quotes liked by " + viewUser.Nick - if len(quotes) == 0 - if strings.Contains(uri, "/added") - p.no-data.mountable= viewUser.Nick + " hasn't added any quotes yet." - else - p.no-data.mountable= viewUser.Nick + " hasn't liked any quotes yet." - else - #load-more-target.quotes - QuotesScrollable(quotes, user) +//- if len(quotes) == 0 +//- if strings.Contains(uri, "/added") +//- p.no-data.mountable= viewUser.Nick + " hasn't added any quotes yet." +//- else +//- p.no-data.mountable= viewUser.Nick + " hasn't liked any quotes yet." +//- else +//- #load-more-target.quotes +//- QuotesScrollable(quotes, user) - if nextIndex != -1 - .buttons - LoadMore(nextIndex) +//- if nextIndex != -1 +//- .buttons +//- LoadMore(nextIndex) \ No newline at end of file diff --git a/pages/profile/profiletracks/tracks.pixy b/pages/profile/profiletracks/tracks.pixy index 697319fc..d49a7af2 100644 --- a/pages/profile/profiletracks/tracks.pixy +++ b/pages/profile/profiletracks/tracks.pixy @@ -1,21 +1,21 @@ -component ProfileSoundTracks(tracks []*arn.SoundTrack, viewUser *arn.User, nextIndex int, user *arn.User, uri string) - ProfileHeader(viewUser, user, uri) +//- component ProfileSoundTracks(tracks []*arn.SoundTrack, viewUser *arn.User, nextIndex int, user *arn.User, uri string) +//- ProfileHeader(viewUser, user, uri) - if strings.Contains(uri, "/added") - h1.page-title= "Tracks added by " + viewUser.Nick - else - h1.page-title= "Tracks liked by " + viewUser.Nick +//- if strings.Contains(uri, "/added") +//- h1.page-title= "Tracks added by " + viewUser.Nick +//- else +//- h1.page-title= "Tracks liked by " + viewUser.Nick - if len(tracks) == 0 - if strings.Contains(uri, "/added") - p.no-data.mountable= viewUser.Nick + " hasn't added any tracks yet." - else - p.no-data.mountable= viewUser.Nick + " hasn't liked any tracks yet." - else - #load-more-target.soundtracks - SoundTracksScrollable(tracks, user) +//- if len(tracks) == 0 +//- if strings.Contains(uri, "/added") +//- p.no-data.mountable= viewUser.Nick + " hasn't added any tracks yet." +//- else +//- p.no-data.mountable= viewUser.Nick + " hasn't liked any tracks yet." +//- else +//- #load-more-target.soundtracks +//- SoundTracksScrollable(tracks, user) - if nextIndex != -1 - .buttons - LoadMore(nextIndex) +//- if nextIndex != -1 +//- .buttons +//- LoadMore(nextIndex) \ No newline at end of file diff --git a/pages/profile/stats.go b/pages/profile/stats.go index c6ffc5f7..b9ef65b7 100644 --- a/pages/profile/stats.go +++ b/pages/profile/stats.go @@ -1,102 +1,102 @@ package profile -import ( - "net/http" - "strconv" - "strings" - "time" +// import ( +// "net/http" +// "strconv" +// "strings" +// "time" - "github.com/aerogo/aero" - "github.com/animenotifier/arn" - "github.com/animenotifier/notify.moe/components" - "github.com/animenotifier/notify.moe/utils" -) +// "github.com/aerogo/aero" +// "github.com/animenotifier/arn" +// "github.com/animenotifier/notify.moe/components" +// "github.com/animenotifier/notify.moe/utils" +// ) -type stats map[string]float64 +// type stats map[string]float64 -// GetStatsByUser shows statistics for a given user. -func GetStatsByUser(ctx *aero.Context) string { - nick := ctx.Get("nick") - viewUser, err := arn.GetUserByNick(nick) - userStats := utils.UserStats{} - ratings := stats{} - status := stats{} - types := stats{} - years := stats{} - studios := stats{} - genres := stats{} - trackTags := stats{} +// // GetStatsByUser shows statistics for a given user. +// func GetStatsByUser(ctx *aero.Context) string { +// nick := ctx.Get("nick") +// viewUser, err := arn.GetUserByNick(nick) +// userStats := utils.UserStats{} +// ratings := stats{} +// status := stats{} +// types := stats{} +// years := stats{} +// studios := stats{} +// genres := stats{} +// trackTags := stats{} - if err != nil { - return ctx.Error(http.StatusNotFound, "User not found", err) - } +// if err != nil { +// return ctx.Error(http.StatusNotFound, "User not found", err) +// } - animeList, err := arn.GetAnimeList(viewUser.ID) +// animeList, err := arn.GetAnimeList(viewUser.ID) - if err != nil { - return ctx.Error(http.StatusInternalServerError, "Anime list not found", err) - } +// if err != nil { +// return ctx.Error(http.StatusInternalServerError, "Anime list not found", err) +// } - animeList.Lock() - defer animeList.Unlock() +// animeList.Lock() +// defer animeList.Unlock() - for _, item := range animeList.Items { - status[item.Status]++ +// for _, item := range animeList.Items { +// status[item.Status]++ - if item.Status == arn.AnimeListStatusPlanned { - continue - } +// if item.Status == arn.AnimeListStatusPlanned { +// continue +// } - currentWatch := item.Episodes * item.Anime().EpisodeLength - reWatch := item.RewatchCount * item.Anime().EpisodeCount * item.Anime().EpisodeLength - duration := time.Duration(currentWatch + reWatch) - userStats.AnimeWatchingTime += duration * time.Minute +// currentWatch := item.Episodes * item.Anime().EpisodeLength +// reWatch := item.RewatchCount * item.Anime().EpisodeCount * item.Anime().EpisodeLength +// duration := time.Duration(currentWatch + reWatch) +// userStats.AnimeWatchingTime += duration * time.Minute - ratings[strconv.Itoa(int(item.Rating.Overall+0.5))]++ - types[item.Anime().Type]++ +// ratings[strconv.Itoa(int(item.Rating.Overall+0.5))]++ +// types[item.Anime().Type]++ - for _, studio := range item.Anime().Studios() { - studios[studio.Name.English]++ - } +// for _, studio := range item.Anime().Studios() { +// studios[studio.Name.English]++ +// } - for _, genre := range item.Anime().Genres { - genres[genre]++ - } +// for _, genre := range item.Anime().Genres { +// genres[genre]++ +// } - if item.Anime().StartDate != "" { - year := item.Anime().StartDate[:4] +// if item.Anime().StartDate != "" { +// year := item.Anime().StartDate[:4] - if year < "2000" { - year = "Before 2000" - } +// if year < "2000" { +// year = "Before 2000" +// } - years[year]++ - } - } +// years[year]++ +// } +// } - for track := range arn.StreamSoundTracks() { - if !track.LikedBy(viewUser.ID) { - continue - } +// for track := range arn.StreamSoundTracks() { +// if !track.LikedBy(viewUser.ID) { +// continue +// } - for _, tag := range track.Tags { - if strings.Contains(tag, ":") { - continue - } +// for _, tag := range track.Tags { +// if strings.Contains(tag, ":") { +// continue +// } - trackTags[tag]++ - } - } +// trackTags[tag]++ +// } +// } - userStats.PieCharts = []*arn.PieChart{ - arn.NewPieChart("Genres", genres), - arn.NewPieChart("Studios", studios), - arn.NewPieChart("Years", years), - arn.NewPieChart("Ratings", ratings), - arn.NewPieChart("Types", types), - arn.NewPieChart("Status", status), - arn.NewPieChart("Soundtracks", trackTags), - } +// userStats.PieCharts = []*arn.PieChart{ +// arn.NewPieChart("Genres", genres), +// arn.NewPieChart("Studios", studios), +// arn.NewPieChart("Years", years), +// arn.NewPieChart("Ratings", ratings), +// arn.NewPieChart("Types", types), +// arn.NewPieChart("Status", status), +// arn.NewPieChart("Soundtracks", trackTags), +// } - return ctx.HTML(components.ProfileStats(&userStats, viewUser, utils.GetUser(ctx), ctx.URI())) -} +// return ctx.HTML(components.ProfileStats(&userStats, viewUser, utils.GetUser(ctx), ctx.URI())) +// } diff --git a/pages/profile/stats.pixy b/pages/profile/stats.pixy index c99822b4..6126c27e 100644 --- a/pages/profile/stats.pixy +++ b/pages/profile/stats.pixy @@ -1,15 +1,15 @@ -component ProfileStats(stats *utils.UserStats, viewUser *arn.User, user *arn.User, uri string) - ProfileHeader(viewUser, user, uri) +//- component ProfileStats(stats *utils.UserStats, viewUser *arn.User, user *arn.User, uri string) +//- ProfileHeader(viewUser, user, uri) - .stats - each pie in stats.PieCharts - .widget.mountable - h3.widget-title - Icon("pie-chart") - span= pie.Title - PieChart(pie.Slices) +//- .stats +//- each pie in stats.PieCharts +//- .widget.mountable +//- h3.widget-title +//- Icon("pie-chart") +//- span= pie.Title +//- PieChart(pie.Slices) - .footer.mountable - span= viewUser.Nick + " spent " - span= int(stats.AnimeWatchingTime / time.Hour / 24) - span days watching anime. \ No newline at end of file +//- .footer.mountable +//- span= viewUser.Nick + " spent " +//- span= int(stats.AnimeWatchingTime / time.Hour / 24) +//- span days watching anime. \ No newline at end of file diff --git a/pages/profile/stats.scarlet b/pages/profile/stats.scarlet index b7a92c67..b4ad76b9 100644 --- a/pages/profile/stats.scarlet +++ b/pages/profile/stats.scarlet @@ -1,7 +1,7 @@ -.stats - horizontal-wrap - justify-content space-around +// .stats +// horizontal-wrap +// justify-content space-around - .widget - min-width 200px - max-width 300px \ No newline at end of file +// .widget +// min-width 200px +// max-width 300px \ No newline at end of file diff --git a/pages/profile/threads.go b/pages/profile/threads.go index ef7fc169..fb0f6863 100644 --- a/pages/profile/threads.go +++ b/pages/profile/threads.go @@ -1,31 +1,31 @@ package profile -import ( - "net/http" +// import ( +// "net/http" - "github.com/aerogo/aero" - "github.com/animenotifier/arn" - "github.com/animenotifier/notify.moe/components" - "github.com/animenotifier/notify.moe/utils" -) +// "github.com/aerogo/aero" +// "github.com/animenotifier/arn" +// "github.com/animenotifier/notify.moe/components" +// "github.com/animenotifier/notify.moe/utils" +// ) -const maxThreads = 20 +// const maxThreads = 20 -// GetThreadsByUser shows all forum threads of a particular user. -func GetThreadsByUser(ctx *aero.Context) string { - nick := ctx.Get("nick") - viewUser, err := arn.GetUserByNick(nick) +// // GetThreadsByUser shows all forum threads of a particular user. +// func GetThreadsByUser(ctx *aero.Context) string { +// nick := ctx.Get("nick") +// viewUser, err := arn.GetUserByNick(nick) - if err != nil { - return ctx.Error(http.StatusNotFound, "User not found", err) - } +// if err != nil { +// return ctx.Error(http.StatusNotFound, "User not found", err) +// } - threads := viewUser.Threads() - arn.SortThreadsLatestFirst(threads) +// threads := viewUser.Threads() +// arn.SortThreadsLatestFirst(threads) - if len(threads) > maxThreads { - threads = threads[:maxThreads] - } +// if len(threads) > maxThreads { +// threads = threads[:maxThreads] +// } - return ctx.HTML(components.ProfileThreads(threads, viewUser, utils.GetUser(ctx), ctx.URI())) -} +// return ctx.HTML(components.ProfileThreads(threads, viewUser, utils.GetUser(ctx), ctx.URI())) +// } diff --git a/pages/profile/threads.pixy b/pages/profile/threads.pixy index 81b6c23d..6a1a7b69 100644 --- a/pages/profile/threads.pixy +++ b/pages/profile/threads.pixy @@ -1,9 +1,9 @@ -component ProfileThreads(threads []*arn.Thread, viewUser *arn.User, user *arn.User, uri string) - ProfileHeader(viewUser, user, uri) - ProfileForumTabs(viewUser) +//- component ProfileThreads(threads []*arn.Thread, viewUser *arn.User, user *arn.User, uri string) +//- ProfileHeader(viewUser, user, uri) +//- ProfileForumTabs(viewUser) - if len(threads) == 0 - p.no-data.mountable= viewUser.Nick + " hasn't written any threads yet." - else - .forum - ThreadList(threads) +//- if len(threads) == 0 +//- p.no-data.mountable= viewUser.Nick + " hasn't written any threads yet." +//- else +//- .forum +//- ThreadList(threads) diff --git a/pages/profile/watching.scarlet b/pages/profile/watching.scarlet index 232fdcb2..0e7c76b2 100644 --- a/pages/profile/watching.scarlet +++ b/pages/profile/watching.scarlet @@ -1,15 +1,15 @@ -.profile-watching-list - horizontal-wrap - justify-content center +// .profile-watching-list +// horizontal-wrap +// justify-content center - // CSS grid variant: - // display grid - // grid-gap 0.5rem - // grid-template-columns repeat(auto-fill, 55px) - // justify-content center +// // CSS grid variant: +// // display grid +// // grid-gap 0.5rem +// // grid-template-columns repeat(auto-fill, 55px) +// // justify-content center -.profile-watching-list-item - anime-mini-item +// .profile-watching-list-item +// anime-mini-item -.profile-watching-list-item-image - anime-mini-item-image \ No newline at end of file +// .profile-watching-list-item-image +// anime-mini-item-image \ No newline at end of file