diff --git a/src/components/AddTeamModal.svelte b/src/components/AddTeamModal.svelte new file mode 100644 index 00000000..aeff59c8 --- /dev/null +++ b/src/components/AddTeamModal.svelte @@ -0,0 +1,159 @@ + + +{#if modal_open} +
{ + modal_open = false; + }}> +
+ +
+{/if} diff --git a/src/components/Teams.svelte b/src/components/Teams.svelte index 7bcfd325..75ad7411 100644 --- a/src/components/Teams.svelte +++ b/src/components/Teams.svelte @@ -1,10 +1,31 @@
{$_('teams')} + {#if store.state.jwtinfo.userdetails.permissions.includes('USER:CREATE')} + + {/if}

everything is more fun together 🏃‍♂️🏃‍♀️🏃‍♂️

+
+ +{#if store.state.jwtinfo.userdetails.permissions.includes('USER:CREATE')} + +{/if} diff --git a/src/components/TeamsEmptyState.svelte b/src/components/TeamsEmptyState.svelte new file mode 100644 index 00000000..9e306776 --- /dev/null +++ b/src/components/TeamsEmptyState.svelte @@ -0,0 +1,14 @@ + + +
+

+ There are no teams added yet.
+ Add your first team +

+
+ + diff --git a/src/components/TeamsOverview.svelte b/src/components/TeamsOverview.svelte new file mode 100644 index 00000000..7f7b25a5 --- /dev/null +++ b/src/components/TeamsOverview.svelte @@ -0,0 +1,182 @@ + + +{#if store.state.jwtinfo.userdetails.permissions.includes('USER:GET')} + {#await teams_promise} + + {:then} + {#if current_teams.length === 0} + + {:else} + + + + +
+ + + + + + + + + + + {#each current_teams as u} + {#if Object.values(u) + .toString() + .toLowerCase() + .includes(searchvalue)} + + + + + {#if active_deletes[u.id] === true} + + {:else} + + {/if} + + {/if} + {/each} + +
+ Name + + Status + + Groups + + Action +
+
+ {#if u.profilePic} +
+ +
+ {/if} +
+
+ {u.firstname} + {u.middlename || ''} + {u.lastname} +
+
+ {u.email || u.username} +
+
+
+
+ {#if u.enabled} + Active + {:else} + Inactive + {/if} + + {#each u.groups as g} + {g.name} + {/each} + + + + + Edit + {#if store.state.jwtinfo.userdetails.permissions.includes('USER:DELETE')} + + {/if} +
+
+ {/if} + {:catch error} +
+ + {$_('general_promise_error')} + {error} + +
+ {/await} +{/if} diff --git a/src/locales/en.json b/src/locales/en.json index 0c3b7555..91c60fda 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -106,6 +106,7 @@ "settings": "Settings", "signout": "Sign out", "stats-are-being-loaded": "stats are being loaded...", + "team-name": "Team name", "teams": "Teams", "this-might-take-a-moment": "This might take a moment 👀", "total-distance": "total distance",