{{ define "title" }}{{ .RepoInfo.FullName }} at {{ .Ref }}{{ end }} {{ define "extrameta" }} {{ template "repo/fragments/meta" . }} {{ template "repo/fragments/og" (dict "RepoInfo" .RepoInfo) }} {{ end }} {{ define "repoContent" }}
{{ block "branchSelector" . }}{{ end }}
{{ block "fileTree" . }}{{ end }} {{ block "rightInfo" . }}{{ end }}
{{ end }} {{ define "branchSelector" }}
{{ $isOwner := and .LoggedInUser .RepoInfo.Roles.IsOwner }} {{ $isCollaborator := and .LoggedInUser .RepoInfo.Roles.IsCollaborator }} {{ if and (or $isOwner $isCollaborator) .ForkInfo .ForkInfo.IsFork }} {{ $disabled := "" }} {{ $title := "" }} {{ if eq .ForkInfo.Status 0 }} {{ $disabled = "disabled" }} {{ $title = "This branch is not behind the upstream" }} {{ else if eq .ForkInfo.Status 2 }} {{ $disabled = "disabled" }} {{ $title = "This branch has conflicts that must be resolved" }} {{ else if eq .ForkInfo.Status 3 }} {{ $disabled = "disabled" }} {{ $title = "This branch does not exist on the upstream" }} {{ end }} {{ end }} {{ i "git-compare" "w-4 h-4" }}
{{ end }} {{ define "fileTree" }}
{{ $containerstyle := "py-1" }} {{ $linkstyle := "no-underline hover:underline dark:text-white" }} {{ range .Files }} {{ if not .IsFile }}
{{ i "folder" "size-4 fill-current" }} {{ .Name }}
{{ if .LastCommit }} {{ end }}
{{ end }} {{ end }} {{ range .Files }} {{ if .IsFile }}
{{ i "file" "size-4" }}{{ .Name }}
{{ if .LastCommit }} {{ end }}
{{ end }} {{ end }}
{{ end }} {{ define "rightInfo" }} {{ end }} {{ define "commitLog" }}
{{ i "logs" "w-4 h-4" }} commits
{{ range .CommitsTrunc }}
{{ $messageParts := splitN .Message "\n\n" 2 }}
{{ index $messageParts 0 }} {{ if gt (len $messageParts) 1 }} {{ end }}
{{ if gt (len $messageParts) 1 }} {{ end }}
{{ $verified := false }} {{ $verified = index $.VerifiedCommits .Hash.String }} {{ $hashStyle := "text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-900" }} {{ if $verified }} {{ $hashStyle = "bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200 px-2 rounded" }} {{ end }} {{ slice .Hash.String 0 8 }} {{ if $verified }} {{ i "shield-check" "w-3 h-3" }} {{ end }} {{ $didOrHandle := index $.EmailToDidOrHandle .Author.Email }} {{ if $didOrHandle }} {{ $didOrHandle }} {{ else }} {{ .Author.Name }} {{ end }}
{{ timeFmt .Committer.When }} {{ $tagsForCommit := index $.TagMap .Hash.String }} {{ if gt (len $tagsForCommit) 0 }}
{{ end }} {{ range $tagsForCommit }} {{ . }} {{ end }}
{{ end }}
{{ end }} {{ define "branchList" }} {{ if gt (len .BranchesTrunc) 0 }}
{{ i "git-branch" "w-4 h-4" }} branches
{{ range .BranchesTrunc }}
{{ .Reference.Name }} {{ if .Commit }} {{ end }} {{ if .IsDefault }} default {{ end }}
{{ end }}
{{ end }} {{ end }} {{ define "tagList" }} {{ if gt (len .TagsTrunc) 0 }}
{{ i "tags" "w-4 h-4" }} tags
{{ range $idx, $tag := .TagsTrunc }} {{ with $tag }}
{{ with .Tag }} {{ end }} {{ if eq $idx 0 }} latest {{ end }}
{{ end }} {{ end }}
{{ end }} {{ end }} {{ define "repoAfter" }} {{- if .HTMLReadme -}}
{{- if .Raw -}}
                        {{- .HTMLReadme -}}
                    
{{- else -}} {{ .HTMLReadme }} {{- end -}}
{{- end -}} {{ template "repo/fragments/cloneInstructions" . }} {{ end }}