-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #162 from Ree6-Applications/dev
Developer Branch Merge
- Loading branch information
Showing
11 changed files
with
228 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
Frontend/src/lib/components/settings/booleanSelector.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<script lang="ts"> | ||
import LoadingIndicator from "../loadingIndicator.svelte"; | ||
import { setting, updateSetting } from "$lib/scripts/settings"; | ||
import { currentServer } from "$lib/scripts/servers"; | ||
export let title: string; | ||
export let icon: string; | ||
export let description: string; | ||
export let settingName: string; | ||
let current = setting(settingName); | ||
let store = current.value; | ||
current.value.subscribe((value) => { | ||
console.log(value) | ||
}) | ||
</script> | ||
|
||
<div class="box default-margin"> | ||
<div class="box-title"> | ||
<div class="content"> | ||
<div class="title"> | ||
<span class="material-icons icon-primary icon-small">{icon}</span> | ||
<h1 class="text-medium">{title}</h1> | ||
</div> | ||
<p class="text-bg">{description}</p> | ||
</div> | ||
|
||
{#if $store == ":loading"} | ||
<div class="loading"> | ||
<LoadingIndicator size="45" /> | ||
</div> | ||
{:else} | ||
<div class="button-bar"> | ||
|
||
<div on:click={() => { | ||
updateSetting(settingName, $currentServer.id + "", $store == "true" ? "false" : "true") | ||
}} class="button"> | ||
<span class="material-icons icon-small icon-primary">{$store == "true" ? "close" : "check"}</span> | ||
<p>{$store == "true" ? "Disable" : "Enable"}</p> | ||
</div> | ||
</div> | ||
{/if} | ||
</div> | ||
</div> | ||
|
||
<style lang="scss"> | ||
@import '$lib/styles/box.scss'; | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
88 changes: 88 additions & 0 deletions
88
Frontend/src/routes/(dashboard)/dash/[serverId]/news/+page.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
<script> | ||
import { page } from "$app/stores"; | ||
import BooleanSelector from "$lib/components/settings/booleanSelector.svelte"; | ||
import MassDataSelector from "$lib/components/settings/massDataSelector.svelte"; | ||
import { currentServer } from "$lib/scripts/servers"; | ||
</script> | ||
|
||
<svelte:head> | ||
<title>Levels - { $currentServer.name }</title> | ||
</svelte:head> | ||
|
||
<h1 class="headline">News</h1> | ||
|
||
<div class="default-margin"></div> | ||
|
||
<BooleanSelector icon="newspaper" title="Publish news messages" description="Let Ree6 publish your news messages after you sent them!" settingName="configuration_autopublish" /> | ||
|
||
<div class="default-margin"></div> | ||
|
||
<BooleanSelector icon="sync" title="Ree6 announcements" description="Receive announcements published by us." settingName="configuration_news" /> | ||
|
||
<h1 class="headline">Rewards</h1> | ||
|
||
<MassDataSelector icon="mic" title="Voice level rewards" description="Add rewards for reaching certain voice levels." | ||
models={[ | ||
{ | ||
name: "Role reward", | ||
primaryIcon: "military_tech", | ||
isModel: (json) => json.level, | ||
renderFormat: (json) => "When becoming voice level " + json.level + ", the user gets the " + json.role.name + " role.", | ||
model: [ | ||
{ | ||
name: "Needed level", | ||
jsonName: "level", | ||
type: "int", | ||
value: 1, | ||
visible: true, | ||
unit: "", | ||
}, | ||
{ | ||
name: "Rewarded role", | ||
jsonName: "role", | ||
type: "role", | ||
value: null, | ||
visible: true, | ||
unit: "" | ||
} | ||
] | ||
} | ||
]} | ||
endpoint={"/guilds/" + $page.params.serverId + "/voicerole"} deleteField={(json) => json.level}/> | ||
|
||
<MassDataSelector icon="message" title="Message level rewards" description="Add rewards for reaching certain chat message levels." | ||
models={[ | ||
{ | ||
name: "Role reward", | ||
primaryIcon: "military_tech", | ||
isModel: (json) => json.level, | ||
renderFormat: (json) => "When becoming chat level " + json.level + ", the user gets the " + json.role.name + " role.", | ||
model: [ | ||
{ | ||
name: "Needed level", | ||
jsonName: "level", | ||
type: "int", | ||
value: 1, | ||
visible: true, | ||
unit: "", | ||
}, | ||
{ | ||
name: "Rewarded role", | ||
jsonName: "role", | ||
type: "role", | ||
value: null, | ||
visible: true, | ||
unit: "" | ||
} | ||
] | ||
} | ||
]} | ||
endpoint={"/guilds/" + $page.params.serverId + "/chatrole"} deleteField={(json) => json.role.id}/> | ||
|
||
<style lang="scss"> | ||
@import '$lib/default.scss'; | ||
@import '$lib/styles/box.scss'; | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters