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