Added button to add companies

This commit is contained in:
2017-11-18 11:46:17 +01:00
parent c5cb497722
commit 54b08453dc
5 changed files with 23 additions and 8 deletions

View File

@ -6,10 +6,12 @@ import (
"github.com/aerogo/aero"
"github.com/animenotifier/arn"
"github.com/animenotifier/notify.moe/components"
"github.com/animenotifier/notify.moe/utils"
)
// Get company.
func Get(ctx *aero.Context) string {
user := utils.GetUser(ctx)
id := ctx.Get("id")
company, err := arn.GetCompany(id)
@ -17,5 +19,5 @@ func Get(ctx *aero.Context) string {
return ctx.Error(http.StatusNotFound, "Company not found", err)
}
return ctx.HTML(components.CompanyPage(company))
return ctx.HTML(components.CompanyPage(company, user))
}

View File

@ -1,2 +1,2 @@
component CompanyPage(company *arn.Company)
component CompanyPage(company *arn.Company, user *arn.User)
h1= company.Name.English