From a19c4f6a3613ed87a13afbb4f2e27e897251bffd Mon Sep 17 00:00:00 2001 From: Daniel Kempkens Date: Wed, 4 Oct 2023 20:59:52 +0200 Subject: [PATCH] feat: Link directly to comments --- lib/bdfr_browser/comment.ex | 3 +++ priv/templates/http/_comment.eex | 2 +- priv/templates/http/search.eex | 4 +++- priv/templates/http/user.eex | 4 +++- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/bdfr_browser/comment.ex b/lib/bdfr_browser/comment.ex index 4531606..6910032 100644 --- a/lib/bdfr_browser/comment.ex +++ b/lib/bdfr_browser/comment.ex @@ -28,6 +28,7 @@ defmodule BdfrBrowser.Comment do join: p in assoc(c, :post), join: s in assoc(p, :subreddit), select: %{ + id: c.id, body: c.body, children: [], posted_at: c.posted_at, @@ -51,6 +52,7 @@ defmodule BdfrBrowser.Comment do join: p in assoc(c, :post), join: s in assoc(p, :subreddit), select: %{ + id: c.id, author: c.author, body: c.body, children: [], @@ -73,6 +75,7 @@ defmodule BdfrBrowser.Comment do join: p in assoc(c, :post), join: s in assoc(p, :subreddit), select: %{ + id: c.id, author: c.author, body: c.body, children: [], diff --git a/priv/templates/http/_comment.eex b/priv/templates/http/_comment.eex index 57dff27..582a618 100644 --- a/priv/templates/http/_comment.eex +++ b/priv/templates/http/_comment.eex @@ -1,4 +1,4 @@ -
+
diff --git a/priv/templates/http/search.eex b/priv/templates/http/search.eex index ee0c98b..353cd26 100644 --- a/priv/templates/http/search.eex +++ b/priv/templates/http/search.eex @@ -54,7 +54,9 @@ diff --git a/priv/templates/http/user.eex b/priv/templates/http/user.eex index 7c88e46..f3e16e6 100644 --- a/priv/templates/http/user.eex +++ b/priv/templates/http/user.eex @@ -59,7 +59,9 @@ <%= BdfrBrowser.RenderUtils.comment(comment.body) %>