Applied new layout system

This commit is contained in:
2019-06-03 12:20:17 +09:00
parent 36427a1501
commit 3268488b7b
26 changed files with 346 additions and 308 deletions

View File

@ -1,27 +1,28 @@
package forumroutes
import (
"github.com/aerogo/layout"
"github.com/aerogo/aero"
"github.com/animenotifier/notify.moe/pages/forum"
"github.com/animenotifier/notify.moe/pages/newthread"
"github.com/animenotifier/notify.moe/pages/post"
"github.com/animenotifier/notify.moe/pages/post/editpost"
"github.com/animenotifier/notify.moe/pages/thread"
"github.com/animenotifier/notify.moe/pages/thread/editthread"
"github.com/animenotifier/notify.moe/utils/page"
)
// Register registers the page routes.
func Register(l *layout.Layout) {
func Register(app *aero.Application) {
// Forum
l.Page("/forum", forum.Get)
l.Page("/forum/:tag", forum.Get)
page.Get(app, "/forum", forum.Get)
page.Get(app, "/forum/:tag", forum.Get)
// Thread
l.Page("/thread/:id", thread.Get)
l.Page("/thread/:id/edit", editthread.Get)
l.Page("/new/thread", newthread.Get)
page.Get(app, "/thread/:id", thread.Get)
page.Get(app, "/thread/:id/edit", editthread.Get)
page.Get(app, "/new/thread", newthread.Get)
// Post
l.Page("/post/:id", post.Get)
l.Page("/post/:id/edit", editpost.Get)
page.Get(app, "/post/:id", post.Get)
page.Get(app, "/post/:id/edit", editpost.Get)
}