User settings feature/103-settings_page #104

Merged
niggl merged 25 commits from feature/103-settings_page into dev 2021-03-20 14:01:33 +00:00
3 changed files with 55 additions and 2 deletions
Showing only changes of commit 418f9c2662 - Show all commits

View File

@ -5,6 +5,7 @@
import Toastify from "toastify-js";
import ConfirmProfileDeletion from "./ConfirmProfileDeletion.svelte";
$: data_loaded = false;
$: delete_triggered = false;
$: original_data = {};
$: editable = {};
$: changes_performed = !(
@ -172,4 +173,50 @@
</div>
</div>
</div>
<div class="max-w-7xl mx-auto py-6 px-4 sm:px-6 lg:px-8">
<div>
<div class="md:grid md:grid-cols-3 md:gap-6">
<div class="md:col-span-1">
<div class="px-4 sm:px-0">
<h3 class="text-lg font-medium leading-6 text-gray-900">
{$_('danger-zone')}
</h3>
<p class="mt-1 text-sm text-gray-600">
{$_('stuff-that-could-harm-your-profile')}
</p>
</div>
</div>
{#await user_promise}
{$_('loading-profile-data')}
{:then}
<div class="mt-5 md:mt-0 md:col-span-2">
<div class="shadow sm:rounded-md sm:overflow-hidden">
<div class="px-4 py-3 bg-gray-50 text-left sm:px-6">
<span data-id="donor_actions_${editable.id}">
{#if delete_triggered}
<button
on:click={modal_open=true}
class="w-full justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:">{$_('confirm-deletion')}</button>
<button
on:click={() => {
delete_triggered = !delete_triggered;
}}
class="w-full justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-400 text-base font-medium text-white sm:w-auto sm:">{$_('cancel')}</button>
{/if}
{#if !delete_triggered}
<button
on:click={() => {
delete_triggered = true;
}}
type="button"
class="w-full justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:">{$_('delete-profile')}</button>
{/if}
</span>
</div>
</div>
</div>
{/await}
</div>
</div>
</div>
</div>

View File

@ -361,5 +361,8 @@
"you-are-going-to-loose-all-permissions-and-access-to-the-runner-system": "Du wirst all deine Berechtigungen und den Zugriff aufs Läufersystem verlieren!",
"after-deletion-we-cant-restore-your-old-profile": "Nach der Löschung können auch die Admins dein Profil nicht wiederherstellen!",
"confirm-delete-my-user-profile": "Bestätigung, mein Benutzerprofil löschen",
"cancel-keep-my-profile": "Abbrechen, mein Profil behalten"
"cancel-keep-my-profile": "Abbrechen, mein Profil behalten",
"danger-zone": "Gefahrenzone",
"stuff-that-could-harm-your-profile": "Einstellungen, die deinem Profil nachhaltig schaden können",
"delete-profile": "Profil löschen"
}

View File

@ -361,5 +361,8 @@
"you-are-going-to-loose-all-permissions-and-access-to-the-runner-system": "You are going to loose all permissions and access to the runner system!",
"after-deletion-we-cant-restore-your-old-profile": "After deletion we can't restore your old profile!",
"confirm-delete-my-user-profile": "Confirm, delete my user profile",
"cancel-keep-my-profile": "Cancel, keep my profile"
"cancel-keep-my-profile": "Cancel, keep my profile",
"danger-zone": "Danger zone",
"stuff-that-could-harm-your-profile": "Stuff that could harm your profile",
"delete-profile": "Delete Profile"
}