this repo has no description
at icy/tolqpt 5.7 kB view raw
1{{ define "title" }} commit {{ .Diff.Commit.This }} &middot; {{ .RepoInfo.FullName }} {{ end }} 2 3{{ define "extrameta" }} 4 {{ $title := printf "commit %s &middot; %s" .Diff.Commit.This .RepoInfo.FullName }} 5 {{ $url := printf "https://tangled.org/%s/commit/%s" .RepoInfo.FullName .Diff.Commit.This }} 6 7 {{ template "repo/fragments/og" (dict "RepoInfo" .RepoInfo "Title" $title "Url" $url) }} 8{{ end }} 9 10 11{{ define "repoContent" }} 12 13{{ $repo := .RepoInfo.FullName }} 14{{ $commit := .Diff.Commit }} 15 16<section class="commit dark:text-white"> 17 <div id="commit-message"> 18 {{ $messageParts := splitN $commit.Message "\n\n" 2 }} 19 <div> 20 <p class="pb-2">{{ index $messageParts 0 }}</p> 21 {{ if gt (len $messageParts) 1 }} 22 <p class="mt-1 cursor-text pb-2 text-sm">{{ nl2br (index $messageParts 1) }}</p> 23 {{ end }} 24 </div> 25 </div> 26 27 <div class="flex flex-wrap items-center space-x-2"> 28 <p class="flex flex-wrap items-center gap-1 text-sm text-gray-500 dark:text-gray-300"> 29 {{ template "attribution" . }} 30 31 <span class="px-1 select-none before:content-['\00B7']"></span> 32 {{ template "repo/fragments/time" $commit.Committer.When }} 33 <span class="px-1 select-none before:content-['\00B7']"></span> 34 35 <a href="/{{ $repo }}/commit/{{ $commit.This }}" class="no-underline hover:underline text-gray-500 dark:text-gray-300">{{ slice $commit.This 0 8 }}</a> 36 37 {{ if $commit.Parent }} 38 {{ i "arrow-left" "w-3 h-3 mx-1" }} 39 <a href="/{{ $repo }}/commit/{{ $commit.Parent }}" class="no-underline hover:underline text-gray-500 dark:text-gray-300">{{ slice $commit.Parent 0 8 }}</a> 40 {{ end }} 41 </p> 42 43 {{ if .VerifiedCommit.IsVerified $commit.This }} 44 <div class="group relative inline-block text-sm"> 45 <div class="bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200 px-2 py-1 rounded cursor-pointer"> 46 <div class="flex items-center gap-2"> 47 {{ i "shield-check" "w-4 h-4" }} 48 verified 49 </div> 50 </div> 51 <div class="absolute z-[9999] hidden group-hover:block bg-white dark:bg-gray-900 text-sm text-black dark:text-white rounded-md shadow-md p-4 w-80 top-full mt-2"> 52 <div class="mb-1">This commit was signed with the committer's <span class="text-green-600 font-semibold">known signature</span>.</div> 53 <div class="flex items-center gap-2 my-2"> 54 {{ i "user" "w-4 h-4" }} 55 {{ $committerDid := index $.EmailToDid $commit.Committer.Email }} 56 {{ template "user/fragments/picHandleLink" $committerDid }} 57 </div> 58 <div class="my-1 pt-2 text-xs border-t border-gray-200 dark:border-gray-700"> 59 <div class="text-gray-600 dark:text-gray-300">SSH Key Fingerprint:</div> 60 <div class="break-all">{{ .VerifiedCommit.Fingerprint $commit.This }}</div> 61 </div> 62 </div> 63 </div> 64 {{ end }} 65 66 <div class="text-sm"> 67 {{ if $.Pipeline }} 68 {{ template "repo/pipelines/fragments/pipelineSymbolLong" (dict "Pipeline" $.Pipeline "RepoInfo" $.RepoInfo) }} 69 {{ end }} 70 </div> 71 </div> 72 73</section> 74{{end}} 75 76{{ define "attribution" }} 77 {{ $commit := .Diff.Commit }} 78 {{ $showCommitter := true }} 79 {{ if eq $commit.Author.Email $commit.Committer.Email }} 80 {{ $showCommitter = false }} 81 {{ end }} 82 83 {{ if $showCommitter }} 84 authored by {{ template "attributedUser" (list $commit.Author.Email $commit.Author.Name $.EmailToDid) }} 85 {{ range $commit.CoAuthors }} 86 {{ template "attributedUser" (list .Email .Name $.EmailToDid) }} 87 {{ end }} 88 and committed by {{ template "attributedUser" (list $commit.Committer.Email $commit.Committer.Name $.EmailToDid) }} 89 {{ else }} 90 {{ template "attributedUser" (list $commit.Author.Email $commit.Author.Name $.EmailToDid )}} 91 {{ end }} 92{{ end }} 93 94{{ define "attributedUser" }} 95 {{ $email := index . 0 }} 96 {{ $name := index . 1 }} 97 {{ $map := index . 2 }} 98 {{ $did := index $map $email }} 99 100 {{ if $did }} 101 {{ template "user/fragments/picHandleLink" $did }} 102 {{ else }} 103 <span class="flex items-center gap-1"> 104 {{ placeholderAvatar "tiny" }} 105 <a href="mailto:{{ $email }}" class="no-underline hover:underline text-gray-500 dark:text-gray-300">{{ $name }}</a> 106 </span> 107 {{ end }} 108{{ end }} 109 110{{ define "topbarLayout" }} 111 <header class="col-span-full" style="z-index: 20;"> 112 {{ template "layouts/fragments/topbar" . }} 113 </header> 114{{ end }} 115 116{{ define "mainLayout" }} 117 <div class="px-1 flex-grow col-span-full flex flex-col gap-4"> 118 {{ block "contentLayout" . }} 119 {{ block "content" . }}{{ end }} 120 {{ end }} 121 122 {{ block "contentAfterLayout" . }} 123 <div class="flex-grow grid grid-cols-1 md:grid-cols-12 gap-4"> 124 <div class="flex flex-col gap-4 col-span-1 md:col-span-2"> 125 {{ block "contentAfterLeft" . }} {{ end }} 126 </div> 127 <main class="col-span-1 md:col-span-10"> 128 {{ block "contentAfter" . }}{{ end }} 129 </main> 130 </div> 131 {{ end }} 132 </div> 133{{ end }} 134 135{{ define "footerLayout" }} 136 <footer class="col-span-full mt-12"> 137 {{ template "layouts/fragments/footer" . }} 138 </footer> 139{{ end }} 140 141{{ define "contentAfter" }} 142 {{ template "repo/fragments/diff" (list .Diff .DiffOpts) }} 143{{end}} 144 145{{ define "contentAfterLeft" }} 146 <div class="flex flex-col gap-4 col-span-1 md:col-span-2"> 147 {{ template "repo/fragments/diffOpts" .DiffOpts }} 148 </div> 149 <div class="sticky top-0 flex-grow max-h-screen overflow-y-auto"> 150 {{ template "repo/fragments/diffChangedFiles" .Diff }} 151 </div> 152{{end}}