diff --git a/main.go b/main.go index 4f56d07..7bb61b2 100644 --- a/main.go +++ b/main.go @@ -60,12 +60,12 @@ type meikanAPIIDs struct { func main() { r := router.New() r.Renderer = NewRenderer() + r.ErrorHandler = errorHandler r.GET(`/static/*asset`, getStatic) r.GET(`/`, home) r.GET(`/compare`, compare) err := r.Start(`:8070`) check(err) - r.ErrorHandler = errorHandler } func check(e error) { @@ -80,13 +80,11 @@ func home(c *router.Context) error { func compare(c *router.Context) error { user := c.QueryParam(`name`) - fmt.Println(user) //https://api.jikan.moe/v3/user/nekomata1037/animelist/all //https://api.meikan.moe/v1/ids/anime jikanList := jikanAPIGetUserAnimelist(user) var list meikanList list.User = user - anime := list.Anime fmt.Println("Getting IDs") IDs := meikanAPIGetIDs() for i := 0; i < len(jikanList.Anime); i++ { @@ -113,7 +111,7 @@ func compare(c *router.Context) error { case 2: temp.Anime.State = "Finished" } - anime = append(anime, temp) + list.Anime = append(list.Anime, temp) } return c.Render(200, `list`, list) diff --git a/static/stylesheet.css b/static/stylesheet.css index 6b9c06d..42cbde8 100644 --- a/static/stylesheet.css +++ b/static/stylesheet.css @@ -1,3 +1,31 @@ body { - color: black; + background: #FFF; + color: #333; +} + +a { + text-decoration: none; + color: #7331e8; +} + +a:visited { + color: #7331e8; +} + +a:hover { + color: #a06cfc; +} + +#list { + margin: auto; + border-collapse:collapse; + box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23); +} + +#list tr:nth-child(odd) { + background: #F5F5F5; +} + +h1 { + text-align: center; } \ No newline at end of file diff --git a/templates/pages/list.gohtml b/templates/pages/list.gohtml index 7fd5d34..21647ba 100644 --- a/templates/pages/list.gohtml +++ b/templates/pages/list.gohtml @@ -1,3 +1,21 @@ {{ define "body" }} -

List for {{.List.User}}

+

List for {{.Content.User}}

+ + + + + + + + + {{range .Content.Anime}} + + + + + + + + {{end}} +
IDTitleScoreTypeProgress
{{.Anime.ID}}{{.Anime.Title}}{{.Rating}}{{.Anime.Type}}{{.Episode}}/{{.Anime.Episodes}}
{{ end }} \ No newline at end of file