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