Improve edit buttons on issue and patch

This commit is contained in:
dnlklmn
2024-02-14 18:22:50 +00:00
committed by Rūdolfs Ošiņš
parent 04999a1e55
commit 51efbc93d7
2 changed files with 18 additions and 13 deletions
+7 -5
View File
@@ -30,7 +30,7 @@
import Embeds from "@app/views/projects/Cob/Embeds.svelte";
import ErrorModal from "@app/modals/ErrorModal.svelte";
import ExtendedTextarea from "@app/components/ExtendedTextarea.svelte";
import IconButton from "@app/components/IconButton.svelte";
import Button from "@app/components/Button.svelte";
import IconSmall from "@app/components/IconSmall.svelte";
import InlineMarkdown from "@app/components/InlineMarkdown.svelte";
import LabelInput from "./Cob/LabelInput.svelte";
@@ -495,15 +495,17 @@
content={issue.title} />
</div>
{/if}
</div>
<div style="display: flex; gap: 0.5rem;">
{#if session && role.isDelegateOrAuthor(session.publicKey, project.delegates, issue.author.id) && issueState === "read"}
<IconButton
<Button
variant="outline"
title="edit issue"
on:click={() => (issueState = "edit")}>
<IconSmall name={"edit"} />
</IconButton>
Edit
</Button>
{/if}
</div>
<div style="display: flex; gap: 1rem;">
<Share {preferredSeeds} {publicExplorer} {baseUrl} />
{#if session && role.isDelegateOrAuthor(session.publicKey, project.delegates, issue.author.id)}
<CobStateButton
+11 -8
View File
@@ -717,7 +717,8 @@
<div class="main">
<CobHeader>
<svelte:fragment slot="title">
<div style="display: flex; gap: 1rem; width: 100%;">
<div
style="display: flex; align-items: center; gap: 1rem; width: 100%;">
{#if patchState !== "read"}
<TextInput
placeholder="Title"
@@ -733,14 +734,16 @@
content={patch.title} />
</div>
{/if}
{#if session && role.isDelegateOrAuthor(session.publicKey, project.delegates, patch.author.id) && patchState === "read"}
<IconButton
title="edit patch"
on:click={() => (patchState = "edit")}>
<IconSmall name={"edit"} />
</IconButton>
{/if}
</div>
{#if session && role.isDelegateOrAuthor(session.publicKey, project.delegates, patch.author.id) && patchState === "read"}
<Button
variant="outline"
title="edit patch"
on:click={() => (patchState = "edit")}>
<IconSmall name={"edit"} />
Edit
</Button>
{/if}
<Share {preferredSeeds} {publicExplorer} {baseUrl} />
{#if session && role.isDelegateOrAuthor(session.publicKey, project.delegates, patch.author.id)}
<CobStateButton