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