Removed games integration

This commit is contained in:
2021-11-20 21:26:51 +09:00
parent 9368689019
commit 0a41069e4a
21 changed files with 3 additions and 512 deletions

View File

@ -12,9 +12,6 @@ func Register(app *aero.Application) {
page.Get(app, "/users", users.Active)
page.Get(app, "/users/map", users.Map)
page.Get(app, "/users/noavatar", users.ActiveNoAvatar)
page.Get(app, "/users/games/osu", users.Osu)
page.Get(app, "/users/games/overwatch", users.Overwatch)
page.Get(app, "/users/games/ffxiv", users.FFXIV)
page.Get(app, "/users/staff", users.Staff)
page.Get(app, "/users/pro", users.Pro)
page.Get(app, "/users/editors", users.Editors)

View File

@ -198,18 +198,6 @@ component ProfileTags(viewUser *arn.User, animeList *arn.AnimeList, user *arn.Us
if viewUser.Website != ""
a.profile-tag.tip.mountable.never-unmount.show-more(href=viewUser.WebsiteURL(), target="_blank", rel="noopener", aria-label=viewUser.WebsiteShortURL(), data-mountable-type="header")
RawIcon("globe")
if viewUser.Accounts.Osu.Nick != "" && viewUser.Accounts.Osu.PP >= 100
a.profile-tag.tip.mountable.never-unmount.show-more(href="https://osu.ppy.sh/u/" + viewUser.Accounts.Osu.Nick, aria-label=fmt.Sprintf("osu! | %.0f pp | Level %.0f | Accuracy: %.1f%%", viewUser.Accounts.Osu.PP, viewUser.Accounts.Osu.Level, viewUser.Accounts.Osu.Accuracy), target="_blank", rel="noopener", data-mountable-type="header")
RawIcon("trophy")
if viewUser.Accounts.Overwatch.BattleTag != "" && viewUser.Accounts.Overwatch.SkillRating >= 1000
a.profile-tag.tip.mountable.never-unmount.show-more(href="https://playoverwatch.com/en-us/career/pc/" + strings.Replace(viewUser.Accounts.Overwatch.BattleTag, "#", "-", 1), aria-label=fmt.Sprintf("Overwatch | %d SR | %s", viewUser.Accounts.Overwatch.SkillRating, stringutils.Capitalize(viewUser.Accounts.Overwatch.Tier)), target="_blank", rel="noopener", data-mountable-type="header")
RawIcon("overwatch")
if viewUser.Accounts.FinalFantasyXIV.Nick != "" && viewUser.Accounts.FinalFantasyXIV.Class != ""
.profile-tag.tip.mountable.never-unmount.show-more(aria-label=fmt.Sprintf("Final Fantasy XIV | %s | Level %d | IL %d", viewUser.Accounts.FinalFantasyXIV.Class, viewUser.Accounts.FinalFantasyXIV.Level, viewUser.Accounts.FinalFantasyXIV.ItemLevel), data-mountable-type="header")
RawIcon("gamepad")
if viewUser.Accounts.Discord.Nick != "" && viewUser.Accounts.Discord.Verified
a.profile-tag.tip.mountable.never-unmount.show-more(href="https://discord.gg/0kimAmMCeXGXuzNF", aria-label=fmt.Sprintf("Discord | %s", viewUser.Accounts.Discord.Nick), data-mountable-type="header")
@ -231,4 +219,4 @@ component ProfileTags(viewUser *arn.User, animeList *arn.AnimeList, user *arn.Us
if user != nil && user.Role == "admin"
a.profile-tag.tip.mountable.never-unmount.show-more(href="/api/user/" + viewUser.ID, aria-label="API", target="_blank", rel="noopener", data-mountable-type="header")
RawIcon("search-plus")
RawIcon("search-plus")

View File

@ -13,16 +13,6 @@ component SettingsAccounts(user *arn.User)
InputText("Accounts.Kitsu.Nick", user.Accounts.Kitsu.Nick, "Kitsu", "Your username on kitsu.io", 30)
InputText("Accounts.MyAnimeList.Nick", user.Accounts.MyAnimeList.Nick, "MyAnimeList", "Your username on myanimelist.net", 30)
InputText("Accounts.Discord.Nick", user.Accounts.Discord.Nick, "Discord", "Your username on Discord", 30)
.widget.mountable(data-api="/api/user/" + user.ID)
h3.widget-title
Icon("gamepad")
span Games
InputText("Accounts.FinalFantasyXIV.Nick", user.Accounts.FinalFantasyXIV.Nick, "Final Fantasy XIV", "Your character name on FFXIV", 30)
InputSelection("Accounts.FinalFantasyXIV.Server", user.Accounts.FinalFantasyXIV.Server, "Final Fantasy XIV - World", "Your server/world on FFXIV", arn.DataLists["ffxiv-servers"])
InputText("Accounts.Osu.Nick", user.Accounts.Osu.Nick, "Osu", "Your username on osu.ppy.sh", 30)
InputText("Accounts.Overwatch.BattleTag", user.Accounts.Overwatch.BattleTag, "Overwatch", "Your battletag on Overwatch", 30)
.widget.mountable
h3.widget-title
@ -80,10 +70,3 @@ component SettingsAccounts(user *arn.User)
a.button(href="/api/animelist/" + user.ID, target="_blank")
Icon("upload")
span Export anime list as JSON
.widget.mountable
h3.widget-title
Icon("refresh")
span Sync
footer.footer Reserved for upcoming features.

View File

@ -44,20 +44,7 @@ component SoundTrackPage(track *arn.SoundTrack, relatedTracks []*arn.SoundTrack,
each relatedTrack in relatedTracks
li
a(href=relatedTrack.Link())= relatedTrack.TitleByUser(user)
//- TODO: This is quite ineffective, performance-wise
if len(track.OsuBeatmaps()) > 0 || len(track.EtternaBeatmaps()) > 0
.widget.mountable
h3.widget-title Beatmaps
ul.beatmaps
for index, beatmap := range track.OsuBeatmaps()
li
a.beatmap(href="https://osu.ppy.sh/s/" + beatmap, target="_blank")= "Osu Beatmap #" + strconv.Itoa(index + 1)
for index, beatmap := range track.EtternaBeatmaps()
li
a.beatmap(href="https://etternaonline.com/song/view/" + beatmap, target="_blank")= "Etterna Beatmap #" + strconv.Itoa(index + 1)
.widget.mountable
h3.widget-title Tags

View File

@ -1,8 +0,0 @@
component FinalFantasyXIVRankingList(users []*arn.User, url string)
h1.page-title Final Fantasy XIV ranking list
UsersTabs(url)
.user-cards
each user in users
UserCard(user, fmt.Sprintf("%s (iLvl %d)", user.Accounts.FinalFantasyXIV.Class, user.Accounts.FinalFantasyXIV.ItemLevel))

View File

@ -1,8 +0,0 @@
component OsuRankingList(users []*arn.User, url string)
h1.page-title osu! ranking list
UsersTabs(url)
.user-cards
each user in users
UserCard(user, fmt.Sprintf("%s pp (%.1f%%)", humanize.Comma(int64(user.Accounts.Osu.PP + 0.5)), user.Accounts.Osu.Accuracy))

View File

@ -1,8 +0,0 @@
component OverwatchRankingList(users []*arn.User, url string)
h1.page-title Overwatch ranking list
UsersTabs(url)
.user-cards
each user in users
UserCard(user, fmt.Sprintf("%s (%d SR)", strings.Title(user.Accounts.Overwatch.Tier), user.Accounts.Overwatch.SkillRating))

View File

@ -86,48 +86,6 @@ func ActiveNoAvatar(ctx aero.Context) error {
return ctx.HTML(components.Users(users, followCount, ctx.Path()))
}
// Osu ...
func Osu(ctx aero.Context) error {
users := arn.FilterUsers(func(user *arn.User) bool {
return user.HasAvatar() && user.HasNick() && user.IsActive() && user.Accounts.Osu.PP > 0
})
// Sort by pp
sort.Slice(users, func(i, j int) bool {
return users[i].Accounts.Osu.PP > users[j].Accounts.Osu.PP
})
return ctx.HTML(components.OsuRankingList(users, ctx.Path()))
}
// Overwatch ...
func Overwatch(ctx aero.Context) error {
users := arn.FilterUsers(func(user *arn.User) bool {
return user.HasAvatar() && user.HasNick() && user.IsActive() && user.Accounts.Overwatch.SkillRating > 0
})
// Sort by Skill Ratings
sort.Slice(users, func(i, j int) bool {
return users[i].Accounts.Overwatch.SkillRating > users[j].Accounts.Overwatch.SkillRating
})
return ctx.HTML(components.OverwatchRankingList(users, ctx.Path()))
}
// FFXIV ...
func FFXIV(ctx aero.Context) error {
users := arn.FilterUsers(func(user *arn.User) bool {
return user.HasAvatar() && user.HasNick() && user.IsActive() && user.Accounts.FinalFantasyXIV.ItemLevel > 0
})
// Sort by item level
sort.Slice(users, func(i, j int) bool {
return users[i].Accounts.FinalFantasyXIV.ItemLevel > users[j].Accounts.FinalFantasyXIV.ItemLevel
})
return ctx.HTML(components.FinalFantasyXIVRankingList(users, ctx.Path()))
}
// ByCountry ...
func ByCountry(ctx aero.Context) error {
countryName := ctx.Get("country")

View File

@ -48,14 +48,7 @@ component StaffRecruitment
component UsersTabs(url string)
.tabs
Tab("Active", "users", "/users")
Tab("Games", "gamepad", "/users/games/osu")
Tab("Editors", "pencil", "/users/editors")
Tab("Supporters", "heart", "/users/pro")
Tab("Staff", "user-secret", "/users/staff")
//- Tab("Map", "map", "/users/map")
if strings.Contains(url, "/users/games")
.tabs
Tab("Osu", "gamepad", "/users/games/osu")
Tab("Overwatch", "overwatch", "/users/games/overwatch")
Tab("FFXIV", "gamepad", "/users/games/ffxiv")