Create new thread
This commit is contained in:
@ -4,8 +4,12 @@ component Forum(tag string, threads []*arn.Thread, threadsPerPage int)
|
||||
.forum
|
||||
ThreadList(threads)
|
||||
|
||||
if len(threads) == threadsPerPage
|
||||
.buttons
|
||||
|
||||
.buttons
|
||||
button#new-thread.action(data-action="load", data-trigger="click", data-url="/new/thread")
|
||||
Icon("plus")
|
||||
span New thread
|
||||
if len(threads) == threadsPerPage
|
||||
button
|
||||
Icon("refresh")
|
||||
span Load more
|
||||
|
@ -29,5 +29,8 @@
|
||||
.forum-tag-text
|
||||
display none
|
||||
|
||||
#load-more-threads
|
||||
margin-top 1rem
|
||||
> 1250px
|
||||
#new-thread
|
||||
position fixed
|
||||
right content-padding
|
||||
bottom content-padding
|
||||
|
20
pages/newthread/newthread.go
Normal file
20
pages/newthread/newthread.go
Normal file
@ -0,0 +1,20 @@
|
||||
package newthread
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/aerogo/aero"
|
||||
"github.com/animenotifier/notify.moe/components"
|
||||
"github.com/animenotifier/notify.moe/utils"
|
||||
)
|
||||
|
||||
// Get forums page.
|
||||
func Get(ctx *aero.Context) string {
|
||||
user := utils.GetUser(ctx)
|
||||
|
||||
if user == nil {
|
||||
return ctx.Error(http.StatusBadRequest, "Not logged in", nil)
|
||||
}
|
||||
|
||||
return ctx.HTML(components.NewThread(user))
|
||||
}
|
20
pages/newthread/newthread.pixy
Normal file
20
pages/newthread/newthread.pixy
Normal file
@ -0,0 +1,20 @@
|
||||
component NewThread(user *arn.User)
|
||||
.widgets
|
||||
.widget
|
||||
input#title.widget-element(type="text", placeholder="Title")
|
||||
|
||||
textarea#text.widget-element(placeholder="Content")
|
||||
|
||||
select#tag.widget-element
|
||||
option(value="general") General
|
||||
option(value="news") News
|
||||
option(value="anime") Anime
|
||||
option(value="bug") Bug
|
||||
option(value="suggestion") Suggestion
|
||||
|
||||
if user.Role == "admin"
|
||||
option(value="update") Update
|
||||
|
||||
button.action(data-action="createThread", data-trigger="click")
|
||||
Icon("check")
|
||||
span Create thread
|
Reference in New Issue
Block a user