aboutsummaryrefslogtreecommitdiff
path: root/cmd/web/templates/articles/partials/detail-post-meta.tmpl
blob: a871b44e0862d38fd0b40258e13a04f4709b3945 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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>