Minor changes

This commit is contained in:
Eduard Urbach 2017-10-18 23:17:54 +02:00
parent 15267bd102
commit d72543b31e
5 changed files with 28 additions and 1 deletions

View File

@ -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
View 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
View File

@ -0,0 +1,4 @@
component GroupForum(group *arn.Group)
GroupTabs(group)
h1 Forum

View File

@ -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")

View File

@ -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>`)
}