diff options
author | Vikas Kushwaha <dev@vikas.rocks> | 2025-02-11 16:31:08 +0530 |
---|---|---|
committer | Vikas Kushwaha <dev@vikas.rocks> | 2025-02-11 16:31:08 +0530 |
commit | 57eb8f6712361a3bf75983ce153fac4846dc0273 (patch) | |
tree | 269a168d59c917c4e313c819e2b4c3ff8175f912 /cmd/web/templates/articles/partials/comments-wrapper.tmpl |
Initial commit
Diffstat (limited to 'cmd/web/templates/articles/partials/comments-wrapper.tmpl')
-rw-r--r-- | cmd/web/templates/articles/partials/comments-wrapper.tmpl | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/cmd/web/templates/articles/partials/comments-wrapper.tmpl b/cmd/web/templates/articles/partials/comments-wrapper.tmpl new file mode 100644 index 0000000..266b4e5 --- /dev/null +++ b/cmd/web/templates/articles/partials/comments-wrapper.tmpl @@ -0,0 +1,26 @@ +<div id="article-comments-wrapper"> + {{ range $comment := .Article.Comments }} + {{ template "articles/partials/comments-card" Dict "Comment" $comment }} + {{ end }} +</div> + +{{ if .IsAuthenticated }} + <div id="form-message"></div> + + {{ template "articles/partials/comments-form" . }} +{{ else }} + <div> + <a href="/htmx/sign-in" hx-get="/htmx/sign-in" hx-target="#app-body" + hx-push-url="/sign-in" + > + Sign in + </a> + or + <a href="/htmx/sign-up" hx-get="/htmx/sign-up" hx-target="#app-body" + hx-push-url="/sign-up" + > + sign up + </a> + to add comments on this article. + </div> +{{ end }}
\ No newline at end of file |