From da08f802473bc65c9438e008405e1dcf9c2ed972 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Thu, 22 Nov 2018 11:13:39 +0900 Subject: [PATCH] Improved group join and leave --- pages/group/members.pixy | 4 ++-- pages/groups/groups.pixy | 3 ++- pages/groups/render.go | 4 ++-- scripts/Actions/Group.ts | 6 +++++- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/pages/group/members.pixy b/pages/group/members.pixy index f22b602c..e7698426 100644 --- a/pages/group/members.pixy +++ b/pages/group/members.pixy @@ -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) \ No newline at end of file + span Leave group \ No newline at end of file diff --git a/pages/groups/groups.pixy b/pages/groups/groups.pixy index 321e2c4a..1f89c509 100644 --- a/pages/groups/groups.pixy +++ b/pages/groups/groups.pixy @@ -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 diff --git a/pages/groups/render.go b/pages/groups/render.go index d507738f..c9b3f619 100644 --- a/pages/groups/render.go +++ b/pages/groups/render.go @@ -9,8 +9,8 @@ import ( ) const ( - groupsFirstLoad = 12 - groupsPerScroll = 9 + groupsFirstLoad = 24 + groupsPerScroll = 12 ) // render renders the groups page with the given groups. diff --git a/scripts/Actions/Group.ts b/scripts/Actions/Group.ts index 71dab1b9..dcbf8093 100644 --- a/scripts/Actions/Group.ts +++ b/scripts/Actions/Group.ts @@ -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 }