Implemented groups

This commit is contained in:
2017-10-17 23:17:04 +02:00
parent e9b6cb3ac8
commit 63a421e6a2
15 changed files with 248 additions and 158 deletions

29
pages/group/group.go Normal file
View File

@ -0,0 +1,29 @@
package group
import (
"net/http"
"github.com/aerogo/aero"
"github.com/animenotifier/arn"
"github.com/animenotifier/notify.moe/components"
)
// Get ...
func Get(ctx *aero.Context) string {
id := ctx.Get("id")
group, err := arn.GetGroup(id)
if err != nil {
return ctx.Error(http.StatusNotFound, "Group not found", err)
}
ctx.Data = &arn.OpenGraph{
Tags: map[string]string{
"og:title": group.Name,
"og:url": "https://" + ctx.App.Config.Domain + group.Link(),
"og:site_name": "notify.moe",
},
}
return ctx.HTML(components.Group(group))
}