back interdiff of round #2 and #1

appview/pages: use consistent time component #290

merged
opened by uncenter.dev targeting master from uncenter.dev/core: feat/datetime-on-hover

Creates a new template fragment, repo/fragments/time, that is a component based on the

I haven't been able to test this everywhere because I've still not get local dev-ing all under control. I also plan to make this work for the new duration times in the pipeline -TODO.

REVERTED
appview/pages/funcmap.go
··· 107 }, 108 "timeFmt": humanize.Time, 109 "longTimeFmt": func(t time.Time) string { 110 - return t.Format("Jan 2, 2006, 3:04 PM MST") 111 - }, 112 - "iso8601Fmt": func(t time.Time) string { 113 - return t.Format("2006-01-02T15:04:05-07:00") 114 }, 115 "commaFmt": humanize.Comma, 116 "shortTimeFmt": func(t time.Time) string {
··· 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 {
ERROR
appview/pages/templates/knot.html

Failed to calculate interdiff for this file.

ERROR
appview/pages/templates/knots.html

Failed to calculate interdiff for this file.

ERROR
appview/pages/templates/repo/branches.html

Failed to calculate interdiff for this file.

ERROR
appview/pages/templates/repo/commit.html

Failed to calculate interdiff for this file.

ERROR
appview/pages/templates/repo/compare/new.html

Failed to calculate interdiff for this file.

ERROR
appview/pages/templates/repo/empty.html

Failed to calculate interdiff for this file.

ERROR
appview/pages/templates/repo/fragments/artifact.html

Failed to calculate interdiff for this file.

REVERTED
appview/pages/templates/repo/fragments/time.html
··· 1 - {{ define "repo/fragments/timeWrapper" }} 2 - <time datetime="{{ .Time | iso8601Fmt }}" title="{{ .Time | longTimeFmt }}">{{ .Content }}</time> 3 - {{ end }} 4 - 5 - {{ define "repo/fragments/time" }} 6 - {{ template "repo/fragments/timeWrapper" (dict "Time" . "Content" (. | timeFmt)) }} 7 - {{ end }} 8 - 9 - {{ define "repo/fragments/shortTime" }} 10 - {{ template "repo/fragments/timeWrapper" (dict "Time" . "Content" (. | shortTimeFmt)) }} 11 - {{ end }} 12 - 13 - {{ define "repo/fragments/shortTimeAgo" }} 14 - {{ template "repo/fragments/timeWrapper" (dict "Time" . "Content" (print (. | shortTimeFmt) " ago")) }} 15 - {{ end }}
···
ERROR
appview/pages/templates/repo/index.html

Failed to calculate interdiff for this file.

ERROR
appview/pages/templates/repo/issues/fragments/editIssueComment.html

Failed to calculate interdiff for this file.

ERROR
appview/pages/templates/repo/issues/fragments/issueComment.html

Failed to calculate interdiff for this file.

ERROR
appview/pages/templates/repo/issues/issue.html

Failed to calculate interdiff for this file.

ERROR
appview/pages/templates/repo/issues/issues.html

Failed to calculate interdiff for this file.

ERROR
appview/pages/templates/repo/log.html

Failed to calculate interdiff for this file.

ERROR
appview/pages/templates/repo/pipelines/pipelines.html

Failed to calculate interdiff for this file.

ERROR
appview/pages/templates/repo/pulls/fragments/pullHeader.html

Failed to calculate interdiff for this file.

REVERTED
appview/pages/templates/repo/pulls/pull.html
··· 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 }}">{{ template "repo/fragments/shortTime" .Created }}</a> 59 <span class="select-none before:content-['·']"></span> 60 {{ $s := "s" }} 61 {{ if eq (len .Comments) 1 }} ··· 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}}">{{ template "repo/fragments/time" $c.Created }}</a> 158 </div> 159 <div class="prose dark:prose-invert"> 160 {{ $c.Body | markdown }}
··· 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 }} ··· 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 }}
ERROR
appview/pages/templates/repo/pulls/pulls.html

Failed to calculate interdiff for this file.

ERROR
appview/pages/templates/repo/tags.html

Failed to calculate interdiff for this file.

ERROR
appview/pages/templates/repo/tree.html

Failed to calculate interdiff for this file.

ERROR
appview/pages/templates/settings.html

Failed to calculate interdiff for this file.

ERROR
appview/pages/templates/spindles/fragments/spindleListing.html

Failed to calculate interdiff for this file.

ERROR
appview/pages/templates/timeline.html

Failed to calculate interdiff for this file.

NEW
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>
NEW
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>