aboutsummaryrefslogtreecommitdiff
path: root/cmd/web/templates/articles/partials/detail-post-meta.tmpl
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/web/templates/articles/partials/detail-post-meta.tmpl')
-rw-r--r--cmd/web/templates/articles/partials/detail-post-meta.tmpl42
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