Upgraded to latest pixy version

This commit is contained in:
Eduard Urbach 2016-11-13 01:40:16 +09:00
parent d6075f55b9
commit f9424a79e4
11 changed files with 14 additions and 7 deletions

2
.gitignore vendored
View File

@ -34,7 +34,7 @@ node_modules/
debug
# pixy
$.go
/components
# binaries
/notify.moe

View File

@ -4,12 +4,14 @@ import (
"io/ioutil"
"github.com/aerogo/aero"
"github.com/animenotifier/notify.moe/components"
)
var app = aero.New()
func main() {
app.SetStyle(bundledCSS)
// app.SetStyle(bundledCSS)
app.SetStyle("")
scripts, _ := ioutil.ReadFile("temp/scripts.js")
js := string(scripts)
@ -19,8 +21,12 @@ func main() {
return js
})
app.Get("/hello", func(ctx *aero.Context) string {
return "Hello World"
})
app.Layout = func(ctx *aero.Context, content string) string {
return Render.Layout(content)
return components.Layout(content)
}
app.Run()

View File

@ -5,11 +5,12 @@ import (
"github.com/aerogo/aero"
"github.com/animenotifier/arn"
"github.com/animenotifier/notify.moe/components"
)
func init() {
app.Ajax("/", func(ctx *aero.Context) string {
return ctx.HTML(Render.Dashboard())
return ctx.HTML(components.Dashboard())
})
app.Ajax("/anime/:id", func(ctx *aero.Context) string {
@ -20,11 +21,11 @@ func init() {
return ctx.Text("Anime not found")
}
return ctx.HTML(Render.Anime(anime))
return ctx.HTML(components.Anime(anime))
})
app.Ajax("/genres", func(ctx *aero.Context) string {
return ctx.HTML(Render.GenreOverview())
return ctx.HTML(components.GenreOverview())
})
app.Ajax("/genres/:name", func(ctx *aero.Context) string {
@ -37,6 +38,6 @@ func init() {
return err.Error()
}
return ctx.HTML(Render.AnimeInGenre(genreInfo.Genre, genreInfo.AnimeList))
return ctx.HTML(components.AnimeInGenre(genreInfo.Genre, genreInfo.AnimeList))
})
}