issue_detail.html
·
95 lines
·
3.8 KB
| 1 | {{define "content"}} |
| 2 | <div class="container"> |
| 3 | {{template "repo_header" .}} |
| 4 | |
| 5 | <!-- Issue Header --> |
| 6 | <div class="mb-4 pb-3" style="border-bottom:1px solid hsl(var(--border));"> |
| 7 | <div class="flex items-start justify-between flex-wrap gap-3"> |
| 8 | <div class="flex items-center gap-2 flex-wrap"> |
| 9 | <h1 class="text-lg font-bold" style="margin:0;">{{.Issue.Title}}</h1> |
| 10 | <span class="font-mono text-base text-muted">#{{.Issue.Number}}</span> |
| 11 | </div> |
| 12 | {{if .CanToggleIssue}} |
| 13 | <form method="post" action="/{{.Repo.OwnerUsername}}/{{.Repo.Name}}/issues/{{.Issue.Number}}/state" style="margin:0;"> |
| 14 | <input type="hidden" name="_csrf" value="{{.CSRFToken}}"> |
| 15 | {{if .Issue.IsClosed}} |
| 16 | <input type="hidden" name="state" value="open"> |
| 17 | <button type="submit" class="btn btn-outline btn-sm"> |
| 18 | {{icon "alert-circle" "size-3.5"}} |
| 19 | <span>{{t .Lang "issue.reopen_btn"}}</span> |
| 20 | </button> |
| 21 | {{else}} |
| 22 | <input type="hidden" name="state" value="closed"> |
| 23 | <button type="submit" class="btn btn-outline btn-sm"> |
| 24 | {{icon "check" "size-3.5"}} |
| 25 | <span>{{t .Lang "issue.close_btn"}}</span> |
| 26 | </button> |
| 27 | {{end}} |
| 28 | </form> |
| 29 | {{end}} |
| 30 | </div> |
| 31 | |
| 32 | <div class="flex items-center gap-2 mt-2 text-xs text-muted"> |
| 33 | {{if .Issue.IsClosed}} |
| 34 | <span class="badge badge-outline">{{icon "check" "size-3.5"}} {{t .Lang "issue.status.closed"}}</span> |
| 35 | {{else}} |
| 36 | <span class="badge badge-primary">{{icon "alert-circle" "size-3.5"}} {{t .Lang "issue.status.open"}}</span> |
| 37 | {{end}} |
| 38 | <a href="/{{.Issue.AuthorUsername}}" class="font-medium" style="color:hsl(var(--foreground));">@{{.Issue.AuthorUsername}}</a> |
| 39 | <span>·</span> |
| 40 | <span>{{timeAgo .Issue.CreatedAt .Lang}}</span> |
| 41 | </div> |
| 42 | </div> |
| 43 | |
| 44 | <!-- Issue Description Card --> |
| 45 | <div class="card mb-4"> |
| 46 | <div class="card-header text-xs" style="padding:0.5rem 0.85rem;background:hsl(var(--muted));"> |
| 47 | <div class="flex items-center gap-2"> |
| 48 | {{avatar .Issue.AuthorUsername .Issue.AuthorAvatar}} |
| 49 | <a href="/{{.Issue.AuthorUsername}}" class="font-semibold">@{{.Issue.AuthorUsername}}</a> |
| 50 | <span class="text-muted">{{timeAgo .Issue.CreatedAt .Lang}}</span> |
| 51 | </div> |
| 52 | </div> |
| 53 | <div class="card-body markdown-body"> |
| 54 | {{if .Issue.Body}} |
| 55 | {{renderMD .Issue.Body}} |
| 56 | {{else}} |
| 57 | <span class="text-xs text-muted">—</span> |
| 58 | {{end}} |
| 59 | </div> |
| 60 | </div> |
| 61 | |
| 62 | <!-- Comments --> |
| 63 | {{if .Comments}} |
| 64 | <div class="flex flex-col gap-3 mb-4"> |
| 65 | {{range .Comments}} |
| 66 | <div class="card"> |
| 67 | <div class="card-header text-xs" style="padding:0.5rem 0.85rem;background:hsl(var(--muted));"> |
| 68 | <div class="flex items-center gap-2"> |
| 69 | {{avatar .AuthorUsername .AuthorAvatar}} |
| 70 | <a href="/{{.AuthorUsername}}" class="font-semibold">@{{.AuthorUsername}}</a> |
| 71 | <span class="text-muted">{{timeAgo .CreatedAt $.Lang}}</span> |
| 72 | </div> |
| 73 | </div> |
| 74 | <div class="card-body markdown-body"> |
| 75 | {{renderMD .Body}} |
| 76 | </div> |
| 77 | </div> |
| 78 | {{end}} |
| 79 | </div> |
| 80 | {{end}} |
| 81 | |
| 82 | <!-- Add Comment Form --> |
| 83 | {{if .CurrentUser}} |
| 84 | <div class="card"> |
| 85 | <form method="post" action="/{{.Repo.OwnerUsername}}/{{.Repo.Name}}/issues/{{.Issue.Number}}/comments" class="card-body flex flex-col gap-2.5"> |
| 86 | <input type="hidden" name="_csrf" value="{{.CSRFToken}}"> |
| 87 | <textarea name="body" class="textarea" rows="4" placeholder="{{t .Lang "issue.comment_ph"}}" required maxlength="20000"></textarea> |
| 88 | <div class="flex items-center justify-end"> |
| 89 | <button type="submit" class="btn btn-primary btn-sm">{{t .Lang "issue.comment_btn"}}</button> |
| 90 | </div> |
| 91 | </form> |
| 92 | </div> |
| 93 | {{end}} |
| 94 | </div> |
| 95 | {{end}} |