2017-11-07 15:49:56 +00:00
|
|
|
package pages
|
|
|
|
|
|
|
|
import (
|
2018-03-27 22:26:06 +00:00
|
|
|
"strings"
|
|
|
|
|
2017-11-07 15:49:56 +00:00
|
|
|
"github.com/aerogo/aero"
|
2017-11-11 14:09:30 +00:00
|
|
|
"github.com/aerogo/layout"
|
2017-11-07 15:49:56 +00:00
|
|
|
"github.com/animenotifier/arn"
|
|
|
|
"github.com/animenotifier/notify.moe/components"
|
2017-11-11 14:09:30 +00:00
|
|
|
"github.com/animenotifier/notify.moe/layout"
|
2017-11-07 15:49:56 +00:00
|
|
|
"github.com/animenotifier/notify.moe/pages/admin"
|
2018-04-14 21:23:00 +00:00
|
|
|
"github.com/animenotifier/notify.moe/pages/amv"
|
|
|
|
"github.com/animenotifier/notify.moe/pages/amvs"
|
2017-11-07 15:49:56 +00:00
|
|
|
"github.com/animenotifier/notify.moe/pages/anime"
|
2018-03-18 20:41:13 +00:00
|
|
|
"github.com/animenotifier/notify.moe/pages/animeimport"
|
2017-11-07 15:49:56 +00:00
|
|
|
"github.com/animenotifier/notify.moe/pages/animelist"
|
|
|
|
"github.com/animenotifier/notify.moe/pages/animelistitem"
|
|
|
|
"github.com/animenotifier/notify.moe/pages/apiview"
|
2018-03-27 22:26:06 +00:00
|
|
|
"github.com/animenotifier/notify.moe/pages/apiview/apidocs"
|
2017-11-22 10:51:59 +00:00
|
|
|
"github.com/animenotifier/notify.moe/pages/calendar"
|
2017-11-07 15:49:56 +00:00
|
|
|
"github.com/animenotifier/notify.moe/pages/character"
|
2018-04-22 15:43:20 +00:00
|
|
|
"github.com/animenotifier/notify.moe/pages/characters"
|
2017-11-07 15:49:56 +00:00
|
|
|
"github.com/animenotifier/notify.moe/pages/charge"
|
2017-11-18 10:46:17 +00:00
|
|
|
"github.com/animenotifier/notify.moe/pages/companies"
|
2017-11-18 10:28:53 +00:00
|
|
|
"github.com/animenotifier/notify.moe/pages/company"
|
2017-11-07 15:49:56 +00:00
|
|
|
"github.com/animenotifier/notify.moe/pages/compare"
|
|
|
|
"github.com/animenotifier/notify.moe/pages/editanime"
|
2018-03-09 18:04:06 +00:00
|
|
|
"github.com/animenotifier/notify.moe/pages/editlog"
|
2017-11-07 15:49:56 +00:00
|
|
|
"github.com/animenotifier/notify.moe/pages/editor"
|
2018-03-22 19:15:21 +00:00
|
|
|
"github.com/animenotifier/notify.moe/pages/editor/filteranime"
|
2018-03-19 21:28:44 +00:00
|
|
|
"github.com/animenotifier/notify.moe/pages/editor/filtercompanies"
|
2018-03-25 00:54:01 +00:00
|
|
|
"github.com/animenotifier/notify.moe/pages/editor/filtersoundtracks"
|
2017-11-07 15:49:56 +00:00
|
|
|
"github.com/animenotifier/notify.moe/pages/embed"
|
2017-12-04 20:07:13 +00:00
|
|
|
"github.com/animenotifier/notify.moe/pages/episode"
|
2017-11-07 15:49:56 +00:00
|
|
|
"github.com/animenotifier/notify.moe/pages/explore"
|
2018-03-21 21:57:06 +00:00
|
|
|
"github.com/animenotifier/notify.moe/pages/explore/explorecolor"
|
2018-03-26 21:38:15 +00:00
|
|
|
"github.com/animenotifier/notify.moe/pages/explore/explorerelations"
|
2018-03-27 19:08:26 +00:00
|
|
|
"github.com/animenotifier/notify.moe/pages/explore/halloffame"
|
2017-11-07 15:49:56 +00:00
|
|
|
"github.com/animenotifier/notify.moe/pages/forum"
|
2017-11-30 00:47:12 +00:00
|
|
|
"github.com/animenotifier/notify.moe/pages/genre"
|
2017-11-30 01:59:19 +00:00
|
|
|
"github.com/animenotifier/notify.moe/pages/genres"
|
2017-11-07 15:49:56 +00:00
|
|
|
"github.com/animenotifier/notify.moe/pages/group"
|
|
|
|
"github.com/animenotifier/notify.moe/pages/groups"
|
|
|
|
"github.com/animenotifier/notify.moe/pages/home"
|
|
|
|
"github.com/animenotifier/notify.moe/pages/inventory"
|
|
|
|
"github.com/animenotifier/notify.moe/pages/listimport"
|
|
|
|
"github.com/animenotifier/notify.moe/pages/listimport/listimportanilist"
|
|
|
|
"github.com/animenotifier/notify.moe/pages/listimport/listimportkitsu"
|
|
|
|
"github.com/animenotifier/notify.moe/pages/listimport/listimportmyanimelist"
|
|
|
|
"github.com/animenotifier/notify.moe/pages/login"
|
|
|
|
"github.com/animenotifier/notify.moe/pages/me"
|
|
|
|
"github.com/animenotifier/notify.moe/pages/newthread"
|
|
|
|
"github.com/animenotifier/notify.moe/pages/notifications"
|
|
|
|
"github.com/animenotifier/notify.moe/pages/paypal"
|
2017-11-16 15:38:49 +00:00
|
|
|
"github.com/animenotifier/notify.moe/pages/popular"
|
2018-04-25 17:12:47 +00:00
|
|
|
"github.com/animenotifier/notify.moe/pages/post"
|
2017-11-07 15:49:56 +00:00
|
|
|
"github.com/animenotifier/notify.moe/pages/profile"
|
2018-04-19 14:23:14 +00:00
|
|
|
"github.com/animenotifier/notify.moe/pages/profile/profilecharacters"
|
2018-03-19 11:25:31 +00:00
|
|
|
"github.com/animenotifier/notify.moe/pages/profile/profilequotes"
|
2018-03-14 17:21:22 +00:00
|
|
|
"github.com/animenotifier/notify.moe/pages/profile/profiletracks"
|
2017-12-03 21:33:24 +00:00
|
|
|
"github.com/animenotifier/notify.moe/pages/quote"
|
|
|
|
"github.com/animenotifier/notify.moe/pages/quotes"
|
2018-02-27 14:27:16 +00:00
|
|
|
"github.com/animenotifier/notify.moe/pages/recommended"
|
2017-11-07 15:49:56 +00:00
|
|
|
"github.com/animenotifier/notify.moe/pages/search"
|
2018-04-16 22:02:24 +00:00
|
|
|
"github.com/animenotifier/notify.moe/pages/search/multisearch"
|
2017-11-07 15:49:56 +00:00
|
|
|
"github.com/animenotifier/notify.moe/pages/settings"
|
|
|
|
"github.com/animenotifier/notify.moe/pages/shop"
|
|
|
|
"github.com/animenotifier/notify.moe/pages/soundtrack"
|
|
|
|
"github.com/animenotifier/notify.moe/pages/soundtracks"
|
|
|
|
"github.com/animenotifier/notify.moe/pages/statistics"
|
2018-03-04 15:53:42 +00:00
|
|
|
"github.com/animenotifier/notify.moe/pages/support"
|
2017-11-17 11:08:16 +00:00
|
|
|
"github.com/animenotifier/notify.moe/pages/terms"
|
2018-04-25 16:59:23 +00:00
|
|
|
"github.com/animenotifier/notify.moe/pages/thread"
|
2018-03-02 20:42:34 +00:00
|
|
|
"github.com/animenotifier/notify.moe/pages/upload"
|
2017-11-07 15:49:56 +00:00
|
|
|
"github.com/animenotifier/notify.moe/pages/user"
|
|
|
|
"github.com/animenotifier/notify.moe/pages/users"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Configure registers the page routes in the application.
|
|
|
|
func Configure(app *aero.Application) {
|
2017-11-11 14:14:16 +00:00
|
|
|
l := layout.New(app)
|
2017-11-11 14:09:30 +00:00
|
|
|
|
|
|
|
// Set render function for the layout
|
2017-11-11 14:14:16 +00:00
|
|
|
l.Render = fullpage.Render
|
2017-11-11 14:09:30 +00:00
|
|
|
|
2017-11-07 15:49:56 +00:00
|
|
|
// Main menu
|
2017-11-11 14:14:16 +00:00
|
|
|
l.Page("/", home.Get)
|
2018-04-13 15:55:52 +00:00
|
|
|
l.Page("/explore", explore.Filter)
|
|
|
|
l.Page("/explore/anime/:year/:season/:status/:type", explore.Filter)
|
2018-03-21 21:57:06 +00:00
|
|
|
l.Page("/explore/color/:color/anime", explorecolor.AnimeByAverageColor)
|
2018-03-21 22:18:08 +00:00
|
|
|
l.Page("/explore/color/:color/anime/from/:index", explorecolor.AnimeByAverageColor)
|
2018-03-26 21:38:15 +00:00
|
|
|
l.Page("/explore/sequels", explorerelations.Sequels)
|
2018-03-27 19:08:26 +00:00
|
|
|
l.Page("/halloffame", halloffame.Get)
|
2017-11-11 14:14:16 +00:00
|
|
|
l.Page("/login", login.Get)
|
|
|
|
l.Page("/api", apiview.Get)
|
2018-03-27 22:26:06 +00:00
|
|
|
|
|
|
|
for name := range arn.DB.Types() {
|
|
|
|
l.Page("/api/"+strings.ToLower(name), apidocs.ByType(name))
|
|
|
|
}
|
|
|
|
|
2017-11-07 15:49:56 +00:00
|
|
|
// Forum
|
2017-11-13 12:34:08 +00:00
|
|
|
l.Page("/forum", forum.Get)
|
2017-11-11 14:14:16 +00:00
|
|
|
l.Page("/forum/:tag", forum.Get)
|
2018-04-25 16:59:23 +00:00
|
|
|
l.Page("/thread/:id", thread.Get)
|
2018-04-25 17:12:47 +00:00
|
|
|
l.Page("/post/:id", post.Get)
|
2017-11-11 14:14:16 +00:00
|
|
|
l.Page("/new/thread", newthread.Get)
|
2017-11-07 15:49:56 +00:00
|
|
|
|
|
|
|
// User lists
|
2017-11-11 14:14:16 +00:00
|
|
|
l.Page("/users", users.Active)
|
2018-04-16 21:01:34 +00:00
|
|
|
l.Page("/users/map", users.Map)
|
2017-11-30 15:40:52 +00:00
|
|
|
l.Page("/users/noavatar", users.ActiveNoAvatar)
|
2018-03-10 15:42:39 +00:00
|
|
|
l.Page("/users/games/osu", users.Osu)
|
|
|
|
l.Page("/users/games/overwatch", users.Overwatch)
|
2017-11-11 14:14:16 +00:00
|
|
|
l.Page("/users/staff", users.Staff)
|
2018-03-10 15:42:39 +00:00
|
|
|
l.Page("/users/pro", users.Pro)
|
|
|
|
l.Page("/users/editors", users.Editors)
|
2017-11-07 15:49:56 +00:00
|
|
|
|
|
|
|
// Statistics
|
2017-11-11 14:14:16 +00:00
|
|
|
l.Page("/statistics", statistics.Get)
|
|
|
|
l.Page("/statistics/anime", statistics.Anime)
|
2017-11-07 15:49:56 +00:00
|
|
|
|
|
|
|
// Anime
|
2017-11-11 14:14:16 +00:00
|
|
|
l.Page("/anime/:id", anime.Get)
|
|
|
|
l.Page("/anime/:id/episodes", anime.Episodes)
|
|
|
|
l.Page("/anime/:id/characters", anime.Characters)
|
|
|
|
l.Page("/anime/:id/tracks", anime.Tracks)
|
2018-04-09 16:17:21 +00:00
|
|
|
l.Page("/anime/:id/relations", anime.Relations)
|
2017-12-04 20:07:13 +00:00
|
|
|
l.Page("/anime/:id/episode/:episode-number", episode.Get)
|
2017-11-07 15:49:56 +00:00
|
|
|
|
2018-04-04 14:45:02 +00:00
|
|
|
// Anime redirects
|
|
|
|
l.Page("/kitsu/anime/:id", anime.RedirectByMapping("kitsu/anime"))
|
|
|
|
l.Page("/mal/anime/:id", anime.RedirectByMapping("myanimelist/anime"))
|
|
|
|
l.Page("/anilist/anime/:id", anime.RedirectByMapping("anilist/anime"))
|
|
|
|
|
2018-03-09 14:09:27 +00:00
|
|
|
// Edit anime
|
|
|
|
l.Page("/anime/:id/edit", editanime.Main)
|
2018-03-16 21:40:38 +00:00
|
|
|
l.Page("/anime/:id/edit/images", editanime.Images)
|
2018-03-09 14:09:27 +00:00
|
|
|
l.Page("/anime/:id/edit/characters", editanime.Characters)
|
|
|
|
l.Page("/anime/:id/edit/relations", editanime.Relations)
|
2018-03-09 15:27:40 +00:00
|
|
|
l.Page("/anime/:id/edit/episodes", editanime.Episodes)
|
2018-03-13 16:59:16 +00:00
|
|
|
l.Page("/anime/:id/edit/history", editanime.History)
|
2018-03-09 14:09:27 +00:00
|
|
|
|
2017-11-07 15:49:56 +00:00
|
|
|
// Characters
|
2018-04-22 15:43:20 +00:00
|
|
|
l.Page("/characters", characters.Latest)
|
|
|
|
l.Page("/characters/from/:index", characters.Latest)
|
|
|
|
l.Page("/characters/best", characters.Best)
|
|
|
|
l.Page("/characters/best/from/:index", characters.Best)
|
|
|
|
|
|
|
|
// Character
|
2017-11-11 14:14:16 +00:00
|
|
|
l.Page("/character/:id", character.Get)
|
2018-04-10 19:25:45 +00:00
|
|
|
l.Page("/character/:id/edit", character.Edit)
|
2018-04-22 13:24:17 +00:00
|
|
|
l.Page("/character/:id/edit/images", character.EditImages)
|
2018-04-10 19:25:45 +00:00
|
|
|
l.Page("/character/:id/history", character.History)
|
2017-11-07 15:49:56 +00:00
|
|
|
|
2018-04-14 21:23:00 +00:00
|
|
|
// AMVs
|
|
|
|
l.Page("/amvs", amvs.Latest)
|
2018-04-16 13:48:54 +00:00
|
|
|
l.Page("/amvs/from/:index", amvs.Latest)
|
2018-04-14 21:23:00 +00:00
|
|
|
l.Page("/amvs/best", amvs.Best)
|
2018-04-16 13:48:54 +00:00
|
|
|
l.Page("/amvs/best/from/:index", amvs.Best)
|
2018-04-22 15:43:20 +00:00
|
|
|
|
|
|
|
// AMV
|
2018-04-14 21:23:00 +00:00
|
|
|
l.Page("/amv/:id", amv.Get)
|
2018-04-14 21:51:18 +00:00
|
|
|
l.Page("/amv/:id/edit", amv.Edit)
|
|
|
|
l.Page("/amv/:id/history", amv.History)
|
2018-04-14 21:23:00 +00:00
|
|
|
|
2017-12-03 21:33:24 +00:00
|
|
|
// Quotes
|
|
|
|
l.Page("/quote/:id", quote.Get)
|
|
|
|
l.Page("/quote/:id/edit", quote.Edit)
|
2018-03-13 16:59:16 +00:00
|
|
|
l.Page("/quote/:id/history", quote.History)
|
2018-01-17 22:30:55 +00:00
|
|
|
l.Page("/quotes", quotes.Latest)
|
2018-03-13 21:38:26 +00:00
|
|
|
l.Page("/quotes/from/:index", quotes.Latest)
|
2018-01-17 22:30:55 +00:00
|
|
|
l.Page("/quotes/best", quotes.Best)
|
2018-03-13 21:38:26 +00:00
|
|
|
l.Page("/quotes/best/from/:index", quotes.Best)
|
2017-12-04 00:01:16 +00:00
|
|
|
|
2017-11-22 10:51:59 +00:00
|
|
|
// Calendar
|
|
|
|
l.Page("/calendar", calendar.Get)
|
|
|
|
|
2017-11-18 10:28:53 +00:00
|
|
|
// Companies
|
|
|
|
l.Page("/company/:id", company.Get)
|
2017-11-19 00:15:57 +00:00
|
|
|
l.Page("/company/:id/edit", company.Edit)
|
2018-03-13 16:59:16 +00:00
|
|
|
l.Page("/company/:id/history", company.History)
|
2018-03-13 22:06:16 +00:00
|
|
|
l.Page("/companies", companies.Popular)
|
|
|
|
l.Page("/companies/from/:index", companies.Popular)
|
|
|
|
l.Page("/companies/all", companies.All)
|
2017-11-18 10:28:53 +00:00
|
|
|
|
2017-11-07 15:49:56 +00:00
|
|
|
// Settings
|
2017-11-11 14:14:16 +00:00
|
|
|
l.Page("/settings", settings.Get(components.SettingsPersonal))
|
|
|
|
l.Page("/settings/accounts", settings.Get(components.SettingsAccounts))
|
|
|
|
l.Page("/settings/notifications", settings.Get(components.SettingsNotifications))
|
|
|
|
l.Page("/settings/apps", settings.Get(components.SettingsApps))
|
|
|
|
l.Page("/settings/formatting", settings.Get(components.SettingsFormatting))
|
|
|
|
l.Page("/settings/pro", settings.Get(components.SettingsPro))
|
2017-11-07 15:49:56 +00:00
|
|
|
|
|
|
|
// Soundtracks
|
2017-11-19 16:02:20 +00:00
|
|
|
l.Page("/soundtracks", soundtracks.Latest)
|
2018-03-13 21:38:26 +00:00
|
|
|
l.Page("/soundtracks/from/:index", soundtracks.Latest)
|
2017-11-19 16:02:20 +00:00
|
|
|
l.Page("/soundtracks/best", soundtracks.Best)
|
2018-03-13 21:38:26 +00:00
|
|
|
l.Page("/soundtracks/best/from/:index", soundtracks.Best)
|
2018-03-13 00:49:54 +00:00
|
|
|
l.Page("/soundtracks/tag/:tag", soundtracks.FilterByTag)
|
2018-03-14 03:57:08 +00:00
|
|
|
l.Page("/soundtracks/tag/:tag/from/:index", soundtracks.FilterByTag)
|
2017-11-11 14:14:16 +00:00
|
|
|
l.Page("/soundtrack/:id", soundtrack.Get)
|
2018-04-13 10:20:13 +00:00
|
|
|
l.Page("/soundtrack/:id/lyrics", soundtrack.Lyrics)
|
2017-11-11 14:14:16 +00:00
|
|
|
l.Page("/soundtrack/:id/edit", soundtrack.Edit)
|
2018-03-13 16:59:16 +00:00
|
|
|
l.Page("/soundtrack/:id/history", soundtrack.History)
|
2017-11-07 15:49:56 +00:00
|
|
|
|
|
|
|
// Groups
|
2017-11-11 14:14:16 +00:00
|
|
|
l.Page("/groups", groups.Get)
|
|
|
|
l.Page("/group/:id", group.Get)
|
|
|
|
l.Page("/group/:id/edit", group.Edit)
|
|
|
|
l.Page("/group/:id/forum", group.Forum)
|
2017-11-07 15:49:56 +00:00
|
|
|
|
2018-02-27 14:27:16 +00:00
|
|
|
// Notifications
|
2018-03-01 22:18:29 +00:00
|
|
|
l.Page("/notifications", notifications.ByUser)
|
|
|
|
l.Page("/notifications/all", notifications.All)
|
2018-02-27 14:27:16 +00:00
|
|
|
|
2017-11-07 15:49:56 +00:00
|
|
|
// User profiles
|
2017-11-11 14:14:16 +00:00
|
|
|
l.Page("/user", user.Get)
|
|
|
|
l.Page("/user/:nick", profile.Get)
|
2018-04-19 14:23:14 +00:00
|
|
|
l.Page("/user/:nick/characters/liked", profilecharacters.Liked)
|
2017-11-17 10:00:49 +00:00
|
|
|
l.Page("/user/:nick/forum/threads", profile.GetThreadsByUser)
|
|
|
|
l.Page("/user/:nick/forum/posts", profile.GetPostsByUser)
|
2018-03-14 17:21:22 +00:00
|
|
|
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)
|
2018-03-19 11:25:31 +00:00
|
|
|
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)
|
2017-11-11 14:14:16 +00:00
|
|
|
l.Page("/user/:nick/stats", profile.GetStatsByUser)
|
|
|
|
l.Page("/user/:nick/followers", profile.GetFollowers)
|
2018-03-14 19:13:20 +00:00
|
|
|
l.Page("/user/:nick/animelist/anime/:id", animelistitem.Get)
|
|
|
|
l.Page("/user/:nick/recommended/anime", recommended.Anime)
|
|
|
|
l.Page("/user/:nick/notifications", notifications.ByUser)
|
2018-04-03 23:45:47 +00:00
|
|
|
l.Page("/user/:nick/edit", user.Edit)
|
2018-03-14 19:13:20 +00:00
|
|
|
|
|
|
|
// Anime list
|
2017-11-11 14:14:16 +00:00
|
|
|
l.Page("/user/:nick/animelist/watching", animelist.FilterByStatus(arn.AnimeListStatusWatching))
|
|
|
|
l.Page("/user/:nick/animelist/completed", animelist.FilterByStatus(arn.AnimeListStatusCompleted))
|
|
|
|
l.Page("/user/:nick/animelist/planned", animelist.FilterByStatus(arn.AnimeListStatusPlanned))
|
|
|
|
l.Page("/user/:nick/animelist/hold", animelist.FilterByStatus(arn.AnimeListStatusHold))
|
|
|
|
l.Page("/user/:nick/animelist/dropped", animelist.FilterByStatus(arn.AnimeListStatusDropped))
|
2017-11-07 15:49:56 +00:00
|
|
|
|
2018-03-14 19:13:20 +00:00
|
|
|
l.Page("/user/:nick/animelist/watching/from/:index", animelist.FilterByStatus(arn.AnimeListStatusWatching))
|
|
|
|
l.Page("/user/:nick/animelist/completed/from/:index", animelist.FilterByStatus(arn.AnimeListStatusCompleted))
|
|
|
|
l.Page("/user/:nick/animelist/planned/from/:index", animelist.FilterByStatus(arn.AnimeListStatusPlanned))
|
|
|
|
l.Page("/user/:nick/animelist/hold/from/:index", animelist.FilterByStatus(arn.AnimeListStatusHold))
|
|
|
|
l.Page("/user/:nick/animelist/dropped/from/:index", animelist.FilterByStatus(arn.AnimeListStatusDropped))
|
|
|
|
|
|
|
|
l.Page("/animelist/watching", animelist.Redirect)
|
|
|
|
l.Page("/animelist/completed", animelist.Redirect)
|
|
|
|
l.Page("/animelist/planned", animelist.Redirect)
|
|
|
|
l.Page("/animelist/hold", animelist.Redirect)
|
|
|
|
l.Page("/animelist/dropped", animelist.Redirect)
|
2018-03-14 15:15:35 +00:00
|
|
|
|
2017-11-07 15:49:56 +00:00
|
|
|
// Compare
|
2017-11-11 14:14:16 +00:00
|
|
|
l.Page("/compare/animelist/:nick-1/:nick-2", compare.AnimeList)
|
2017-11-07 15:49:56 +00:00
|
|
|
|
|
|
|
// Search
|
2017-11-11 15:16:25 +00:00
|
|
|
l.Page("/search/*term", search.Get)
|
2018-03-17 19:41:18 +00:00
|
|
|
l.Page("/empty-search", search.GetEmptySearch)
|
|
|
|
l.Page("/anime-search/*term", search.Anime)
|
|
|
|
l.Page("/character-search/*term", search.Characters)
|
|
|
|
l.Page("/forum-search/*term", search.Forum)
|
|
|
|
l.Page("/soundtrack-search/*term", search.SoundTracks)
|
|
|
|
l.Page("/user-search/*term", search.Users)
|
2018-03-17 21:09:17 +00:00
|
|
|
l.Page("/company-search/*term", search.Companies)
|
2018-04-16 22:02:24 +00:00
|
|
|
l.Page("/multisearch/anime", multisearch.Anime)
|
2017-11-07 15:49:56 +00:00
|
|
|
|
2018-04-16 22:02:24 +00:00
|
|
|
// Shop
|
2017-11-07 15:49:56 +00:00
|
|
|
// Shop
|
2018-03-04 15:53:42 +00:00
|
|
|
l.Page("/support", support.Get)
|
2017-11-11 14:14:16 +00:00
|
|
|
l.Page("/shop", shop.Get)
|
|
|
|
l.Page("/inventory", inventory.Get)
|
|
|
|
l.Page("/charge", charge.Get)
|
|
|
|
l.Page("/shop/history", shop.PurchaseHistory)
|
2017-11-07 15:49:56 +00:00
|
|
|
app.Post("/api/shop/buy/:item/:quantity", shop.BuyItem)
|
|
|
|
|
2018-03-18 20:41:13 +00:00
|
|
|
// Import anime
|
|
|
|
app.Post("/api/import/kitsu/anime/:id", animeimport.Kitsu)
|
2018-04-17 10:27:54 +00:00
|
|
|
app.Post("/api/delete/kitsu/anime/:id", animeimport.DeleteKitsu)
|
2018-03-18 20:41:13 +00:00
|
|
|
|
2018-03-02 20:42:34 +00:00
|
|
|
// Upload
|
|
|
|
app.Post("/api/upload/avatar", upload.Avatar)
|
2018-03-07 13:00:14 +00:00
|
|
|
app.Post("/api/upload/cover", upload.Cover)
|
2018-03-16 21:40:38 +00:00
|
|
|
app.Post("/api/upload/anime/:id/image", upload.AnimeImage)
|
2018-04-22 13:24:17 +00:00
|
|
|
app.Post("/api/upload/character/:id/image", upload.CharacterImage)
|
2018-04-15 08:36:51 +00:00
|
|
|
app.Post("/api/upload/amv/:id/file", upload.AMVFile)
|
2018-03-02 20:42:34 +00:00
|
|
|
|
2017-11-07 15:49:56 +00:00
|
|
|
// Admin
|
2017-11-11 14:14:16 +00:00
|
|
|
l.Page("/admin", admin.Get)
|
|
|
|
l.Page("/admin/webdev", admin.WebDev)
|
2018-04-16 13:17:23 +00:00
|
|
|
l.Page("/admin/registrations", admin.UserRegistrations)
|
2018-04-17 16:20:53 +00:00
|
|
|
l.Page("/admin/errors/client", admin.ClientErrors)
|
2017-11-11 14:14:16 +00:00
|
|
|
l.Page("/admin/purchases", admin.PurchaseHistory)
|
2017-11-07 15:49:56 +00:00
|
|
|
|
|
|
|
// Editor
|
2017-11-11 14:14:16 +00:00
|
|
|
l.Page("/editor", editor.Get)
|
2018-03-19 21:28:44 +00:00
|
|
|
|
2018-03-23 00:43:45 +00:00
|
|
|
// Editor links can be filtered by year, status and type
|
|
|
|
editorFilterable := func(route string, handler func(ctx *aero.Context) string) {
|
2018-04-13 15:55:52 +00:00
|
|
|
l.Page(route+"/:year/:season/:status/:type", handler)
|
2018-03-22 21:26:52 +00:00
|
|
|
}
|
|
|
|
|
2018-03-23 00:43:45 +00:00
|
|
|
// Editor - Anime
|
|
|
|
editorFilterable("/editor/anime/mapping/shoboi", filteranime.Shoboi)
|
|
|
|
editorFilterable("/editor/anime/mapping/anilist", filteranime.AniList)
|
|
|
|
editorFilterable("/editor/anime/mapping/mal", filteranime.MAL)
|
2018-03-23 02:37:14 +00:00
|
|
|
editorFilterable("/editor/anime/mapping/duplicate", filteranime.DuplicateMappings)
|
2018-03-26 17:44:35 +00:00
|
|
|
|
2018-03-23 00:43:45 +00:00
|
|
|
editorFilterable("/editor/anime/image/lowres", filteranime.LowResolutionAnimeImages)
|
|
|
|
editorFilterable("/editor/anime/image/ultralowres", filteranime.UltraLowResolutionAnimeImages)
|
2018-03-20 00:19:11 +00:00
|
|
|
|
2018-03-26 17:44:35 +00:00
|
|
|
editorFilterable("/editor/anime/companies/studios", filteranime.Studios)
|
|
|
|
editorFilterable("/editor/anime/companies/producers", filteranime.Producers)
|
|
|
|
editorFilterable("/editor/anime/companies/licensors", filteranime.Licensors)
|
|
|
|
|
2018-04-08 08:55:17 +00:00
|
|
|
editorFilterable("/editor/anime/connections/relations", filteranime.Relations)
|
|
|
|
editorFilterable("/editor/anime/connections/characters", filteranime.Characters)
|
|
|
|
|
2018-03-26 17:44:35 +00:00
|
|
|
editorFilterable("/editor/anime/details/synopsis", filteranime.Synopsis)
|
|
|
|
editorFilterable("/editor/anime/details/genres", filteranime.Genres)
|
2018-04-05 22:37:10 +00:00
|
|
|
editorFilterable("/editor/anime/details/trailers", filteranime.Trailers)
|
2018-03-26 17:44:35 +00:00
|
|
|
editorFilterable("/editor/anime/details/startdate", filteranime.StartDate)
|
|
|
|
editorFilterable("/editor/anime/details/episodelength", filteranime.EpisodeLength)
|
|
|
|
editorFilterable("/editor/anime/details/source", filteranime.Source)
|
|
|
|
|
2018-04-07 14:32:37 +00:00
|
|
|
editorFilterable("/editor/anime/all", filteranime.All)
|
2018-03-26 17:44:35 +00:00
|
|
|
|
2018-03-20 00:19:11 +00:00
|
|
|
// Editor - MALdiff
|
2018-03-23 00:43:45 +00:00
|
|
|
editorFilterable("/editor/mal/diff/anime", editor.CompareMAL)
|
2018-03-20 00:19:11 +00:00
|
|
|
|
|
|
|
// Editor - Kitsu
|
2018-03-22 21:26:52 +00:00
|
|
|
l.Page("/editor/kitsu/new/anime", editor.NewKitsuAnime)
|
2017-11-07 15:49:56 +00:00
|
|
|
|
2018-03-19 21:28:44 +00:00
|
|
|
// Editor - Companies
|
2018-03-22 21:26:52 +00:00
|
|
|
l.Page("/editor/companies/description", filtercompanies.NoDescription)
|
2018-03-19 21:28:44 +00:00
|
|
|
|
2018-03-25 00:54:01 +00:00
|
|
|
// Editor - Soundtracks
|
2018-04-13 11:09:46 +00:00
|
|
|
l.Page("/editor/soundtracks/links", filtersoundtracks.Links)
|
2018-04-25 14:13:03 +00:00
|
|
|
l.Page("/editor/soundtracks/lyrics/missing", filtersoundtracks.MissingLyrics)
|
|
|
|
l.Page("/editor/soundtracks/lyrics/unaligned", filtersoundtracks.UnalignedLyrics)
|
2018-04-13 11:09:46 +00:00
|
|
|
l.Page("/editor/soundtracks/tags", filtersoundtracks.Tags)
|
|
|
|
l.Page("/editor/soundtracks/file", filtersoundtracks.File)
|
2018-03-25 00:54:01 +00:00
|
|
|
|
2018-03-09 18:04:06 +00:00
|
|
|
// Log
|
|
|
|
l.Page("/log", editlog.Get)
|
2018-04-09 11:44:02 +00:00
|
|
|
l.Page("/log/from/:index", editlog.Get)
|
|
|
|
l.Page("/user/:nick/log", editlog.Get)
|
|
|
|
l.Page("/user/:nick/log/from/:index", editlog.Get)
|
2018-03-09 18:04:06 +00:00
|
|
|
|
2017-11-07 15:49:56 +00:00
|
|
|
// Mixed
|
2018-03-23 00:43:45 +00:00
|
|
|
// l.Page("/database", database.Get)
|
|
|
|
// app.Get("/api/select/:data-type/where/:field/is/:field-value", database.Select)
|
2017-11-07 15:49:56 +00:00
|
|
|
|
|
|
|
// Import
|
2017-11-11 14:14:16 +00:00
|
|
|
l.Page("/import", listimport.Get)
|
|
|
|
l.Page("/import/anilist/animelist", listimportanilist.Preview)
|
|
|
|
l.Page("/import/anilist/animelist/finish", listimportanilist.Finish)
|
|
|
|
l.Page("/import/myanimelist/animelist", listimportmyanimelist.Preview)
|
|
|
|
l.Page("/import/myanimelist/animelist/finish", listimportmyanimelist.Finish)
|
|
|
|
l.Page("/import/kitsu/animelist", listimportkitsu.Preview)
|
|
|
|
l.Page("/import/kitsu/animelist/finish", listimportkitsu.Finish)
|
2017-11-07 15:49:56 +00:00
|
|
|
|
|
|
|
// Browser extension
|
2017-11-11 14:14:16 +00:00
|
|
|
l.Page("/extension/embed", embed.Get)
|
2017-11-07 15:49:56 +00:00
|
|
|
|
|
|
|
// API
|
|
|
|
app.Get("/api/me", me.Get)
|
2017-11-16 15:38:49 +00:00
|
|
|
app.Get("/api/popular/anime/titles/:count", popular.AnimeTitles)
|
2017-11-07 15:49:56 +00:00
|
|
|
app.Get("/api/test/notification", notifications.Test)
|
2018-02-28 15:26:49 +00:00
|
|
|
app.Get("/api/count/notifications/unseen", notifications.CountUnseen)
|
2018-02-28 23:06:03 +00:00
|
|
|
app.Get("/api/mark/notifications/seen", notifications.MarkNotificationsAsSeen)
|
2018-03-11 19:22:33 +00:00
|
|
|
app.Get("/api/random/soundtrack", soundtrack.Random)
|
|
|
|
app.Get("/api/next/soundtrack", soundtrack.Next)
|
2017-11-07 15:49:56 +00:00
|
|
|
|
2017-11-17 11:08:16 +00:00
|
|
|
// Legal stuff
|
|
|
|
l.Page("/terms", terms.Get)
|
|
|
|
|
2017-11-07 15:49:56 +00:00
|
|
|
// PayPal
|
2017-11-11 14:14:16 +00:00
|
|
|
l.Page("/paypal/success", paypal.Success)
|
|
|
|
l.Page("/paypal/cancel", paypal.Cancel)
|
2017-11-07 15:49:56 +00:00
|
|
|
app.Post("/api/paypal/payment/create", paypal.CreatePayment)
|
|
|
|
|
|
|
|
// Genres
|
2017-11-30 01:59:19 +00:00
|
|
|
l.Page("/genres", genres.Get)
|
2017-11-30 00:47:12 +00:00
|
|
|
l.Page("/genre/:name", genre.Get)
|
2017-11-07 15:49:56 +00:00
|
|
|
}
|