Updated to latest aero version
This commit is contained in:
parent
2c37bcf6dd
commit
560f87d3f2
@ -1,4 +1,4 @@
|
||||
package layout
|
||||
package fullpage
|
||||
|
||||
import (
|
||||
"sort"
|
||||
|
4
main.go
4
main.go
@ -6,7 +6,6 @@ import (
|
||||
"github.com/animenotifier/arn"
|
||||
"github.com/animenotifier/notify.moe/auth"
|
||||
"github.com/animenotifier/notify.moe/components/css"
|
||||
"github.com/animenotifier/notify.moe/layout"
|
||||
"github.com/animenotifier/notify.moe/middleware"
|
||||
"github.com/animenotifier/notify.moe/pages"
|
||||
)
|
||||
@ -23,9 +22,6 @@ func configure(app *aero.Application) *aero.Application {
|
||||
app.Sessions.Duration = 3600 * 24 * 30 * 6
|
||||
app.Sessions.Store = nanostore.New(arn.DB.Collection("Session"))
|
||||
|
||||
// Layout
|
||||
app.Layout = layout.Render
|
||||
|
||||
// CSS
|
||||
app.SetStyle(css.Bundle())
|
||||
|
||||
|
177
pages/index.go
177
pages/index.go
@ -2,8 +2,10 @@ package pages
|
||||
|
||||
import (
|
||||
"github.com/aerogo/aero"
|
||||
"github.com/aerogo/layout"
|
||||
"github.com/animenotifier/arn"
|
||||
"github.com/animenotifier/notify.moe/components"
|
||||
"github.com/animenotifier/notify.moe/layout"
|
||||
"github.com/animenotifier/notify.moe/pages/admin"
|
||||
"github.com/animenotifier/notify.moe/pages/anime"
|
||||
"github.com/animenotifier/notify.moe/pages/animelist"
|
||||
@ -47,137 +49,142 @@ import (
|
||||
|
||||
// Configure registers the page routes in the application.
|
||||
func Configure(app *aero.Application) {
|
||||
layout := layout.New(app)
|
||||
|
||||
// Set render function for the layout
|
||||
layout.Render = fullpage.Render
|
||||
|
||||
// Main menu
|
||||
app.Ajax("/", home.Get)
|
||||
app.Ajax("/explore", explore.Get)
|
||||
app.Ajax("/explore/anime/:year/:status/:type", explore.Filter)
|
||||
app.Ajax("/login", login.Get)
|
||||
app.Ajax("/api", apiview.Get)
|
||||
// app.Ajax("/dashboard", dashboard.Get)
|
||||
// app.Ajax("/best/anime", best.Get)
|
||||
// app.Ajax("/artworks", artworks.Get)
|
||||
// app.Ajax("/amvs", amvs.Get)
|
||||
layout.Page("/", home.Get)
|
||||
layout.Page("/explore", explore.Get)
|
||||
layout.Page("/explore/anime/:year/:status/:type", explore.Filter)
|
||||
layout.Page("/login", login.Get)
|
||||
layout.Page("/api", apiview.Get)
|
||||
// layout.Ajax("/dashboard", dashboard.Get)
|
||||
// layout.Ajax("/best/anime", best.Get)
|
||||
// layout.Ajax("/artworks", artworks.Get)
|
||||
// layout.Ajax("/amvs", amvs.Get)
|
||||
|
||||
// Forum
|
||||
app.Ajax("/forum", forums.Get)
|
||||
app.Ajax("/forum/:tag", forum.Get)
|
||||
app.Ajax("/thread/:id", threads.Get)
|
||||
app.Ajax("/post/:id", posts.Get)
|
||||
app.Ajax("/new/thread", newthread.Get)
|
||||
layout.Page("/forum", forums.Get)
|
||||
layout.Page("/forum/:tag", forum.Get)
|
||||
layout.Page("/thread/:id", threads.Get)
|
||||
layout.Page("/post/:id", posts.Get)
|
||||
layout.Page("/new/thread", newthread.Get)
|
||||
|
||||
// User lists
|
||||
app.Ajax("/users", users.Active)
|
||||
app.Ajax("/users/osu", users.Osu)
|
||||
app.Ajax("/users/staff", users.Staff)
|
||||
layout.Page("/users", users.Active)
|
||||
layout.Page("/users/osu", users.Osu)
|
||||
layout.Page("/users/staff", users.Staff)
|
||||
|
||||
// Statistics
|
||||
app.Ajax("/statistics", statistics.Get)
|
||||
app.Ajax("/statistics/anime", statistics.Anime)
|
||||
layout.Page("/statistics", statistics.Get)
|
||||
layout.Page("/statistics/anime", statistics.Anime)
|
||||
|
||||
// Anime
|
||||
app.Ajax("/anime/:id", anime.Get)
|
||||
app.Ajax("/anime/:id/episodes", anime.Episodes)
|
||||
app.Ajax("/anime/:id/characters", anime.Characters)
|
||||
app.Ajax("/anime/:id/tracks", anime.Tracks)
|
||||
app.Ajax("/anime/:id/edit", editanime.Get)
|
||||
layout.Page("/anime/:id", anime.Get)
|
||||
layout.Page("/anime/:id/episodes", anime.Episodes)
|
||||
layout.Page("/anime/:id/characters", anime.Characters)
|
||||
layout.Page("/anime/:id/tracks", anime.Tracks)
|
||||
layout.Page("/anime/:id/edit", editanime.Get)
|
||||
|
||||
// Characters
|
||||
app.Ajax("/character/:id", character.Get)
|
||||
layout.Page("/character/:id", character.Get)
|
||||
|
||||
// Settings
|
||||
app.Ajax("/settings", settings.Get(components.SettingsPersonal))
|
||||
app.Ajax("/settings/accounts", settings.Get(components.SettingsAccounts))
|
||||
app.Ajax("/settings/notifications", settings.Get(components.SettingsNotifications))
|
||||
app.Ajax("/settings/apps", settings.Get(components.SettingsApps))
|
||||
app.Ajax("/settings/avatar", settings.Get(components.SettingsAvatar))
|
||||
app.Ajax("/settings/formatting", settings.Get(components.SettingsFormatting))
|
||||
app.Ajax("/settings/pro", settings.Get(components.SettingsPro))
|
||||
layout.Page("/settings", settings.Get(components.SettingsPersonal))
|
||||
layout.Page("/settings/accounts", settings.Get(components.SettingsAccounts))
|
||||
layout.Page("/settings/notifications", settings.Get(components.SettingsNotifications))
|
||||
layout.Page("/settings/apps", settings.Get(components.SettingsApps))
|
||||
layout.Page("/settings/avatar", settings.Get(components.SettingsAvatar))
|
||||
layout.Page("/settings/formatting", settings.Get(components.SettingsFormatting))
|
||||
layout.Page("/settings/pro", settings.Get(components.SettingsPro))
|
||||
|
||||
// Soundtracks
|
||||
app.Ajax("/soundtracks", soundtracks.Get)
|
||||
app.Ajax("/soundtracks/from/:index", soundtracks.From)
|
||||
app.Ajax("/soundtrack/:id", soundtrack.Get)
|
||||
app.Ajax("/soundtrack/:id/edit", soundtrack.Edit)
|
||||
layout.Page("/soundtracks", soundtracks.Get)
|
||||
layout.Page("/soundtracks/from/:index", soundtracks.From)
|
||||
layout.Page("/soundtrack/:id", soundtrack.Get)
|
||||
layout.Page("/soundtrack/:id/edit", soundtrack.Edit)
|
||||
|
||||
// Groups
|
||||
app.Ajax("/groups", groups.Get)
|
||||
app.Ajax("/group/:id", group.Get)
|
||||
app.Ajax("/group/:id/edit", group.Edit)
|
||||
app.Ajax("/group/:id/forum", group.Forum)
|
||||
layout.Page("/groups", groups.Get)
|
||||
layout.Page("/group/:id", group.Get)
|
||||
layout.Page("/group/:id/edit", group.Edit)
|
||||
layout.Page("/group/:id/forum", group.Forum)
|
||||
|
||||
// User profiles
|
||||
app.Ajax("/user", user.Get)
|
||||
app.Ajax("/user/:nick", profile.Get)
|
||||
app.Ajax("/user/:nick/threads", profile.GetThreadsByUser)
|
||||
app.Ajax("/user/:nick/posts", profile.GetPostsByUser)
|
||||
app.Ajax("/user/:nick/soundtracks", profile.GetSoundTracksByUser)
|
||||
app.Ajax("/user/:nick/stats", profile.GetStatsByUser)
|
||||
app.Ajax("/user/:nick/followers", profile.GetFollowers)
|
||||
app.Ajax("/user/:nick/animelist", animelist.Get)
|
||||
app.Ajax("/user/:nick/animelist/watching", animelist.FilterByStatus(arn.AnimeListStatusWatching))
|
||||
app.Ajax("/user/:nick/animelist/completed", animelist.FilterByStatus(arn.AnimeListStatusCompleted))
|
||||
app.Ajax("/user/:nick/animelist/planned", animelist.FilterByStatus(arn.AnimeListStatusPlanned))
|
||||
app.Ajax("/user/:nick/animelist/hold", animelist.FilterByStatus(arn.AnimeListStatusHold))
|
||||
app.Ajax("/user/:nick/animelist/dropped", animelist.FilterByStatus(arn.AnimeListStatusDropped))
|
||||
app.Ajax("/user/:nick/animelist/anime/:id", animelistitem.Get)
|
||||
layout.Page("/user", user.Get)
|
||||
layout.Page("/user/:nick", profile.Get)
|
||||
layout.Page("/user/:nick/threads", profile.GetThreadsByUser)
|
||||
layout.Page("/user/:nick/posts", profile.GetPostsByUser)
|
||||
layout.Page("/user/:nick/soundtracks", profile.GetSoundTracksByUser)
|
||||
layout.Page("/user/:nick/stats", profile.GetStatsByUser)
|
||||
layout.Page("/user/:nick/followers", profile.GetFollowers)
|
||||
layout.Page("/user/:nick/animelist", animelist.Get)
|
||||
layout.Page("/user/:nick/animelist/watching", animelist.FilterByStatus(arn.AnimeListStatusWatching))
|
||||
layout.Page("/user/:nick/animelist/completed", animelist.FilterByStatus(arn.AnimeListStatusCompleted))
|
||||
layout.Page("/user/:nick/animelist/planned", animelist.FilterByStatus(arn.AnimeListStatusPlanned))
|
||||
layout.Page("/user/:nick/animelist/hold", animelist.FilterByStatus(arn.AnimeListStatusHold))
|
||||
layout.Page("/user/:nick/animelist/dropped", animelist.FilterByStatus(arn.AnimeListStatusDropped))
|
||||
layout.Page("/user/:nick/animelist/anime/:id", animelistitem.Get)
|
||||
|
||||
// Anime list
|
||||
app.Ajax("/animelist/watching", home.FilterByStatus(arn.AnimeListStatusWatching))
|
||||
app.Ajax("/animelist/completed", home.FilterByStatus(arn.AnimeListStatusCompleted))
|
||||
app.Ajax("/animelist/planned", home.FilterByStatus(arn.AnimeListStatusPlanned))
|
||||
app.Ajax("/animelist/hold", home.FilterByStatus(arn.AnimeListStatusHold))
|
||||
app.Ajax("/animelist/dropped", home.FilterByStatus(arn.AnimeListStatusDropped))
|
||||
layout.Page("/animelist/watching", home.FilterByStatus(arn.AnimeListStatusWatching))
|
||||
layout.Page("/animelist/completed", home.FilterByStatus(arn.AnimeListStatusCompleted))
|
||||
layout.Page("/animelist/planned", home.FilterByStatus(arn.AnimeListStatusPlanned))
|
||||
layout.Page("/animelist/hold", home.FilterByStatus(arn.AnimeListStatusHold))
|
||||
layout.Page("/animelist/dropped", home.FilterByStatus(arn.AnimeListStatusDropped))
|
||||
|
||||
// Compare
|
||||
app.Ajax("/compare/animelist/:nick-1/:nick-2", compare.AnimeList)
|
||||
layout.Page("/compare/animelist/:nick-1/:nick-2", compare.AnimeList)
|
||||
|
||||
// Search
|
||||
app.Ajax("/search", search.Get)
|
||||
app.Ajax("/search/:term", search.Get)
|
||||
layout.Page("/search", search.Get)
|
||||
layout.Page("/search/:term", search.Get)
|
||||
|
||||
// Shop
|
||||
app.Ajax("/shop", shop.Get)
|
||||
app.Ajax("/inventory", inventory.Get)
|
||||
app.Ajax("/charge", charge.Get)
|
||||
app.Ajax("/shop/history", shop.PurchaseHistory)
|
||||
layout.Page("/shop", shop.Get)
|
||||
layout.Page("/inventory", inventory.Get)
|
||||
layout.Page("/charge", charge.Get)
|
||||
layout.Page("/shop/history", shop.PurchaseHistory)
|
||||
app.Post("/api/shop/buy/:item/:quantity", shop.BuyItem)
|
||||
|
||||
// Admin
|
||||
app.Ajax("/admin", admin.Get)
|
||||
app.Ajax("/admin/webdev", admin.WebDev)
|
||||
app.Ajax("/admin/purchases", admin.PurchaseHistory)
|
||||
layout.Page("/admin", admin.Get)
|
||||
layout.Page("/admin/webdev", admin.WebDev)
|
||||
layout.Page("/admin/purchases", admin.PurchaseHistory)
|
||||
|
||||
// Editor
|
||||
app.Ajax("/editor", editor.Get)
|
||||
app.Ajax("/editor/anilist", editor.AniList)
|
||||
app.Ajax("/editor/shoboi", editor.Shoboi)
|
||||
layout.Page("/editor", editor.Get)
|
||||
layout.Page("/editor/anilist", editor.AniList)
|
||||
layout.Page("/editor/shoboi", editor.Shoboi)
|
||||
|
||||
// Mixed
|
||||
app.Ajax("/database", database.Get)
|
||||
layout.Page("/database", database.Get)
|
||||
app.Get("/api/select/:data-type/where/:field/is/:field-value", database.Select)
|
||||
|
||||
// Import
|
||||
app.Ajax("/import", listimport.Get)
|
||||
app.Ajax("/import/anilist/animelist", listimportanilist.Preview)
|
||||
app.Ajax("/import/anilist/animelist/finish", listimportanilist.Finish)
|
||||
app.Ajax("/import/myanimelist/animelist", listimportmyanimelist.Preview)
|
||||
app.Ajax("/import/myanimelist/animelist/finish", listimportmyanimelist.Finish)
|
||||
app.Ajax("/import/kitsu/animelist", listimportkitsu.Preview)
|
||||
app.Ajax("/import/kitsu/animelist/finish", listimportkitsu.Finish)
|
||||
layout.Page("/import", listimport.Get)
|
||||
layout.Page("/import/anilist/animelist", listimportanilist.Preview)
|
||||
layout.Page("/import/anilist/animelist/finish", listimportanilist.Finish)
|
||||
layout.Page("/import/myanimelist/animelist", listimportmyanimelist.Preview)
|
||||
layout.Page("/import/myanimelist/animelist/finish", listimportmyanimelist.Finish)
|
||||
layout.Page("/import/kitsu/animelist", listimportkitsu.Preview)
|
||||
layout.Page("/import/kitsu/animelist/finish", listimportkitsu.Finish)
|
||||
|
||||
// Browser extension
|
||||
app.Ajax("/extension/embed", embed.Get)
|
||||
layout.Page("/extension/embed", embed.Get)
|
||||
|
||||
// API
|
||||
app.Get("/api/me", me.Get)
|
||||
app.Get("/api/test/notification", notifications.Test)
|
||||
|
||||
// PayPal
|
||||
app.Ajax("/paypal/success", paypal.Success)
|
||||
app.Ajax("/paypal/cancel", paypal.Cancel)
|
||||
layout.Page("/paypal/success", paypal.Success)
|
||||
layout.Page("/paypal/cancel", paypal.Cancel)
|
||||
app.Post("/api/paypal/payment/create", paypal.CreatePayment)
|
||||
|
||||
// Genres
|
||||
// app.Ajax("/genres", genres.Get)
|
||||
// app.Ajax("/genres/:name", genre.Get)
|
||||
// layout.Ajax("/genres", genres.Get)
|
||||
// layout.Ajax("/genres/:name", genre.Get)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user