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
···
},
"timeFmt": humanize.Time,
"longTimeFmt": func(t time.Time) string {
+
return t.Format("2006-01-02 * 3:04 PM")
-
return t.Format("Jan 2, 2006, 3:04 PM MST")
-
},
-
"iso8601Fmt": func(t time.Time) string {
-
return t.Format("2006-01-02T15:04:05-07:00")
},
"commaFmt": humanize.Comma,
"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
···
-
{{ define "repo/fragments/timeWrapper" }}
-
<time datetime="{{ .Time | iso8601Fmt }}" title="{{ .Time | longTimeFmt }}">{{ .Content }}</time>
-
{{ end }}
-
-
{{ define "repo/fragments/time" }}
-
{{ template "repo/fragments/timeWrapper" (dict "Time" . "Content" (. | timeFmt)) }}
-
{{ end }}
-
-
{{ define "repo/fragments/shortTime" }}
-
{{ template "repo/fragments/timeWrapper" (dict "Time" . "Content" (. | shortTimeFmt)) }}
-
{{ end }}
-
-
{{ define "repo/fragments/shortTimeAgo" }}
-
{{ template "repo/fragments/timeWrapper" (dict "Time" . "Content" (print (. | shortTimeFmt) " ago")) }}
-
{{ 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
···
<span class="hidden md:inline">{{$re}}submitted</span>
by <a href="/{{ $owner }}">{{ $owner }}</a>
<span class="select-none before:content-['\00B7']"></span>
+
<a class="text-gray-500 dark:text-gray-400 hover:text-gray-500" href="#round-#{{ .RoundNumber }}"><time>{{ .Created | shortTimeFmt }}</time></a>
-
<a class="text-gray-500 dark:text-gray-400 hover:text-gray-500" href="#round-#{{ .RoundNumber }}">{{ template "repo/fragments/shortTime" .Created }}</a>
<span class="select-none before:content-['·']"></span>
{{ $s := "s" }}
{{ if eq (len .Comments) 1 }}
···
{{ $owner := index $.DidHandleMap $c.OwnerDid }}
<a href="/{{$owner}}">{{$owner}}</a>
<span class="before:content-['·']"></span>
+
<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>
-
<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>
</div>
<div class="prose dark:prose-invert">
{{ $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
···
{{ $lastStatus := $all.Latest }}
{{ $kind := $lastStatus.Status.String }}
-
{{ $t := .TimeTaken }}
-
{{ $time := "" }}
-
{{ if $t }}
-
{{ $time = durationFmt $t }}
-
{{ else }}
-
{{ $time = printf "%s ago" (shortTimeFmt $pipeline.Created) }}
-
{{ end }}
-
<div id="left" class="flex items-center gap-2 flex-shrink-0">
{{ template "repo/pipelines/fragments/workflowSymbol" $all }}
{{ $name }}
</div>
<div id="right" class="flex items-center gap-2 flex-shrink-0">
<span class="font-bold">{{ $kind }}</span>
-
<time>{{ $time }}</time>
+
{{ if .TimeTaken }}
+
{{ template "repo/fragments/duration" .TimeTaken }}
+
{{ else }}
+
{{ template "repo/fragments/shortTimeAgo" $pipeline.Created }}
+
{{ end }}
</div>
</div>
</a>
NEW
appview/pages/templates/repo/pipelines/workflow.html
···
{{ $lastStatus := $all.Latest }}
{{ $kind := $lastStatus.Status.String }}
-
{{ $t := .TimeTaken }}
-
{{ $time := "" }}
-
-
{{ if $t }}
-
{{ $time = durationFmt $t }}
-
{{ else }}
-
{{ $time = printf "%s ago" (shortTimeFmt $lastStatus.Created) }}
-
{{ end }}
-
<div id="left" class="flex items-center gap-2 flex-shrink-0">
{{ template "repo/pipelines/fragments/workflowSymbol" $all }}
{{ $name }}
</div>
<div id="right" class="flex items-center gap-2 flex-shrink-0">
<span class="font-bold">{{ $kind }}</span>
-
<time>{{ $time }}</time>
+
{{ if .TimeTaken }}
+
{{ template "repo/fragments/duration" .TimeTaken }}
+
{{ else }}
+
{{ template "repo/fragments/shortTimeAgo" $lastStatus.Created }}
+
{{ end }}
</div>
</div>
</a>