forked from tangled.org/core
this repo has no description

Compare changes

Choose any two refs to compare.

+197 -174
+44 -27
appview/pages/funcmap.go
··· 105 s = append(s, values...) 106 return s 107 }, 108 - "timeFmt": humanize.Time, 109 - "longTimeFmt": func(t time.Time) string { 110 - return t.Format("2006-01-02 * 3:04 PM") 111 - }, 112 - "commaFmt": humanize.Comma, 113 - "shortTimeFmt": func(t time.Time) string { 114 return humanize.CustomRelTime(t, time.Now(), "", "", []humanize.RelTimeMagnitude{ 115 {time.Second, "now", time.Second}, 116 {2 * time.Second, "1s %s", 1}, ··· 129 {math.MaxInt64, "a long while %s", 1}, 130 }) 131 }, 132 - "durationFmt": func(duration time.Duration) string { 133 days := int64(duration.Hours() / 24) 134 hours := int64(math.Mod(duration.Hours(), 24)) 135 minutes := int64(math.Mod(duration.Minutes(), 60)) 136 seconds := int64(math.Mod(duration.Seconds(), 60)) 137 - 138 - chunks := []struct { 139 - name string 140 - amount int64 141 - }{ 142 - {"d", days}, 143 - {"hr", hours}, 144 - {"min", minutes}, 145 - {"s", seconds}, 146 - } 147 - 148 - parts := []string{} 149 - 150 - for _, chunk := range chunks { 151 - if chunk.amount != 0 { 152 - parts = append(parts, fmt.Sprintf("%d%s", chunk.amount, chunk.name)) 153 - } 154 - } 155 - 156 - return strings.Join(parts, " ") 157 }, 158 "byteFmt": humanize.Bytes, 159 "length": func(slice any) int { ··· 288 modifiedSVG := svgStr[:svgTagEnd] + classTag + svgStr[svgTagEnd:] 289 return template.HTML(modifiedSVG), nil 290 }
··· 105 s = append(s, values...) 106 return s 107 }, 108 + "commaFmt": humanize.Comma, 109 + "relTimeFmt": humanize.Time, 110 + "shortRelTimeFmt": func(t time.Time) string { 111 return humanize.CustomRelTime(t, time.Now(), "", "", []humanize.RelTimeMagnitude{ 112 {time.Second, "now", time.Second}, 113 {2 * time.Second, "1s %s", 1}, ··· 126 {math.MaxInt64, "a long while %s", 1}, 127 }) 128 }, 129 + "longTimeFmt": func(t time.Time) string { 130 + return t.Format("Jan 2, 2006, 3:04 PM MST") 131 + }, 132 + "iso8601DateTimeFmt": func(t time.Time) string { 133 + return t.Format("2006-01-02T15:04:05-07:00") 134 + }, 135 + "iso8601DurationFmt": func(duration time.Duration) string { 136 days := int64(duration.Hours() / 24) 137 hours := int64(math.Mod(duration.Hours(), 24)) 138 minutes := int64(math.Mod(duration.Minutes(), 60)) 139 seconds := int64(math.Mod(duration.Seconds(), 60)) 140 + return fmt.Sprintf("P%dD%dH%dM%dS", days, hours, minutes, seconds) 141 + }, 142 + "durationFmt": func(duration time.Duration) string { 143 + return durationFmt(duration, [4]string{"d", "hr", "min", "s"}) 144 + }, 145 + "longDurationFmt": func(duration time.Duration) string { 146 + return durationFmt(duration, [4]string{"days", "hours", "minutes", "seconds"}) 147 }, 148 "byteFmt": humanize.Bytes, 149 "length": func(slice any) int { ··· 278 modifiedSVG := svgStr[:svgTagEnd] + classTag + svgStr[svgTagEnd:] 279 return template.HTML(modifiedSVG), nil 280 } 281 + 282 + func durationFmt(duration time.Duration, names [4]string) string { 283 + days := int64(duration.Hours() / 24) 284 + hours := int64(math.Mod(duration.Hours(), 24)) 285 + minutes := int64(math.Mod(duration.Minutes(), 60)) 286 + seconds := int64(math.Mod(duration.Seconds(), 60)) 287 + 288 + chunks := []struct { 289 + name string 290 + amount int64 291 + }{ 292 + {names[0], days}, 293 + {names[1], hours}, 294 + {names[2], minutes}, 295 + {names[3], seconds}, 296 + } 297 + 298 + parts := []string{} 299 + 300 + for _, chunk := range chunks { 301 + if chunk.amount != 0 { 302 + parts = append(parts, fmt.Sprintf("%d%s", chunk.amount, chunk.name)) 303 + } 304 + } 305 + 306 + return strings.Join(parts, " ") 307 + }
+20 -18
appview/pages/pages.go
··· 691 DidHandleMap map[string]string 692 693 OrderedReactionKinds []db.ReactionKind 694 - Reactions map[db.ReactionKind]int 695 - UserReacted map[db.ReactionKind]bool 696 697 State string 698 } 699 700 type ThreadReactionFragmentParams struct { 701 ThreadAt syntax.ATURI 702 - Kind db.ReactionKind 703 - Count int 704 IsReacted bool 705 } 706 ··· 825 } 826 827 type RepoPullPatchParams struct { 828 - LoggedInUser *oauth.User 829 - DidHandleMap map[string]string 830 - RepoInfo repoinfo.RepoInfo 831 - Pull *db.Pull 832 - Stack db.Stack 833 - Diff *types.NiceDiff 834 - Round int 835 - Submission *db.PullSubmission 836 } 837 838 // this name is a mouthful ··· 841 } 842 843 type RepoPullInterdiffParams struct { 844 - LoggedInUser *oauth.User 845 - DidHandleMap map[string]string 846 - RepoInfo repoinfo.RepoInfo 847 - Pull *db.Pull 848 - Round int 849 - Interdiff *patchutil.InterdiffResult 850 } 851 852 // this name is a mouthful
··· 691 DidHandleMap map[string]string 692 693 OrderedReactionKinds []db.ReactionKind 694 + Reactions map[db.ReactionKind]int 695 + UserReacted map[db.ReactionKind]bool 696 697 State string 698 } 699 700 type ThreadReactionFragmentParams struct { 701 ThreadAt syntax.ATURI 702 + Kind db.ReactionKind 703 + Count int 704 IsReacted bool 705 } 706 ··· 825 } 826 827 type RepoPullPatchParams struct { 828 + LoggedInUser *oauth.User 829 + DidHandleMap map[string]string 830 + RepoInfo repoinfo.RepoInfo 831 + Pull *db.Pull 832 + Stack db.Stack 833 + Diff *types.NiceDiff 834 + Round int 835 + Submission *db.PullSubmission 836 + OrderedReactionKinds []db.ReactionKind 837 } 838 839 // this name is a mouthful ··· 842 } 843 844 type RepoPullInterdiffParams struct { 845 + LoggedInUser *oauth.User 846 + DidHandleMap map[string]string 847 + RepoInfo repoinfo.RepoInfo 848 + Pull *db.Pull 849 + Round int 850 + Interdiff *patchutil.InterdiffResult 851 + OrderedReactionKinds []db.ReactionKind 852 } 853 854 // this name is a mouthful
+2 -2
appview/pages/templates/knot.html
··· 26 </dd> 27 28 <dt class="font-bold">opened</dt> 29 - <dd>{{ .Registration.Created | timeFmt }}</dd> 30 31 {{ if .Registration.Registered }} 32 <dt class="font-bold">registered</dt> 33 - <dd>{{ .Registration.Registered | timeFmt }}</dd> 34 {{ else }} 35 <dt class="font-bold">status</dt> 36 <dd class="text-yellow-800 dark:text-yellow-200 bg-yellow-100 dark:bg-yellow-900 rounded px-2 py-1 inline-block">
··· 26 </dd> 27 28 <dt class="font-bold">opened</dt> 29 + <dd>{{ template "repo/fragments/time" .Registration.Created }}</dd> 30 31 {{ if .Registration.Registered }} 32 <dt class="font-bold">registered</dt> 33 + <dd>{{ template "repo/fragments/time" .Registration.Registered }}</dd> 34 {{ else }} 35 <dt class="font-bold">status</dt> 36 <dd class="text-yellow-800 dark:text-yellow-200 bg-yellow-100 dark:bg-yellow-900 rounded px-2 py-1 inline-block">
+2 -2
appview/pages/templates/knots.html
··· 44 </a> 45 </div> 46 <p class="text-sm text-gray-500 dark:text-gray-400">owned by {{ .ByDid }}</p> 47 - <p class="text-sm text-gray-500 dark:text-gray-400">registered {{ .Registered | timeFmt }}</p> 48 </div> 49 </div> 50 {{ end }} ··· 70 </div> 71 </div> 72 <p class="text-sm text-gray-500 dark:text-gray-400">opened by {{ .ByDid }}</p> 73 - <p class="text-sm text-gray-500 dark:text-gray-400">created {{ .Created | timeFmt }}</p> 74 </div> 75 <div class="flex gap-2 items-center"> 76 <button
··· 44 </a> 45 </div> 46 <p class="text-sm text-gray-500 dark:text-gray-400">owned by {{ .ByDid }}</p> 47 + <p class="text-sm text-gray-500 dark:text-gray-400">registered {{ template "repo/fragments/time" .Registered }}</p> 48 </div> 49 </div> 50 {{ end }} ··· 70 </div> 71 </div> 72 <p class="text-sm text-gray-500 dark:text-gray-400">opened by {{ .ByDid }}</p> 73 + <p class="text-sm text-gray-500 dark:text-gray-400">created {{ template "repo/fragments/time" .Created }}</p> 74 </div> 75 <div class="flex gap-2 items-center"> 76 <button
+4 -3
appview/pages/templates/layouts/topbar.html
··· 36 {{ define "dropDown" }} 37 <details class="relative inline-block text-left"> 38 <summary 39 - class="cursor-pointer list-none" 40 > 41 - {{ didOrHandle .Did .Handle }} 42 </summary> 43 <div 44 class="absolute flex flex-col right-0 mt-4 p-4 rounded w-48 bg-white dark:bg-gray-800 dark:text-white border border-gray-200 dark:border-gray-700" 45 > 46 - <a href="/{{ didOrHandle .Did .Handle }}">profile</a> 47 <a href="/knots">knots</a> 48 <a href="/spindles">spindles</a> 49 <a href="/settings">settings</a>
··· 36 {{ define "dropDown" }} 37 <details class="relative inline-block text-left"> 38 <summary 39 + class="cursor-pointer list-none flex items-center" 40 > 41 + {{ $user := didOrHandle .Did .Handle }} 42 + {{ template "user/fragments/picHandleLink" $user }} 43 </summary> 44 <div 45 class="absolute flex flex-col right-0 mt-4 p-4 rounded w-48 bg-white dark:bg-gray-800 dark:text-white border border-gray-200 dark:border-gray-700" 46 > 47 + <a href="/{{ $user }}">profile</a> 48 <a href="/knots">knots</a> 49 <a href="/spindles">spindles</a> 50 <a href="/settings">settings</a>
+2 -2
appview/pages/templates/repo/branches.html
··· 59 </td> 60 <td class="py-3 whitespace-nowrap text-gray-500 dark:text-gray-400"> 61 {{ if .Commit }} 62 - {{ .Commit.Committer.When | timeFmt }} 63 {{ end }} 64 </td> 65 </tr> ··· 98 </a> 99 </span> 100 <div class="inline-block px-1 select-none after:content-['ยท']"></div> 101 - <span>{{ .Commit.Committer.When | timeFmt }}</span> 102 </div> 103 {{ end }} 104 </div>
··· 59 </td> 60 <td class="py-3 whitespace-nowrap text-gray-500 dark:text-gray-400"> 61 {{ if .Commit }} 62 + {{ template "repo/fragments/time" .Commit.Committer.When }} 63 {{ end }} 64 </td> 65 </tr> ··· 98 </a> 99 </span> 100 <div class="inline-block px-1 select-none after:content-['ยท']"></div> 101 + {{ template "repo/fragments/time" .Commit.Committer.When }} 102 </div> 103 {{ end }} 104 </div>
+2 -2
appview/pages/templates/repo/commit.html
··· 34 <a href="mailto:{{ $commit.Author.Email }}" class="no-underline hover:underline text-gray-500 dark:text-gray-300">{{ $commit.Author.Name }}</a> 35 {{ end }} 36 <span class="px-1 select-none before:content-['\00B7']"></span> 37 - {{ timeFmt $commit.Author.When }} 38 <span class="px-1 select-none before:content-['\00B7']"></span> 39 </p> 40 ··· 59 <div class="flex items-center gap-2 my-2"> 60 {{ i "user" "w-4 h-4" }} 61 {{ $committerDidOrHandle := index $.EmailToDidOrHandle $commit.Committer.Email }} 62 - <a href="/{{ $committerDidOrHandle }}">{{ $committerDidOrHandle }}</a> 63 </div> 64 <div class="my-1 pt-2 text-xs border-t"> 65 <div class="text-gray-600 dark:text-gray-300">SSH Key Fingerprint:</div>
··· 34 <a href="mailto:{{ $commit.Author.Email }}" class="no-underline hover:underline text-gray-500 dark:text-gray-300">{{ $commit.Author.Name }}</a> 35 {{ end }} 36 <span class="px-1 select-none before:content-['\00B7']"></span> 37 + {{ template "repo/fragments/time" $commit.Author.When }} 38 <span class="px-1 select-none before:content-['\00B7']"></span> 39 </p> 40 ··· 59 <div class="flex items-center gap-2 my-2"> 60 {{ i "user" "w-4 h-4" }} 61 {{ $committerDidOrHandle := index $.EmailToDidOrHandle $commit.Committer.Email }} 62 + <a href="/{{ $committerDidOrHandle }}">{{ template "user/fragments/picHandleLink" $committerDidOrHandle }}</a> 63 </div> 64 <div class="my-1 pt-2 text-xs border-t"> 65 <div class="text-gray-600 dark:text-gray-300">SSH Key Fingerprint:</div>
+1 -1
appview/pages/templates/repo/compare/new.html
··· 19 <a href="/{{ $.RepoInfo.FullName }}/compare?head={{ $br.Name | urlquery }}" class="no-underline hover:no-underline"> 20 <div class="flex items-center justify-between p-2"> 21 {{ $br.Name }} 22 - <time class="text-gray-500 dark:text-gray-400">{{ timeFmt $br.Commit.Committer.When }}</time> 23 </div> 24 </a> 25 {{ end }}
··· 19 <a href="/{{ $.RepoInfo.FullName }}/compare?head={{ $br.Name | urlquery }}" class="no-underline hover:no-underline"> 20 <div class="flex items-center justify-between p-2"> 21 {{ $br.Name }} 22 + <span class="text-gray-500 dark:text-gray-400">{{ template "repo/fragments/time" $br.Commit.Committer.When }}</span> 23 </div> 24 </a> 25 {{ end }}
+1 -1
appview/pages/templates/repo/empty.html
··· 17 <a href="/{{ $.RepoInfo.FullName }}/tree/{{$br.Name | urlquery }}" class="no-underline hover:no-underline"> 18 <div class="flex items-center justify-between p-2"> 19 {{ $br.Name }} 20 - <time class="text-gray-500 dark:text-gray-400">{{ timeFmt $br.Commit.Committer.When }}</time> 21 </div> 22 </a> 23 {{ end }}
··· 17 <a href="/{{ $.RepoInfo.FullName }}/tree/{{$br.Name | urlquery }}" class="no-underline hover:no-underline"> 18 <div class="flex items-center justify-between p-2"> 19 {{ $br.Name }} 20 + <span class="text-gray-500 dark:text-gray-400">{{ template "repo/fragments/time" $br.Commit.Committer.When }}</span> 21 </div> 22 </a> 23 {{ end }}
+2 -2
appview/pages/templates/repo/fragments/artifact.html
··· 10 </div> 11 12 <div id="right-side" class="text-gray-500 dark:text-gray-400 flex items-center flex-shrink-0 gap-2 text-sm"> 13 - <span title="{{ longTimeFmt .Artifact.CreatedAt }}" class="hidden md:inline">{{ timeFmt .Artifact.CreatedAt }}</span> 14 - <span title="{{ longTimeFmt .Artifact.CreatedAt }}" class=" md:hidden">{{ shortTimeFmt .Artifact.CreatedAt }}</span> 15 16 <span class="select-none after:content-['ยท'] hidden md:inline"></span> 17 <span class="truncate max-w-[100px] hidden md:inline">{{ .Artifact.MimeType }}</span>
··· 10 </div> 11 12 <div id="right-side" class="text-gray-500 dark:text-gray-400 flex items-center flex-shrink-0 gap-2 text-sm"> 13 + <span class="hidden md:inline">{{ template "repo/fragments/time" .Artifact.CreatedAt }}</span> 14 + <span class=" md:hidden">{{ template "repo/fragments/shortTime" .Artifact.CreatedAt }}</span> 15 16 <span class="select-none after:content-['ยท'] hidden md:inline"></span> 17 <span class="truncate max-w-[100px] hidden md:inline">{{ .Artifact.MimeType }}</span>
+19
appview/pages/templates/repo/fragments/time.html
···
··· 1 + {{ define "repo/fragments/timeWrapper" }} 2 + <time datetime="{{ .Time | iso8601DateTimeFmt }}" title="{{ .Time | longTimeFmt }}">{{ .Content }}</time> 3 + {{ end }} 4 + 5 + {{ define "repo/fragments/time" }} 6 + {{ template "repo/fragments/timeWrapper" (dict "Time" . "Content" (. | relTimeFmt)) }} 7 + {{ end }} 8 + 9 + {{ define "repo/fragments/shortTime" }} 10 + {{ template "repo/fragments/timeWrapper" (dict "Time" . "Content" (. | shortRelTimeFmt)) }} 11 + {{ end }} 12 + 13 + {{ define "repo/fragments/shortTimeAgo" }} 14 + {{ template "repo/fragments/timeWrapper" (dict "Time" . "Content" (print (. | shortRelTimeFmt) " ago")) }} 15 + {{ end }} 16 + 17 + {{ define "repo/fragments/duration" }} 18 + <time datetime="{{ . | iso8601DurationFmt }}" title="{{ . | longDurationFmt }}">{{ . | durationFmt }}</time> 19 + {{ end }}
+6 -10
appview/pages/templates/repo/index.html
··· 149 </a> 150 151 {{ if .LastCommit }} 152 - <time class="text-xs text-gray-500 dark:text-gray-400" 153 - >{{ timeFmt .LastCommit.When }}</time 154 - > 155 {{ end }} 156 </div> 157 </div> ··· 172 </a> 173 174 {{ if .LastCommit }} 175 - <time class="text-xs text-gray-500 dark:text-gray-400" 176 - >{{ timeFmt .LastCommit.When }}</time 177 - > 178 {{ end }} 179 </div> 180 </div> ··· 266 {{ end }}" 267 class="text-gray-500 dark:text-gray-400 no-underline hover:underline" 268 >{{ if $didOrHandle }} 269 - {{ $didOrHandle }} 270 {{ else }} 271 {{ .Author.Name }} 272 {{ end }}</a 273 > 274 </span> 275 <div class="inline-block px-1 select-none after:content-['ยท']"></div> 276 - <span>{{ timeFmt .Committer.When }}</span> 277 278 <!-- tags/branches --> 279 {{ $tagsForCommit := index $.TagMap .Hash.String }} ··· 320 </a> 321 {{ if .Commit }} 322 <span class="px-1 text-gray-500 dark:text-gray-400 select-none after:content-['ยท']"></span> 323 - <time class="text-xs text-gray-500 dark:text-gray-400">{{ timeFmt .Commit.Committer.When }}</time> 324 {{ end }} 325 {{ if .IsDefault }} 326 <span class="px-1 text-gray-500 dark:text-gray-400 select-none after:content-['ยท']"></span> ··· 366 </div> 367 <div> 368 {{ with .Tag }} 369 - <time class="text-xs text-gray-500 dark:text-gray-400">{{ timeFmt .Tagger.When }}</time> 370 {{ end }} 371 {{ if eq $idx 0 }} 372 {{ with .Tag }}<span class="px-1 text-gray-500 dark:text-gray-400 select-none after:content-['ยท']"></span>{{ end }}
··· 149 </a> 150 151 {{ if .LastCommit }} 152 + <span class="text-xs text-gray-500 dark:text-gray-400">{{ template "repo/fragments/time" .LastCommit.When }}</span> 153 {{ end }} 154 </div> 155 </div> ··· 170 </a> 171 172 {{ if .LastCommit }} 173 + <span class="text-xs text-gray-500 dark:text-gray-400">{{ template "repo/fragments/time" .LastCommit.When }}</span> 174 {{ end }} 175 </div> 176 </div> ··· 262 {{ end }}" 263 class="text-gray-500 dark:text-gray-400 no-underline hover:underline" 264 >{{ if $didOrHandle }} 265 + {{ template "user/fragments/picHandleLink" $didOrHandle }} 266 {{ else }} 267 {{ .Author.Name }} 268 {{ end }}</a 269 > 270 </span> 271 <div class="inline-block px-1 select-none after:content-['ยท']"></div> 272 + {{ template "repo/fragments/time" .Committer.When }} 273 274 <!-- tags/branches --> 275 {{ $tagsForCommit := index $.TagMap .Hash.String }} ··· 316 </a> 317 {{ if .Commit }} 318 <span class="px-1 text-gray-500 dark:text-gray-400 select-none after:content-['ยท']"></span> 319 + <span class="text-xs text-gray-500 dark:text-gray-400">{{ template "repo/fragments/time" .Commit.Committer.When }}</span> 320 {{ end }} 321 {{ if .IsDefault }} 322 <span class="px-1 text-gray-500 dark:text-gray-400 select-none after:content-['ยท']"></span> ··· 362 </div> 363 <div> 364 {{ with .Tag }} 365 + <span class="text-xs text-gray-500 dark:text-gray-400">{{ template "repo/fragments/time" .Tagger.When }}</span> 366 {{ end }} 367 {{ if eq $idx 0 }} 368 {{ with .Tag }}<span class="px-1 text-gray-500 dark:text-gray-400 select-none after:content-['ยท']"></span>{{ end }}
+1 -1
appview/pages/templates/repo/issues/fragments/editIssueComment.html
··· 19 href="#{{ .CommentId }}" 20 class="text-gray-500 hover:text-gray-500 hover:underline no-underline" 21 id="{{ .CommentId }}"> 22 - {{ .Created | timeFmt }} 23 </a> 24 25 <button
··· 19 href="#{{ .CommentId }}" 20 class="text-gray-500 hover:text-gray-500 hover:underline no-underline" 21 id="{{ .CommentId }}"> 22 + {{ template "repo/fragments/time" .Created }} 23 </a> 24 25 <button
+9 -9
appview/pages/templates/repo/issues/fragments/issueComment.html
··· 1 {{ define "repo/issues/fragments/issueComment" }} 2 {{ with .Comment }} 3 <div id="comment-container-{{.CommentId}}"> 4 - <div class="flex items-center gap-2 mb-2 text-gray-500 dark:text-gray-400 text-sm"> 5 {{ $owner := index $.DidHandleMap .OwnerDid }} 6 - <a href="/{{ $owner }}" class="no-underline hover:underline">{{ $owner }}</a> 7 8 <span class="before:content-['ยท']"></span> 9 <a ··· 11 class="text-gray-500 dark:text-gray-400 hover:text-gray-500 dark:hover:text-gray-400 hover:underline no-underline" 12 id="{{ .CommentId }}"> 13 {{ if .Deleted }} 14 - deleted {{ .Deleted | timeFmt }} 15 {{ else if .Edited }} 16 - edited {{ .Edited | timeFmt }} 17 {{ else }} 18 - {{ .Created | timeFmt }} 19 {{ end }} 20 </a> 21 - 22 <!-- show user "hats" --> 23 {{ $isIssueAuthor := eq .OwnerDid $.Issue.OwnerDid }} 24 {{ if $isIssueAuthor }} ··· 29 30 {{ $isCommentOwner := and $.LoggedInUser (eq $.LoggedInUser.Did .OwnerDid) }} 31 {{ if and $isCommentOwner (not .Deleted) }} 32 - <button 33 - class="btn px-2 py-1 text-sm" 34 hx-get="/{{ $.RepoInfo.FullName }}/issues/{{ .Issue }}/comment/{{ .CommentId }}/edit" 35 hx-swap="outerHTML" 36 hx-target="#comment-container-{{.CommentId}}" 37 > 38 {{ i "pencil" "w-4 h-4" }} 39 </button> 40 - <button 41 class="btn px-2 py-1 text-sm text-red-500 flex gap-2 items-center group" 42 hx-delete="/{{ $.RepoInfo.FullName }}/issues/{{ .Issue }}/comment/{{ .CommentId }}/" 43 hx-confirm="Are you sure you want to delete your comment?"
··· 1 {{ define "repo/issues/fragments/issueComment" }} 2 {{ with .Comment }} 3 <div id="comment-container-{{.CommentId}}"> 4 + <div class="flex items-center gap-2 mb-2 text-gray-500 dark:text-gray-400 text-sm flex-wrap"> 5 {{ $owner := index $.DidHandleMap .OwnerDid }} 6 + {{ template "user/fragments/picHandleLink" $owner }} 7 8 <span class="before:content-['ยท']"></span> 9 <a ··· 11 class="text-gray-500 dark:text-gray-400 hover:text-gray-500 dark:hover:text-gray-400 hover:underline no-underline" 12 id="{{ .CommentId }}"> 13 {{ if .Deleted }} 14 + deleted {{ template "repo/fragments/time" .Deleted }} 15 {{ else if .Edited }} 16 + edited {{ template "repo/fragments/time" .Edited }} 17 {{ else }} 18 + {{ template "repo/fragments/time" .Created }} 19 {{ end }} 20 </a> 21 + 22 <!-- show user "hats" --> 23 {{ $isIssueAuthor := eq .OwnerDid $.Issue.OwnerDid }} 24 {{ if $isIssueAuthor }} ··· 29 30 {{ $isCommentOwner := and $.LoggedInUser (eq $.LoggedInUser.Did .OwnerDid) }} 31 {{ if and $isCommentOwner (not .Deleted) }} 32 + <button 33 + class="btn px-2 py-1 text-sm" 34 hx-get="/{{ $.RepoInfo.FullName }}/issues/{{ .Issue }}/comment/{{ .CommentId }}/edit" 35 hx-swap="outerHTML" 36 hx-target="#comment-container-{{.CommentId}}" 37 > 38 {{ i "pencil" "w-4 h-4" }} 39 </button> 40 + <button 41 class="btn px-2 py-1 text-sm text-red-500 flex gap-2 items-center group" 42 hx-delete="/{{ $.RepoInfo.FullName }}/issues/{{ .Issue }}/comment/{{ .CommentId }}/" 43 hx-confirm="Are you sure you want to delete your comment?"
+3 -5
appview/pages/templates/repo/issues/issue.html
··· 33 <span class="text-gray-500 dark:text-gray-400 text-sm flex flex-wrap items-center gap-1"> 34 opened by 35 {{ $owner := didOrHandle .Issue.OwnerDid .IssueOwnerHandle }} 36 - {{ template "user/fragments/picHandle" $owner }} 37 <span class="select-none before:content-['\00B7']"></span> 38 - <time title="{{ .Issue.Created | longTimeFmt }}"> 39 - {{ .Issue.Created | timeFmt }} 40 - </time> 41 </span> 42 </div> 43 ··· 90 > 91 <div class="bg-white dark:bg-gray-800 rounded drop-shadow-sm py-4 px-4 relative w-full md:w-3/5"> 92 <div class="text-sm pb-2 text-gray-500 dark:text-gray-400"> 93 - {{ didOrHandle .LoggedInUser.Did .LoggedInUser.Handle }} 94 </div> 95 <textarea 96 id="comment-textarea"
··· 33 <span class="text-gray-500 dark:text-gray-400 text-sm flex flex-wrap items-center gap-1"> 34 opened by 35 {{ $owner := didOrHandle .Issue.OwnerDid .IssueOwnerHandle }} 36 + {{ template "user/fragments/picHandleLink" $owner }} 37 <span class="select-none before:content-['\00B7']"></span> 38 + {{ template "repo/fragments/time" .Issue.Created }} 39 </span> 40 </div> 41 ··· 88 > 89 <div class="bg-white dark:bg-gray-800 rounded drop-shadow-sm py-4 px-4 relative w-full md:w-3/5"> 90 <div class="text-sm pb-2 text-gray-500 dark:text-gray-400"> 91 + {{ template "user/fragments/picHandleLink" (didOrHandle .LoggedInUser.Did .LoggedInUser.Handle) }} 92 </div> 93 <textarea 94 id="comment-textarea"
+2 -4
appview/pages/templates/repo/issues/issues.html
··· 66 67 <span class="ml-1"> 68 {{ $owner := index $.DidHandleMap .OwnerDid }} 69 - {{ template "user/fragments/picHandle" $owner }} 70 </span> 71 72 <span class="before:content-['ยท']"> 73 - <time> 74 - {{ .Created | timeFmt }} 75 - </time> 76 </span> 77 78 <span class="before:content-['ยท']">
··· 66 67 <span class="ml-1"> 68 {{ $owner := index $.DidHandleMap .OwnerDid }} 69 + {{ template "user/fragments/picHandleLink" $owner }} 70 </span> 71 72 <span class="before:content-['ยท']"> 73 + {{ template "repo/fragments/time" .Created }} 74 </span> 75 76 <span class="before:content-['ยท']">
+4 -4
appview/pages/templates/repo/log.html
··· 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 }} ··· 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> ··· 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 }}
··· 31 <td class=" py-3 align-top"> 32 {{ $didOrHandle := index $.EmailToDidOrHandle $commit.Author.Email }} 33 {{ if $didOrHandle }} 34 + {{ template "user/fragments/picHandleLink" $didOrHandle }} 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 }} ··· 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">{{ template "repo/fragments/time" $commit.Committer.When }}</td> 91 </tr> 92 {{ end }} 93 </tbody> ··· 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 }}{{ template "user/fragments/picHandleLink" $didOrHandle }}{{ else }}{{ $commit.Author.Name }}{{ end }} 163 </a> 164 </span> 165 <div class="inline-block px-1 select-none after:content-['ยท']"></div> 166 + <span>{{ template "repo/fragments/shortTime" $commit.Committer.When }}</span> 167 168 <!-- ci status --> 169 {{ $pipeline := index $.Pipelines .Hash.String }}
+5 -9
appview/pages/templates/repo/pipelines/fragments/tooltip.html
··· 10 {{ $lastStatus := $all.Latest }} 11 {{ $kind := $lastStatus.Status.String }} 12 13 - {{ $t := .TimeTaken }} 14 - {{ $time := "" }} 15 - {{ if $t }} 16 - {{ $time = durationFmt $t }} 17 - {{ else }} 18 - {{ $time = printf "%s ago" (shortTimeFmt $pipeline.Created) }} 19 - {{ end }} 20 - 21 <div id="left" class="flex items-center gap-2 flex-shrink-0"> 22 {{ template "repo/pipelines/fragments/workflowSymbol" $all }} 23 {{ $name }} 24 </div> 25 <div id="right" class="flex items-center gap-2 flex-shrink-0"> 26 <span class="font-bold">{{ $kind }}</span> 27 - <time>{{ $time }}</time> 28 </div> 29 </div> 30 </a>
··· 10 {{ $lastStatus := $all.Latest }} 11 {{ $kind := $lastStatus.Status.String }} 12 13 <div id="left" class="flex items-center gap-2 flex-shrink-0"> 14 {{ template "repo/pipelines/fragments/workflowSymbol" $all }} 15 {{ $name }} 16 </div> 17 <div id="right" class="flex items-center gap-2 flex-shrink-0"> 18 <span class="font-bold">{{ $kind }}</span> 19 + {{ if .TimeTaken }} 20 + {{ template "repo/fragments/duration" .TimeTaken }} 21 + {{ else }} 22 + {{ template "repo/fragments/shortTimeAgo" $pipeline.Created }} 23 + {{ end }} 24 </div> 25 </div> 26 </a>
+1 -3
appview/pages/templates/repo/pipelines/pipelines.html
··· 74 </div> 75 76 <div class="text-sm md:text-base col-span-1 text-right"> 77 - <time title="{{ .Created | longTimeFmt }}"> 78 - {{ .Created | shortTimeFmt }} ago 79 - </time> 80 </div> 81 82 {{ $t := .TimeTaken }}
··· 74 </div> 75 76 <div class="text-sm md:text-base col-span-1 text-right"> 77 + {{ template "repo/fragments/shortTimeAgo" .Created }} 78 </div> 79 80 {{ $t := .TimeTaken }}
+5 -10
appview/pages/templates/repo/pipelines/workflow.html
··· 32 {{ $lastStatus := $all.Latest }} 33 {{ $kind := $lastStatus.Status.String }} 34 35 - {{ $t := .TimeTaken }} 36 - {{ $time := "" }} 37 - 38 - {{ if $t }} 39 - {{ $time = durationFmt $t }} 40 - {{ else }} 41 - {{ $time = printf "%s ago" (shortTimeFmt $lastStatus.Created) }} 42 - {{ end }} 43 - 44 <div id="left" class="flex items-center gap-2 flex-shrink-0"> 45 {{ template "repo/pipelines/fragments/workflowSymbol" $all }} 46 {{ $name }} 47 </div> 48 <div id="right" class="flex items-center gap-2 flex-shrink-0"> 49 <span class="font-bold">{{ $kind }}</span> 50 - <time>{{ $time }}</time> 51 </div> 52 </div> 53 </a>
··· 32 {{ $lastStatus := $all.Latest }} 33 {{ $kind := $lastStatus.Status.String }} 34 35 <div id="left" class="flex items-center gap-2 flex-shrink-0"> 36 {{ template "repo/pipelines/fragments/workflowSymbol" $all }} 37 {{ $name }} 38 </div> 39 <div id="right" class="flex items-center gap-2 flex-shrink-0"> 40 <span class="font-bold">{{ $kind }}</span> 41 + {{ if .TimeTaken }} 42 + {{ template "repo/fragments/duration" .TimeTaken }} 43 + {{ else }} 44 + {{ template "repo/fragments/shortTimeAgo" $lastStatus.Created }} 45 + {{ end }} 46 </div> 47 </div> 48 </a>
+6 -4
appview/pages/templates/repo/pulls/fragments/pullHeader.html
··· 29 <span class="text-gray-500 dark:text-gray-400 text-sm flex flex-wrap items-center gap-1"> 30 opened by 31 {{ $owner := index $.DidHandleMap .Pull.OwnerDid }} 32 - {{ template "user/fragments/picHandle" $owner }} 33 <span class="select-none before:content-['\00B7']"></span> 34 - <time>{{ .Pull.Created | timeFmt }}</time> 35 36 <span class="select-none before:content-['\00B7']"></span> 37 <span> ··· 62 </article> 63 {{ end }} 64 65 <div class="flex items-center gap-2 mt-2"> 66 - {{ template "repo/fragments/reactionsPopUp" .OrderedReactionKinds }} 67 - {{ range $kind := .OrderedReactionKinds }} 68 {{ 69 template "repo/fragments/reaction" 70 (dict ··· 75 }} 76 {{ end }} 77 </div> 78 </section> 79 80
··· 29 <span class="text-gray-500 dark:text-gray-400 text-sm flex flex-wrap items-center gap-1"> 30 opened by 31 {{ $owner := index $.DidHandleMap .Pull.OwnerDid }} 32 + {{ template "user/fragments/picHandleLink" $owner }} 33 <span class="select-none before:content-['\00B7']"></span> 34 + {{ template "repo/fragments/time" .Pull.Created }} 35 36 <span class="select-none before:content-['\00B7']"></span> 37 <span> ··· 62 </article> 63 {{ end }} 64 65 + {{ with .OrderedReactionKinds }} 66 <div class="flex items-center gap-2 mt-2"> 67 + {{ template "repo/fragments/reactionsPopUp" . }} 68 + {{ range $kind := . }} 69 {{ 70 template "repo/fragments/reaction" 71 (dict ··· 76 }} 77 {{ end }} 78 </div> 79 + {{ end }} 80 </section> 81 82
+3 -4
appview/pages/templates/repo/pulls/fragments/pullNewComment.html
··· 1 {{ define "repo/pulls/fragments/pullNewComment" }} 2 - <div 3 - id="pull-comment-card-{{ .RoundNumber }}" 4 class="bg-white dark:bg-gray-800 rounded drop-shadow-sm p-4 relative w-full flex flex-col gap-2"> 5 <div class="text-sm text-gray-500 dark:text-gray-400"> 6 - {{ didOrHandle .LoggedInUser.Did .LoggedInUser.Handle }} 7 </div> 8 <form 9 hx-post="/{{ .RepoInfo.FullName }}/pulls/{{ .Pull.PullId }}/round/{{ .RoundNumber }}/comment" ··· 38 </form> 39 </div> 40 {{ end }} 41 -
··· 1 {{ define "repo/pulls/fragments/pullNewComment" }} 2 + <div 3 + id="pull-comment-card-{{ .RoundNumber }}" 4 class="bg-white dark:bg-gray-800 rounded drop-shadow-sm p-4 relative w-full flex flex-col gap-2"> 5 <div class="text-sm text-gray-500 dark:text-gray-400"> 6 + {{ template "user/fragments/picHandleLink" (didOrHandle .LoggedInUser.Did .LoggedInUser.Handle) }} 7 </div> 8 <form 9 hx-post="/{{ .RepoInfo.FullName }}/pulls/{{ .Pull.PullId }}/round/{{ .RoundNumber }}/comment" ··· 38 </form> 39 </div> 40 {{ end }}
+14 -19
appview/pages/templates/repo/pulls/pull.html
··· 5 {{ define "extrameta" }} 6 {{ $title := printf "%s &middot; pull #%d &middot; %s" .Pull.Title .Pull.PullId .RepoInfo.FullName }} 7 {{ $url := printf "https://tangled.sh/%s/pulls/%d" .RepoInfo.FullName .Pull.PullId }} 8 - 9 {{ template "repo/fragments/og" (dict "RepoInfo" .RepoInfo "Title" $title "Url" $url) }} 10 {{ end }} 11 ··· 46 </div> 47 <!-- round summary --> 48 <div class="rounded drop-shadow-sm bg-white dark:bg-gray-800 p-2 text-gray-500 dark:text-gray-400"> 49 - <span> 50 {{ $owner := index $.DidHandleMap $.Pull.OwnerDid }} 51 {{ $re := "re" }} 52 {{ if eq .RoundNumber 0 }} 53 {{ $re = "" }} 54 {{ end }} 55 <span class="hidden md:inline">{{$re}}submitted</span> 56 - by <a href="/{{ $owner }}">{{ $owner }}</a> 57 <span class="select-none before:content-['\00B7']"></span> 58 - <a class="text-gray-500 dark:text-gray-400 hover:text-gray-500" href="#round-#{{ .RoundNumber }}"><time>{{ .Created | shortTimeFmt }}</time></a> 59 <span class="select-none before:content-['ยท']"></span> 60 {{ $s := "s" }} 61 {{ if eq (len .Comments) 1 }} ··· 68 <a class="btn flex items-center gap-2 no-underline hover:no-underline p-2 group" 69 hx-boost="true" 70 href="/{{ $.RepoInfo.FullName }}/pulls/{{ $.Pull.PullId }}/round/{{.RoundNumber}}"> 71 - {{ i "file-diff" "w-4 h-4" }} 72 <span class="hidden md:inline">diff</span> 73 {{ i "loader-circle" "w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" }} 74 </a> ··· 150 {{ if gt $cidx 0 }} 151 <div class="absolute left-8 -top-2 w-px h-2 bg-gray-300 dark:bg-gray-600"></div> 152 {{ end }} 153 - <div class="text-sm text-gray-500 dark:text-gray-400"> 154 - {{ $owner := index $.DidHandleMap $c.OwnerDid }} 155 - <a href="/{{$owner}}">{{$owner}}</a> 156 <span class="before:content-['ยท']"></span> 157 - <a class="text-gray-500 dark:text-gray-400 hover:text-gray-500 dark:hover:text-gray-300" href="#comment-{{.ID}}"><time>{{ $c.Created | shortTimeFmt }}</time></a> 158 </div> 159 <div class="prose dark:prose-invert"> 160 {{ $c.Body | markdown }} ··· 277 {{ $lastStatus := $all.Latest }} 278 {{ $kind := $lastStatus.Status.String }} 279 280 - {{ $t := .TimeTaken }} 281 - {{ $time := "" }} 282 - 283 - {{ if $t }} 284 - {{ $time = durationFmt $t }} 285 - {{ else }} 286 - {{ $time = printf "%s ago" (shortTimeFmt $lastStatus.Created) }} 287 - {{ end }} 288 - 289 <div id="left" class="flex items-center gap-2 flex-shrink-0"> 290 {{ template "repo/pipelines/fragments/workflowSymbol" $all }} 291 {{ $name }} 292 </div> 293 <div id="right" class="flex items-center gap-2 flex-shrink-0"> 294 <span class="font-bold">{{ $kind }}</span> 295 - <time>{{ $time }}</time> 296 </div> 297 </div> 298 </a>
··· 5 {{ define "extrameta" }} 6 {{ $title := printf "%s &middot; pull #%d &middot; %s" .Pull.Title .Pull.PullId .RepoInfo.FullName }} 7 {{ $url := printf "https://tangled.sh/%s/pulls/%d" .RepoInfo.FullName .Pull.PullId }} 8 + 9 {{ template "repo/fragments/og" (dict "RepoInfo" .RepoInfo "Title" $title "Url" $url) }} 10 {{ end }} 11 ··· 46 </div> 47 <!-- round summary --> 48 <div class="rounded drop-shadow-sm bg-white dark:bg-gray-800 p-2 text-gray-500 dark:text-gray-400"> 49 + <span class="gap-1 flex items-center"> 50 {{ $owner := index $.DidHandleMap $.Pull.OwnerDid }} 51 {{ $re := "re" }} 52 {{ if eq .RoundNumber 0 }} 53 {{ $re = "" }} 54 {{ end }} 55 <span class="hidden md:inline">{{$re}}submitted</span> 56 + by {{ template "user/fragments/picHandleLink" $owner }} 57 <span class="select-none before:content-['\00B7']"></span> 58 + <a class="text-gray-500 dark:text-gray-400 hover:text-gray-500" href="#round-#{{ .RoundNumber }}">{{ template "repo/fragments/shortTime" .Created }}</a> 59 <span class="select-none before:content-['ยท']"></span> 60 {{ $s := "s" }} 61 {{ if eq (len .Comments) 1 }} ··· 68 <a class="btn flex items-center gap-2 no-underline hover:no-underline p-2 group" 69 hx-boost="true" 70 href="/{{ $.RepoInfo.FullName }}/pulls/{{ $.Pull.PullId }}/round/{{.RoundNumber}}"> 71 + {{ i "file-diff" "w-4 h-4" }} 72 <span class="hidden md:inline">diff</span> 73 {{ i "loader-circle" "w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" }} 74 </a> ··· 150 {{ if gt $cidx 0 }} 151 <div class="absolute left-8 -top-2 w-px h-2 bg-gray-300 dark:bg-gray-600"></div> 152 {{ end }} 153 + <div class="text-sm text-gray-500 dark:text-gray-400 flex items-center gap-1"> 154 + {{ $owner := index $.DidHandleMap $c.OwnerDid }} 155 + {{ template "user/fragments/picHandleLink" $owner }} 156 <span class="before:content-['ยท']"></span> 157 + <a class="text-gray-500 dark:text-gray-400 hover:text-gray-500 dark:hover:text-gray-300" href="#comment-{{.ID}}">{{ template "repo/fragments/time" $c.Created }}</a> 158 </div> 159 <div class="prose dark:prose-invert"> 160 {{ $c.Body | markdown }} ··· 277 {{ $lastStatus := $all.Latest }} 278 {{ $kind := $lastStatus.Status.String }} 279 280 <div id="left" class="flex items-center gap-2 flex-shrink-0"> 281 {{ template "repo/pipelines/fragments/workflowSymbol" $all }} 282 {{ $name }} 283 </div> 284 <div id="right" class="flex items-center gap-2 flex-shrink-0"> 285 <span class="font-bold">{{ $kind }}</span> 286 + {{ if .TimeTaken }} 287 + {{ template "repo/fragments/duration" .TimeTaken }} 288 + {{ else }} 289 + {{ template "repo/fragments/shortTimeAgo" $lastStatus.Created }} 290 + {{ end }} 291 </div> 292 </div> 293 </a>
+3 -5
appview/pages/templates/repo/pulls/pulls.html
··· 76 </span> 77 78 <span class="ml-1"> 79 - {{ template "user/fragments/picHandle" $owner }} 80 </span> 81 82 - <span> 83 - <time> 84 - {{ .Created | timeFmt }} 85 - </time> 86 </span> 87 88 <span class="before:content-['ยท']">
··· 76 </span> 77 78 <span class="ml-1"> 79 + {{ template "user/fragments/picHandleLink" $owner }} 80 </span> 81 82 + <span class="before:content-['ยท']"> 83 + {{ template "repo/fragments/time" .Created }} 84 </span> 85 86 <span class="before:content-['ยท']">
+2 -2
appview/pages/templates/repo/tags.html
··· 35 <span>{{ .Tag.Tagger.Name }}</span> 36 37 <span class="px-1 text-gray-500 dark:text-gray-400 select-none after:content-['ยท']"></span> 38 - <time>{{ shortTimeFmt .Tag.Tagger.When }}</time> 39 {{ end }} 40 </div> 41 </div> ··· 54 {{ slice .Tag.Target.String 0 8 }} 55 </a> 56 <span>{{ .Tag.Tagger.Name }}</span> 57 - <time>{{ timeFmt .Tag.Tagger.When }}</time> 58 {{ end }} 59 </div> 60 </div>
··· 35 <span>{{ .Tag.Tagger.Name }}</span> 36 37 <span class="px-1 text-gray-500 dark:text-gray-400 select-none after:content-['ยท']"></span> 38 + {{ template "repo/fragments/shortTime" .Tag.Tagger.When }} 39 {{ end }} 40 </div> 41 </div> ··· 54 {{ slice .Tag.Target.String 0 8 }} 55 </a> 56 <span>{{ .Tag.Tagger.Name }}</span> 57 + {{ template "repo/fragments/time" .Tag.Tagger.When }} 58 {{ end }} 59 </div> 60 </div>
+9 -3
appview/pages/templates/repo/tree.html
··· 11 {{ template "repo/fragments/meta" . }} 12 {{ $title := printf "%s at %s &middot; %s" $path .Ref .RepoInfo.FullName }} 13 {{ $url := printf "https://tangled.sh/%s/tree/%s%s" .RepoInfo.FullName .Ref $path }} 14 - 15 {{ template "repo/fragments/og" (dict "RepoInfo" .RepoInfo "Title" $title "Url" $url) }} 16 {{ end }} 17 ··· 63 </div> 64 </a> 65 {{ if .LastCommit}} 66 - <time class="text-xs text-gray-500 dark:text-gray-400">{{ timeFmt .LastCommit.When }}</time> 67 {{ end }} 68 </div> 69 </div> ··· 80 </div> 81 </a> 82 {{ if .LastCommit}} 83 - <time class="text-xs text-gray-500 dark:text-gray-400">{{ timeFmt .LastCommit.When }}</time> 84 {{ end }} 85 </div> 86 </div>
··· 11 {{ template "repo/fragments/meta" . }} 12 {{ $title := printf "%s at %s &middot; %s" $path .Ref .RepoInfo.FullName }} 13 {{ $url := printf "https://tangled.sh/%s/tree/%s%s" .RepoInfo.FullName .Ref $path }} 14 + 15 {{ template "repo/fragments/og" (dict "RepoInfo" .RepoInfo "Title" $title "Url" $url) }} 16 {{ end }} 17 ··· 63 </div> 64 </a> 65 {{ if .LastCommit}} 66 + <div class="flex items-end gap-2"> 67 + <span class="text text-gray-500 dark:text-gray-400 mr-6">{{ .LastCommit.Message }}</span> 68 + <span class="text-xs text-gray-500 dark:text-gray-400">{{ template "repo/fragments/time" .LastCommit.When }}</span> 69 + </div> 70 {{ end }} 71 </div> 72 </div> ··· 83 </div> 84 </a> 85 {{ if .LastCommit}} 86 + <div class="flex items-end gap-2"> 87 + <span class="text text-gray-500 dark:text-gray-400 mr-6">{{ .LastCommit.Message }}</span> 88 + <span class="text-xs text-gray-500 dark:text-gray-400">{{ template "repo/fragments/time" .LastCommit.When }}</span> 89 + </div> 90 {{ end }} 91 </div> 92 </div>
+2 -2
appview/pages/templates/settings.html
··· 39 {{ i "key" "w-3 h-3 dark:text-gray-300" }} 40 <p class="font-bold dark:text-white">{{ .Name }}</p> 41 </div> 42 - <p class="text-sm text-gray-500 dark:text-gray-400">added {{ .Created | timeFmt }}</p> 43 <div class="overflow-x-auto whitespace-nowrap flex-1 max-w-full"> 44 <code class="text-sm text-gray-500 dark:text-gray-400">{{ .Key }}</code> 45 </div> ··· 112 {{ end }} 113 </div> 114 </div> 115 - <p class="text-sm text-gray-500 dark:text-gray-400">added {{ .CreatedAt | timeFmt }}</p> 116 </div> 117 <div class="flex gap-2 items-center"> 118 {{ if not .Verified }}
··· 39 {{ i "key" "w-3 h-3 dark:text-gray-300" }} 40 <p class="font-bold dark:text-white">{{ .Name }}</p> 41 </div> 42 + <p class="text-sm text-gray-500 dark:text-gray-400">added {{ template "repo/fragments/time" .Created }}</p> 43 <div class="overflow-x-auto whitespace-nowrap flex-1 max-w-full"> 44 <code class="text-sm text-gray-500 dark:text-gray-400">{{ .Key }}</code> 45 </div> ··· 112 {{ end }} 113 </div> 114 </div> 115 + <p class="text-sm text-gray-500 dark:text-gray-400">added {{ template "repo/fragments/time" .CreatedAt }}</p> 116 </div> 117 <div class="flex gap-2 items-center"> 118 {{ if not .Verified }}
+2 -2
appview/pages/templates/spindles/fragments/spindleListing.html
··· 11 {{ i "hard-drive" "w-4 h-4" }} 12 {{ .Instance }} 13 <span class="text-gray-500"> 14 - {{ .Created | shortTimeFmt }} ago 15 </span> 16 </a> 17 {{ else }} ··· 19 {{ i "hard-drive" "w-4 h-4" }} 20 {{ .Instance }} 21 <span class="text-gray-500"> 22 - {{ .Created | shortTimeFmt }} ago 23 </span> 24 </div> 25 {{ end }}
··· 11 {{ i "hard-drive" "w-4 h-4" }} 12 {{ .Instance }} 13 <span class="text-gray-500"> 14 + {{ template "repo/fragments/shortTimeAgo" .Created }} 15 </span> 16 </a> 17 {{ else }} ··· 19 {{ i "hard-drive" "w-4 h-4" }} 20 {{ .Instance }} 21 <span class="text-gray-500"> 22 + {{ template "repo/fragments/shortTimeAgo" .Created }} 23 </span> 24 </div> 25 {{ end }}
+10 -10
appview/pages/templates/timeline.html
··· 61 {{ $userHandle := index $.DidHandleMap .Repo.Did }} 62 <div class="flex items-center"> 63 <p class="text-gray-600 dark:text-gray-300 flex flex-wrap items-center gap-2"> 64 - {{ template "user/fragments/picHandle" $userHandle }} 65 {{ if .Source }} 66 forked 67 <a ··· 84 >{{ .Repo.Name }}</a 85 > 86 {{ end }} 87 - <time 88 class="text-gray-700 dark:text-gray-400 text-xs" 89 - >{{ .Repo.Created | timeFmt }}</time 90 > 91 </p> 92 </div> ··· 95 {{ $subjectHandle := index $.DidHandleMap .Follow.SubjectDid }} 96 <div class="flex items-center"> 97 <p class="text-gray-600 dark:text-gray-300 flex flex-wrap items-center gap-2"> 98 - {{ template "user/fragments/picHandle" $userHandle }} 99 followed 100 - {{ template "user/fragments/picHandle" $subjectHandle }} 101 - <time 102 class="text-gray-700 dark:text-gray-400 text-xs" 103 - >{{ .Follow.FollowedAt | timeFmt }}</time 104 > 105 </p> 106 </div> ··· 109 {{ $repoOwnerHandle := index $.DidHandleMap .Star.Repo.Did }} 110 <div class="flex items-center"> 111 <p class="text-gray-600 dark:text-gray-300 flex flex-wrap items-center gap-2"> 112 - {{ template "user/fragments/picHandle" $starrerHandle }} 113 starred 114 <a 115 href="/{{ $repoOwnerHandle }}/{{ .Star.Repo.Name }}" 116 class="no-underline hover:underline" 117 >{{ $repoOwnerHandle | truncateAt30 }}/{{ .Star.Repo.Name }}</a 118 > 119 - <time 120 class="text-gray-700 dark:text-gray-400 text-xs" 121 - >{{ .Star.Created | timeFmt }}</time 122 > 123 </p> 124 </div>
··· 61 {{ $userHandle := index $.DidHandleMap .Repo.Did }} 62 <div class="flex items-center"> 63 <p class="text-gray-600 dark:text-gray-300 flex flex-wrap items-center gap-2"> 64 + {{ template "user/fragments/picHandleLink" $userHandle }} 65 {{ if .Source }} 66 forked 67 <a ··· 84 >{{ .Repo.Name }}</a 85 > 86 {{ end }} 87 + <span 88 class="text-gray-700 dark:text-gray-400 text-xs" 89 + >{{ template "repo/fragments/time" .Repo.Created }}</span 90 > 91 </p> 92 </div> ··· 95 {{ $subjectHandle := index $.DidHandleMap .Follow.SubjectDid }} 96 <div class="flex items-center"> 97 <p class="text-gray-600 dark:text-gray-300 flex flex-wrap items-center gap-2"> 98 + {{ template "user/fragments/picHandleLink" $userHandle }} 99 followed 100 + {{ template "user/fragments/picHandleLink" $subjectHandle }} 101 + <span 102 class="text-gray-700 dark:text-gray-400 text-xs" 103 + >{{ template "repo/fragments/time" .Follow.FollowedAt }}</span 104 > 105 </p> 106 </div> ··· 109 {{ $repoOwnerHandle := index $.DidHandleMap .Star.Repo.Did }} 110 <div class="flex items-center"> 111 <p class="text-gray-600 dark:text-gray-300 flex flex-wrap items-center gap-2"> 112 + {{ template "user/fragments/picHandleLink" $starrerHandle }} 113 starred 114 <a 115 href="/{{ $repoOwnerHandle }}/{{ .Star.Repo.Name }}" 116 class="no-underline hover:underline" 117 >{{ $repoOwnerHandle | truncateAt30 }}/{{ .Star.Repo.Name }}</a 118 > 119 + <span 120 class="text-gray-700 dark:text-gray-400 text-xs" 121 + >{{ template "repo/fragments/time" .Star.Created }}</spa 122 > 123 </p> 124 </div>
+6 -8
appview/pages/templates/user/fragments/picHandle.html
··· 1 {{ define "user/fragments/picHandle" }} 2 - <a href="/{{ . }}" class="flex items-center"> 3 - <img 4 - src="{{ tinyAvatar . }}" 5 - alt="{{ . }}" 6 - class="rounded-full h-6 w-6 mr-1 border border-gray-300 dark:border-gray-700" 7 - /> 8 - {{ . | truncateAt30 }} 9 - </a> 10 {{ end }}
··· 1 {{ define "user/fragments/picHandle" }} 2 + <img 3 + src="{{ tinyAvatar . }}" 4 + alt="{{ . }}" 5 + class="rounded-full h-6 w-6 mr-1 border border-gray-300 dark:border-gray-700" 6 + /> 7 + {{ . | truncateAt30 }} 8 {{ end }}
+5
appview/pages/templates/user/fragments/picHandleLink.html
···
··· 1 + {{ define "user/fragments/picHandleLink" }} 2 + <a href="/{{ . }}" class="flex items-center"> 3 + {{ template "user/fragments/picHandle" . }} 4 + </a> 5 + {{ end }}