this repo has no description
1{{ define "title" }} 2 {{ .Issue.Title }} &middot; 3 {{ .RepoInfo.FullName }} 4{{ end }} 5 6{{ define "repoContent" }} 7 <header> 8 <p class="text-2xl"> 9 {{ .Issue.Title }} 10 <span class="text-gray-500">#{{ .Issue.IssueId }}</span> 11 </p> 12 </header> 13 14 {{ $bgColor := "bg-gray-800" }} 15 {{ $icon := "ban" }} 16 {{ if eq .State "open" }} 17 {{ $bgColor = "bg-green-600" }} 18 {{ $icon = "circle-dot" }} 19 {{ end }} 20 21 <section class="mt-2"> 22 <div class="inline-flex items-center gap-2"> 23 <div id="state" 24 class="inline-flex items-center rounded px-3 py-1 {{ $bgColor }} text-sm"> 25 <i data-lucide="{{ $icon }}" class="w-4 h-4 mr-1.5 text-white" ></i> 26 <span class="text-white">{{ .State }}</span> 27 </div> 28 <span class="text-gray-500 text-sm"> 29 opened by 30 {{ $owner := didOrHandle .Issue.OwnerDid .IssueOwnerHandle }} 31 <a href="/{{ $owner }}" class="no-underline hover:underline" 32 >{{ $owner }}</a 33 > 34 <span class="px-1 select-none before:content-['\00B7']"></span> 35 <time>{{ .Issue.Created | timeFmt }}</time> 36 </span> 37 </div> 38 39 {{ if .Issue.Body }} 40 <article id="body" class="mt-4 prose"> 41 {{ .Issue.Body | markdown }} 42 </article> 43 {{ end }} 44 </section> 45{{ end }} 46 47{{ define "repoAfter" }} 48 <section id="comments" class="mt-8 space-y-4 relative"> 49 {{ range $index, $comment := .Comments }} 50 <div 51 id="comment-{{ .CommentId }}" 52 class="rounded bg-white px-6 py-4 relative" 53 > 54 {{ if eq $index 0 }} 55 <div 56 class="absolute left-8 -top-8 w-px h-8 bg-gray-300" 57 ></div> 58 {{ else }} 59 <div 60 class="absolute left-8 -top-4 w-px h-4 bg-gray-300" 61 ></div> 62 {{ end }} 63 <div class="flex items-center gap-2 mb-2 text-gray-500"> 64 {{ $owner := index $.DidHandleMap .OwnerDid }} 65 <span class="text-sm"> 66 <a 67 href="/{{ $owner }}" 68 class="no-underline hover:underline" 69 >{{ $owner }}</a 70 > 71 </span> 72 73 <span class="before:content-['·']"></span> 74 <a 75 href="#{{ .CommentId }}" 76 class="text-gray-500 text-sm hover:text-gray-500 hover:underline no-underline" 77 id="{{ .CommentId }}" 78 > 79 {{ .Created | timeFmt }} 80 </a> 81 </div> 82 <div class="prose"> 83 {{ .Body | markdown }} 84 </div> 85 </div> 86 {{ end }} 87 </section> 88 89 {{ if .LoggedInUser }} 90 <form 91 hx-post="/{{ .RepoInfo.FullName }}/issues/{{ .Issue.IssueId }}/comment" 92 class="mt-8" 93 > 94 <textarea 95 name="body" 96 class="w-full p-2 rounded border border-gray-200" 97 placeholder="Add to the discussion..." 98 ></textarea> 99 <button type="submit" class="btn mt-2">comment</button> 100 <div id="issue-comment"></div> 101 </form> 102 {{ end }} 103 104 {{ $isIssueAuthor := eq .LoggedInUser.Did .Issue.OwnerDid }} 105 {{ $isRepoCollaborator := .RepoInfo.Roles.IsCollaborator }} 106 {{ if or $isIssueAuthor $isRepoCollaborator }} 107 {{ $action := "close" }} 108 {{ $icon := "circle-x" }} 109 {{ $hoverColor := "red" }} 110 {{ if eq .State "closed" }} 111 {{ $action = "reopen" }} 112 {{ $icon = "circle-dot" }} 113 {{ $hoverColor = "green" }} 114 {{ end }} 115 <form 116 hx-post="/{{ .RepoInfo.FullName }}/issues/{{ .Issue.IssueId }}/{{ $action }}" 117 hx-swap="none" 118 class="mt-8" 119 > 120 <button type="submit" class="btn hover:bg-{{ $hoverColor }}-300"> 121 <i 122 data-lucide="{{ $icon }}" 123 class="w-4 h-4 mr-2 text-{{ $hoverColor }}-400" 124 ></i> 125 <span class="text-black">{{ $action }}</span> 126 </button> 127 <div id="issue-action" class="error"></div> 128 </form> 129 {{ end }} 130{{ end }}