From 1afe87d9c1e30dd7629f2fdc31082b5305645d6d Mon Sep 17 00:00:00 2001 From: Melmon Date: Sun, 20 Jun 2021 01:28:37 +0100 Subject: [PATCH] added rudimentary reply function --- atch/static/js/threadMain.js | 25 +++++++++++++++++++++++++ atch/templates/board.html | 6 +++--- atch/templates/thread.html | 17 ++++++++++++++--- 3 files changed, 42 insertions(+), 6 deletions(-) create mode 100644 atch/static/js/threadMain.js diff --git a/atch/static/js/threadMain.js b/atch/static/js/threadMain.js new file mode 100644 index 0000000..9d8a1cc --- /dev/null +++ b/atch/static/js/threadMain.js @@ -0,0 +1,25 @@ +function parsePostBodies() { + /*$('.post.body').each(function(i, el) { + if (el.text().includes(">")) { + + } + });*/ +} + + +function addReplyTag(tag) { + let text = $('textarea#body') + text.append(">>" + tag) + text.focus() + console.log("eeee") +} + + +function refreshPosts() { + +} + + +$(document).ready(function() { + parsePostBodies(); +}) \ No newline at end of file diff --git a/atch/templates/board.html b/atch/templates/board.html index cd9ece1..0d6a400 100644 --- a/atch/templates/board.html +++ b/atch/templates/board.html @@ -1,8 +1,5 @@ {% extends "base.html" %} -{% block scripts %} -{% endblock %} - {% block header %}

Boards: [ {% for b in board_list %}{{ b }} {% endfor %}]

{% block title %}/{{ uri }}/ - {{ name }}{% endblock %}

@@ -58,4 +55,7 @@ {% endfor %} +{% endblock %} + +{% block scripts %} {% endblock %} \ No newline at end of file diff --git a/atch/templates/thread.html b/atch/templates/thread.html index 71ca0cc..329cdcf 100644 --- a/atch/templates/thread.html +++ b/atch/templates/thread.html @@ -1,6 +1,12 @@ {% extends "base.html" %} + {% block scripts %} + + + {% endblock %} {% block header %} @@ -40,10 +46,10 @@ {% for reply in replies %}
- >>{{ reply["reply_id"] }} + >>{{ reply["reply_id"] }}
-
+
{% if reply["email"] == "" %} {{ reply["name"] }} @@ -52,6 +58,7 @@ {% endif %} {{ reply["created"] }} + Reply
{% set text = reply["body"].split('\n') %} @@ -61,4 +68,8 @@
{% endfor %} -{% endblock %} \ No newline at end of file + + [Refresh] + [Go Back] + +{% endblock %} -- 2.45.2