Improved groups
This commit is contained in:
parent
4fd5cb76e2
commit
621155bfcc
@ -28,5 +28,5 @@ func Edit(ctx *aero.Context) string {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
return ctx.HTML(components.GroupTabs(group) + editform.Render(group, "Edit group", user))
|
return ctx.HTML(components.GroupTabs(group, user) + editform.Render(group, "Edit group", user))
|
||||||
}
|
}
|
||||||
|
@ -6,10 +6,12 @@ import (
|
|||||||
"github.com/aerogo/aero"
|
"github.com/aerogo/aero"
|
||||||
"github.com/animenotifier/arn"
|
"github.com/animenotifier/arn"
|
||||||
"github.com/animenotifier/notify.moe/components"
|
"github.com/animenotifier/notify.moe/components"
|
||||||
|
"github.com/animenotifier/notify.moe/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Forum ...
|
// Forum ...
|
||||||
func Forum(ctx *aero.Context) string {
|
func Forum(ctx *aero.Context) string {
|
||||||
|
user := utils.GetUser(ctx)
|
||||||
id := ctx.Get("id")
|
id := ctx.Get("id")
|
||||||
group, err := arn.GetGroup(id)
|
group, err := arn.GetGroup(id)
|
||||||
|
|
||||||
@ -17,5 +19,5 @@ func Forum(ctx *aero.Context) string {
|
|||||||
return ctx.Error(http.StatusNotFound, "Group not found", err)
|
return ctx.Error(http.StatusNotFound, "Group not found", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return ctx.HTML(components.GroupForum(group))
|
return ctx.HTML(components.GroupForum(group, user))
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
component GroupForum(group *arn.Group)
|
component GroupForum(group *arn.Group, user *arn.User)
|
||||||
GroupTabs(group)
|
GroupTabs(group, user)
|
||||||
|
|
||||||
h1 Forum
|
h1 Forum
|
@ -6,10 +6,12 @@ import (
|
|||||||
"github.com/aerogo/aero"
|
"github.com/aerogo/aero"
|
||||||
"github.com/animenotifier/arn"
|
"github.com/animenotifier/arn"
|
||||||
"github.com/animenotifier/notify.moe/components"
|
"github.com/animenotifier/notify.moe/components"
|
||||||
|
"github.com/animenotifier/notify.moe/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Get ...
|
// Get ...
|
||||||
func Get(ctx *aero.Context) string {
|
func Get(ctx *aero.Context) string {
|
||||||
|
user := utils.GetUser(ctx)
|
||||||
id := ctx.Get("id")
|
id := ctx.Get("id")
|
||||||
group, err := arn.GetGroup(id)
|
group, err := arn.GetGroup(id)
|
||||||
|
|
||||||
@ -25,5 +27,5 @@ func Get(ctx *aero.Context) string {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
return ctx.HTML(components.Group(group))
|
return ctx.HTML(components.Group(group, user))
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
component Group(group *arn.Group)
|
component Group(group *arn.Group, user *arn.User)
|
||||||
GroupTabs(group)
|
GroupTabs(group, user)
|
||||||
|
|
||||||
if group.Name != ""
|
if group.Name != ""
|
||||||
h1.mountable= group.Name
|
h1.mountable= group.Name
|
||||||
@ -31,8 +31,10 @@ component Group(group *arn.Group)
|
|||||||
each post in group.Posts()
|
each post in group.Posts()
|
||||||
p!= post.HTML()
|
p!= post.HTML()
|
||||||
|
|
||||||
component GroupTabs(group *arn.Group)
|
component GroupTabs(group *arn.Group, user *arn.User)
|
||||||
.tabs
|
.tabs
|
||||||
Tab("Group", "users", group.Link())
|
Tab("Group", "users", group.Link())
|
||||||
Tab("Forum", "comment", group.Link() + "/forum")
|
//- Tab("Forum", "comment", group.Link() + "/forum")
|
||||||
|
|
||||||
|
if user != nil && group.FindMember(user.ID) != nil && group.FindMember(user.ID).Role == "founder"
|
||||||
Tab("Edit", "pencil", group.Link() + "/edit")
|
Tab("Edit", "pencil", group.Link() + "/edit")
|
@ -1,6 +1,8 @@
|
|||||||
.group-view
|
.group-view
|
||||||
horizontal-wrap
|
horizontal-wrap
|
||||||
width 100%
|
width 100%
|
||||||
|
max-width 1200px
|
||||||
|
margin 0 auto
|
||||||
|
|
||||||
< 1100px
|
< 1100px
|
||||||
.group-view
|
.group-view
|
||||||
|
@ -4,7 +4,7 @@ component Groups(groups []*arn.Group, groupsPerPage int, user *arn.User)
|
|||||||
|
|
||||||
h1.page-title Groups
|
h1.page-title Groups
|
||||||
|
|
||||||
.buttons
|
.corner-buttons
|
||||||
if user != nil
|
if user != nil
|
||||||
if user.DraftIndex().GroupID == ""
|
if user.DraftIndex().GroupID == ""
|
||||||
button.action(data-action="newObject", data-trigger="click", data-type="group")
|
button.action(data-action="newObject", data-trigger="click", data-type="group")
|
||||||
@ -19,6 +19,7 @@ component Groups(groups []*arn.Group, groupsPerPage int, user *arn.User)
|
|||||||
each group in groups
|
each group in groups
|
||||||
a.group.mountable.ajax(href=group.Link())
|
a.group.mountable.ajax(href=group.Link())
|
||||||
img.group-image.lazy(data-src=group.ImageURL(), alt=group.Name)
|
img.group-image.lazy(data-src=group.ImageURL(), alt=group.Name)
|
||||||
|
|
||||||
.group-info
|
.group-info
|
||||||
h3.group-name= group.Name
|
h3.group-name= group.Name
|
||||||
.group-tagline= group.Tagline
|
.group-tagline= group.Tagline
|
||||||
|
@ -665,7 +665,7 @@ export class AnimeNotifier {
|
|||||||
this.loading(true)
|
this.loading(true)
|
||||||
|
|
||||||
// Delay by transition-speed
|
// Delay by transition-speed
|
||||||
return delay(200).then(() => request)
|
return delay(150).then(() => request)
|
||||||
.then(html => Diff.innerHTML(this.app.content, html))
|
.then(html => Diff.innerHTML(this.app.content, html))
|
||||||
.then(() => this.app.emit("DOMContentLoaded"))
|
.then(() => this.app.emit("DOMContentLoaded"))
|
||||||
.then(() => this.loading(false))
|
.then(() => this.loading(false))
|
||||||
|
@ -95,6 +95,6 @@ content-line-height = 1.7em
|
|||||||
typography-margin = 0.4rem
|
typography-margin = 0.4rem
|
||||||
|
|
||||||
// Timings
|
// Timings
|
||||||
fade-speed = 200ms
|
fade-speed = 150ms
|
||||||
transition-speed = 150ms
|
transition-speed = 150ms
|
||||||
mountable-transition-speed = 200ms
|
mountable-transition-speed = 150ms
|
||||||
|
Loading…
x
Reference in New Issue
Block a user