Starting with a fresh database

This commit is contained in:
2017-06-02 16:17:58 +02:00
parent a762b7bec1
commit 13c87d65d8
7 changed files with 170 additions and 117 deletions

View File

@ -2,25 +2,24 @@ package dashboard
import (
"github.com/aerogo/aero"
"github.com/animenotifier/arn"
"github.com/animenotifier/notify.moe/components"
)
const maxPosts = 5
// Get ...
func Get(ctx *aero.Context) string {
posts, err := arn.GetPosts()
// posts, err := arn.GetPosts()
if err != nil {
return ctx.Error(500, "Error fetching posts", err)
}
// if err != nil {
// return ctx.Error(500, "Error fetching posts", err)
// }
arn.SortPostsLatestFirst(posts)
// arn.SortPostsLatestFirst(posts)
if len(posts) > maxPosts {
posts = posts[:maxPosts]
}
// if len(posts) > maxPosts {
// posts = posts[:maxPosts]
// }
return ctx.HTML(components.Dashboard(posts))
// return ctx.HTML(components.Dashboard(posts))
return ctx.HTML("ARN 4.0 is currently under construction.<br><a href='https://paypal.me/blitzprog' target='_blank' rel='noopener'>Support the development</a>")
}