diff --git a/appview/pages/funcmap.go b/appview/pages/funcmap.go index bedeabd..7370c0e 100644 --- a/appview/pages/funcmap.go +++ b/appview/pages/funcmap.go @@ -6,9 +6,11 @@ import ( "html" "html/template" "log" + "math" "path/filepath" "reflect" "strings" + "time" "github.com/dustin/go-humanize" ) @@ -66,6 +68,25 @@ func funcMap() template.FuncMap { return s }, "timeFmt": humanize.Time, + "shortTimeFmt": func(t time.Time) string { + return humanize.CustomRelTime(t, time.Now(), "", "", []humanize.RelTimeMagnitude{ + {time.Second, "now", time.Second}, + {2 * time.Second, "1s %s", 1}, + {time.Minute, "%ds %s", time.Second}, + {2 * time.Minute, "1min %s", 1}, + {time.Hour, "%dmin %s", time.Minute}, + {2 * time.Hour, "1hr %s", 1}, + {humanize.Day, "%dhrs %s", time.Hour}, + {2 * humanize.Day, "1d %s", 1}, + {20 * humanize.Day, "%dd %s", humanize.Day}, + {8 * humanize.Week, "%dw %s", humanize.Week}, + {humanize.Year, "%dmo %s", humanize.Month}, + {18 * humanize.Month, "1y %s", 1}, + {2 * humanize.Year, "2y %s", 1}, + {humanize.LongTime, "%dy %s", humanize.Year}, + {math.MaxInt64, "a long while %s", 1}, + }) + }, "byteFmt": humanize.Bytes, "length": func(slice any) int { v := reflect.ValueOf(slice) diff --git a/appview/pages/templates/fragments/diff.html b/appview/pages/templates/fragments/diff.html index 47257a4..50baf2e 100644 --- a/appview/pages/templates/fragments/diff.html +++ b/appview/pages/templates/fragments/diff.html @@ -84,11 +84,11 @@
{{ .Header }}
{{- range .Lines -}} {{- if eq .Op.String "+" -}} -
{{ .Op.String }}{{ .Line }}
+
{{ .Op.String }}{{ .Line }}
{{- end -}} {{- if eq .Op.String "-" -}} -
{{ .Op.String }}{{ .Line }}
+
{{ .Op.String }}{{ .Line }}
{{- end -}} {{- if eq .Op.String " " -}} diff --git a/appview/pages/templates/fragments/pullActions.html b/appview/pages/templates/fragments/pullActions.html index 3ee8d2a..c600813 100644 --- a/appview/pages/templates/fragments/pullActions.html +++ b/appview/pages/templates/fragments/pullActions.html @@ -28,7 +28,7 @@ - -
- - - {{ else }} -
-
- login to join the discussion -
- {{ end }} - {{ end }} -{{ end }} - -{{ define "alreadyMergedCard" }} -
- -
- {{ i "git-merge" "w-4 h-4" }} - pull request successfully merged -
- -
-

This pull request has been merged into the base branch.

-
-
-{{ end }} - -{{ define "isConflictedCard" }} -
- -
- - merge conflicts detected -
- -
- -
-
-

- Please resolve these conflicts locally and update - the patch to continue with the merge. -

-
-
-{{ end }} - - -{{ define "noConflictsCard" }} - {{ $isPushAllowed := .RepoInfo.Roles.IsPushAllowed }} - {{ $isPullAuthor := and .LoggedInUser (eq .LoggedInUser.Did .Pull.OwnerDid) }} -
- -
- - ready to merge -
- -
- No conflicts detected with the base branch. This - pull request can be merged safely. -
- -
- {{ if $isPushAllowed }} - - {{ end }} - - {{ if and (or $isPullAuthor $isPushAllowed) (not .Pull.State.IsMerged) }} - {{ $action := "close" }} - {{ $icon := "circle-x" }} - {{ $hoverColor := "red" }} - {{ if .Pull.State.IsClosed }} - {{ $action = "reopen" }} - {{ $icon = "circle-dot" }} - {{ $hoverColor = "green" }} - {{ end }} - - {{ end }} - -
-
-
-
-{{ end }} - -{{ define "resubmitCard" }} -
- -
- - resubmit your patch -
- -
- You can update this patch to address any reviews. - This will begin a new round of reviews, - but you'll still be able to view your previous submissions and feedback. -
- -
-
- - -
- -
-
-
-
-{{ end }} diff --git a/input.css b/input.css index fa3db54..89ee377 100644 --- a/input.css +++ b/input.css @@ -132,7 +132,7 @@ @apply relative z-10 inline-flex min-h-[30px] cursor-pointer items-center justify-center bg-transparent px-2 pb-[0.2rem] text-base text-gray-900 before:absolute before:inset-0 before:-z-10 - before:block before:rounded-sm before:border before:border-gray-200 + before:block before:rounded before:border before:border-gray-200 before:bg-white before:drop-shadow-sm before:content-[''] hover:before:border-gray-300 hover:before:bg-gray-50