39 lines
1.1 KiB
Plaintext
Raw Normal View History

2018-11-22 01:27:53 +00:00
component Groups(groups []*arn.Group, nextIndex int, user *arn.User)
2017-10-17 21:17:04 +00:00
.tabs
2018-11-22 02:13:39 +00:00
Tab("Latest", "users", "/groups")
Tab("Popular", "globe", "/groups/popular")
2017-10-17 21:17:04 +00:00
2018-11-22 02:51:44 +00:00
if user != nil
Tab("Joined", "user-plus", "/groups/joined")
2017-10-17 21:17:04 +00:00
h1.page-title Groups
2018-03-06 23:36:04 +00:00
.corner-buttons
2017-10-17 21:17:04 +00:00
if user != nil
if user.DraftIndex().GroupID == ""
button.action(data-action="newObject", data-trigger="click", data-type="group")
Icon("plus")
span New group
else
a.button(href="/group/" + user.DraftIndex().GroupID + "/edit")
2017-10-17 21:17:04 +00:00
Icon("pencil")
span Edit draft
2017-10-18 16:18:15 +00:00
#load-more-target.groups
2018-11-22 01:27:53 +00:00
GroupsScrollable(groups, user)
2017-10-18 16:18:15 +00:00
2018-11-22 01:27:53 +00:00
if nextIndex != -1
2017-10-18 16:18:15 +00:00
.buttons
2018-11-22 01:27:53 +00:00
LoadMore(nextIndex)
component GroupsScrollable(groups []*arn.Group, user *arn.User)
each group in groups
a.group.mountable(href=group.Link())
img.group-image.lazy(data-src=group.ImageLink("small"), data-webp="true", data-color=group.AverageColor(), alt=group.Name)
.group-info
h3.group-name= group.Name
.group-tagline= group.Tagline
.group-member-count
Icon("user")
span= len(group.Members)