this repo has no description
1{{ define "title" }}commits &middot; {{ .RepoInfo.FullName }}{{ end }} 2 3{{ define "extrameta" }} 4 {{ $title := printf "commits &middot; %s" .RepoInfo.FullName }} 5 {{ $url := printf "https://tangled.sh/%s/commits" .RepoInfo.FullName }} 6 7 {{ template "repo/fragments/og" (dict "RepoInfo" .RepoInfo "Title" $title "Url" $url) }} 8{{ end }} 9 10{{ define "repoContent" }} 11<section id="commit-table" class="overflow-x-auto"> 12 <h2 class="font-bold text-sm mb-4 uppercase dark:text-white"> 13 commits 14 </h2> 15 16 <!-- desktop view (hidden on small screens) --> 17 <table class="w-full border-collapse hidden md:table"> 18 <thead> 19 <tr> 20 <th class="py-2 text-sm text-left text-gray-700 dark:text-gray-300 uppercase font-bold">Author</th> 21 <th class="py-2 text-sm text-left text-gray-700 dark:text-gray-300 uppercase font-bold">Commit</th> 22 <th class="py-2 text-sm text-left text-gray-700 dark:text-gray-300 uppercase font-bold">Message</th> 23 <th class="py-2 text-sm text-left text-gray-700 dark:text-gray-300 uppercase font-bold"></th> 24 <th class="py-2 text-sm text-left text-gray-700 dark:text-gray-300 uppercase font-bold">Date</th> 25 </tr> 26 </thead> 27 <tbody> 28 {{ range $index, $commit := .Commits }} 29 {{ $messageParts := splitN $commit.Message "\n\n" 2 }} 30 <tr class="{{ if ne $index (sub (len $.Commits) 1) }}border-b border-gray-200 dark:border-gray-700{{ end }}"> 31 <td class=" py-3 align-top"> 32 {{ $didOrHandle := index $.EmailToDidOrHandle $commit.Author.Email }} 33 {{ if $didOrHandle }} 34 <a href="/{{ $didOrHandle }}" class="text-gray-700 dark:text-gray-300 no-underline hover:underline">{{ $didOrHandle }}</a> 35 {{ else }} 36 <a href="mailto:{{ $commit.Author.Email }}" class="text-gray-700 dark:text-gray-300 no-underline hover:underline">{{ $commit.Author.Name }}</a> 37 {{ end }} 38 </td> 39 <td class="py-3 align-top font-mono flex items-center"> 40 {{ $verified := $.VerifiedCommits.IsVerified $commit.Hash.String }} 41 {{ $hashStyle := "text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-900" }} 42 {{ if $verified }} 43 {{ $hashStyle = "bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200 px-2 rounded" }} 44 {{ end }} 45 <a href="/{{ $.RepoInfo.FullName }}/commit/{{ $commit.Hash.String }}" class="no-underline hover:underline {{ $hashStyle }} px-2 py-1/2 rounded flex items-center gap-2"> 46 {{ slice $commit.Hash.String 0 8 }} 47 {{ if $verified }} 48 {{ i "shield-check" "w-4 h-4" }} 49 {{ end }} 50 </a> 51 <div class="{{ if not $verified }} ml-6 {{ end }}inline-flex"> 52 <button class="p-1 mx-1 hover:bg-gray-100 dark:hover:bg-gray-700 rounded" 53 title="Copy SHA" 54 onclick="navigator.clipboard.writeText('{{ $commit.Hash.String }}'); this.innerHTML=`{{ i "copy-check" "w-4 h-4" }}`; setTimeout(() => this.innerHTML=`{{ i "copy" "w-4 h-4" }}`, 1500)"> 55 {{ i "copy" "w-4 h-4" }} 56 </button> 57 <a href="/{{ $.RepoInfo.FullName }}/tree/{{ $commit.Hash.String }}" class="p-1 mx-1 hover:bg-gray-100 dark:hover:bg-gray-700 rounded" title="Browse repository at this commit"> 58 {{ i "folder-code" "w-4 h-4" }} 59 </a> 60 </div> 61 62 </td> 63 <td class=" py-3 align-top"> 64 <div class="flex items-center justify-start gap-2"> 65 <a href="/{{ $.RepoInfo.FullName }}/commit/{{ $commit.Hash.String }}" class="dark:text-white no-underline hover:underline">{{ index $messageParts 0 }}</a> 66 {{ if gt (len $messageParts) 1 }} 67 <button class="py-1/2 px-1 bg-gray-200 hover:bg-gray-400 dark:bg-gray-700 dark:hover:bg-gray-600 rounded" hx-on:click="this.parentElement.nextElementSibling.classList.toggle('hidden')">{{ i "ellipsis" "w-3 h-3" }}</button> 68 {{ end }} 69 70 {{ if index $.TagMap $commit.Hash.String }} 71 {{ range $tag := index $.TagMap $commit.Hash.String }} 72 <span class="ml-2 text-xs rounded bg-gray-100 dark:bg-gray-700 text-black dark:text-white font-mono px-2 inline-flex items-center"> 73 {{ $tag }} 74 </span> 75 {{ end }} 76 {{ end }} 77 </div> 78 79 {{ if gt (len $messageParts) 1 }} 80 <p class="hidden mt-1 text-sm text-gray-600 dark:text-gray-400">{{ nl2br (index $messageParts 1) }}</p> 81 {{ end }} 82 </td> 83 <td class="py-3 align-top"> 84 <!-- ci status --> 85 {{ $pipeline := index $.Pipelines .Hash.String }} 86 {{ if and $pipeline (gt (len $pipeline.Statuses) 0) }} 87 {{ template "repo/pipelines/fragments/pipelineSymbolLong" (dict "Pipeline" $pipeline "RepoInfo" $.RepoInfo) }} 88 {{ end }} 89 </td> 90 <td class=" py-3 align-top text-gray-500 dark:text-gray-400">{{ timeFmt $commit.Committer.When }}</td> 91 </tr> 92 {{ end }} 93 </tbody> 94 </table> 95 96 <!-- mobile view (visible only on small screens) --> 97 <div class="md:hidden"> 98 {{ range $index, $commit := .Commits }} 99 <div class="relative p-2 mb-2 {{ if ne $index (sub (len $.Commits) 1) }}border-b border-gray-200 dark:border-gray-700{{ end }}"> 100 <div id="commit-message"> 101 {{ $messageParts := splitN $commit.Message "\n\n" 2 }} 102 <div class="text-base cursor-pointer"> 103 <div class="flex items-center justify-between"> 104 <div class="flex-1"> 105 <div class="inline-flex items-end"> 106 <a href="/{{ $.RepoInfo.FullName }}/commit/{{ $commit.Hash.String }}" 107 class="inline no-underline hover:underline dark:text-white"> 108 {{ index $messageParts 0 }} 109 </a> 110 {{ if gt (len $messageParts) 1 }} 111 <button 112 class="py-1/2 px-1 bg-gray-200 hover:bg-gray-400 rounded dark:bg-gray-700 dark:hover:bg-gray-600 ml-2" 113 hx-on:click="this.parentElement.nextElementSibling.classList.toggle('hidden')"> 114 {{ i "ellipsis" "w-3 h-3" }} 115 </button> 116 {{ end }} 117 118 {{ if index $.TagMap $commit.Hash.String }} 119 {{ range $tag := index $.TagMap $commit.Hash.String }} 120 <span class="ml-2 text-xs rounded bg-gray-100 dark:bg-gray-700 text-black dark:text-white font-mono px-2 inline-flex items-center"> 121 {{ $tag }} 122 </span> 123 {{ end }} 124 {{ end }} 125 </div> 126 127 {{ if gt (len $messageParts) 1 }} 128 <p class="hidden mt-1 text-sm cursor-text pb-2 dark:text-gray-300"> 129 {{ nl2br (index $messageParts 1) }} 130 </p> 131 {{ end }} 132 </div> 133 <a href="/{{ $.RepoInfo.FullName }}/tree/{{ $commit.Hash.String }}" 134 class="p-1 mr-1 hover:bg-gray-100 dark:hover:bg-gray-700 rounded" 135 title="Browse repository at this commit"> 136 {{ i "folder-code" "w-4 h-4" }} 137 </a> 138 </div> 139 </div> 140 </div> 141 142 <div class="text-xs mt-2 text-gray-500 dark:text-gray-400 flex items-center"> 143 {{ $verified := $.VerifiedCommits.IsVerified $commit.Hash.String }} 144 {{ $hashStyle := "text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-900" }} 145 {{ if $verified }} 146 {{ $hashStyle = "bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200 px-2 rounded" }} 147 {{ end }} 148 <span class="font-mono"> 149 <a href="/{{ $.RepoInfo.FullName }}/commit/{{ $commit.Hash.String }}" 150 class="no-underline hover:underline {{ $hashStyle }} px-2 py-1 rounded flex items-center gap-2"> 151 {{ slice $commit.Hash.String 0 8 }} 152 {{ if $verified }} 153 {{ i "shield-check" "w-3 h-3" }} 154 {{ end }} 155 </a> 156 </span> 157 <span class="mx-2 before:content-['·'] before:select-none"></span> 158 <span> 159 {{ $didOrHandle := index $.EmailToDidOrHandle $commit.Author.Email }} 160 <a href="{{ if $didOrHandle }}/{{ $didOrHandle }}{{ else }}mailto:{{ $commit.Author.Email }}{{ end }}" 161 class="text-gray-500 dark:text-gray-400 no-underline hover:underline"> 162 {{ if $didOrHandle }}{{ $didOrHandle }}{{ else }}{{ $commit.Author.Name }}{{ end }} 163 </a> 164 </span> 165 <div class="inline-block px-1 select-none after:content-['·']"></div> 166 <span>{{ shortTimeFmt $commit.Committer.When }}</span> 167 168 <!-- ci status --> 169 {{ $pipeline := index $.Pipelines .Hash.String }} 170 {{ if and $pipeline (gt (len $pipeline.Statuses) 0) }} 171 <div class="inline-block px-1 select-none after:content-['·']"></div> 172 <span class="text-sm"> 173 {{ template "repo/pipelines/fragments/pipelineSymbolLong" (dict "Pipeline" $pipeline "RepoInfo" $.RepoInfo) }} 174 </span> 175 {{ end }} 176 </div> 177 </div> 178 {{ end }} 179 </div> 180</section> 181 182{{ end }} 183 184{{ define "repoAfter" }} 185 {{ $commits_len := len .Commits }} 186 <div class="flex justify-end mt-4 gap-2"> 187 {{ if gt .Page 1 }}<a class="btn flex items-center gap-2 no-underline hover:no-underline dark:text-white dark:hover:bg-gray-700" hx-boost="true" onclick="window.location.href = window.location.pathname + '?page={{ sub .Page 1 }}'">{{ i "chevron-left" "w-4 h-4" }} previous</a>{{ else }}<div></div>{{ end }} 188 {{ if eq $commits_len 60 }}<a class="btn flex items-center gap-2 no-underline hover:no-underline dark:text-white dark:hover:bg-gray-700" hx-boost="true" onclick="window.location.href = window.location.pathname + '?page={{ add .Page 1 }}'">next {{ i "chevron-right" "w-4 h-4" }}</a>{{ end }} 189 </div> 190{{ end }}