diff --git a/pages/index.go b/pages/index.go index ec55c188..481ac3ed 100644 --- a/pages/index.go +++ b/pages/index.go @@ -108,6 +108,7 @@ func Configure(app *aero.Application) { l.Page("/quote/:id", quote.Get) l.Page("/quote/:id/edit", quote.Edit) l.Page("/quotes", quotes.Get) + // Calendar l.Page("/calendar", calendar.Get) diff --git a/pages/quote/edit.go b/pages/quote/edit.go new file mode 100644 index 00000000..a741e1b9 --- /dev/null +++ b/pages/quote/edit.go @@ -0,0 +1,32 @@ +package quote + +import ( + "net/http" + + "github.com/aerogo/aero" + "github.com/animenotifier/arn" + "github.com/animenotifier/notify.moe/components" + "github.com/animenotifier/notify.moe/utils" + "github.com/animenotifier/notify.moe/utils/editform" +) + +// Edit track. +func Edit(ctx *aero.Context) string { + user := utils.GetUser(ctx) + id := ctx.Get("id") + quote, err := arn.GetQuote(id) + + if err != nil { + return ctx.Error(http.StatusNotFound, "Quote not found", err) + } + + ctx.Data = &arn.OpenGraph{ + Tags: map[string]string{ + "og:title": quote.Description, + "og:url": "https://" + ctx.App.Config.Domain + quote.Link(), + "og:site_name": "notify.moe", + }, + } + + return ctx.HTML(components.QuoteTabs(quote, user) + editform.Render(quote, "Edit quote", user)) +} diff --git a/pages/quote/quote.pixy b/pages/quote/quote.pixy index 43187019..28923e78 100644 --- a/pages/quote/quote.pixy +++ b/pages/quote/quote.pixy @@ -1,4 +1,3 @@ -<<<<<<< HEAD component QuotePage(quote *arn.Quote, character *arn.Character, user *arn.User) QuoteTabs(quote, user) diff --git a/pages/quote/quote.scarlet b/pages/quote/quote.scarlet new file mode 100644 index 00000000..421788f7 --- /dev/null +++ b/pages/quote/quote.scarlet @@ -0,0 +1,36 @@ +.quote-page + vertical + +.quote-header + vertical + +.quote-sidebar + sidebar + +> 1250px + .quote-page + horizontal + + .quote-sidebar + sidebar-medium + +> 1400px + .quote-sidebar + sidebar-big + +.quote-name, +.quote-description + text-align left + +.quote-location + width 100% + height 300px + +.quote-character + horizontal-wrap + +.quote-character-item + anime-mini-item + +.quote-character-item-image + anime-mini-item-image \ No newline at end of file