forked from tangled.org/core
this repo has no description
at fork-repo 2.7 kB view raw
1{{ define "title" }} commit {{ .Diff.Commit.This }} &middot; {{ .RepoInfo.FullName }} {{ end }} 2 3{{ define "repoContent" }} 4 5{{ $repo := .RepoInfo.FullName }} 6{{ $commit := .Diff.Commit }} 7{{ $stat := .Diff.Stat }} 8{{ $diff := .Diff.Diff }} 9 10<section class="commit dark:text-white"> 11 <div id="commit-message"> 12 {{ $messageParts := splitN $commit.Message "\n\n" 2 }} 13 <div> 14 <p class="pb-2">{{ index $messageParts 0 }}</p> 15 {{ if gt (len $messageParts) 1 }} 16 <p class="mt-1 cursor-text pb-2 text-sm">{{ nl2br (unwrapText (index $messageParts 1)) }}</p> 17 {{ end }} 18 </div> 19 </div> 20 21 <div class="flex items-center"> 22 <p class="text-sm text-gray-500 dark:text-gray-300"> 23 {{ $didOrHandle := index $.EmailToDidOrHandle $commit.Author.Email }} 24 25 {{ if $didOrHandle }} 26 <a href="/{{ $didOrHandle }}" class="no-underline hover:underline text-gray-500 dark:text-gray-300">{{ $didOrHandle }}</a> 27 {{ else }} 28 <a href="mailto:{{ $commit.Author.Email }}" class="no-underline hover:underline text-gray-500 dark:text-gray-300">{{ $commit.Author.Name }}</a> 29 {{ end }} 30 <span class="px-1 select-none before:content-['\00B7']"></span> 31 {{ timeFmt $commit.Author.When }} 32 <span class="px-1 select-none before:content-['\00B7']"></span> 33 <span>{{ $stat.FilesChanged }}</span> files <span class="font-mono">(+{{ $stat.Insertions }}, -{{ $stat.Deletions }})</span> 34 <span class="px-1 select-none before:content-['\00B7']"></span> 35 </p> 36 37 <p class="flex items-center text-sm text-gray-500 dark:text-gray-300"> 38 <a href="/{{ $repo }}/commit/{{ $commit.This }}" class="no-underline hover:underline text-gray-500 dark:text-gray-300">{{ slice $commit.This 0 8 }}</a> 39 {{ if $commit.Parent }} 40 {{ i "arrow-left" "w-3 h-3 mx-1" }} 41 <a href="/{{ $repo }}/commit/{{ $commit.Parent }}" class="no-underline hover:underline text-gray-500 dark:text-gray-300">{{ slice $commit.Parent 0 8 }}</a> 42 {{ end }} 43 </p> 44 </div> 45 46 <div class="diff-stat"> 47 <br> 48 <strong class="text-sm uppercase mb-4 dark:text-gray-200">Changed files</strong> 49 {{ range $diff }} 50 <ul class="dark:text-gray-200"> 51 {{ if .IsDelete }} 52 <li><a href="#file-{{ .Name.Old }}" class="dark:hover:text-gray-300">{{ .Name.Old }}</a></li> 53 {{ else }} 54 <li><a href="#file-{{ .Name.New }}" class="dark:hover:text-gray-300">{{ .Name.New }}</a></li> 55 {{ end }} 56 </ul> 57 {{ end }} 58 </div> 59</section> 60 61{{end}} 62 63{{ define "repoAfter" }} 64{{ template "fragments/diff" (list .RepoInfo.FullName .Diff) }} 65{{end}}