A vibe coded tangled fork which supports pijul.
at master 110 lines 4.8 kB view raw
1{{ define "title" }} change {{ .Change.Hash }} &middot; {{ .RepoInfo.FullName }} {{ end }} 2 3{{ define "repoContent" }} 4{{ $repo := .RepoInfo.FullName }} 5{{ $change := .Change }} 6 7<section class="dark:text-white"> 8 <h1 class="mt-2">{{ $change.Message }}</h1> 9 10 <div class="flex items-center gap-3 py-3"> 11 {{ if $change.Authors }} 12 {{ $author := index $change.Authors 0 }} 13 {{ if $author.Did }} 14 <a href="/{{ resolve (deref $author.Did) }}"> 15 {{ template "user/fragments/pic" (list (deref $author.Did) "h-10 w-10") }} 16 </a> 17 {{ else }} 18 {{ placeholderAvatar "md" }} 19 {{ end }} 20 <div class="flex flex-col"> 21 <div> 22 {{ range $idx, $a := $change.Authors }} 23 {{ if gt $idx 0 }}, {{ end }} 24 {{ if $a.Did }} 25 <a href="/{{ resolve (deref $a.Did) }}" class="no-underline hover:underline text-gray-700 dark:text-gray-300">{{ deref $a.Did | resolve | truncateAt30 }}</a> 26 {{ else }} 27 {{ $a.Name }}{{ if $a.Email }} &lt;{{ $a.Email }}&gt;{{ end }} 28 {{ end }} 29 {{ end }} 30 </div> 31 {{ if $change.HasTimestamp }} 32 <div class="text-sm text-gray-500 dark:text-gray-400"> 33 {{ template "repo/fragments/time" $change.Timestamp }} 34 </div> 35 {{ end }} 36 <div class="font-mono text-sm text-gray-500 dark:text-gray-400 break-all">{{ $change.Hash }}</div> 37 </div> 38 {{ else }} 39 {{ placeholderAvatar "md" }} 40 <div class="text-gray-500">unknown</div> 41 {{ end }} 42 </div> 43 44 {{ if .RepoInfo.Roles.CanManageRepo }} 45 <div class="mt-4" id="change"> 46 <button 47 class="px-3 py-1.5 text-sm font-medium text-red-600 dark:text-red-400 border border-red-300 dark:border-red-700 rounded hover:bg-red-50 dark:hover:bg-red-900/30 cursor-pointer" 48 hx-post="/{{ $repo }}/change/{{ $change.Hash }}/unrecord" 49 hx-confirm="Are you sure you want to unrecord this change? This will remove it from the current channel." 50 hx-swap="none" 51 > 52 Unrecord 53 </button> 54 </div> 55 {{ end }} 56 57 <h2 class="mt-6 text-sm uppercase text-gray-600 dark:text-gray-400">Dependencies</h2> 58 <ul class="mt-2"> 59 {{ if $change.Dependencies }} 60 {{ range $change.Dependencies }} 61 <li class="font-mono text-sm break-all"> 62 <a class="no-underline hover:underline" href="/{{ $repo }}/change/{{ . }}">{{ . }}</a> 63 </li> 64 {{ end }} 65 {{ else }} 66 <li class="text-sm text-gray-500">none</li> 67 {{ end }} 68 </ul> 69 70 <h2 class="mt-8 text-sm uppercase text-gray-600 dark:text-gray-400">Change contents</h2> 71 {{ if $change.HasDiff }} 72 {{ if $change.DiffLines }} 73 <div class="overflow-x-auto text-sm bg-gray-50 dark:bg-gray-900 p-3 rounded mt-2 font-mono"> 74 {{ $lineNrStyle := "min-w-[3.5rem] flex-shrink-0 select-none text-right bg-white dark:bg-gray-800" }} 75 {{ $lineNrSepStyle1 := "" }} 76 {{ $lineNrSepStyle2 := "pr-2 border-r border-gray-200 dark:border-gray-700" }} 77 {{ $containerStyle := "inline-flex w-full items-center" }} 78 {{ range $change.DiffLines }} 79 {{ if eq .Kind "section" }} 80 <div class="whitespace-pre text-xs uppercase tracking-wide text-gray-600 dark:text-gray-300 mt-3">{{ .Text }}</div> 81 {{ else if eq .Kind "meta" }} 82 <div class="whitespace-pre text-gray-500 dark:text-gray-400">{{ .Text }}</div> 83 {{ else }} 84 {{ $lineClass := "bg-white dark:bg-gray-800 text-gray-500 dark:text-gray-400" }} 85 {{ if eq .Kind "add" }} 86 {{ $lineClass = "bg-green-100 dark:bg-green-800/30 text-green-700 dark:text-green-400" }} 87 {{ else if eq .Kind "del" }} 88 {{ $lineClass = "bg-red-100 dark:bg-red-800/30 text-red-700 dark:text-red-400" }} 89 {{ end }} 90 <div class="{{ $containerStyle }} {{ $lineClass }}"> 91 <div class="{{ $lineNrStyle }} {{ $lineNrSepStyle1 }}"> 92 {{ if .HasOld }}{{ .OldLine }}{{ else }}<span aria-hidden="true" class="invisible">0</span>{{ end }} 93 </div> 94 <div class="{{ $lineNrStyle }} {{ $lineNrSepStyle2 }}"> 95 {{ if .HasNew }}{{ .NewLine }}{{ else }}<span aria-hidden="true" class="invisible">0</span>{{ end }} 96 </div> 97 <div class="w-5 flex-shrink-0 select-none text-center">{{ .Op }}</div> 98 <div class="px-2 whitespace-pre">{{ .Body }}</div> 99 </div> 100 {{ end }} 101 {{ end }} 102 </div> 103 {{ else }} 104 <pre class="overflow-x-auto text-sm bg-gray-50 dark:bg-gray-900 p-3 rounded mt-2 font-mono whitespace-pre">{{ $change.Diff }}</pre> 105 {{ end }} 106 {{ else }} 107 <div class="text-sm text-gray-500 mt-2">no diff available</div> 108 {{ end }} 109</section> 110{{ end }}