Minor changes
This commit is contained in:
parent
15267bd102
commit
d72543b31e
1
main.go
1
main.go
@ -107,6 +107,7 @@ func configure(app *aero.Application) *aero.Application {
|
||||
app.Ajax("/groups", groups.Get)
|
||||
app.Ajax("/group/:id", group.Get)
|
||||
app.Ajax("/group/:id/edit", group.Edit)
|
||||
app.Ajax("/group/:id/forum", group.Forum)
|
||||
|
||||
// User profiles
|
||||
app.Ajax("/user", user.Get)
|
||||
|
21
pages/group/forum.go
Normal file
21
pages/group/forum.go
Normal file
@ -0,0 +1,21 @@
|
||||
package group
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/aerogo/aero"
|
||||
"github.com/animenotifier/arn"
|
||||
"github.com/animenotifier/notify.moe/components"
|
||||
)
|
||||
|
||||
// Forum ...
|
||||
func Forum(ctx *aero.Context) string {
|
||||
id := ctx.Get("id")
|
||||
group, err := arn.GetGroup(id)
|
||||
|
||||
if err != nil {
|
||||
return ctx.Error(http.StatusNotFound, "Group not found", err)
|
||||
}
|
||||
|
||||
return ctx.HTML(components.GroupForum(group))
|
||||
}
|
4
pages/group/forum.pixy
Normal file
4
pages/group/forum.pixy
Normal file
@ -0,0 +1,4 @@
|
||||
component GroupForum(group *arn.Group)
|
||||
GroupTabs(group)
|
||||
|
||||
h1 Forum
|
@ -30,4 +30,5 @@ component Group(group *arn.Group)
|
||||
component GroupTabs(group *arn.Group)
|
||||
.tabs
|
||||
Tab("Group", "users", group.Link())
|
||||
Tab("Forum", "comment", group.Link() + "/forum")
|
||||
Tab("Edit", "pencil", group.Link() + "/edit")
|
@ -34,7 +34,7 @@ func Render(obj interface{}, title string, user *arn.User) string {
|
||||
if user != nil && (user.Role == "editor" || user.Role == "admin") {
|
||||
b.WriteString(`<div class="buttons">`)
|
||||
b.WriteString(`<div class="buttons"><button class="action" data-action="publish" data-trigger="click">` + utils.Icon("share-alt") + `Publish</button></div>`)
|
||||
b.WriteString(`<button class="action" data-action="deleteObject" data-trigger="click" data-return-path="/` + lowerCaseTypeName + "s" + `" data-confirm-type="` + lowerCaseTypeName + `">` + utils.Icon("trash") + `Delete ` + t.Name() + `</button>`)
|
||||
b.WriteString(`<button class="action" data-action="deleteObject" data-trigger="click" data-return-path="/` + lowerCaseTypeName + "s" + `" data-confirm-type="` + lowerCaseTypeName + `">` + utils.Icon("trash") + `Delete</button>`)
|
||||
b.WriteString(`</div>`)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user