diff --git a/src/post.rs b/src/post.rs index ab7835d..5df1d60 100644 --- a/src/post.rs +++ b/src/post.rs @@ -164,6 +164,7 @@ async fn parse_comments(json: serde_json::Value) -> Result, &'stati }; comments.push(Comment { + id: val(comment, "id").await, body: body, author: val(comment, "author").await, score: format_num(score), diff --git a/src/utils.rs b/src/utils.rs index 17b228b..148f2e1 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -34,6 +34,7 @@ pub struct Post { #[allow(dead_code)] // Comment with content, post, score and data/time that it was posted pub struct Comment { + pub id: String, pub body: String, pub author: String, pub flair: Flair, diff --git a/static/style.css b/static/style.css index 118b3ae..85b0265 100644 --- a/static/style.css +++ b/static/style.css @@ -435,6 +435,11 @@ td, th { max-width: initial; } + .replies > .comment { + margin-left: -25px; + padding: 10px 10px 10px 5px; + } + .datetime { width: 100%; } diff --git a/templates/post.html b/templates/post.html index b9b09c1..278c790 100644 --- a/templates/post.html +++ b/templates/post.html @@ -7,7 +7,7 @@ {% macro comment(item) -%} -
+

{{ item.score }}

@@ -67,11 +67,16 @@
{% call comment(c) %}
- {% for reply in c.replies %} - {% call comment(reply) %} + {% for reply1 in c.replies %} + {% call comment(reply1) %}
- {% for response in reply.replies %} - {% call comment(response) %}
+ {% for reply2 in reply1.replies %} + {% call comment(reply2) %} +
+ {% for reply3 in reply2.replies %} + {% call comment(reply3) %}
+ {% endfor %} +
{% endfor %}
{% endfor %}