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/detail-post-meta.tmpl |
Initial commit
Diffstat (limited to 'cmd/web/templates/articles/partials/detail-post-meta.tmpl')
-rw-r--r-- | cmd/web/templates/articles/partials/detail-post-meta.tmpl | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/cmd/web/templates/articles/partials/detail-post-meta.tmpl b/cmd/web/templates/articles/partials/detail-post-meta.tmpl new file mode 100644 index 0000000..a871b44 --- /dev/null +++ b/cmd/web/templates/articles/partials/detail-post-meta.tmpl @@ -0,0 +1,42 @@ +<div class="post-meta"> + <a href="#"><img src="{{ .Article.User.Image }}" /></a> + <div class="info"> + <a href="/users/{{ .Article.User.Username }}" + hx-push-url="/users/{{ .Article.User.Username }}" + hx-get="/htmx/users/{{ .Article.User.Username }}" + hx-target="#app-body" + class="author" + > + {{ .Article.User.Name }} + </a> + <span class="date">{{ .Article.GetFormattedCreatedAt }}</span> + </div> + + {{ if .IsSelf }} + + <button class="btn btn-outline-secondary btn-sm edit-button" + hx-get="/htmx/editor/{{ .Article.Slug }}" + hx-target="#app-body" + hx-push-url="/editor/{{ .Article.Slug }}" + > + <i class="ion-edit"></i> + Edit Article + </button> + + <button class="btn btn-outline-danger btn-sm delete-button" + hx-delete="/htmx/articles/{{ .Article.Slug }}" + hx-target="#app-body" + hx-confirm="Are you sure you wish to delete the article?" + > + <i class="ion-trash-a"></i> + Delete Article + </button> + + {{ else }} + + {{ template "articles/partials/follow-button" . }} + + {{ template "articles/partials/favorite-button" . }} + + {{ end }} +</div>
\ No newline at end of file |