From 9d952483f250a97cbeab4061fa1c4e68341b330f Mon Sep 17 00:00:00 2001 From: kartofen Date: Sun, 28 Aug 2022 23:22:15 +0300 Subject: posting thread and image works --- src/components/Comment.svelte | 45 ------------------------ src/components/Form.astro | 53 +++++++++++++++++++++++++++++ src/components/Thread.svelte | 79 ++++++++++++++++++++++++++++++------------- 3 files changed, 108 insertions(+), 69 deletions(-) delete mode 100644 src/components/Comment.svelte create mode 100644 src/components/Form.astro (limited to 'src/components') diff --git a/src/components/Comment.svelte b/src/components/Comment.svelte deleted file mode 100644 index bc53f4d..0000000 --- a/src/components/Comment.svelte +++ /dev/null @@ -1,45 +0,0 @@ - - - -
- - - {comment.id} - at {formatTime(comment.creationDate)}
- -> - {comment.commentCreator} -
-
- - {#if comment.imageId!= null && comment.imageId != undefined} - {#if comment.fileType == 'image'} - - {comment.imageId}
-
- {:else if comment.fileType == 'video'} - - {/if} - {/if} - -

{@html comment.commentText}

- -
- - diff --git a/src/components/Form.astro b/src/components/Form.astro new file mode 100644 index 0000000..417b569 --- /dev/null +++ b/src/components/Form.astro @@ -0,0 +1,53 @@ +--- +import '../styles/blackbox.css'; +import { sha256 } from 'js-sha256'; + +const { board, tid } = Astro.props; +const iphash = sha256(Astro.clientAddress); +--- + +
+ +
+ + diff --git a/src/components/Thread.svelte b/src/components/Thread.svelte index fee1a78..0321b8d 100644 --- a/src/components/Thread.svelte +++ b/src/components/Thread.svelte @@ -1,11 +1,15 @@ + {#if thread.id != "rules"}
@@ -27,13 +31,16 @@ -> {thread.threadCreator}
+
- {#if listReplies(thread.id)} -
- {#each replies as id} - >>{id}  - {/each} -
+ {#if comments} + {#if listReplies(thread.id) } + + {#each listReplies(thread.id, true) as id} + >>{id}  + {/each} +
+ {/if} {/if} @@ -54,21 +61,45 @@

{@html thread.threadText}

- +{#if comments} + {#each thread.comments as comment} +
+ + {comment.id} + at {formatTime(comment.creationDate)}
-
+ -> + {comment.commentCreator} +
+
+ + {#if listReplies(comment.id)} + + {#each listReplies(comment.id, true) as id} + >>{id}  + {/each} +
+ {/if} + + + + {#if comment.imageId!= null && comment.imageId != undefined} + {#if comment.fileType == 'image'} + + {comment.imageId}
+
+ {:else if comment.fileType == 'video'} + + {/if} + {/if} + +

{@html comment.commentText}

+ +
+ {/each} {/if} - + +{/if} -- cgit v1.2.3