Improved group join and leave
This commit is contained in:
parent
deba81e11f
commit
da08f80247
@ -10,8 +10,8 @@ component GroupMembers(group *arn.Group, member *arn.GroupMember, user *arn.User
|
||||
if member == nil
|
||||
button.mountable.action(data-action="join", data-trigger="click")
|
||||
Icon("user-plus")
|
||||
span= fmt.Sprintf(`Join "%s"`, group.Name)
|
||||
span Join group
|
||||
else
|
||||
button.mountable.action(data-action="leave", data-trigger="click")
|
||||
Icon("user-times")
|
||||
span= fmt.Sprintf(`Leave "%s"`, group.Name)
|
||||
span Leave group
|
@ -1,6 +1,7 @@
|
||||
component Groups(groups []*arn.Group, nextIndex int, user *arn.User)
|
||||
.tabs
|
||||
Tab("Groups", "users", "/groups")
|
||||
Tab("Latest", "users", "/groups")
|
||||
Tab("Popular", "globe", "/groups/popular")
|
||||
|
||||
h1.page-title Groups
|
||||
|
||||
|
@ -9,8 +9,8 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
groupsFirstLoad = 12
|
||||
groupsPerScroll = 9
|
||||
groupsFirstLoad = 24
|
||||
groupsPerScroll = 12
|
||||
)
|
||||
|
||||
// render renders the groups page with the given groups.
|
||||
|
@ -2,6 +2,10 @@ import AnimeNotifier from "scripts/AnimeNotifier"
|
||||
|
||||
// join
|
||||
export async function join(arn: AnimeNotifier, element: HTMLElement) {
|
||||
if(!confirm(`Are you sure you want to join this group?`)) {
|
||||
return
|
||||
}
|
||||
|
||||
arn.statusMessage.showInfo("Joined group!", 1000)
|
||||
let apiEndpoint = arn.findAPIEndpoint(element)
|
||||
|
||||
@ -15,7 +19,7 @@ export async function join(arn: AnimeNotifier, element: HTMLElement) {
|
||||
|
||||
// leave
|
||||
export async function leave(arn: AnimeNotifier, element: HTMLElement) {
|
||||
if(!confirm(`Are you sure you want to leave the group?`)) {
|
||||
if(!confirm(`Are you sure you want to leave this group?`)) {
|
||||
return
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user