mirror of
https://github.com/aljazceru/hypergolic.git
synced 2025-12-18 14:04:21 +01:00
problem: not clear if contributors should vote to approve or reject a merit request
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { Button } from '@/components/ui/button';
|
||||
import Checkbox from '@/components/ui/checkbox/checkbox.svelte';
|
||||
import Label from '@/components/ui/label/label.svelte';
|
||||
import {
|
||||
MeritRequest,
|
||||
prepareMeritNoteEvent,
|
||||
@@ -15,6 +17,53 @@
|
||||
export let merit: MeritRequest;
|
||||
export let rocket: Rocket;
|
||||
|
||||
let checkboxes = new Map<string, boolean>();
|
||||
|
||||
let haveUnchecked = true;
|
||||
$: {
|
||||
let foundUnchecked = false;
|
||||
for (let [_, c] of checkboxes) {
|
||||
if (!c) {
|
||||
foundUnchecked = true;
|
||||
}
|
||||
}
|
||||
haveUnchecked = foundUnchecked;
|
||||
}
|
||||
|
||||
{
|
||||
checkboxes.set('I believe this problem is worth solving', false);
|
||||
checkboxes.set(
|
||||
'I believe the Problem statement is a true and accurate observation of reality',
|
||||
false
|
||||
);
|
||||
checkboxes.set("I believe the contributor's solution fully solves the stated problem", false);
|
||||
checkboxes.set(
|
||||
'I believe the Solution provided is the minimum possible answer to the described Problem, and no more complex than it needs to be',
|
||||
false
|
||||
);
|
||||
checkboxes.set(
|
||||
'I believe that the solution does NOT introduce any way to create Merits in this project other than by solving problems (proof of work)',
|
||||
false
|
||||
);
|
||||
checkboxes.set(
|
||||
'I believe that the Merit Holders are the sole beneficiary of any revenue that this solution potentially leads towards',
|
||||
false
|
||||
);
|
||||
checkboxes.set(
|
||||
"I can't see any way in which this solution could be harmful to any Nostrocket Participants, their families, community, or ecological system.",
|
||||
false
|
||||
);
|
||||
checkboxes.set(
|
||||
"I can't see any way in which this solution could be harmful to Bitcoin or Bitcoin users",
|
||||
false
|
||||
);
|
||||
checkboxes.set(
|
||||
'I believe the amount of Merits being claimed is reasonable for the work that has been done',
|
||||
false
|
||||
);
|
||||
checkboxes = checkboxes;
|
||||
}
|
||||
|
||||
function publish(ndk: NDKSvelte, direction: VoteDirection) {
|
||||
if (!ndk.signer) {
|
||||
throw new Error('no ndk signer found');
|
||||
@@ -57,28 +106,56 @@
|
||||
</script>
|
||||
|
||||
{#if $currentUser}
|
||||
<Button
|
||||
variant="default"
|
||||
class="m-2"
|
||||
on:click={() => {
|
||||
if (currentUserHasVotepower) {
|
||||
publish($ndk, 'ratify');
|
||||
} else {
|
||||
alert(`Your pubkey does not have votepower in ${rocket.Name()}`);
|
||||
}
|
||||
}}>Vote to Approve</Button
|
||||
>
|
||||
<Button
|
||||
variant="destructive"
|
||||
class="m-2"
|
||||
on:click={() => {
|
||||
if (currentUserHasVotepower) {
|
||||
publish($ndk, 'blackball');
|
||||
} else {
|
||||
alert(`Your pubkey does not have votepower in ${rocket.Name()}`);
|
||||
}
|
||||
}}>Vote to Reject</Button
|
||||
>
|
||||
<div class="flex flex-col">
|
||||
<div class="flex flex-col">
|
||||
{#each checkboxes as [text, bool]}
|
||||
<div class="mb-2 flex flex-nowrap text-left">
|
||||
<Checkbox
|
||||
on:click={() => {
|
||||
checkboxes.set(text, !bool), (checkboxes = checkboxes);
|
||||
}}
|
||||
id="worthsolving"
|
||||
bind:checked={bool}
|
||||
/>
|
||||
<Label
|
||||
on:mousedown={() => {
|
||||
checkboxes.set(text, !bool), (checkboxes = checkboxes);
|
||||
}}
|
||||
for={text}
|
||||
class=" ml-2 font-extralight peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
||||
>
|
||||
{text}
|
||||
</Label>
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
<div class="flex">
|
||||
<Button
|
||||
variant="default"
|
||||
class="m-2"
|
||||
disabled={haveUnchecked}
|
||||
on:click={() => {
|
||||
if (currentUserHasVotepower) {
|
||||
publish($ndk, 'ratify');
|
||||
} else {
|
||||
alert(`Your pubkey does not have votepower in ${rocket.Name()}`);
|
||||
}
|
||||
}}>Vote to Approve</Button
|
||||
>
|
||||
<Button
|
||||
variant="destructive"
|
||||
class="m-2"
|
||||
disabled={!haveUnchecked}
|
||||
on:click={() => {
|
||||
if (currentUserHasVotepower) {
|
||||
publish($ndk, 'blackball');
|
||||
} else {
|
||||
alert(`Your pubkey does not have votepower in ${rocket.Name()}`);
|
||||
}
|
||||
}}>Vote to Reject</Button
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
{:else}
|
||||
<Login />
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user