summaryrefslogtreecommitdiff
path: root/web/template/thread.tmpl
diff options
context:
space:
mode:
authorLibravatar f0x52 <f0x@cthu.lu>2021-09-13 14:45:33 +0200
committerLibravatar GitHub <noreply@github.com>2021-09-13 14:45:33 +0200
commit026674bc2c4eb5f53bcb38e7efce2fe2dfebe974 (patch)
treeaeb8d5a884379b86597bc530f0375fc5dbe5357d /web/template/thread.tmpl
parentupdate my personal library versions (#220) (diff)
downloadgotosocial-026674bc2c4eb5f53bcb38e7efce2fe2dfebe974.tar.xz
Thread views on the web (#207)
* Webviews for status threads * fix up templates * add ForkAwesome and gotosocial-styling into repo * clean up gotosocial-styling, old styling * update CONTRIBUTING with new css building, and nodemon recommendation * update Dockerfile with new css bundling * those weren't supposed to make it in * upgrade gotosocial-styling deps * update authorize template with main wrapper * update css pipeline * abstract status from thread to avoid copy-pasting * basic CW implementation * fix PR review suggestions * fix no-image-desc icon alignment * remove template loading println * remove println * remove changes to testmodels * reset changes to testmodels
Diffstat (limited to 'web/template/thread.tmpl')
-rw-r--r--web/template/thread.tmpl34
1 files changed, 34 insertions, 0 deletions
diff --git a/web/template/thread.tmpl b/web/template/thread.tmpl
new file mode 100644
index 000000000..b6b91fd31
--- /dev/null
+++ b/web/template/thread.tmpl
@@ -0,0 +1,34 @@
+{{ template "header.tmpl" .}}
+<main>
+ <div class="thread">
+ {{range .context.Ancestors}}
+ <div class="toot">
+ {{ template "status.tmpl" .}}
+ </div>
+ {{end}}
+ <div class="toot expanded">
+ {{ template "status.tmpl" .status}}
+ </div>
+ {{range .context.Descendants}}
+ <div class="toot">
+ {{ template "status.tmpl" .}}
+ </div>
+ {{end}}
+ </div>
+</main>
+<script>
+ Array.from(document.getElementsByClassName("spoiler-label")).forEach((label) => {
+ let checkbox = document.getElementById(label.htmlFor);
+ function update() {
+ if(checkbox.checked) {
+ label.innerHTML = "Show more";
+ } else {
+ label.innerHTML = "Show less";
+ }
+ }
+ update();
+
+ label.addEventListener("click", () => {setTimeout(update, 1)});
+ });
+</script>
+{{ template "footer.tmpl" .}} \ No newline at end of file