aboutsummaryrefslogtreecommitdiff
path: root/cmd/web/templates/projects/partials/detail-post-meta.tmpl
blob: eb957b48b0749b7e7ab2e60ceb184b38c0537736 (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="{{ .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>