PluralKit/dashboard/src/lib/system/Privacy.svelte

49 lines
2 KiB
Svelte
Raw Normal View History

2021-12-11 18:41:21 +01:00
<script lang="ts">
2021-12-12 08:59:34 +01:00
import { Card, CardHeader, CardBody, CardTitle, Row, Col, Button, Spinner } from 'sveltestrap';
import FaUserLock from 'svelte-icons/fa/FaUserLock.svelte';
2021-12-12 08:59:34 +01:00
import PrivacyEdit from './PrivacyEdit.svelte';
2021-12-11 18:41:21 +01:00
2022-02-01 15:24:45 -05:00
import { System } from '../../api/types';
export let user: System;
2021-12-11 18:41:21 +01:00
let editMode = false;
2021-12-12 08:59:34 +01:00
let loading: boolean;
2021-12-11 18:41:21 +01:00
</script>
<Card class="mb-4">
<CardHeader>
<CardTitle style="margin-top: 8px; outline: none;">
<div class="icon d-inline-block">
<FaUserLock />
</div> System privacy
2021-12-12 08:59:34 +01:00
{#if loading}<div class="d-inline-block mr-5" style="float: right;"><Spinner color="primary" /></div>{/if}
2021-12-11 18:41:21 +01:00
</CardTitle>
</CardHeader>
2021-12-12 08:59:34 +01:00
<CardBody style="border-left: 4px solid #{user.color}">
2021-12-11 18:41:21 +01:00
{#if editMode}
2021-12-12 08:59:34 +01:00
<PrivacyEdit bind:loading bind:user={user} bind:editMode/>
2021-12-11 18:41:21 +01:00
{:else}
<Row>
<Col xs={12} lg={4} class="mb-3">
<b>Description:</b> {user.privacy.description_privacy}
</Col>
<Col xs={12} lg={4} class="mb-3">
<b>Member list:</b> {user.privacy.member_list_privacy}
</Col>
<Col xs={12} lg={4} class="mb-3">
<b>Group list:</b> {user.privacy.group_list_privacy}
</Col>
<Col xs={12} lg={4} class="mb-3">
<b>Current front:</b> {user.privacy.front_privacy}
</Col>
<Col xs={12} lg={4} class="mb-3">
<b>Front history:</b> {user.privacy.front_history_privacy}
</Col>
</Row>
<Button style="flex: 0" color="primary" on:click={() => editMode = true}>Edit</Button>
2022-05-09 17:15:00 -04:00
<Button style="flex: 0" color="secondary" on:click={() => window.location.href = window.location.origin+"/dash/bulk-member-privacy"}>Bulk member privacy</Button>
<Button style="flex: 0" color="secondary" on:click={() => window.location.href = window.location.origin+"/dash/bulk-group-privacy"}>Bulk group privacy</Button>
2021-12-11 18:41:21 +01:00
{/if}
</CardBody>
</Card>