✨ Added basic quote display
This commit is contained in:
16
pages/quotes/quotes.go
Normal file
16
pages/quotes/quotes.go
Normal file
@ -0,0 +1,16 @@
|
||||
package quotes
|
||||
|
||||
import (
|
||||
"github.com/aerogo/aero"
|
||||
"github.com/animenotifier/arn"
|
||||
"github.com/animenotifier/notify.moe/components"
|
||||
"github.com/animenotifier/notify.moe/utils"
|
||||
)
|
||||
|
||||
// Get renders the quotes page.
|
||||
func Get(ctx *aero.Context) string {
|
||||
user := utils.GetUser(ctx)
|
||||
|
||||
quotes := arn.AllQuotes()
|
||||
return ctx.HTML(components.Quotes(quotes, user))
|
||||
}
|
17
pages/quotes/quotes.pixy
Normal file
17
pages/quotes/quotes.pixy
Normal file
@ -0,0 +1,17 @@
|
||||
component Quotes(quotes []*arn.Quote, user *arn.User)
|
||||
h1.page-title Quotes
|
||||
|
||||
.corner-buttons
|
||||
if user != nil
|
||||
if user.DraftIndex().QuoteID == ""
|
||||
button.action(data-action="newObject", data-trigger="click", data-type="quote")
|
||||
Icon("plus")
|
||||
span Add quote
|
||||
else
|
||||
a.button.ajax(href="/quote/" + user.DraftIndex().QuoteID + "/edit")
|
||||
Icon("pencil")
|
||||
span Edit draft
|
||||
|
||||
ul
|
||||
each quote in quotes
|
||||
li= quote.Description
|
Reference in New Issue
Block a user