mirror of
https://github.com/aljazceru/hypergolic.git
synced 2025-12-18 14:04:21 +01:00
problem: can't see merit request solution text
This commit is contained in:
@@ -19,6 +19,7 @@
|
|||||||
import { Alert } from '@/components/ui/alert';
|
import { Alert } from '@/components/ui/alert';
|
||||||
import { currentUser } from '@/stores/session';
|
import { currentUser } from '@/stores/session';
|
||||||
import MeritComment from './MeritComment.svelte';
|
import MeritComment from './MeritComment.svelte';
|
||||||
|
import { Description } from 'formsnap';
|
||||||
|
|
||||||
export let merit: MeritRequest;
|
export let merit: MeritRequest;
|
||||||
//export let rocket: NDKEvent;
|
//export let rocket: NDKEvent;
|
||||||
@@ -118,9 +119,9 @@
|
|||||||
<div class="flex flex-nowrap justify-between">
|
<div class="flex flex-nowrap justify-between">
|
||||||
<Card.Title>
|
<Card.Title>
|
||||||
{merit.Problem().split('\n')[0]}
|
{merit.Problem().split('\n')[0]}
|
||||||
</Card.Title>{#if merit.Solution()}<a
|
</Card.Title>{#if merit.SolutionURL()}<a
|
||||||
class="flex flex-nowrap text-orange-500 underline decoration-orange-500"
|
class="flex flex-nowrap text-orange-500 underline decoration-orange-500"
|
||||||
href={merit.Solution()}>View Solution <ExternalLink size={18} class="m-1" /></a
|
href={merit.SolutionURL()}>View Solution <ExternalLink size={18} class="m-1" /></a
|
||||||
>{/if}
|
>{/if}
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-nowrap">
|
<div class="flex flex-nowrap">
|
||||||
@@ -131,7 +132,12 @@
|
|||||||
/>
|
/>
|
||||||
<Name ndk={$ndk} pubkey={merit.Pubkey} class="inline-block max-w-32 truncate p-2" />
|
<Name ndk={$ndk} pubkey={merit.Pubkey} class="inline-block max-w-32 truncate p-2" />
|
||||||
</div>
|
</div>
|
||||||
|
{#if merit.SolutionText()}
|
||||||
|
{merit.SolutionText()?.trim()}
|
||||||
|
{/if}
|
||||||
|
<Card.Description></Card.Description>
|
||||||
</Card.Header>
|
</Card.Header>
|
||||||
|
|
||||||
<Card.Content class="p-6 text-sm">
|
<Card.Content class="p-6 text-sm">
|
||||||
<div class="grid gap-3">
|
<div class="grid gap-3">
|
||||||
<div class="font-semibold">Merit Request Details</div>
|
<div class="font-semibold">Merit Request Details</div>
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
.then((x) => {
|
.then((x) => {
|
||||||
console.log(x);
|
console.log(x);
|
||||||
if (direction === 'ratify') {
|
if (direction === 'ratify') {
|
||||||
let content = `I've voted to ratify your merit request! ${merit.Problem()} \n\n ${merit.Solution() ? merit.Solution() : ''}`;
|
let content = `I've voted to ratify your merit request! ${merit.Problem()} \n\n ${merit.SolutionURL() ? merit.SolutionURL() : ''}`;
|
||||||
prepareMeritNoteEvent({
|
prepareMeritNoteEvent({
|
||||||
ndk,
|
ndk,
|
||||||
merit,
|
merit,
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ export class MeritRequest {
|
|||||||
}
|
}
|
||||||
return _problem;
|
return _problem;
|
||||||
}
|
}
|
||||||
Solution(): URL | undefined {
|
SolutionURL(): URL | undefined {
|
||||||
let _solution: URL | undefined = undefined;
|
let _solution: URL | undefined = undefined;
|
||||||
for (let solution of this.Event.getMatchingTags('solution')) {
|
for (let solution of this.Event.getMatchingTags('solution')) {
|
||||||
if (solution && solution.length > 2 && solution[1] == 'url') {
|
if (solution && solution.length > 2 && solution[1] == 'url') {
|
||||||
@@ -34,6 +34,15 @@ export class MeritRequest {
|
|||||||
}
|
}
|
||||||
return _solution;
|
return _solution;
|
||||||
}
|
}
|
||||||
|
SolutionText(): string | undefined {
|
||||||
|
let _solution: string | undefined = undefined;
|
||||||
|
for (let solution of this.Event.getMatchingTags('solution')) {
|
||||||
|
if (solution && solution.length > 2 && solution[1] == 'text') {
|
||||||
|
_solution = solution[2];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return _solution;
|
||||||
|
}
|
||||||
IncludedInRocketState(rocket: Rocket): boolean {
|
IncludedInRocketState(rocket: Rocket): boolean {
|
||||||
let included = rocket.ApprovedMeritRequests();
|
let included = rocket.ApprovedMeritRequests();
|
||||||
return Boolean(included.get(this.ID));
|
return Boolean(included.get(this.ID));
|
||||||
|
|||||||
Reference in New Issue
Block a user