{{ define "timeline/fragments/recents" }} {{ if .LoggedInUser }}

{{ i "history" "size-4 flex-shrink-0" }} Recents

{{ if not .Recents }}
{{ i "route" "size-10" }}

No recent pages yet.

{{ else }}
{{ range .Recents }} {{ if .Repo }} {{ template "timeline/fragments/recentRepo" . }} {{ else if .Issue }} {{ template "timeline/fragments/recentIssue" . }} {{ else if .Pull }} {{ template "timeline/fragments/recentPull" . }} {{ end }} {{ end }}
{{ end }}
{{ end }} {{ end }} {{ define "recentRowClass" }} relative grid grid-cols-[1.75rem_1fr_auto] grid-rows-2 gap-x-3 pl-4 pr-4 py-3 text-sm no-underline hover:no-underline hover:bg-gray-100/50 dark:hover:bg-gray-700/50 overflow-hidden {{ end }} {{/* call with dict "color" "text-*" "icon" "icon-name" */}} {{ define "recentIconCircle" }} {{ i .icon "w-3.5 h-3.5" }} {{ end }} {{ define "timeline/fragments/recentRepo" }} {{ $repoOwner := resolve .Repo.Did }} {{ template "user/fragments/pic" (list .Repo.Did "size-7") }} {{ $repoOwner }}/{{ .Repo.Name }} {{ template "repo/fragments/shortTime" .Link.Visited }} {{ end }} {{ define "timeline/fragments/recentIssue" }} {{ $repoOwner := resolve .Issue.Repo.Did }} {{ if .Issue.Open }} {{ template "recentIconCircle" (dict "color" "text-green-600 dark:text-green-500" "icon" "circle-dot") }} {{ else }} {{ template "recentIconCircle" (dict "color" "text-gray-500 dark:text-gray-400" "icon" "ban") }} {{ end }} {{ .Issue.Title }} {{ $repoOwner }}/{{ .Issue.Repo.Name }} {{ template "repo/fragments/shortTime" .Link.Visited }} {{ end }} {{ define "timeline/fragments/recentPull" }} {{ $repoOwner := resolve .Pull.Repo.Did }} {{ if .Pull.State.IsOpen }} {{ template "recentIconCircle" (dict "color" "text-green-600 dark:text-green-500" "icon" "git-pull-request") }} {{ else if .Pull.State.IsMerged }} {{ template "recentIconCircle" (dict "color" "text-purple-600 dark:text-purple-500" "icon" "git-merge") }} {{ else }} {{ template "recentIconCircle" (dict "color" "text-gray-600 dark:text-gray-300" "icon" "git-pull-request-closed") }} {{ end }} {{ .Pull.Title }} {{ $repoOwner }}/{{ .Pull.Repo.Name }} {{ template "repo/fragments/shortTime" .Link.Visited }} {{ end }}