Added welcome page
This commit is contained in:
20
pages/welcome/welcome.go
Normal file
20
pages/welcome/welcome.go
Normal file
@ -0,0 +1,20 @@
|
||||
package welcome
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/aerogo/aero"
|
||||
"github.com/animenotifier/notify.moe/components"
|
||||
"github.com/animenotifier/notify.moe/utils"
|
||||
)
|
||||
|
||||
// Get returns the welcome page.
|
||||
func Get(ctx *aero.Context) string {
|
||||
user := utils.GetUser(ctx)
|
||||
|
||||
if user == nil {
|
||||
return ctx.Error(http.StatusUnauthorized, "Not logged in")
|
||||
}
|
||||
|
||||
return ctx.HTML(components.Welcome(user))
|
||||
}
|
44
pages/welcome/welcome.pixy
Normal file
44
pages/welcome/welcome.pixy
Normal file
@ -0,0 +1,44 @@
|
||||
component Welcome(user *arn.User)
|
||||
.welcome
|
||||
if user.HasBasicInfo()
|
||||
h1.mountable Thanks!
|
||||
else
|
||||
h1.mountable Welcome!
|
||||
|
||||
if !user.HasNick()
|
||||
p.welcome-text.mountable To start using notify.moe, please enter a username.
|
||||
|
||||
.mountable(data-api="/api/user/" + user.ID)
|
||||
//- [^\\W\\s\\d]{1,24}[A-Za-z]{1}
|
||||
InputText("Nick", user.CleanNick(), "Nick", "Your username on notify.moe")
|
||||
|
||||
.footer.mountable
|
||||
p Only letters and underscore.
|
||||
else if !user.HasAvatar()
|
||||
p.welcome-text.mountable Add an avatar so people can recognize you.
|
||||
|
||||
.mountable(data-api="/api/user/" + user.ID)
|
||||
AvatarInput(user)
|
||||
|
||||
.footer.mountable
|
||||
p Recommended size: 560x560 (minimum: 280x280)
|
||||
else if user.Introduction == ""
|
||||
p.welcome-text.mountable Write a little introduction so people know who you are!
|
||||
|
||||
.mountable(data-api="/api/user/" + user.ID)
|
||||
InputTextArea("Introduction", user.Introduction, "Introduction", "Tell us about yourself")
|
||||
|
||||
.footer.mountable
|
||||
p Markdown allowed.
|
||||
else
|
||||
p.welcome-text.mountable You're ready to start using Anime Notifier!
|
||||
|
||||
.buttons.mountable
|
||||
if len(user.AnimeList().Items) == 0
|
||||
a.button(href="/settings/accounts")
|
||||
Icon("download")
|
||||
span Import anime list
|
||||
else
|
||||
a.button(href=user.Link())
|
||||
Icon("user")
|
||||
span= user.Nick
|
10
pages/welcome/welcome.scarlet
Normal file
10
pages/welcome/welcome.scarlet
Normal file
@ -0,0 +1,10 @@
|
||||
.welcome
|
||||
max-width 600px
|
||||
margin 0 auto
|
||||
|
||||
label
|
||||
display none
|
||||
|
||||
.welcome-text
|
||||
text-align center
|
||||
margin-bottom 1rem
|
Reference in New Issue
Block a user