forked from tangled.org/core
this repo has no description
1{{ define "title" }}commits &middot; {{ .RepoInfo.FullName }}{{ end }} 2 3{{ define "repoContent" }} 4 <section id="commit-message"> 5 {{ $commit := index .Commits 0 }} 6 {{ $messageParts := splitN $commit.Message "\n\n" 2 }} 7 <div> 8 <a href="/{{ $.RepoInfo.FullName }}/commit/{{ $commit.Hash.String }}"> 9 <p class="pb-5">{{ index $messageParts 0 }}</p> 10 {{ if gt (len $messageParts) 1 }} 11 <p class="mt-1 text-sm cursor-text pb-5"> 12 {{ nl2br (unwrapText (index $messageParts 1)) }} 13 </p> 14 {{ end }} 15 </a> 16 </div> 17 18 <div class="text-sm text-gray-500"> 19 <span class="font-mono"> 20 <a 21 href="/{{ $.RepoInfo.FullName }}/commit/{{ $commit.Hash.String }}" 22 class="text-gray-500 no-underline hover:underline" 23 >{{ slice $commit.Hash.String }}</a 24 > 25 </span> 26 <span class="mx-2 before:content-['·'] before:select-none"></span> 27 <span> 28 {{ $didOrHandle := index $.EmailToDidOrHandle $commit.Author.Email }} 29 {{ if $didOrHandle }} 30 <a 31 href="/{{ $didOrHandle }}" 32 class="text-gray-500 no-underline hover:underline" 33 >{{ $didOrHandle }}</a 34 > 35 {{ else }} 36 <a 37 href="mailto:{{ $commit.Author.Email }}" 38 class="text-gray-500 no-underline hover:underline" 39 >{{ $commit.Author.Name }}</a 40 > 41 {{ end }} 42 </span> 43 <div 44 class="inline-block px-1 select-none after:content-['·']" 45 ></div> 46 <span>{{ timeFmt $commit.Author.When }}</span> 47 </div> 48 </section> 49{{ end }} 50 51{{ define "repoAfter" }} 52 <main> 53 <div id="commit-log" class="flex-1 relative"> 54 <div class="absolute left-8 top-0 bottom-0 w-px bg-gray-300"></div> 55 {{ $end := length .Commits }} 56 {{ $commits := subslice .Commits 1 $end }} 57 {{ range $commits }} 58 <div class="flex flex-row justify-between items-center"> 59 <div 60 class="relative w-full px-4 py-4 mt-4 rounded-sm bg-white" 61 > 62 <div id="commit-message"> 63 {{ $messageParts := splitN .Message "\n\n" 2 }} 64 <div class="text-base cursor-pointer"> 65 <div> 66 <div> 67 <a 68 href="/{{ $.RepoInfo.FullName }}/commit/{{ .Hash.String }}" 69 class="inline no-underline hover:underline" 70 >{{ index $messageParts 0 }}</a 71 > 72 {{ if gt (len $messageParts) 1 }} 73 74 <button 75 class="py-1/2 px-1 bg-gray-200 hover:bg-gray-400 rounded" 76 hx-on:click="this.parentElement.nextElementSibling.classList.toggle('hidden')" 77 > 78 <i 79 class="w-3 h-3" 80 data-lucide="ellipsis" 81 ></i> 82 </button> 83 {{ end }} 84 </div> 85 {{ if gt (len $messageParts) 1 }} 86 <p 87 class="hidden mt-1 text-sm cursor-text pb-2" 88 > 89 {{ nl2br (unwrapText (index $messageParts 1)) }} 90 </p> 91 {{ end }} 92 </div> 93 </div> 94 </div> 95 96 <div class="text-sm text-gray-500 mt-3"> 97 <span class="font-mono"> 98 <a 99 href="/{{ $.RepoInfo.FullName }}/commit/{{ .Hash.String }}" 100 class="text-gray-500 no-underline hover:underline" 101 >{{ slice .Hash.String 0 8 }}</a 102 > 103 </span> 104 <span 105 class="mx-2 before:content-['·'] before:select-none" 106 ></span> 107 <span> 108 {{ $didOrHandle := index $.EmailToDidOrHandle .Author.Email }} 109 {{ if $didOrHandle }} 110 <a 111 href="/{{ $didOrHandle }}" 112 class="text-gray-500 no-underline hover:underline" 113 >{{ $didOrHandle }}</a 114 > 115 {{ else }} 116 <a 117 href="mailto:{{ .Author.Email }}" 118 class="text-gray-500 no-underline hover:underline" 119 >{{ .Author.Name }}</a 120 > 121 {{ end }} 122 </span> 123 <div 124 class="inline-block px-1 select-none after:content-['·']" 125 ></div> 126 <span>{{ timeFmt .Author.When }}</span> 127 </div> 128 </div> 129 </div> 130 {{ end }} 131 </div> 132 133 {{ $commits_len := len .Commits }} 134 <div class="flex justify-end mt-4 gap-2"> 135 {{ if gt .Page 1 }} 136 <a 137 class="btn flex items-center gap-2 no-underline hover:no-underline" 138 hx-boost="true" 139 onclick="window.location.href = window.location.pathname + '?page={{ sub .Page 1 }}'" 140 > 141 <i data-lucide="chevron-left" class="w-4 h-4"></i> 142 previous 143 </a> 144 {{ else }} 145 <div></div> 146 {{ end }} 147 148 {{ if eq $commits_len 30 }} 149 <a 150 class="btn flex items-center gap-2 no-underline hover:no-underline" 151 hx-boost="true" 152 onclick="window.location.href = window.location.pathname + '?page={{ add .Page 1 }}'" 153 > 154 next 155 <i data-lucide="chevron-right" class="w-4 h-4"></i> 156 </a> 157 {{ end }} 158 </div> 159 </main> 160{{ end }}