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 {{ if gt (len .Comments) 0 }} 49 <section id="comments" class="mt-8 space-y-4 relative"> 50 {{ range $index, $comment := .Comments }} 51 <div 52 id="comment-{{ .CommentId }}" 53 class="rounded bg-white px-6 py-4 relative" 54 > 55 {{ if eq $index 0 }} 56 <div class="absolute left-8 -top-8 w-px h-8 bg-gray-300" ></div> 57 {{ else }} 58 <div class="absolute left-8 -top-4 w-px h-4 bg-gray-300" ></div> 59 {{ end }} 60 <div class="flex items-center gap-2 mb-2 text-gray-500"> 61 {{ $owner := index $.DidHandleMap .OwnerDid }} 62 <span class="text-sm"> 63 <a 64 href="/{{ $owner }}" 65 class="no-underline hover:underline" 66 >{{ $owner }}</a 67 > 68 </span> 69 70 <span class="before:content-['·']"></span> 71 <a 72 href="#{{ .CommentId }}" 73 class="text-gray-500 text-sm hover:text-gray-500 hover:underline no-underline" 74 id="{{ .CommentId }}" 75 > 76 {{ .Created | timeFmt }} 77 </a> 78 </div> 79 <div class="prose"> 80 {{ .Body | markdown }} 81 </div> 82 </div> 83 {{ end }} 84 </section> 85 {{ end }} 86 87 {{ block "newComment" . }} {{ end }} 88 89 {{ $isIssueAuthor := and .LoggedInUser (eq .LoggedInUser.Did .Issue.OwnerDid) }} 90 {{ $isRepoCollaborator := .RepoInfo.Roles.IsCollaborator }} 91 {{ if or $isIssueAuthor $isRepoCollaborator }} 92 {{ $action := "close" }} 93 {{ $icon := "circle-x" }} 94 {{ $hoverColor := "red" }} 95 {{ if eq .State "closed" }} 96 {{ $action = "reopen" }} 97 {{ $icon = "circle-dot" }} 98 {{ $hoverColor = "green" }} 99 {{ end }} 100 <form 101 hx-post="/{{ .RepoInfo.FullName }}/issues/{{ .Issue.IssueId }}/{{ $action }}" 102 hx-swap="none" 103 class="mt-8" 104 > 105 <button type="submit" class="btn hover:bg-{{ $hoverColor }}-300"> 106 <i 107 data-lucide="{{ $icon }}" 108 class="w-4 h-4 mr-2 text-{{ $hoverColor }}-400" 109 ></i> 110 <span class="text-black">{{ $action }}</span> 111 </button> 112 <div id="issue-action" class="error"></div> 113 </form> 114 {{ end }} 115{{ end }} 116 117{{ define "newComment" }} 118 {{ if .LoggedInUser }} 119 <div class="bg-white rounded drop-shadow-sm py-4 px-6 relative w-full flex flex-col gap-2 mt-8"> 120 <div class="absolute left-8 -top-8 w-px h-8 bg-gray-300" ></div> 121 <div class="text-sm text-gray-500"> 122 {{ didOrHandle .LoggedInUser.Did .LoggedInUser.Handle }} 123 </div> 124 <form hx-post="/{{ .RepoInfo.FullName }}/issues/{{ .Issue.IssueId }}/comment"> 125 <textarea 126 name="body" 127 class="w-full p-2 rounded border border-gray-200" 128 placeholder="Add to the discussion..." 129 ></textarea> 130 <button type="submit" class="btn mt-2">comment</button> 131 <div id="issue-comment"></div> 132 </form> 133 </div> 134 {{ else }} 135 <div class="bg-white rounded drop-shadow-sm px-6 py-4 mt-8"> 136 <div class="absolute left-8 -top-8 w-px h-8 bg-gray-300" ></div> 137 <a href="/login" class="underline">login</a> to join the discussion 138 </div> 139 {{ end }} 140{{ end }}