This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

core / appview / pages / templates / repo / issues / issue.html
4.4 kB 129 lines
1{{ define "title" }}{{ .Issue.Title }} &middot; issue #{{ .Issue.IssueId }} &middot; {{ .RepoInfo.FullName }}{{ end }} 2 3 4{{ define "extrameta" }} 5 {{ template "repo/issues/fragments/og" (dict "RepoInfo" .RepoInfo "Issue" .Issue) }} 6{{ end }} 7 8{{ define "repoContentLayout" }} 9 <div class="grid grid-cols-1 md:grid-cols-10 gap-4 w-full"> 10 <div class="col-span-1 md:col-span-8"> 11 <section class="bg-white dark:bg-gray-800 p-6 rounded relative w-full mx-auto dark:text-white"> 12 {{ block "repoContent" . }}{{ end }} 13 </section> 14 {{ block "repoAfter" . }}{{ end }} 15 </div> 16 <div class="col-span-1 md:col-span-2 flex flex-col gap-6"> 17 {{ template "repo/fragments/labelPanel" 18 (dict "RepoInfo" $.RepoInfo 19 "Defs" $.LabelDefs 20 "Subject" $.Issue.AtUri 21 "State" $.Issue.Labels) }} 22 {{ template "repo/fragments/participants" $.Issue.Participants }} 23 {{ template "repo/fragments/backlinks" 24 (dict "RepoInfo" $.RepoInfo 25 "Backlinks" $.Backlinks) }} 26 {{ template "repo/fragments/externalLinkPanel" $.Issue.AtUri }} 27 </div> 28 </div> 29{{ end }} 30 31{{ define "repoContent" }} 32<section id="issue-{{ .Issue.IssueId }}"> 33 {{ template "issueHeader" .Issue }} 34 {{ template "issueInfo" . }} 35 {{ if .Issue.Body }} 36 <article id="body" class="mt-4 prose dark:prose-invert">{{ .Issue.Body | markdown }}</article> 37 {{ end }} 38 <div class="mt-4"> 39 {{ template "repo/fragments/reactions" 40 (dict "Reactions" .Reactions 41 "UserReacted" .UserReacted 42 "ThreadAt" .Issue.AtUri) }} 43 </div> 44</section> 45{{ end }} 46 47{{ define "issueHeader" }} 48 <header class="pb-2"> 49 <h1 class="text-2xl"> 50 {{ .Title | description }} 51 <span class="text-gray-500 dark:text-gray-400">#{{ .IssueId }}</span> 52 </h1> 53 </header> 54{{ end }} 55 56{{ define "issueInfo" }} 57 {{ $bgColor := "bg-gray-800 dark:bg-gray-700" }} 58 {{ $icon := "ban" }} 59 {{ if eq .Issue.State "open" }} 60 {{ $bgColor = "bg-green-600 dark:bg-green-700" }} 61 {{ $icon = "circle-dot" }} 62 {{ end }} 63 <div class="inline-flex items-center gap-2"> 64 <span class="inline-flex items-center rounded px-2 py-[5px] {{ $bgColor }}"> 65 {{ i $icon "w-3 h-3 mr-1.5 text-white dark:text-white" }} 66 <span class="text-white dark:text-white text-sm">{{ .Issue.State }}</span> 67 </span> 68 69 <span class="text-gray-500 dark:text-gray-400 text-sm flex flex-wrap items-center gap-1"> 70 opened by 71 {{ template "user/fragments/picLink" (list .Issue.Did "size-6" (index .VouchRelationships (did .Issue.Did))) }} 72 <a href="/{{ resolve .Issue.Did }}">{{ resolve .Issue.Did }}</a> 73 <span class="select-none before:content-['\00B7']"></span> 74 {{ if .Issue.Edited }} 75 edited {{ template "repo/fragments/time" .Issue.Edited }} 76 {{ else }} 77 {{ template "repo/fragments/time" .Issue.Created }} 78 {{ end }} 79 </span> 80 81 {{ if and .LoggedInUser (eq .LoggedInUser.Did .Issue.Did) }} 82 {{ template "issueActions" . }} 83 {{ end }} 84 </div> 85 <div id="issue-actions-error" class="error"></div> 86{{ end }} 87 88{{ define "issueActions" }} 89 {{ template "editIssue" . }} 90 {{ template "deleteIssue" . }} 91{{ end }} 92 93{{ define "editIssue" }} 94 <a 95 class="text-gray-500 dark:text-gray-400 flex gap-1 items-center group cursor-pointer" 96 hx-get="/{{ .RepoInfo.FullName }}/issues/{{ .Issue.IssueId }}/edit" 97 hx-swap="innerHTML" 98 hx-target="#issue-{{.Issue.IssueId}}"> 99 {{ i "pencil" "size-3" }} 100 </a> 101{{ end }} 102 103{{ define "deleteIssue" }} 104 <a 105 class="text-gray-500 dark:text-gray-400 flex gap-1 items-center group cursor-pointer" 106 hx-delete="/{{ .RepoInfo.FullName }}/issues/{{ .Issue.IssueId }}/" 107 hx-confirm="Are you sure you want to delete your issue?" 108 hx-swap="none"> 109 {{ i "trash-2" "size-3 inline group-[.htmx-request]:hidden" }} 110 {{ i "loader-circle" "size-3 animate-spin hidden group-[.htmx-request]:inline" }} 111 </a> 112{{ end }} 113 114{{ define "repoAfter" }} 115 <div class="flex flex-col gap-4 mt-4"> 116 {{ 117 template "repo/issues/fragments/commentList" 118 (dict 119 "RepoInfo" $.RepoInfo 120 "LoggedInUser" $.LoggedInUser 121 "Issue" $.Issue 122 "CommentList" $.Issue.CommentList 123 "VouchRelationships" $.VouchRelationships 124 ) 125 }} 126 127 {{ template "repo/issues/fragments/newComment" . }} 128 </div> 129{{ end }}